musl.patch 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. diff -Nur gcc-4.7.3.orig/config.sub gcc-4.7.3/config.sub
  2. --- gcc-4.7.3.orig/config.sub 2012-08-06 16:34:27.000000000 +0200
  3. +++ gcc-4.7.3/config.sub 2013-08-11 14:20:23.979180205 +0200
  4. @@ -125,6 +125,7 @@
  5. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  6. case $maybe_os in
  7. nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
  8. + linux-musl* | \
  9. linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
  10. knetbsd*-gnu* | netbsd*-gnu* | \
  11. kopensolaris*-gnu* | \
  12. diff -Nur gcc-4.7.3.orig/fixincludes/mkfixinc.sh gcc-4.7.3/fixincludes/mkfixinc.sh
  13. --- gcc-4.7.3.orig/fixincludes/mkfixinc.sh 2011-09-22 16:00:17.000000000 +0200
  14. +++ gcc-4.7.3/fixincludes/mkfixinc.sh 2013-08-11 14:17:48.905129751 +0200
  15. @@ -20,7 +20,8 @@
  16. powerpc-*-eabi* | \
  17. powerpc-*-rtems* | \
  18. powerpcle-*-eabisim* | \
  19. - powerpcle-*-eabi* )
  20. + powerpcle-*-eabi* | \
  21. + *-musl* )
  22. # IF there is no include fixing,
  23. # THEN create a no-op fixer and exit
  24. (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
  25. diff -Nur gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h gcc-4.7.3/gcc/config/arm/linux-eabi.h
  26. --- gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h 2011-11-02 16:03:19.000000000 +0100
  27. +++ gcc-4.7.3/gcc/config/arm/linux-eabi.h 2013-08-11 14:17:15.153554066 +0200
  28. @@ -64,6 +64,10 @@
  29. #undef GLIBC_DYNAMIC_LINKER
  30. #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
  31. +/* musl has no "classic" (i.e. broken) mode */
  32. +#undef MUSL_DYNAMIC_LINKER
  33. +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1"
  34. +
  35. /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
  36. use the GNU/Linux version, not the generic BPABI version. */
  37. #undef LINK_SPEC
  38. diff -Nur gcc-4.7.3.orig/gcc/config/i386/linux64.h gcc-4.7.3/gcc/config/i386/linux64.h
  39. --- gcc-4.7.3.orig/gcc/config/i386/linux64.h 2011-07-07 17:38:34.000000000 +0200
  40. +++ gcc-4.7.3/gcc/config/i386/linux64.h 2013-08-11 14:17:15.157554016 +0200
  41. @@ -31,3 +31,7 @@
  42. #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
  43. #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
  44. #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
  45. +
  46. +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
  47. +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
  48. +#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
  49. diff -Nur gcc-4.7.3.orig/gcc/config/i386/linux.h gcc-4.7.3/gcc/config/i386/linux.h
  50. --- gcc-4.7.3.orig/gcc/config/i386/linux.h 2011-06-03 20:30:39.000000000 +0200
  51. +++ gcc-4.7.3/gcc/config/i386/linux.h 2013-08-11 14:17:15.153554066 +0200
  52. @@ -22,3 +22,4 @@
  53. #define GNU_USER_LINK_EMULATION "elf_i386"
  54. #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  55. +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
  56. diff -Nur gcc-4.7.3.orig/gcc/config/linux.h gcc-4.7.3/gcc/config/linux.h
  57. --- gcc-4.7.3.orig/gcc/config/linux.h 2012-08-14 15:59:04.000000000 +0200
  58. +++ gcc-4.7.3/gcc/config/linux.h 2013-08-11 14:17:15.169553864 +0200
  59. @@ -33,10 +33,12 @@
  60. #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
  61. #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
  62. #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
  63. +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
  64. #else
  65. #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
  66. #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
  67. #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
  68. +#define OPTION_MUSL (linux_libc == LIBC_MUSL)
  69. #endif
  70. #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
  71. @@ -54,18 +56,21 @@
  72. uClibc or Bionic is the default C library and whether
  73. -muclibc or -mglibc or -mbionic has been passed to change the default. */
  74. -#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
  75. - "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
  76. +#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
  77. + "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
  78. #if DEFAULT_LIBC == LIBC_GLIBC
  79. -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
  80. - CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
  81. +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
  82. + CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
  83. #elif DEFAULT_LIBC == LIBC_UCLIBC
  84. -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
  85. - CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
  86. +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
  87. + CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
  88. #elif DEFAULT_LIBC == LIBC_BIONIC
  89. -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
  90. - CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
  91. +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
  92. + CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
  93. +#elif DEFAULT_LIBC == LIBC_MUSL
  94. +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
  95. + CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
  96. #else
  97. #error "Unsupported DEFAULT_LIBC"
  98. #endif /* DEFAULT_LIBC */
  99. @@ -85,16 +90,16 @@
  100. #define GNU_USER_DYNAMIC_LINKER \
  101. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
  102. - BIONIC_DYNAMIC_LINKER)
  103. + BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
  104. #define GNU_USER_DYNAMIC_LINKER32 \
  105. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
  106. - BIONIC_DYNAMIC_LINKER32)
  107. + BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
  108. #define GNU_USER_DYNAMIC_LINKER64 \
  109. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
  110. - BIONIC_DYNAMIC_LINKER64)
  111. + BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
  112. #define GNU_USER_DYNAMIC_LINKERX32 \
  113. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
  114. - BIONIC_DYNAMIC_LINKERX32)
  115. + BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
  116. /* Determine whether the entire c99 runtime
  117. is present in the runtime library. */
  118. diff -Nur gcc-4.7.3.orig/gcc/config/linux.opt gcc-4.7.3/gcc/config/linux.opt
  119. --- gcc-4.7.3.orig/gcc/config/linux.opt 2010-09-29 16:51:52.000000000 +0200
  120. +++ gcc-4.7.3/gcc/config/linux.opt 2013-08-11 14:17:15.169553864 +0200
  121. @@ -30,3 +30,7 @@
  122. muclibc
  123. Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
  124. Use uClibc C library
  125. +
  126. +mmusl
  127. +Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
  128. +Use musl C library
  129. diff -Nur gcc-4.7.3.orig/gcc/config/mips/linux64.h gcc-4.7.3/gcc/config/mips/linux64.h
  130. --- gcc-4.7.3.orig/gcc/config/mips/linux64.h 2011-07-19 20:00:27.000000000 +0200
  131. +++ gcc-4.7.3/gcc/config/mips/linux64.h 2013-08-11 14:17:15.357551501 +0200
  132. @@ -28,6 +28,9 @@
  133. #define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
  134. #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
  135. #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
  136. +#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mips.so.1"
  137. +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips.so.1"
  138. +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips.so.1"
  139. #define GNU_USER_DYNAMIC_LINKERN32 \
  140. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
  141. - BIONIC_DYNAMIC_LINKERN32)
  142. + BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
  143. diff -Nur gcc-4.7.3.orig/gcc/config/mips/linux.h gcc-4.7.3/gcc/config/mips/linux.h
  144. --- gcc-4.7.3.orig/gcc/config/mips/linux.h 2011-07-19 20:00:27.000000000 +0200
  145. +++ gcc-4.7.3/gcc/config/mips/linux.h 2013-08-11 14:17:15.169553864 +0200
  146. @@ -19,3 +19,5 @@
  147. <http://www.gnu.org/licenses/>. */
  148. #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
  149. +
  150. +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1"
  151. diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/linux64.h gcc-4.7.3/gcc/config/rs6000/linux64.h
  152. --- gcc-4.7.3.orig/gcc/config/rs6000/linux64.h 2012-03-12 17:16:51.000000000 +0100
  153. +++ gcc-4.7.3/gcc/config/rs6000/linux64.h 2013-08-11 14:17:15.169553864 +0200
  154. @@ -362,17 +362,21 @@
  155. #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
  156. #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
  157. #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
  158. +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
  159. +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
  160. #if DEFAULT_LIBC == LIBC_UCLIBC
  161. -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
  162. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
  163. #elif DEFAULT_LIBC == LIBC_GLIBC
  164. -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
  165. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
  166. +#elif DEFAULT_LIBC == LIBC_MUSL
  167. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
  168. #else
  169. #error "Unsupported DEFAULT_LIBC"
  170. #endif
  171. #define GNU_USER_DYNAMIC_LINKER32 \
  172. - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
  173. + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
  174. #define GNU_USER_DYNAMIC_LINKER64 \
  175. - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
  176. + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
  177. #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
  178. diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h gcc-4.7.3/gcc/config/rs6000/sysv4.h
  179. --- gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h 2012-04-30 19:39:01.000000000 +0200
  180. +++ gcc-4.7.3/gcc/config/rs6000/sysv4.h 2013-08-11 14:17:15.173553814 +0200
  181. @@ -804,15 +804,18 @@
  182. #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
  183. #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
  184. +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
  185. #if DEFAULT_LIBC == LIBC_UCLIBC
  186. -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
  187. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
  188. +#elif DEFAULT_LIBC == LIBC_MUSL
  189. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
  190. #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
  191. -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
  192. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
  193. #else
  194. #error "Unsupported DEFAULT_LIBC"
  195. #endif
  196. #define GNU_USER_DYNAMIC_LINKER \
  197. - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
  198. + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
  199. #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
  200. %{rdynamic:-export-dynamic} \
  201. diff -Nur gcc-4.7.3.orig/gcc/config.gcc gcc-4.7.3/gcc/config.gcc
  202. --- gcc-4.7.3.orig/gcc/config.gcc 2013-03-06 23:54:11.000000000 +0100
  203. +++ gcc-4.7.3/gcc/config.gcc 2013-08-11 14:17:15.141554216 +0200
  204. @@ -522,7 +522,7 @@
  205. esac
  206. # Common C libraries.
  207. -tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
  208. +tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
  209. # Common parts for widely ported systems.
  210. case ${target} in
  211. @@ -625,6 +625,9 @@
  212. *-*-*uclibc*)
  213. tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
  214. ;;
  215. + *-*-*musl*)
  216. + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
  217. + ;;
  218. *)
  219. tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
  220. ;;
  221. diff -Nur gcc-4.7.3.orig/gcc/configure gcc-4.7.3/gcc/configure
  222. --- gcc-4.7.3.orig/gcc/configure 2013-02-06 16:23:55.000000000 +0100
  223. +++ gcc-4.7.3/gcc/configure 2013-08-11 14:17:42.205213980 +0200
  224. @@ -26902,6 +26902,9 @@
  225. gcc_cv_target_dl_iterate_phdr=no
  226. fi
  227. ;;
  228. + *-linux-musl*)
  229. + gcc_cv_target_dl_iterate_phdr=yes
  230. + ;;
  231. esac
  232. if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
  233. diff -Nur gcc-4.7.3.orig/gcc/ginclude/stddef.h gcc-4.7.3/gcc/ginclude/stddef.h
  234. --- gcc-4.7.3.orig/gcc/ginclude/stddef.h 2012-02-12 02:06:04.000000000 +0100
  235. +++ gcc-4.7.3/gcc/ginclude/stddef.h 2013-08-11 14:17:15.349551601 +0200
  236. @@ -184,6 +184,7 @@
  237. #ifndef _GCC_SIZE_T
  238. #ifndef _SIZET_
  239. #ifndef __size_t
  240. +#ifndef __DEFINED_size_t /* musl */
  241. #define __size_t__ /* BeOS */
  242. #define __SIZE_T__ /* Cray Unicos/Mk */
  243. #define _SIZE_T
  244. @@ -200,6 +201,7 @@
  245. #define ___int_size_t_h
  246. #define _GCC_SIZE_T
  247. #define _SIZET_
  248. +#define __DEFINED_size_t /* musl */
  249. #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
  250. || defined(__FreeBSD_kernel__)
  251. /* __size_t is a typedef on FreeBSD 5, must not trash it. */
  252. @@ -215,6 +217,7 @@
  253. typedef long ssize_t;
  254. #endif /* __BEOS__ */
  255. #endif /* !(defined (__GNUG__) && defined (size_t)) */
  256. +#endif /* __DEFINED_size_t */
  257. #endif /* __size_t */
  258. #endif /* _SIZET_ */
  259. #endif /* _GCC_SIZE_T */
  260. diff -Nur gcc-4.7.3.orig/libgomp/config/posix/time.c gcc-4.7.3/libgomp/config/posix/time.c
  261. --- gcc-4.7.3.orig/libgomp/config/posix/time.c 2009-04-09 17:00:19.000000000 +0200
  262. +++ gcc-4.7.3/libgomp/config/posix/time.c 2013-08-11 14:17:15.349551601 +0200
  263. @@ -28,6 +28,8 @@
  264. The following implementation uses the most simple POSIX routines.
  265. If present, POSIX 4 clocks should be used instead. */
  266. +#define _POSIX_C_SOURCE 199309L /* for clocks */
  267. +
  268. #include "libgomp.h"
  269. #include <unistd.h>
  270. #if TIME_WITH_SYS_TIME
  271. diff -Nur gcc-4.7.3.orig/libitm/config/arm/hwcap.cc gcc-4.7.3/libitm/config/arm/hwcap.cc
  272. --- gcc-4.7.3.orig/libitm/config/arm/hwcap.cc 2011-12-15 04:24:05.000000000 +0100
  273. +++ gcc-4.7.3/libitm/config/arm/hwcap.cc 2013-08-11 14:17:15.353551551 +0200
  274. @@ -40,7 +40,11 @@
  275. #ifdef __linux__
  276. #include <unistd.h>
  277. +#ifdef __GLIBC__
  278. #include <sys/fcntl.h>
  279. +#else
  280. +#include <fcntl.h>
  281. +#endif
  282. #include <elf.h>
  283. static void __attribute__((constructor))
  284. diff -Nur gcc-4.7.3.orig/libitm/config/linux/x86/tls.h gcc-4.7.3/libitm/config/linux/x86/tls.h
  285. --- gcc-4.7.3.orig/libitm/config/linux/x86/tls.h 2011-11-08 12:13:41.000000000 +0100
  286. +++ gcc-4.7.3/libitm/config/linux/x86/tls.h 2013-08-11 14:17:15.353551551 +0200
  287. @@ -25,16 +25,19 @@
  288. #ifndef LIBITM_X86_TLS_H
  289. #define LIBITM_X86_TLS_H 1
  290. -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
  291. +#if defined(__GLIBC_PREREQ)
  292. +#if __GLIBC_PREREQ(2, 10)
  293. /* Use slots in the TCB head rather than __thread lookups.
  294. GLIBC has reserved words 10 through 13 for TM. */
  295. #define HAVE_ARCH_GTM_THREAD 1
  296. #define HAVE_ARCH_GTM_THREAD_DISP 1
  297. #endif
  298. +#endif
  299. #include "config/generic/tls.h"
  300. -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
  301. +#if defined(__GLIBC_PREREQ)
  302. +#if __GLIBC_PREREQ(2, 10)
  303. namespace GTM HIDDEN {
  304. #ifdef __x86_64__
  305. @@ -101,5 +104,6 @@
  306. } // namespace GTM
  307. #endif /* >= GLIBC 2.10 */
  308. +#endif
  309. #endif // LIBITM_X86_TLS_H
  310. diff -Nur gcc-4.7.3.orig/libstdc++-v3/configure.host gcc-4.7.3/libstdc++-v3/configure.host
  311. --- gcc-4.7.3.orig/libstdc++-v3/configure.host 2012-12-18 15:27:14.000000000 +0100
  312. +++ gcc-4.7.3/libstdc++-v3/configure.host 2013-08-11 14:17:15.357551501 +0200
  313. @@ -243,6 +243,13 @@
  314. os_include_dir="os/bsd/freebsd"
  315. ;;
  316. gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
  317. + # check for musl by target
  318. + case "${host_os}" in
  319. + *-musl*)
  320. + os_include_dir="os/generic"
  321. + ;;
  322. + *)
  323. +
  324. if [ "$uclibc" = "yes" ]; then
  325. os_include_dir="os/uclibc"
  326. elif [ "$bionic" = "yes" ]; then
  327. @@ -251,6 +258,9 @@
  328. os_include_dir="os/gnu-linux"
  329. fi
  330. ;;
  331. +
  332. + esac
  333. + ;;
  334. hpux*)
  335. os_include_dir="os/hpux"
  336. ;;