Browse Source

musl: Added musl 0.9.7 - A lightweight implementation of a standard C library

user/chris/wip/musl
Christian Wiese 12 years ago
parent
commit
803fa16242
  1. 220
      base/musl/0001-musl-add-sys-mtio.h.patch
  2. 17
      base/musl/m4.conf
  3. 34
      base/musl/musl.conf
  4. 37
      base/musl/musl.desc
  5. 274
      base/musl/parse-config-9
  6. 17
      base/musl/parse-config-fixarch
  7. 17
      base/musl/pkg_conf/kmod.conf
  8. 24
      base/musl/pkg_conf/lvm2.conf
  9. 12
      base/musl/pkg_conf/perl.conf.disabled
  10. 27
      base/musl/pkg_patch/busybox/0001-busybox-musl-no-useconds_t.patch
  11. 26
      base/musl/pkg_patch/distcc/distcc-musl-no-SOL_TCP.patch
  12. 47
      base/musl/pkg_patch/dovecot/dovecot-musl-netdb-NO_ADDRESS.patch
  13. 451
      base/musl/pkg_patch/gcc/gcc-4.7.2-musl.patch
  14. 480
      base/musl/pkg_patch/gcc/gcc-4.7.2-musl.patch.orig
  15. 153
      base/musl/pkg_patch/iptables/iptables-1.4.14-musl-fixes.patch
  16. 37
      base/musl/pkg_patch/linux/linux-3.4-musl-install-scsi-headers.patch
  17. 121
      base/musl/pkg_patch/lvm2/lvm2-musl-0001-read-only-assignment.patch
  18. 28
      base/musl/pkg_patch/lvm2/lvm2-musl-0002-stddef.h.patch
  19. 42
      base/musl/pkg_patch/lvm2/lvm2-musl-0003-fcntl.h.patch
  20. 28
      base/musl/pkg_patch/lvm2/lvm2-musl-0004-PATH_MAX.patch
  21. 173
      base/musl/pkg_patch/lvm2/lvm2-musl-read-only-assignment.patch.old
  22. 65
      base/musl/pkg_patch/mdadm/0001-mdadm-musl-remove-deprecated-values.h.patch
  23. 39
      base/musl/pkg_patch/mdadm/0002-mdadm-musl-no-__off64_t.patch
  24. 38
      base/musl/pkg_patch/mdadm/0003-mdadm-musl-sockaddr.patch
  25. 36
      base/musl/pkg_patch/mdadm/0004-mdam-musl-no-canonicalize_file_name.patch
  26. 38
      base/musl/pkg_patch/time/time-musl-no-redefinition-of-struct-rusage.patch

220
base/musl/0001-musl-add-sys-mtio.h.patch

@ -0,0 +1,220 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/0001-musl-add-sys-mtio.h.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
From d0197ff03100c716937900fc9c32042ab5581d4a Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Sun, 18 Nov 2012 00:51:49 +0000
Subject: add cleaned-up sys/mtio.h
this is mostly junk, but a few programs with tape-drive support
unconditionally include it, and it might be useful.
---
diff --git a/include/sys/mtio.h b/include/sys/mtio.h
new file mode 100644
index 0000000..dc8e5f5
--- a/dev/null
+++ b/include/sys/mtio.h
@@ -0,0 +1,188 @@
+#ifndef _SYS_MTIO_H
+#define _SYS_MTIO_H
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+
+struct mtop {
+ short mt_op;
+ int mt_count;
+};
+
+#define _IOT_mtop _IOT (_IOTS (short), 1, _IOTS (int), 1, 0, 0)
+#define _IOT_mtget _IOT (_IOTS (long), 7, 0, 0, 0, 0)
+#define _IOT_mtpos _IOT_SIMPLE (long)
+#define _IOT_mtconfiginfo _IOT (_IOTS (long), 2, _IOTS (short), 3, _IOTS (long), 1)
+
+
+#define MTRESET 0
+#define MTFSF 1
+#define MTBSF 2
+#define MTFSR 3
+#define MTBSR 4
+#define MTWEOF 5
+#define MTREW 6
+#define MTOFFL 7
+#define MTNOP 8
+#define MTRETEN 9
+#define MTBSFM 10
+#define MTFSFM 11
+#define MTEOM 12
+#define MTERASE 13
+#define MTRAS1 14
+#define MTRAS2 15
+#define MTRAS3 16
+#define MTSETBLK 20
+#define MTSETDENSITY 21
+#define MTSEEK 22
+#define MTTELL 23
+#define MTSETDRVBUFFER 24
+#define MTFSS 25
+#define MTBSS 26
+#define MTWSM 27
+#define MTLOCK 28
+#define MTUNLOCK 29
+#define MTLOAD 30
+#define MTUNLOAD 31
+#define MTCOMPRESSION 32
+#define MTSETPART 33
+#define MTMKPART 34
+
+struct mtget {
+ long mt_type;
+ long mt_resid;
+ long mt_dsreg;
+ long mt_gstat;
+ long mt_erreg;
+ int mt_fileno;
+ int mt_blkno;
+};
+
+#define MT_ISUNKNOWN 0x01
+#define MT_ISQIC02 0x02
+#define MT_ISWT5150 0x03
+#define MT_ISARCHIVE_5945L2 0x04
+#define MT_ISCMSJ500 0x05
+#define MT_ISTDC3610 0x06
+#define MT_ISARCHIVE_VP60I 0x07
+#define MT_ISARCHIVE_2150L 0x08
+#define MT_ISARCHIVE_2060L 0x09
+#define MT_ISARCHIVESC499 0x0A
+#define MT_ISQIC02_ALL_FEATURES 0x0F
+#define MT_ISWT5099EEN24 0x11
+#define MT_ISTEAC_MT2ST 0x12
+#define MT_ISEVEREX_FT40A 0x32
+#define MT_ISDDS1 0x51
+#define MT_ISDDS2 0x52
+#define MT_ISSCSI1 0x71
+#define MT_ISSCSI2 0x72
+#define MT_ISFTAPE_UNKNOWN 0x800000
+#define MT_ISFTAPE_FLAG 0x800000
+
+struct mt_tape_info {
+ long t_type;
+ char *t_name;
+};
+
+#define MT_TAPE_INFO \
+{ \
+ {MT_ISUNKNOWN, "Unknown type of tape device"}, \
+ {MT_ISQIC02, "Generic QIC-02 tape streamer"}, \
+ {MT_ISWT5150, "Wangtek 5150, QIC-150"}, \
+ {MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \
+ {MT_ISCMSJ500, "CMS Jumbo 500"}, \
+ {MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \
+ {MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \
+ {MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \
+ {MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \
+ {MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \
+ {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \
+ {MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \
+ {MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \
+ {MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \
+ {MT_ISSCSI1, "Generic SCSI-1 tape"}, \
+ {MT_ISSCSI2, "Generic SCSI-2 tape"}, \
+ {0, NULL} \
+}
+
+struct mtpos {
+ long mt_blkno;
+};
+
+struct mtconfiginfo {
+ long mt_type;
+ long ifc_type;
+ unsigned short irqnr;
+ unsigned short dmanr;
+ unsigned short port;
+ unsigned long debug;
+ unsigned have_dens:1;
+ unsigned have_bsf:1;
+ unsigned have_fsr:1;
+ unsigned have_bsr:1;
+ unsigned have_eod:1;
+ unsigned have_seek:1;
+ unsigned have_tell:1;
+ unsigned have_ras1:1;
+ unsigned have_ras2:1;
+ unsigned have_ras3:1;
+ unsigned have_qfa:1;
+ unsigned pad1:5;
+ char reserved[10];
+};
+
+#define MTIOCTOP _IOW('m', 1, struct mtop)
+#define MTIOCGET _IOR('m', 2, struct mtget)
+#define MTIOCPOS _IOR('m', 3, struct mtpos)
+
+#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo)
+#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo)
+
+#define GMT_EOF(x) ((x) & 0x80000000)
+#define GMT_BOT(x) ((x) & 0x40000000)
+#define GMT_EOT(x) ((x) & 0x20000000)
+#define GMT_SM(x) ((x) & 0x10000000)
+#define GMT_EOD(x) ((x) & 0x08000000)
+#define GMT_WR_PROT(x) ((x) & 0x04000000)
+#define GMT_ONLINE(x) ((x) & 0x01000000)
+#define GMT_D_6250(x) ((x) & 0x00800000)
+#define GMT_D_1600(x) ((x) & 0x00400000)
+#define GMT_D_800(x) ((x) & 0x00200000)
+#define GMT_DR_OPEN(x) ((x) & 0x00040000)
+#define GMT_IM_REP_EN(x) ((x) & 0x00010000)
+
+#define MT_ST_BLKSIZE_SHIFT 0
+#define MT_ST_BLKSIZE_MASK 0xffffff
+#define MT_ST_DENSITY_SHIFT 24
+#define MT_ST_DENSITY_MASK 0xff000000
+#define MT_ST_SOFTERR_SHIFT 0
+#define MT_ST_SOFTERR_MASK 0xffff
+#define MT_ST_OPTIONS 0xf0000000
+#define MT_ST_BOOLEANS 0x10000000
+#define MT_ST_SETBOOLEANS 0x30000000
+#define MT_ST_CLEARBOOLEANS 0x40000000
+#define MT_ST_WRITE_THRESHOLD 0x20000000
+#define MT_ST_DEF_BLKSIZE 0x50000000
+#define MT_ST_DEF_OPTIONS 0x60000000
+#define MT_ST_BUFFER_WRITES 0x1
+#define MT_ST_ASYNC_WRITES 0x2
+#define MT_ST_READ_AHEAD 0x4
+#define MT_ST_DEBUGGING 0x8
+#define MT_ST_TWO_FM 0x10
+#define MT_ST_FAST_MTEOM 0x20
+#define MT_ST_AUTO_LOCK 0x40
+#define MT_ST_DEF_WRITES 0x80
+#define MT_ST_CAN_BSR 0x100
+#define MT_ST_NO_BLKLIMS 0x200
+#define MT_ST_CAN_PARTITIONS 0x400
+#define MT_ST_SCSI2LOGICAL 0x800
+#define MT_ST_CLEAR_DEFAULT 0xfffff
+#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
+#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
+#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
+#define MT_ST_HPLOADER_OFFSET 10000
+#ifndef DEFTAPE
+# define DEFTAPE "/dev/tape"
+#endif
+
+#endif
--
cgit v0.9.0.3-65-g4555

17
base/musl/m4.conf

@ -0,0 +1,17 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/m4.conf
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
if atstage cross; then
var_append configcache ' ' "gl_cv_func_re_compile_pattern_working=no"
fi

34
base/musl/musl.conf

@ -0,0 +1,34 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/musl.conf
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
# translate $arch for being usable with musl
musl_arch="$( echo $arch | arch2uname )"
if atstage toolchain; then
confopt="--prefix=$base/build/$SDECFG_ID/usr \$extraconfopt"
makeopt="ARCH=$musl_arch"
var_append makeopt ' ' "include/bits"
makeinstopt="ARCH=$musl_arch install-headers"
musl_install_headers() {
cp -a include/bits/*.h $base/build/$SDECFG_ID/usr/include/bits/
}
#hook_add postmake 5 "musl_install_headers"
fi
if [ "$SDECFG_LIBC" == "musl" ]; then
var_append extraconfopt ' ' "--disable-gcc-wrapper"
fi

37
base/musl/musl.desc

@ -0,0 +1,37 @@
[COPY] --- SDE-COPYRIGHT-NOTE-BEGIN ---
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch.
[COPY]
[COPY] Filename: package/.../musl/musl.desc
[COPY] Copyright (C) 2012 The OpenSDE Project
[COPY]
[COPY] More information can be found in the files COPYING and README.
[COPY]
[COPY] This program is free software; you can redistribute it and/or modify
[COPY] it under the terms of the GNU General Public License as published by
[COPY] the Free Software Foundation; version 2 of the License. A copy of the
[COPY] GNU General Public License can be found in the file COPYING.
[COPY] --- SDE-COPYRIGHT-NOTE-END ---
[I] A lightweight implementation of a standard C library
[T] musl is a new general-purpose implementation of the C library. It is
[T] lightweight, fast, simple, free, and aims to be correct in the sense of
[T] standards-conformance and safety.
[T] It implements the standard library functionality described in the ISO C
[T] and POSIX standards, plus common extensions, intended for use on Linux
[T] based systems.
[U] http://www.musl-libc.org/
[A] Author
[M] Christian Wiese <chris@opensde.org>
[C] extra/base
[F] LIBC
[L] MIT
[S] Beta
[V] 0.9.7
[P] X 01-------9 101.700
[D] 1978003876 musl-0.9.7.tar.gz http://www.musl-libc.org/releases/

274
base/musl/parse-config-9

@ -0,0 +1,274 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/parse-config-9
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
if [ "$SDECFG_LIBC" == "musl" ]; then
pkg_musl_dir=$base/package/base/musl
if [ $pkg != "gettext" ]; then
var_append flistdel "|" "usr/share/locale/locale.alias"
fi
# I don't know what this is for //morfoh
var_append flistdel "|" "usr/lib/charset.alias"
# the most tipical fix is to config.sub
#
musl_fix_configsub() {
local x; for x; do
echo_warning "Adding linux-musl target support to $x"
echo "musl_fix_configsub: adding musl_arch_target support to $x"
cp -f $x $x.orig
sed -e 's,\([-]\?linux\)-gnu\*,\1-gnu\* | \1-musl\*,g' $x.orig > $x
diff -u $x.orig $x || true
done
}
musl_auto_fix_configsub() {
local f
for f in . ./build-aux ./config ./support; do
if [ -e $f/config.sub ] ; then
if ! grep -q '\-musl' $f/config.sub; then
musl_fix_configsub $f/config.sub
fi
fi
done
}
musl_findall_fix_configsub() {
local f
for f in `find . -name config.sub`; do
musl_fix_configsub $f
done
}
# FIXME: i forgot what makes musl_fix_addcases different than musl_fix_configsub //mnemoc
musl_fix_addcases() {
local file; for file; do
echo "musl_fix_addcases: adding *-linux-musl* support to $file"
cp -f $file $file.orig
sed -i -e 's,\([^ ]*\)linux-gnu\*\(.*\)\([\)\\]\),\1linux-gnu* | \1linux-musl*\2\3,g' $file
diff -u $file.orig $file || true
done
}
musl_fix_addcases2() {
local file; for file; do
echo "musl_fix_addcases2: adding *-linux-musl* support to $file"
cp -f $file $file.orig
sed -i -e 's,\( *.*\)linux-gnu\*)\(.*\)\;\;$,\1linux-musl*)\2;;\n\1linux-gnu*)\2;;,g' \
-e 's,\( *.*\)linux-gnu\*)\(.*[^;][^;]\)$,\1linux-musl* \| \\\n\1linux-gnu*)\2,g' \
$file
diff -u $file.orig $file || true
done
}
# fix typical locations
hook_add postpatch 5 'musl_auto_fix_configsub'
# fix issues with included gnulib
# http://openwall.com/lists/musl/2012/06/19/13
musl_fix_gnulib() {
local dir="$1"
gl_config_cache="
gl_cv_func_isnanl_works=yes \
gl_cv_header_working_stdint_h=yes \
gl_cv_func_fpurge_works=yes \
gl_cv_func_fcntl_f_dupfd_cloexec=yes \
gl_cv_func_getcwd_path_max=yes \
gl_cv_func_fprintf_posix=yes \
gl_cv_func_printf_sizes_c99=yes \
gl_cv_func_printf_long_double=yes \
gl_cv_func_printf_infinite=yes \
gl_cv_func_printf_infinite_long_double=yes \
gl_cv_func_printf_directive_a=yes \
gl_cv_func_printf_directive_f=yes \
gl_cv_func_printf_directive_n=yes \
gl_cv_func_printf_directive_ls=yes \
gl_cv_func_printf_positions=yes \
gl_cv_func_printf_flag_grouping=yes \
gl_cv_func_printf_flag_leftadjust=yes \
gl_cv_func_printf_flag_zero=yes \
gl_cv_func_printf_precision=yes \
gl_cv_func_printf_enomem=yes"
for x in $gl_config_cache; do
var_append configcache ' ' "$x"
done
empty_file() {
echo "gnulib fix: emptying file $1"
rm -f $1
touch $1
}
for x in fseterr.c freadahead.c ; do
empty_file "$dir/$x"
done
echo "void close_stdin(void) {}" > "$dir"/closein.c
# fix stuff trying to reimplement libc
culprits="accept4 acosl alloca alphasort asinl asprintf atanl \
atexit atoll bcopy btowc chown closedir cosl dirfd \
dprintf dup2 dup3 _Exit expl fchdir fchown-stub \
fdatasync fdopendir ffs flock fnmatch forkpty fpending \
fprintf freeaddrinfo fsync ftell ftruncate futimens \
gai_strerror getaddrinfo getdelim getdtablesize \
getgroups gethostname getline getlogin getlogin_r \
getnameinfo getpagesize getpass getsubopt gettimeofday \
getusershell gmtime_r grantpt imaxabs imaxdiv inet_ntop \
inet_pton isblank iswblank lchmod lchown ldexp ldexpl \
link linkat logl mbrlen mbrtowc mbsinit memmove mempcpy \
mkdtemp mkfifo mkfifoat mknod mknodat mkstemp mktime \
nanosleep nl_langinfo open openat opendir openpty pclose \
perror pipe pipe2 poll popen pread pselect ptsname \
pwrite raise readdir readlink renameat rewinddir setenv \
sigaction sigaddset sigdelset sigemptyset sigfillset \
sigismember sigpending sigprocmask sinl snprintf \
spawnattr_destroy spawnattr_getdefault spawnattr_getflags \
spawnattr_getpgroup spawnattr_getsigmask spawnattr_init \
spawnattr_setdefault.c spawnattr_setflags spawnattr_setpgroup \
spawnattr_setsigmask spawn_faction_addclose \
spawn_faction_adddup2 spawn_faction_addopen \
spawn_faction_destroy spawn_faction_init \
spawn_factions_addopen spawn_factions_destroy \
spawn_factions_init sprintf sqrtl stdio-read stdio-write \
strcasecmp strcasestr strchrnul strcspn strncasecmp \
strndup strnlen strpbrk strsep strsignal strstr strtod \
strtoimax strtol symlink symlinkat tanl tcgetsid timegm \
time_r times tmpfile uname unlockpt unsetenv usleep \
vasprintf vdprintf waitpid wcrtomb wctob"
#for x in $culprits ; do empty_file "$dir/$x.c" ; done
}
# and some others
case "$pkg" in
libtool|lvm2|freetype|lua|iptables|autoconf|libtirpc)
hook_add preconf 9 'musl_findall_fix_configsub'
;;
gzip|m4)
hook_add preconf 9 'musl_findall_fix_configsub'
hook_add preconf 9 'musl_fix_gnulib lib'
;;
gmp)
hook_add postpatch 6 'musl_fix_configsub configfsf.sub'
;;
findutils)
hook_add preconf 9 'musl_fix_gnulib gnulib/lib'
;;
ntp)
hook_add postpatch 6 'musl_fix_configsub sntp/config.sub'
;;
lzo)
hook_add postpatch 6 'musl_fix_configsub autoconf/config.sub'
;;
binutils)
hook_add postpatch 4 'musl_fix_addcases ./bfd/config.bfd ./bfd/configure \
./bfd/configure.in ./ld/configure.tgt'
hook_add postpatch 5 'musl_fix_addcases2 ./gas/configure ./gas/configure.in'
;;
gdb)
hook_add postpatch 4 'musl_fix_addcases ./bfd/config.bfd ./bfd/configure'
;;
bdb)
hook_add postpatch 6 'musl_fix_configsub ./dist/config.sub'
;;
bdb33)
hook_add postpatch 6 'musl_fix_configsub ./dist/config.sub'
hook_add postpatch 6 'musl_fix_configsub ./dist/configure'
;;
a2ps)
hook_add postpatch 6 'musl_fix_configsub ./auxdir/config.sub'
;;
pidentd)
hook_add postpatch 6 'musl_fix_configsub ./aux/config.sub'
;;
apollon)
hook_add postpatch 6 'musl_fix_configsub ./admin/config.sub'
;;
openldap)
hook_add postpatch 6 'musl_fix_configsub ./contrib/ldapc++/config.sub'
hook_add postpatch 6 'musl_fix_configsub ./build/config.sub'
;;
libsigc++12)
hook_add postpatch 6 'musl_fix_configsub ./scripts/config.sub'
;;
libsigc++1)
hook_add postpatch 6 'musl_fix_configsub ./scripts/config.sub'
hook_add postpatch 6 'musl_fix_configsub ./scripts/ltconfig'
;;
jasper)
# jasper is autoextract=0 so postpatch is never evaluated
hook_add preconf 6 'musl_fix_configsub ./acaux/config.sub'
hook_add preconf 6 'musl_fix_configsub ./configure'
hook_add preconf 6 'musl_fix_configsub ./aclocal.m4'
;;
gdbm)
hook_add postpatch 6 'musl_fix_configsub ./configure'
;;
mono)
hook_add postpatch 6 'musl_fix_configsub ./libgc/config.sub'
hook_add postpatch 6 'musl_fix_configsub ./libgc/configure'
hook_add postpatch 6 'musl_fix_configsub ./libgc/libtool.m4'
;;
gsmlib)
hook_add postpatch 6 'musl_fix_configsub ./configure'
hook_add postpatch 6 'musl_fix_configsub ./aclocal.m4'
hook_add postpatch 6 'musl_fix_configsub ./scripts/config.sub'
hook_add postpatch 6 'musl_fix_configsub ./scripts/ltconfig'
;;
libxml1|librep)
hook_add postpatch 6 'musl_fix_configsub ./configure'
hook_add postpatch 6 'musl_fix_configsub ./aclocal.m4'
;;
fribidi)
hook_add postpatch 6 'musl_fix_configsub ./configure'
;;
rpm)
hook_add postpatch 6 'musl_fix_configsub ./*/config.sub'
hook_add postpatch 6 'musl_fix_configsub ./*/configure'
hook_add postpatch 6 'musl_fix_configsub ./*/aclocal.m4'
hook_add postpatch 6 'musl_fix_configsub ./*/*/config.sub'
hook_add postpatch 6 'musl_fix_configsub ./*/*/configure'
;;
libgd)
hook_add postpatch 6 'musl_fix_configsub ./configure'
hook_add postpatch 6 'musl_fix_configsub ./aclocal.m4'
hook_add postpatch 6 'musl_fix_configsub ./config/config.sub'
;;
libdvdcss|libdvbpsi3|libmpeg2|a52dec)
hook_add postpatch 6 'musl_fix_configsub ./autotools/config.sub'
;;
apr|apr-util)
hook_add postpatch 6 'musl_fix_configsub ./build/config.sub'
;;
esac
# same package translations to look for patches
case "$pkg" in
linux*|linux-header)
pkg_musl_pkg=linux ;;
*)
pkg_musl_pkg=${pkg//-/_} ;;
esac
pkg_musl_patches=$( ls -1 $pkg_musl_dir/pkg_patch/$pkg_musl_pkg/*.patch 2> /dev/null | tr '\n' ' ' )
if [ -n "$pkg_musl_patches" ]; then
echo_status "musl: appending patches ..."
var_append patchfiles ' ' "$pkg_musl_patches"
fi
if [ -f $pkg_musl_dir/pkg_conf/$pkg_musl_pkg.conf ]; then
. $pkg_musl_dir/pkg_conf/$pkg_musl_pkg.conf
fi
fi

17
base/musl/parse-config-fixarch

@ -0,0 +1,17 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/parse-config-fixarch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
if [ "$SDECFG_LIBC" == "musl" -a "${arch_target%gnu}" != "$arch_target" ]; then
arch_target=${arch_target%gnu}musl
fi

17
base/musl/pkg_conf/kmod.conf

@ -0,0 +1,17 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_conf/kmod.conf
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
if atstage cross; then
var_append configcache ' ' "ac_cv_member_struct_stat_st_mtim=no"
fi

24
base/musl/pkg_conf/lvm2.conf

@ -0,0 +1,24 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_conf/lvm2.conf
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
# locking/file_locking.c:43:1: error: unknown type name 'sig_t'
#
# signal.h: sig_t is only available when _BSD_SOURCE is defined
#
var_append CC_WRAPPER_INSERT ' ' "-D_BSD_SOURCE"
# lvm2_activation_generator_systemd_red_hat.c:33:23: error: 'PATH_MAX' undeclared here (not in a function)
#
# limits.h: PATH_MAX gets defined when _GNU_SOURCE is defined
var_append CC_WRAPPER_INSERT ' ' "-D_GNU_SOURCE"

12
base/musl/pkg_conf/perl.conf.disabled

@ -0,0 +1,12 @@
if atstage cross; then
musl_perl_cross_adjust() {
sed -e '/^d_tm_tm_zone/d' \
-e '/^d_tm_tm_gmtoff/d' \
-e '/^d_libm_lib_version/d' \
-i config.sh
echo "d_tm_tm_zone='undef'" >> config.sh
echo "d_tm_tm_gmtoff='undef'" >> config.sh
echo "d_libm_lib_version='undef'" >> config.sh
}
hook_add premake 2 'musl_perl_cross_adjust'
fi

27
base/musl/pkg_patch/busybox/0001-busybox-musl-no-useconds_t.patch

@ -0,0 +1,27 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/busybox/0001-busybox-musl-no-useconds_t.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- a/include/libbb.h 2012-11-25 02:58:40.498568341 +0100
+++ b/include/libbb.h 2012-11-25 02:59:13.719292446 +0100
@@ -1898,7 +1898,7 @@
#define isprint_asciionly(a) ((unsigned)((a) - 0x20) <= 0x7e - 0x20)
#define usleep(usec) bb_usleep(usec)
-static ALWAYS_INLINE int bb_usleep(useconds_t usec)
+static ALWAYS_INLINE int bb_usleep(suseconds_t usec)
{
struct timespec t = { usec/1000000, (usec%1000000)*1000L };
return nanosleep(&t, NULL);

26
base/musl/pkg_patch/distcc/distcc-musl-no-SOL_TCP.patch

@ -0,0 +1,26 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/distcc/distcc-musl-no-SOL_TCP.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./src/distcc.h.orig 2012-11-26 01:32:22.234870269 +0100
+++ ./src/distcc.h 2012-11-26 01:33:17.152177411 +0100
@@ -60,6 +60,7 @@
# define FALSE 0
#endif
+#define SOL_TCP IPPROTO_TCP
struct dcc_hostdef;

47
base/musl/pkg_patch/dovecot/dovecot-musl-netdb-NO_ADDRESS.patch

@ -0,0 +1,47 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/dovecot/dovecot-musl-netdb-NO_ADDRESS.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- a/src/dns/dns-client.c 2012-11-30 16:45:15.043810659 +0100
+++ b/src/dns/dns-client.c 2012-11-30 16:54:23.460494952 +0100
@@ -36,7 +36,7 @@
ret = net_gethostbyname(line + 3, &ips, &ips_count);
if (ret == 0 && ips_count == 0) {
/* shouldn't happen, but fix it anyway.. */
- ret = NO_ADDRESS;
+ ret = NO_DATA;
}
if (ret != 0) {
o_stream_send_str(client->output,
--- a/src/lib/network.c 2012-11-30 16:55:33.654106822 +0100
+++ b/src/lib/network.c 2012-11-30 16:54:49.413097220 +0100
@@ -835,7 +835,7 @@
switch (error) {
case HOST_NOT_FOUND:
return "Host not found";
- case NO_ADDRESS:
+ case NO_DATA:
return "No IP address found for name";
case NO_RECOVERY:
return "A non-recoverable name server error occurred";
@@ -857,7 +857,7 @@
return error != 1 && (error == EAI_NONAME);
#endif
#else
- return error == HOST_NOT_FOUND || error == NO_ADDRESS;
+ return error == HOST_NOT_FOUND || error == NO_DATA;
#endif
}

451
base/musl/pkg_patch/gcc/gcc-4.7.2-musl.patch

@ -0,0 +1,451 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/gcc/gcc-4.7.2-musl.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
# HG changeset patch
# Parent 05e4cf5f033d266c8f8fe065f8c5752891c5bf7a
Adding musl to config.sub, so it's recognized as a target platform.
diff -r 05e4cf5f033d -r 04a6a82b8e06 config.sub
--- a/config.sub Wed Nov 21 21:16:07 2012 -0500
+++ b/config.sub Wed Nov 21 21:16:58 2012 -0500
@@ -125,6 +125,7 @@
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | \
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
@@ -1346,6 +1347,7 @@
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-uclibc* \
+ | -linux-musl* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
# HG changeset patch
# Parent 04a6a82b8e06669a42181c96381b4fbc3ffa008c
Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.
diff -r 04a6a82b8e06 -r 193f80e01b02 libstdc++-v3/configure.host
--- a/libstdc++-v3/configure.host Wed Nov 21 21:16:58 2012 -0500
+++ b/libstdc++-v3/configure.host Wed Nov 21 21:17:38 2012 -0500
@@ -243,6 +243,13 @@
os_include_dir="os/bsd/freebsd"
;;
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+ # check for musl by target
+ case "${host_os}" in
+ *-musl*)
+ os_include_dir="os/generic"
+ ;;
+ *)
+
if [ "$uclibc" = "yes" ]; then
os_include_dir="os/uclibc"
elif [ "$bionic" = "yes" ]; then
@@ -251,6 +258,9 @@
os_include_dir="os/gnu-linux"
fi
;;
+
+ esac
+ ;;
hpux*)
os_include_dir="os/hpux"
;;
# HG changeset patch
# Parent 193f80e01b026d8de7f53d467f2c59cd0b7927dc
Adding -mmusl as a musl libc specifier, and the necessary hacks for it to know how to find musl's dynamic linker.
diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/config.gcc
--- a/gcc/config.gcc Wed Nov 21 21:17:38 2012 -0500
+++ b/gcc/config.gcc Wed Nov 21 21:19:19 2012 -0500
@@ -522,7 +522,7 @@
esac
# Common C libraries.
-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
# Common parts for widely ported systems.
case ${target} in
@@ -625,6 +625,9 @@
*-*-*uclibc*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
;;
+ *-*-*musl*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
+ ;;
*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
;;
diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/config/linux.h
--- a/gcc/config/linux.h Wed Nov 21 21:17:38 2012 -0500
+++ b/gcc/config/linux.h Wed Nov 21 21:19:19 2012 -0500
@@ -33,10 +33,12 @@
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
#else
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
#endif
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
@@ -54,18 +56,21 @@
uClibc or Bionic is the default C library and whether
-muclibc or -mglibc or -mbionic has been passed to change the default. */
-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
#if DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
#elif DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
#elif DEFAULT_LIBC == LIBC_BIONIC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
#else
#error "Unsupported DEFAULT_LIBC"
#endif /* DEFAULT_LIBC */
@@ -85,16 +90,16 @@
#define GNU_USER_DYNAMIC_LINKER \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
- BIONIC_DYNAMIC_LINKER)
+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
#define GNU_USER_DYNAMIC_LINKER32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
- BIONIC_DYNAMIC_LINKER32)
+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
#define GNU_USER_DYNAMIC_LINKER64 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
- BIONIC_DYNAMIC_LINKER64)
+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
#define GNU_USER_DYNAMIC_LINKERX32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
- BIONIC_DYNAMIC_LINKERX32)
+ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
/* Determine whether the entire c99 runtime
is present in the runtime library. */
diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/config/linux.opt
--- a/gcc/config/linux.opt Wed Nov 21 21:17:38 2012 -0500
+++ b/gcc/config/linux.opt Wed Nov 21 21:19:19 2012 -0500
@@ -30,3 +30,7 @@
muclibc
Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
Use uClibc C library
+
+mmusl
+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
+Use musl C library
diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/ginclude/stddef.h
--- a/gcc/ginclude/stddef.h Wed Nov 21 21:17:38 2012 -0500
+++ b/gcc/ginclude/stddef.h Wed Nov 21 21:19:19 2012 -0500
@@ -184,6 +184,7 @@
#ifndef _GCC_SIZE_T
#ifndef _SIZET_
#ifndef __size_t
+#ifndef __DEFINED_size_t /* musl */
#define __size_t__ /* BeOS */
#define __SIZE_T__ /* Cray Unicos/Mk */
#define _SIZE_T
@@ -200,6 +201,7 @@
#define ___int_size_t_h
#define _GCC_SIZE_T
#define _SIZET_
+#define __DEFINED_size_t /* musl */
#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
|| defined(__FreeBSD_kernel__)
/* __size_t is a typedef on FreeBSD 5, must not trash it. */
@@ -215,6 +217,7 @@
typedef long ssize_t;
#endif /* __BEOS__ */
#endif /* !(defined (__GNUG__) && defined (size_t)) */
+#endif /* __DEFINED_size_t */
#endif /* __size_t */
#endif /* _SIZET_ */
#endif /* _GCC_SIZE_T */
# HG changeset patch
# Parent 45cd88d4fb7b0e813578c296004eaab2c2d0bfb9
A fix for libgomp to correctly request a POSIX version for time support.
diff -r 45cd88d4fb7b -r 0afd9d82498d libgomp/config/posix/time.c
--- a/libgomp/config/posix/time.c Wed Nov 21 21:19:19 2012 -0500
+++ b/libgomp/config/posix/time.c Wed Nov 21 21:20:22 2012 -0500
@@ -28,6 +28,8 @@
The following implementation uses the most simple POSIX routines.
If present, POSIX 4 clocks should be used instead. */
+#define _POSIX_C_SOURCE 199309L /* for clocks */
+
#include "libgomp.h"
#include <unistd.h>
#if TIME_WITH_SYS_TIME
# HG changeset patch
# Parent 0afd9d82498d2cd30aa78529ff25f211bdc0c3b9
Support for i386-linux-musl and x86_64-linux-musl.
diff -r 0afd9d82498d -r 53f3e21a7d14 gcc/config/i386/linux.h
--- a/gcc/config/i386/linux.h Wed Nov 21 21:20:22 2012 -0500
+++ b/gcc/config/i386/linux.h Wed Nov 21 21:21:21 2012 -0500
@@ -22,3 +22,4 @@
#define GNU_USER_LINK_EMULATION "elf_i386"
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
diff -r 0afd9d82498d -r 53f3e21a7d14 gcc/config/i386/linux64.h
--- a/gcc/config/i386/linux64.h Wed Nov 21 21:20:22 2012 -0500
+++ b/gcc/config/i386/linux64.h Wed Nov 21 21:21:21 2012 -0500
@@ -31,3 +31,7 @@
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
+
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
diff -r 0afd9d82498d -r 53f3e21a7d14 libitm/config/linux/x86/tls.h
--- a/libitm/config/linux/x86/tls.h Wed Nov 21 21:20:22 2012 -0500
+++ b/libitm/config/linux/x86/tls.h Wed Nov 21 21:21:21 2012 -0500
@@ -25,16 +25,19 @@
#ifndef LIBITM_X86_TLS_H
#define LIBITM_X86_TLS_H 1
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
+#if defined(__GLIBC_PREREQ)
+#if __GLIBC_PREREQ(2, 10)
/* Use slots in the TCB head rather than __thread lookups.
GLIBC has reserved words 10 through 13 for TM. */
#define HAVE_ARCH_GTM_THREAD 1
#define HAVE_ARCH_GTM_THREAD_DISP 1
#endif
+#endif
#include "config/generic/tls.h"
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
+#if defined(__GLIBC_PREREQ)
+#if __GLIBC_PREREQ(2, 10)
namespace GTM HIDDEN {
#ifdef __x86_64__
@@ -101,5 +104,6 @@
} // namespace GTM
#endif /* >= GLIBC 2.10 */
+#endif
#endif // LIBITM_X86_TLS_H
# HG changeset patch
# Parent 53f3e21a7d14d0514ec7cb9ffb67b24dcf1f9fc9
Support for arm-linux-musl.
diff -r 53f3e21a7d14 -r 0a4e297edad6 gcc/config/arm/linux-eabi.h
--- a/gcc/config/arm/linux-eabi.h Wed Nov 21 21:21:21 2012 -0500
+++ b/gcc/config/arm/linux-eabi.h Wed Nov 21 21:21:54 2012 -0500
@@ -64,6 +64,10 @@
#undef GLIBC_DYNAMIC_LINKER
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
+/* musl has no "classic" (i.e. broken) mode */
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1"
+
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
use the GNU/Linux version, not the generic BPABI version. */
#undef LINK_SPEC
diff -r 53f3e21a7d14 -r 0a4e297edad6 libitm/config/arm/hwcap.cc
--- a/libitm/config/arm/hwcap.cc Wed Nov 21 21:21:21 2012 -0500
+++ b/libitm/config/arm/hwcap.cc Wed Nov 21 21:21:54 2012 -0500
@@ -40,7 +40,11 @@
#ifdef __linux__
#include <unistd.h>
+#ifdef __GLIBC__
#include <sys/fcntl.h>
+#else
+#include <fcntl.h>
+#endif
#include <elf.h>
static void __attribute__((constructor))
# HG changeset patch
# Parent 0a4e297edad6e46f4b66401b93b217aa3194af4e
Support for mips-linux-musl.
diff -r 0a4e297edad6 -r 78025c74c5c1 gcc/config/mips/linux.h
--- a/gcc/config/mips/linux.h Wed Nov 21 21:21:54 2012 -0500
+++ b/gcc/config/mips/linux.h Wed Nov 21 21:23:49 2012 -0500
@@ -19,3 +19,5 @@
<http://www.gnu.org/licenses/>. */
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1"
# HG changeset patch
# Parent 78025c74c5c1705f16ce13f3645ecb86c10cc1c2
Support for powerpc-linux-musl.
diff -r 78025c74c5c1 gcc/config.gcc
--- a/gcc/config.gcc Wed Nov 21 21:23:49 2012 -0500
+++ b/gcc/config.gcc Wed Nov 21 21:45:58 2012 -0500
@@ -2078,6 +2078,10 @@
powerpc*-*-linux*paired*)
tm_file="${tm_file} rs6000/750cl.h" ;;
esac
+ case ${target} in
+ *-linux*-musl*)
+ enable_secureplt=yes ;;
+ esac
if test x${enable_secureplt} = xyes; then
tm_file="rs6000/secureplt.h ${tm_file}"
fi
diff -r 78025c74c5c1 gcc/config/rs6000/secureplt.h
--- a/gcc/config/rs6000/secureplt.h Wed Nov 21 21:23:49 2012 -0500
+++ b/gcc/config/rs6000/secureplt.h Wed Nov 21 21:45:58 2012 -0500
@@ -18,3 +18,4 @@
<http://www.gnu.org/licenses/>. */
#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
diff -r 78025c74c5c1 gcc/config/rs6000/sysv4.h
--- a/gcc/config/rs6000/sysv4.h Wed Nov 21 21:23:49 2012 -0500
+++ b/gcc/config/rs6000/sysv4.h Wed Nov 21 21:45:58 2012 -0500
@@ -566,6 +566,9 @@
#ifndef CC1_SECURE_PLT_DEFAULT_SPEC
#define CC1_SECURE_PLT_DEFAULT_SPEC ""
#endif
+#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
+#define LINK_SECURE_PLT_DEFAULT_SPEC ""
+#endif
/* Pass -G xxx to the compiler and set correct endian mode. */
#define CC1_SPEC "%{G*} %(cc1_cpu) \
@@ -626,7 +629,8 @@
%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
%{mcall-i960-old: --oformat elf32-powerpcle} \
- }}}}"
+ }}}} \
+%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
/* Any specific OS flags. */
#define LINK_OS_SPEC "\
@@ -804,15 +808,18 @@
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
#if DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
#else
#error "Unsupported DEFAULT_LIBC"
#endif
#define GNU_USER_DYNAMIC_LINKER \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
@@ -938,6 +945,7 @@
{ "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
{ "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
+ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
diff -r 78025c74c5c1 libgcc/config/rs6000/linux-unwind.h
--- a/libgcc/config/rs6000/linux-unwind.h Wed Nov 21 21:23:49 2012 -0500
+++ b/libgcc/config/rs6000/linux-unwind.h Wed Nov 21 21:45:58 2012 -0500
@@ -176,6 +176,7 @@
}
#endif
+#ifdef __GLIBC__
/* Find an entry in the process auxiliary vector. The canonical way to
test for VMX is to look at AT_HWCAP. */
@@ -207,6 +208,7 @@
return auxp->a_val;
return 0;
}
+#endif
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
@@ -253,7 +255,11 @@
if (hwcap == 0)
{
+#ifdef __GLIBC__
hwcap = ppc_linux_aux_vector (16);
+#else
+ hwcap = -1;
+#endif
/* These will already be set if we found AT_HWCAP. A nonzero
value stops us looking again if for some reason we couldn't
find AT_HWCAP. */
# HG changeset patch
# Parent de922e533313cc0a2af7e1f69a65ed69263904cd
Support (partial) for microblaze-linux-musl.
diff -r de922e533313 -r b065d0a4bebb gcc/config.gcc
--- a/gcc/config.gcc Wed Nov 21 21:24:08 2012 -0500
+++ b/gcc/config.gcc Wed Nov 21 21:31:28 2012 -0500
@@ -1725,6 +1725,7 @@
tm_file="${tm_file} dbxelf.h gnu-user.h linux.h microblaze/linux.h"
c_target_objs="${c_target_objs} microblaze-c.o"
cxx_target_objs="${cxx_target_objs} microblaze-c.o"
+ tmake_file="${tmake_file} microblaze/t-microblaze"
;;
microblaze*-*-*)
tm_file="${tm_file} dbxelf.h"

480
base/musl/pkg_patch/gcc/gcc-4.7.2-musl.patch.orig

@ -0,0 +1,480 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/gcc/gcc-4.7.2-musl.patch.orig
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
# HG changeset patch
# Parent 05e4cf5f033d266c8f8fe065f8c5752891c5bf7a
Adding musl to config.sub, so it's recognized as a target platform.
diff -r 05e4cf5f033d -r 04a6a82b8e06 config.sub
--- a/config.sub Wed Nov 21 21:16:07 2012 -0500
+++ b/config.sub Wed Nov 21 21:16:58 2012 -0500
@@ -125,6 +125,7 @@
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | \
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
@@ -1346,6 +1347,7 @@
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-uclibc* \
+ | -linux-musl* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
# HG changeset patch
# Parent 04a6a82b8e06669a42181c96381b4fbc3ffa008c
Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.
diff -r 04a6a82b8e06 -r 193f80e01b02 libstdc++-v3/configure.host
--- a/libstdc++-v3/configure.host Wed Nov 21 21:16:58 2012 -0500
+++ b/libstdc++-v3/configure.host Wed Nov 21 21:17:38 2012 -0500
@@ -243,6 +243,13 @@
os_include_dir="os/bsd/freebsd"
;;
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+ # check for musl by target
+ case "${host_os}" in
+ *-musl*)
+ os_include_dir="os/generic"
+ ;;
+ *)
+
if [ "$uclibc" = "yes" ]; then
os_include_dir="os/uclibc"
elif [ "$bionic" = "yes" ]; then
@@ -251,6 +258,9 @@
os_include_dir="os/gnu-linux"
fi
;;
+
+ esac
+ ;;
hpux*)
os_include_dir="os/hpux"
;;
# HG changeset patch
# Parent 193f80e01b026d8de7f53d467f2c59cd0b7927dc
Adding -mmusl as a musl libc specifier, and the necessary hacks for it to know how to find musl's dynamic linker.
diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/config.gcc
--- a/gcc/config.gcc Wed Nov 21 21:17:38 2012 -0500
+++ b/gcc/config.gcc Wed Nov 21 21:19:19 2012 -0500
@@ -522,7 +522,7 @@
esac
# Common C libraries.
-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
# Common parts for widely ported systems.
case ${target} in
@@ -625,6 +625,9 @@
*-*-*uclibc*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
;;
+ *-*-*musl*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
+ ;;
*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
;;
diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/config/linux.h
--- a/gcc/config/linux.h Wed Nov 21 21:17:38 2012 -0500
+++ b/gcc/config/linux.h Wed Nov 21 21:19:19 2012 -0500
@@ -33,10 +33,12 @@
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
#else
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
#endif
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
@@ -54,18 +56,21 @@
uClibc or Bionic is the default C library and whether
-muclibc or -mglibc or -mbionic has been passed to change the default. */
-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
#if DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
#elif DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
#elif DEFAULT_LIBC == LIBC_BIONIC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
#else
#error "Unsupported DEFAULT_LIBC"
#endif /* DEFAULT_LIBC */
@@ -85,16 +90,16 @@
#define GNU_USER_DYNAMIC_LINKER \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
- BIONIC_DYNAMIC_LINKER)
+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
#define GNU_USER_DYNAMIC_LINKER32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
- BIONIC_DYNAMIC_LINKER32)
+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
#define GNU_USER_DYNAMIC_LINKER64 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
- BIONIC_DYNAMIC_LINKER64)
+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
#define GNU_USER_DYNAMIC_LINKERX32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
- BIONIC_DYNAMIC_LINKERX32)
+ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
/* Determine whether the entire c99 runtime
is present in the runtime library. */
diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/config/linux.opt
--- a/gcc/config/linux.opt Wed Nov 21 21:17:38 2012 -0500
+++ b/gcc/config/linux.opt Wed Nov 21 21:19:19 2012 -0500
@@ -30,3 +30,7 @@
muclibc
Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
Use uClibc C library
+
+mmusl
+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
+Use musl C library
diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/ginclude/stddef.h
--- a/gcc/ginclude/stddef.h Wed Nov 21 21:17:38 2012 -0500
+++ b/gcc/ginclude/stddef.h Wed Nov 21 21:19:19 2012 -0500
@@ -184,6 +184,7 @@
#ifndef _GCC_SIZE_T
#ifndef _SIZET_
#ifndef __size_t
+#ifndef __DEFINED_size_t /* musl */
#define __size_t__ /* BeOS */
#define __SIZE_T__ /* Cray Unicos/Mk */
#define _SIZE_T
@@ -200,6 +201,7 @@
#define ___int_size_t_h
#define _GCC_SIZE_T
#define _SIZET_
+#define __DEFINED_size_t /* musl */
#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
|| defined(__FreeBSD_kernel__)
/* __size_t is a typedef on FreeBSD 5, must not trash it. */
@@ -215,6 +217,7 @@
typedef long ssize_t;
#endif /* __BEOS__ */
#endif /* !(defined (__GNUG__) && defined (size_t)) */
+#endif /* __DEFINED_size_t */
#endif /* __size_t */
#endif /* _SIZET_ */
#endif /* _GCC_SIZE_T */
# HG changeset patch
# Parent 45cd88d4fb7b0e813578c296004eaab2c2d0bfb9
A fix for libgomp to correctly request a POSIX version for time support.
diff -r 45cd88d4fb7b -r 0afd9d82498d libgomp/config/posix/time.c
--- a/libgomp/config/posix/time.c Wed Nov 21 21:19:19 2012 -0500
+++ b/libgomp/config/posix/time.c Wed Nov 21 21:20:22 2012 -0500
@@ -28,6 +28,8 @@
The following implementation uses the most simple POSIX routines.
If present, POSIX 4 clocks should be used instead. */
+#define _POSIX_C_SOURCE 199309L /* for clocks */
+
#include "libgomp.h"
#include <unistd.h>
#if TIME_WITH_SYS_TIME
# HG changeset patch
# Parent 0afd9d82498d2cd30aa78529ff25f211bdc0c3b9
Support for i386-linux-musl and x86_64-linux-musl.
diff -r 0afd9d82498d -r 53f3e21a7d14 gcc/config/i386/linux.h
--- a/gcc/config/i386/linux.h Wed Nov 21 21:20:22 2012 -0500
+++ b/gcc/config/i386/linux.h Wed Nov 21 21:21:21 2012 -0500
@@ -22,3 +22,4 @@
#define GNU_USER_LINK_EMULATION "elf_i386"
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
diff -r 0afd9d82498d -r 53f3e21a7d14 gcc/config/i386/linux64.h
--- a/gcc/config/i386/linux64.h Wed Nov 21 21:20:22 2012 -0500
+++ b/gcc/config/i386/linux64.h Wed Nov 21 21:21:21 2012 -0500
@@ -31,3 +31,7 @@
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
+
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
diff -r 0afd9d82498d -r 53f3e21a7d14 libitm/config/linux/x86/tls.h
--- a/libitm/config/linux/x86/tls.h Wed Nov 21 21:20:22 2012 -0500
+++ b/libitm/config/linux/x86/tls.h Wed Nov 21 21:21:21 2012 -0500
@@ -25,16 +25,19 @@
#ifndef LIBITM_X86_TLS_H
#define LIBITM_X86_TLS_H 1
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
+#if defined(__GLIBC_PREREQ)
+#if __GLIBC_PREREQ(2, 10)
/* Use slots in the TCB head rather than __thread lookups.
GLIBC has reserved words 10 through 13 for TM. */
#define HAVE_ARCH_GTM_THREAD 1
#define HAVE_ARCH_GTM_THREAD_DISP 1
#endif
+#endif
#include "config/generic/tls.h"
-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
+#if defined(__GLIBC_PREREQ)
+#if __GLIBC_PREREQ(2, 10)
namespace GTM HIDDEN {
#ifdef __x86_64__
@@ -101,5 +104,6 @@
} // namespace GTM
#endif /* >= GLIBC 2.10 */
+#endif
#endif // LIBITM_X86_TLS_H
# HG changeset patch
# Parent 53f3e21a7d14d0514ec7cb9ffb67b24dcf1f9fc9
Support for arm-linux-musl.
diff -r 53f3e21a7d14 -r 0a4e297edad6 gcc/config/arm/linux-eabi.h
--- a/gcc/config/arm/linux-eabi.h Wed Nov 21 21:21:21 2012 -0500
+++ b/gcc/config/arm/linux-eabi.h Wed Nov 21 21:21:54 2012 -0500
@@ -64,6 +64,10 @@
#undef GLIBC_DYNAMIC_LINKER
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
+/* musl has no "classic" (i.e. broken) mode */
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1"
+
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
use the GNU/Linux version, not the generic BPABI version. */
#undef LINK_SPEC
diff -r 53f3e21a7d14 -r 0a4e297edad6 libitm/config/arm/hwcap.cc
--- a/libitm/config/arm/hwcap.cc Wed Nov 21 21:21:21 2012 -0500
+++ b/libitm/config/arm/hwcap.cc Wed Nov 21 21:21:54 2012 -0500
@@ -40,7 +40,11 @@
#ifdef __linux__
#include <unistd.h>
+#ifdef __GLIBC__
#include <sys/fcntl.h>
+#else
+#include <fcntl.h>
+#endif
#include <elf.h>
static void __attribute__((constructor))
# HG changeset patch
# Parent 0a4e297edad6e46f4b66401b93b217aa3194af4e
Support for mips-linux-musl.
diff -r 0a4e297edad6 -r 78025c74c5c1 gcc/config/mips/linux.h
--- a/gcc/config/mips/linux.h Wed Nov 21 21:21:54 2012 -0500
+++ b/gcc/config/mips/linux.h Wed Nov 21 21:23:49 2012 -0500
@@ -19,3 +19,5 @@
<http://www.gnu.org/licenses/>. */
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1"
# HG changeset patch
# Parent 78025c74c5c1705f16ce13f3645ecb86c10cc1c2
Support for powerpc-linux-musl.
diff -r 78025c74c5c1 gcc/config.gcc
--- a/gcc/config.gcc Wed Nov 21 21:23:49 2012 -0500
+++ b/gcc/config.gcc Wed Nov 21 21:45:58 2012 -0500
@@ -2078,6 +2078,10 @@
powerpc*-*-linux*paired*)
tm_file="${tm_file} rs6000/750cl.h" ;;
esac
+ case ${target} in
+ *-linux*-musl*)
+ enable_secureplt=yes ;;
+ esac
if test x${enable_secureplt} = xyes; then
tm_file="rs6000/secureplt.h ${tm_file}"
fi
diff -r 78025c74c5c1 gcc/config/rs6000/linux64.h
--- a/gcc/config/rs6000/linux64.h Wed Nov 21 21:23:49 2012 -0500
+++ b/gcc/config/rs6000/linux64.h Wed Nov 21 21:45:58 2012 -0500
@@ -362,17 +362,21 @@
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
#if DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
#elif DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
#else
#error "Unsupported DEFAULT_LIBC"
#endif
#define GNU_USER_DYNAMIC_LINKER32 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
#define GNU_USER_DYNAMIC_LINKER64 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
diff -r 78025c74c5c1 gcc/config/rs6000/secureplt.h
--- a/gcc/config/rs6000/secureplt.h Wed Nov 21 21:23:49 2012 -0500
+++ b/gcc/config/rs6000/secureplt.h Wed Nov 21 21:45:58 2012 -0500
@@ -18,3 +18,4 @@
<http://www.gnu.org/licenses/>. */
#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
diff -r 78025c74c5c1 gcc/config/rs6000/sysv4.h
--- a/gcc/config/rs6000/sysv4.h Wed Nov 21 21:23:49 2012 -0500
+++ b/gcc/config/rs6000/sysv4.h Wed Nov 21 21:45:58 2012 -0500
@@ -566,6 +566,9 @@
#ifndef CC1_SECURE_PLT_DEFAULT_SPEC
#define CC1_SECURE_PLT_DEFAULT_SPEC ""
#endif
+#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
+#define LINK_SECURE_PLT_DEFAULT_SPEC ""
+#endif
/* Pass -G xxx to the compiler and set correct endian mode. */
#define CC1_SPEC "%{G*} %(cc1_cpu) \
@@ -626,7 +629,8 @@
%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
%{mcall-i960-old: --oformat elf32-powerpcle} \
- }}}}"
+ }}}} \
+%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
/* Any specific OS flags. */
#define LINK_OS_SPEC "\
@@ -804,15 +808,18 @@
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
#if DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
#else
#error "Unsupported DEFAULT_LIBC"
#endif
#define GNU_USER_DYNAMIC_LINKER \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
@@ -938,6 +945,7 @@
{ "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
{ "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
+ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
diff -r 78025c74c5c1 libgcc/config/rs6000/linux-unwind.h
--- a/libgcc/config/rs6000/linux-unwind.h Wed Nov 21 21:23:49 2012 -0500
+++ b/libgcc/config/rs6000/linux-unwind.h Wed Nov 21 21:45:58 2012 -0500
@@ -176,6 +176,7 @@
}
#endif
+#ifdef __GLIBC__
/* Find an entry in the process auxiliary vector. The canonical way to
test for VMX is to look at AT_HWCAP. */
@@ -207,6 +208,7 @@
return auxp->a_val;
return 0;
}
+#endif
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
@@ -253,7 +255,11 @@
if (hwcap == 0)
{
+#ifdef __GLIBC__
hwcap = ppc_linux_aux_vector (16);
+#else
+ hwcap = -1;
+#endif
/* These will already be set if we found AT_HWCAP. A nonzero
value stops us looking again if for some reason we couldn't
find AT_HWCAP. */
# HG changeset patch
# Parent de922e533313cc0a2af7e1f69a65ed69263904cd
Support (partial) for microblaze-linux-musl.
diff -r de922e533313 -r b065d0a4bebb gcc/config.gcc
--- a/gcc/config.gcc Wed Nov 21 21:24:08 2012 -0500
+++ b/gcc/config.gcc Wed Nov 21 21:31:28 2012 -0500
@@ -1725,6 +1725,7 @@
tm_file="${tm_file} dbxelf.h gnu-user.h linux.h microblaze/linux.h"
c_target_objs="${c_target_objs} microblaze-c.o"
cxx_target_objs="${cxx_target_objs} microblaze-c.o"
+ tmake_file="${tmake_file} microblaze/t-microblaze"
;;
microblaze*-*-*)
tm_file="${tm_file} dbxelf.h"

153
base/musl/pkg_patch/iptables/iptables-1.4.14-musl-fixes.patch

@ -0,0 +1,153 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/iptables/iptables-1.4.14-musl-fixes.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- iptables-1.4.12.1.o/extensions/libip6t_ipv6header.c
+++ iptables-1.4.12.1/extensions/libip6t_ipv6header.c
@@ -10,6 +10,9 @@
#include <netdb.h>
#include <xtables.h>
#include <linux/netfilter_ipv6/ip6t_ipv6header.h>
+#ifndef IPPROTO_HOPOPTS
+# define IPPROTO_HOPOPTS 0
+#endif
enum {
O_HEADER = 0,
--- iptables-1.4.12.1.o/extensions/libxt_TCPOPTSTRIP.c
+++ iptables-1.4.12.1/extensions/libxt_TCPOPTSTRIP.c
@@ -12,6 +12,21 @@
#ifndef TCPOPT_MD5SIG
# define TCPOPT_MD5SIG 19
#endif
+#ifndef TCPOPT_MAXSEG
+# define TCPOPT_MAXSEG 2
+#endif
+#ifndef TCPOPT_WINDOW
+# define TCPOPT_WINDOW 3
+#endif
+#ifndef TCPOPT_SACK_PERMITTED
+# define TCPOPT_SACK_PERMITTED 4
+#endif
+#ifndef TCPOPT_SACK
+# define TCPOPT_SACK 5
+#endif
+#ifndef TCPOPT_TIMESTAMP
+# define TCPOPT_TIMESTAMP 8
+#endif
enum {
O_STRIP_OPTION = 0,
--- iptables-1.4.12.1.o/include/libiptc/ipt_kernel_headers.h
+++ iptables-1.4.12.1/include/libiptc/ipt_kernel_headers.h
@@ -5,7 +5,6 @@
#include <limits.h>
-#if defined(__GLIBC__) && __GLIBC__ == 2
#include <netinet/ip.h>
#include <netinet/in.h>
#include <netinet/ip_icmp.h>
@@ -13,15 +12,4 @@
#include <netinet/udp.h>
#include <net/if.h>
#include <sys/types.h>
-#else /* libc5 */
-#include <sys/socket.h>
-#include <linux/ip.h>
-#include <linux/in.h>
-#include <linux/if.h>
-#include <linux/icmp.h>
-#include <linux/tcp.h>
-#include <linux/udp.h>
-#include <linux/types.h>
-#include <linux/in6.h>
-#endif
#endif
--- iptables-1.4.12.1.o/include/linux/netfilter/xt_osf.h
+++ iptables-1.4.12.1/include/linux/netfilter/xt_osf.h
@@ -21,6 +21,7 @@
#define _XT_OSF_H
#include <linux/types.h>
+#include <linux/tcp.h>
#define MAXGENRELEN 32
--- iptables-1.4.12.1.o/include/linux/netfilter_ipv4/ip_tables.h
+++ iptables-1.4.12.1/include/linux/netfilter_ipv4/ip_tables.h
@@ -16,6 +16,7 @@
#define _IPTABLES_H
#include <linux/types.h>
+#include <sys/types.h>
#include <linux/netfilter_ipv4.h>
--- iptables-1.4.12.1.o/iptables/ip6tables-restore.c
+++ iptables-1.4.12.1/iptables/ip6tables-restore.c
@@ -9,7 +9,7 @@
*/
#include <getopt.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
--- iptables-1.4.12.1.o/iptables/ip6tables-save.c
+++ iptables-1.4.12.1/iptables/ip6tables-save.c
@@ -6,7 +6,7 @@
* This code is distributed under the terms of GNU GPL v2
*/
#include <getopt.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
--- iptables-1.4.12.1.o/iptables/iptables-restore.c
+++ iptables-1.4.12.1/iptables/iptables-restore.c
@@ -6,7 +6,7 @@
*/
#include <getopt.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
--- iptables-1.4.12.1.o/iptables/iptables-save.c
+++ iptables-1.4.12.1/iptables/iptables-save.c
@@ -6,7 +6,7 @@
*
*/
#include <getopt.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
--- iptables-1.4.12.1.o/iptables/iptables-xml.c
+++ iptables-1.4.12.1/iptables/iptables-xml.c
@@ -7,7 +7,7 @@
*/
#include <getopt.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

37
base/musl/pkg_patch/linux/linux-3.4-musl-install-scsi-headers.patch

@ -0,0 +1,37 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/linux/linux-3.4-musl-install-scsi-headers.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./include/scsi/Kbuild.orig 2012-11-24 23:36:53.070293896 +0100
+++ ./include/scsi/Kbuild 2012-11-24 23:42:07.749516830 +0100
@@ -2,3 +2,5 @@
header-y += scsi_netlink_fc.h
header-y += scsi_bsg_fc.h
header-y += fc/
+header-y += scsi.h
+header-y += sg.h
--- ./include/scsi/scsi.h.orig 2012-11-24 23:48:57.019041848 +0100
+++ ./include/scsi/scsi.h 2012-11-24 23:49:48.656295475 +0100
@@ -9,7 +9,10 @@
#define _SCSI_SCSI_H
#include <linux/types.h>
+
+#ifdef __KERNEL__
#include <linux/scatterlist.h>
+#endif /* __KERNEL__ */
struct scsi_cmnd;

121
base/musl/pkg_patch/lvm2/lvm2-musl-0001-read-only-assignment.patch

@ -0,0 +1,121 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/lvm2/lvm2-musl-0001-read-only-assignment.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./tools/lvmcmdline.c.orig 2012-11-24 19:32:51.319288478 +0100
+++ ./tools/lvmcmdline.c 2012-11-24 19:34:46.381960596 +0100
@@ -1194,9 +1194,12 @@
static int _check_standard_fds(void)
{
int err = is_valid_fd(STDERR_FILENO);
+ FILE *stdin_stream = stdin;
+ FILE *stdout_stream = stdout;
+ FILE *stderr_stream = stderr;
if (!is_valid_fd(STDIN_FILENO) &&
- !(stdin = fopen(_PATH_DEVNULL, "r"))) {
+ !(stdin_stream = fopen(_PATH_DEVNULL, "r"))) {
if (err)
perror("stdin stream open");
else
@@ -1206,7 +1209,7 @@
}
if (!is_valid_fd(STDOUT_FILENO) &&
- !(stdout = fopen(_PATH_DEVNULL, "w"))) {
+ !(stdout_stream = fopen(_PATH_DEVNULL, "w"))) {
if (err)
perror("stdout stream open");
/* else no stdout */
@@ -1214,7 +1217,7 @@
}
if (!is_valid_fd(STDERR_FILENO) &&
- !(stderr = fopen(_PATH_DEVNULL, "w"))) {
+ !(stderr_stream = fopen(_PATH_DEVNULL, "w"))) {
printf("stderr stream open: %s\n",
strerror(errno));
return 0;
--- ./lib/commands/toolcontext.c.orig 2012-11-24 19:16:13.532208503 +0100
+++ ./lib/commands/toolcontext.c 2012-11-24 19:45:44.053159552 +0100
@@ -1315,6 +1315,8 @@
{
struct cmd_context *cmd;
FILE *new_stream;
+ FILE *stdin_stream = stdin;
+ FILE *stdout_stream = stdout;
#ifdef M_MMAP_MAX
mallopt(M_MMAP_MAX, 0);
@@ -1359,20 +1361,20 @@
}
if (is_valid_fd(STDIN_FILENO)) {
- if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream))
+ if (!_reopen_stream(stdin_stream, STDIN_FILENO, "r", "stdin", &new_stream))
goto_out;
- stdin = new_stream;
- if (setvbuf(stdin, cmd->linebuffer, _IOLBF, linebuffer_size)) {
+ stdin_stream = new_stream;
+ if (setvbuf(stdin_stream, cmd->linebuffer, _IOLBF, linebuffer_size)) {
log_sys_error("setvbuf", "");
goto out;
}
}
if (is_valid_fd(STDOUT_FILENO)) {
- if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream))
+ if (!_reopen_stream(stdout_stream, STDOUT_FILENO, "w", "stdout", &new_stream))
goto_out;
- stdout = new_stream;
- if (setvbuf(stdout, cmd->linebuffer + linebuffer_size,
+ stdout_stream = new_stream;
+ if (setvbuf(stdout_stream, cmd->linebuffer + linebuffer_size,
_IOLBF, linebuffer_size)) {
log_sys_error("setvbuf", "");
goto out;
@@ -1629,6 +1631,8 @@
{
struct dm_config_tree *cft_cmdline;
FILE *new_stream;
+ FILE *stdin_stream = stdin;
+ FILE *stdout_stream = stdout;
if (cmd->dump_filter)
persistent_filter_dump(cmd->filter, 1);
@@ -1655,17 +1659,17 @@
if (cmd->linebuffer) {
/* Reset stream buffering to defaults */
if (is_valid_fd(STDIN_FILENO)) {
- if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) {
- stdin = new_stream;
- setlinebuf(stdin);
+ if (_reopen_stream(stdin_stream, STDIN_FILENO, "r", "stdin", &new_stream)) {
+ stdin_stream = new_stream;
+ setlinebuf(stdin_stream);
} else
cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
}
if (is_valid_fd(STDOUT_FILENO)) {
- if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) {
- stdout = new_stream;
- setlinebuf(stdout);
+ if (_reopen_stream(stdout_stream, STDOUT_FILENO, "w", "stdout", &new_stream)) {
+ stdout_stream = new_stream;
+ setlinebuf(stdout_stream);
} else
cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
}

28
base/musl/pkg_patch/lvm2/lvm2-musl-0002-stddef.h.patch

@ -0,0 +1,28 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/lvm2/lvm2-musl-0002-stddef.h.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
error: 'ptrdiff_t' undeclared (first use in this function)
--- a/libdm/mm/pool-fast.c 2012-11-24 19:05:17.413015858 +0100
+++ b/libdm/mm/pool-fast.c 2012-11-24 19:05:56.589926540 +0100
@@ -18,6 +18,7 @@
#endif
#include "dmlib.h"
+#include <stddef.h>
#include <malloc.h>
struct chunk {

42
base/musl/pkg_patch/lvm2/lvm2-musl-0003-fcntl.h.patch

@ -0,0 +1,42 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/lvm2/lvm2-musl-0003-fcntl.h.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
dmeventd.c: In function '_open_fifos':
dmeventd.c:1294:2: warning: implicit declaration of function 'open' [-Wimplicit-function-declaration]
dmeventd.c:1294:2: warning: nested extern declaration of 'open' [-Wnested-externs]
dmeventd.c:1294:48: error: 'O_RDWR' undeclared (first use in this function)
dmeventd.c:1294:48: note: each undeclared identifier is reported only once for each function it appears in
dmeventd.c: In function '_handle_preloaded_fifo':
dmeventd.c:1665:2: warning: implicit declaration of function 'fcntl' [-Wimplicit-function-declaration]
dmeventd.c:1665:2: warning: nested extern declaration of 'fcntl' [-Wnested-externs]
dmeventd.c:1665:25: error: 'F_GETFD' undeclared (first use in this function)
dmeventd.c:1668:14: error: 'FD_CLOEXEC' undeclared (first use in this function)
dmeventd.c:1679:16: error: 'F_SETFD' undeclared (first use in this function)
dmeventd.c: In function '_daemonize':
dmeventd.c:1817:25: error: 'O_RDONLY' undeclared (first use in this function)
dmeventd.c:1818:25: error: 'O_WRONLY' undeclared (first use in this function)
--- a/daemons/dmeventd/dmeventd.c 2012-11-24 19:08:48.981918074 +0100
+++ b/daemons/dmeventd/dmeventd.c 2012-11-24 19:09:25.822750433 +0100
@@ -37,6 +37,7 @@
#include <unistd.h>
#include <signal.h>
#include <arpa/inet.h> /* for htonl, ntohl */
+#include <fcntl.h>
#ifdef linux
/*

28
base/musl/pkg_patch/lvm2/lvm2-musl-0004-PATH_MAX.patch

@ -0,0 +1,28 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/lvm2/lvm2-musl-0004-PATH_MAX.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
lvm2_activation_generator_systemd_red_hat.c:33:23: error: 'PATH_MAX' undeclared here (not in a function)
--- a/scripts/lvm2_activation_generator_systemd_red_hat.c 2012-11-24 20:06:19.481792514 +0100
+++ b/scripts/lvm2_activation_generator_systemd_red_hat.c 2012-11-24 20:06:56.774634314 +0100
@@ -19,6 +19,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <limits.h> /* for PATH_MAX */
#include "lvm2app.h"
#define KMSG_DEV_PATH "/dev/kmsg"

173
base/musl/pkg_patch/lvm2/lvm2-musl-read-only-assignment.patch.old

@ -0,0 +1,173 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/lvm2/lvm2-musl-read-only-assignment.patch.old
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./configure.in.orig 2012-10-15 16:24:58.000000000 +0200
+++ ./configure.in 2012-11-24 19:02:28.453087873 +0100
@@ -140,7 +140,6 @@
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_FUNC_LSTAT
-AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_REALLOC
--- ./autoconf/config.sub.orig 2012-11-24 19:02:28.473087879 +0100
+++ ./autoconf/config.sub 2012-11-24 19:02:28.477087877 +0100
@@ -123,8 +123,8 @@
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ nto-qnx* | linux-gnu* | linux-musl* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | linux-musl* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
@@ -1294,7 +1294,7 @@
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -mingw32* | -linux-gnu* | -linux-musl* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
--- ./daemons/dmeventd/dmeventd.c.orig 2012-11-24 19:08:48.981918074 +0100
+++ ./daemons/dmeventd/dmeventd.c 2012-11-24 19:09:25.822750433 +0100
@@ -37,6 +37,7 @@
#include <unistd.h>
#include <signal.h>
#include <arpa/inet.h> /* for htonl, ntohl */
+#include <fcntl.h>
#ifdef linux
/*
--- ./libdm/mm/pool-fast.c.orig 2012-11-24 19:05:17.413015858 +0100
+++ ./libdm/mm/pool-fast.c 2012-11-24 19:05:56.589926540 +0100
@@ -18,6 +18,7 @@
#endif
#include "dmlib.h"
+#include <stddef.h>
#include <malloc.h>
struct chunk {
--- ./tools/lvmcmdline.c.orig 2012-11-24 19:32:51.319288478 +0100
+++ ./tools/lvmcmdline.c 2012-11-24 19:34:46.381960596 +0100
@@ -1194,9 +1194,12 @@
static int _check_standard_fds(void)
{
int err = is_valid_fd(STDERR_FILENO);
+ FILE *stdin_stream = stdin;
+ FILE *stdout_stream = stdout;
+ FILE *stderr_stream = stderr;
if (!is_valid_fd(STDIN_FILENO) &&
- !(stdin = fopen(_PATH_DEVNULL, "r"))) {
+ !(stdin_stream = fopen(_PATH_DEVNULL, "r"))) {
if (err)
perror("stdin stream open");
else
@@ -1206,7 +1209,7 @@
}
if (!is_valid_fd(STDOUT_FILENO) &&
- !(stdout = fopen(_PATH_DEVNULL, "w"))) {
+ !(stdout_stream = fopen(_PATH_DEVNULL, "w"))) {
if (err)
perror("stdout stream open");
/* else no stdout */
@@ -1214,7 +1217,7 @@
}
if (!is_valid_fd(STDERR_FILENO) &&
- !(stderr = fopen(_PATH_DEVNULL, "w"))) {
+ !(stderr_stream = fopen(_PATH_DEVNULL, "w"))) {
printf("stderr stream open: %s\n",
strerror(errno));
return 0;
--- ./lib/commands/toolcontext.c.orig 2012-11-24 19:16:13.532208503 +0100
+++ ./lib/commands/toolcontext.c 2012-11-24 19:45:44.053159552 +0100
@@ -1315,6 +1315,8 @@
{
struct cmd_context *cmd;
FILE *new_stream;
+ FILE *stdin_stream = stdin;
+ FILE *stdout_stream = stdout;
#ifdef M_MMAP_MAX
mallopt(M_MMAP_MAX, 0);
@@ -1359,20 +1361,20 @@
}
if (is_valid_fd(STDIN_FILENO)) {
- if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream))
+ if (!_reopen_stream(stdin_stream, STDIN_FILENO, "r", "stdin", &new_stream))
goto_out;
- stdin = new_stream;
- if (setvbuf(stdin, cmd->linebuffer, _IOLBF, linebuffer_size)) {
+ stdin_stream = new_stream;
+ if (setvbuf(stdin_stream, cmd->linebuffer, _IOLBF, linebuffer_size)) {
log_sys_error("setvbuf", "");
goto out;
}
}
if (is_valid_fd(STDOUT_FILENO)) {
- if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream))
+ if (!_reopen_stream(stdout_stream, STDOUT_FILENO, "w", "stdout", &new_stream))
goto_out;
- stdout = new_stream;
- if (setvbuf(stdout, cmd->linebuffer + linebuffer_size,
+ stdout_stream = new_stream;
+ if (setvbuf(stdout_stream, cmd->linebuffer + linebuffer_size,
_IOLBF, linebuffer_size)) {
log_sys_error("setvbuf", "");
goto out;
@@ -1629,6 +1631,8 @@
{
struct dm_config_tree *cft_cmdline;
FILE *new_stream;
+ FILE *stdin_stream = stdin;
+ FILE *stdout_stream = stdout;
if (cmd->dump_filter)
persistent_filter_dump(cmd->filter, 1);
@@ -1655,17 +1659,17 @@
if (cmd->linebuffer) {
/* Reset stream buffering to defaults */
if (is_valid_fd(STDIN_FILENO)) {
- if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) {
- stdin = new_stream;
- setlinebuf(stdin);
+ if (_reopen_stream(stdin_stream, STDIN_FILENO, "r", "stdin", &new_stream)) {
+ stdin_stream = new_stream;
+ setlinebuf(stdin_stream);
} else
cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
}
if (is_valid_fd(STDOUT_FILENO)) {
- if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) {
- stdout = new_stream;
- setlinebuf(stdout);
+ if (_reopen_stream(stdout_stream, STDOUT_FILENO, "w", "stdout", &new_stream)) {
+ stdout_stream = new_stream;
+ setlinebuf(stdout_stream);
} else
cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
}

65
base/musl/pkg_patch/mdadm/0001-mdadm-musl-remove-deprecated-values.h.patch

@ -0,0 +1,65 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/mdadm/0001-mdadm-musl-remove-deprecated-values.h.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- a/super-ddf.c 2012-11-25 01:35:58.911682709 +0100
+++ b/super-ddf.c 2012-11-24 23:24:00.900425167 +0100
@@ -29,7 +29,6 @@
#include "mdadm.h"
#include "mdmon.h"
#include "sha1.h"
-#include <values.h>
/* a non-official T10 name for creation GUIDs */
static char T10[] = "Linux-MD";
@@ -971,13 +970,13 @@
{ DDF_RAID5E, LEVEL_UNSUPPORTED },
{ DDF_RAID5EE, LEVEL_UNSUPPORTED },
{ DDF_RAID6, 6},
- { MAXINT, MAXINT }
+ { INT_MAX, INT_MAX }
};
static int map_num1(struct num_mapping *map, int num)
{
int i;
- for (i=0 ; map[i].num1 != MAXINT; i++)
+ for (i=0 ; map[i].num1 != INT_MAX; i++)
if (map[i].num1 == num)
break;
return map[i].num2;
@@ -2641,10 +2640,10 @@
if (!dev) {
/* Initial sanity check. Exclude illegal levels. */
int i;
- for (i=0; ddf_level_num[i].num1 != MAXINT; i++)
+ for (i=0; ddf_level_num[i].num1 != INT_MAX; i++)
if (ddf_level_num[i].num2 == level)
break;
- if (ddf_level_num[i].num1 == MAXINT) {
+ if (ddf_level_num[i].num1 == INT_MAX) {
if (verbose)
fprintf(stderr, Name ": DDF does not support level %d arrays\n",
level);
--- a/super-intel.c 2012-11-24 23:26:46.412202198 +0100
+++ b/super-intel.c 2012-11-24 23:27:25.229092400 +0100
@@ -22,7 +22,6 @@
#include "mdmon.h"
#include "sha1.h"
#include "platform-intel.h"
-#include <values.h>
#include <scsi/sg.h>
#include <ctype.h>
#include <dirent.h>

39
base/musl/pkg_patch/mdadm/0002-mdadm-musl-no-__off64_t.patch

@ -0,0 +1,39 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/mdadm/0002-mdadm-musl-no-__off64_t.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- a/mdadm.h 2012-11-25 01:44:21.403317766 +0100
+++ b/mdadm.h 2012-11-25 01:43:12.293717364 +0100
@@ -25,6 +25,12 @@
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <unistd.h>
+
+/*
+ * musl doesn't know __off64_t
+ *
+ * mdadm.h:29:1: error: unknown type name '__off64_t'
+ *
#if !defined(__dietlibc__) && !defined(__KLIBC__)
extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
#else
@@ -32,6 +38,7 @@
# define lseek64 lseek
# endif
#endif
+ */
#include <sys/types.h>
#include <sys/stat.h>

38
base/musl/pkg_patch/mdadm/0003-mdadm-musl-sockaddr.patch

@ -0,0 +1,38 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/mdadm/0003-mdadm-musl-sockaddr.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- a/mdmon.c 2012-11-25 02:00:13.801413830 +0100
+++ b/mdmon.c 2012-11-25 02:31:10.676367716 +0100
@@ -231,7 +231,7 @@
addr.sun_family = PF_LOCAL;
strcpy(addr.sun_path, path);
- if (bind(sfd, &addr, sizeof(addr)) < 0) {
+ if (bind(sfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
close(sfd);
return -1;
}
--- a/msg.c 2012-11-25 02:05:54.825264277 +0100
+++ b/msg.c 2012-11-25 02:33:03.923005492 +0100
@@ -173,7 +173,7 @@
addr.sun_family = PF_LOCAL;
strcpy(addr.sun_path, path);
- if (connect(sfd, &addr, sizeof(addr)) < 0) {
+ if (connect(sfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
close(sfd);
return -1;
}

36
base/musl/pkg_patch/mdadm/0004-mdam-musl-no-canonicalize_file_name.patch

@ -0,0 +1,36 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/mdadm/0004-mdam-musl-no-canonicalize_file_name.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./platform-intel.c.orig 2012-11-25 02:37:18.872911773 +0100
+++ ./platform-intel.c 2012-11-25 02:37:24.525034590 +0100
@@ -116,7 +116,7 @@
list->dev_id = (__u16) dev_id;
list->type = type;
- list->path = canonicalize_file_name(path);
+ list->path = realpath(path, NULL);
list->next = NULL;
if ((list->pci_id = strrchr(list->path, '/')) != NULL)
list->pci_id++;
@@ -459,7 +459,7 @@
char device[46];
sprintf(device, "/sys/dev/block/%d:%d/device", major(dev), minor(dev));
- return canonicalize_file_name(device);
+ return realpath(device, NULL);
}
char *diskfd_to_devpath(int fd)

38
base/musl/pkg_patch/time/time-musl-no-redefinition-of-struct-rusage.patch

@ -0,0 +1,38 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg_patch/time/time-musl-no-redefinition-of-struct-rusage.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
resuse.h:43:8: error: redefinition of 'struct rusage'
--- ./resuse.h.orig 2012-11-26 01:54:53.610183362 +0100
+++ ./resuse.h 2012-11-26 01:55:14.810683068 +0100
@@ -38,17 +38,6 @@
# define TV_MSEC tv_usec / 1000
# if HAVE_WAIT3
# include <sys/resource.h>
-# else
-/* Process resource usage structure. */
-struct rusage
-{
- struct timeval ru_utime; /* User time used. */
- struct timeval ru_stime; /* System time used. */
- int ru_maxrss, ru_ixrss, ru_idrss, ru_isrss,
- ru_minflt, ru_majflt, ru_nswap, ru_inblock,
- ru_oublock, ru_msgsnd, ru_msgrcv, ru_nsignals,
- ru_nvcsw, ru_nivcsw;
-};
# endif
#endif
Loading…
Cancel
Save