OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

559 lines
20 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../musl/pkg/gcc/gcc-4.7.3-musl.patch
  5. # Copyright (C) 2013 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. This patch was made by Gregor Richards (https://bitbucket.org/GregorR)
  17. https://bitbucket.org/GregorR/musl-cross/raw/8c8493b7e33486d4240965d0e2f9575ad2c3593d/patches/gcc-4.7.3-musl.diff
  18. # HG changeset patch
  19. # Parent 05e4cf5f033d266c8f8fe065f8c5752891c5bf7a
  20. Adding musl to config.sub, so it's recognized as a target platform.
  21. It has to be slightly changed to apply on top of OpenSDE's patch
  22. 'base/gcc/gcc-4.7-multilib-1.patch' which is for adjusting multilib
  23. dirnames to suite OpenSDE's lib as symlink strategy.
  24. OpenSDE specific changes have been done in:
  25. gcc/config/rs6000/linux64.h
  26. diff -r 05e4cf5f033d -r 04a6a82b8e06 config.sub
  27. --- a/config.sub Wed Nov 21 21:16:07 2012 -0500
  28. +++ b/config.sub Wed Nov 21 21:16:58 2012 -0500
  29. @@ -125,6 +125,7 @@
  30. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  31. case $maybe_os in
  32. nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
  33. + linux-musl* | \
  34. linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
  35. knetbsd*-gnu* | netbsd*-gnu* | \
  36. kopensolaris*-gnu* | \
  37. @@ -1346,6 +1347,7 @@
  38. | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  39. | -mingw32* | -linux-gnu* | -linux-android* \
  40. | -linux-newlib* | -linux-uclibc* \
  41. + | -linux-musl* \
  42. | -uxpv* | -beos* | -mpeix* | -udk* \
  43. | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
  44. | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
  45. # HG changeset patch
  46. # Parent 04a6a82b8e06669a42181c96381b4fbc3ffa008c
  47. Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.
  48. diff -r 04a6a82b8e06 -r 193f80e01b02 libstdc++-v3/configure.host
  49. --- a/libstdc++-v3/configure.host Wed Nov 21 21:16:58 2012 -0500
  50. +++ b/libstdc++-v3/configure.host Wed Nov 21 21:17:38 2012 -0500
  51. @@ -243,6 +243,13 @@
  52. os_include_dir="os/bsd/freebsd"
  53. ;;
  54. gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
  55. + # check for musl by target
  56. + case "${host_os}" in
  57. + *-musl*)
  58. + os_include_dir="os/generic"
  59. + ;;
  60. + *)
  61. +
  62. if [ "$uclibc" = "yes" ]; then
  63. os_include_dir="os/uclibc"
  64. elif [ "$bionic" = "yes" ]; then
  65. @@ -251,6 +258,9 @@
  66. os_include_dir="os/gnu-linux"
  67. fi
  68. ;;
  69. +
  70. + esac
  71. + ;;
  72. hpux*)
  73. os_include_dir="os/hpux"
  74. ;;
  75. # HG changeset patch
  76. # Parent 193f80e01b026d8de7f53d467f2c59cd0b7927dc
  77. Adding -mmusl as a musl libc specifier, and the necessary hacks for it to know how to find musl's dynamic linker.
  78. diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/config.gcc
  79. --- a/gcc/config.gcc Wed Nov 21 21:17:38 2012 -0500
  80. +++ b/gcc/config.gcc Wed Nov 21 21:19:19 2012 -0500
  81. @@ -522,7 +522,7 @@
  82. esac
  83. # Common C libraries.
  84. -tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
  85. +tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
  86. # Common parts for widely ported systems.
  87. case ${target} in
  88. @@ -625,6 +625,9 @@
  89. *-*-*uclibc*)
  90. tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
  91. ;;
  92. + *-*-*musl*)
  93. + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
  94. + ;;
  95. *)
  96. tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
  97. ;;
  98. diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/config/linux.h
  99. --- a/gcc/config/linux.h Wed Nov 21 21:17:38 2012 -0500
  100. +++ b/gcc/config/linux.h Wed Nov 21 21:19:19 2012 -0500
  101. @@ -33,10 +33,12 @@
  102. #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
  103. #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
  104. #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
  105. +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
  106. #else
  107. #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
  108. #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
  109. #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
  110. +#define OPTION_MUSL (linux_libc == LIBC_MUSL)
  111. #endif
  112. #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
  113. @@ -54,18 +56,21 @@
  114. uClibc or Bionic is the default C library and whether
  115. -muclibc or -mglibc or -mbionic has been passed to change the default. */
  116. -#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
  117. - "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
  118. +#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
  119. + "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
  120. #if DEFAULT_LIBC == LIBC_GLIBC
  121. -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
  122. - CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
  123. +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
  124. + CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
  125. #elif DEFAULT_LIBC == LIBC_UCLIBC
  126. -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
  127. - CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
  128. +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
  129. + CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
  130. #elif DEFAULT_LIBC == LIBC_BIONIC
  131. -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
  132. - CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
  133. +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
  134. + CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
  135. +#elif DEFAULT_LIBC == LIBC_MUSL
  136. +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
  137. + CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
  138. #else
  139. #error "Unsupported DEFAULT_LIBC"
  140. #endif /* DEFAULT_LIBC */
  141. @@ -85,16 +90,16 @@
  142. #define GNU_USER_DYNAMIC_LINKER \
  143. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
  144. - BIONIC_DYNAMIC_LINKER)
  145. + BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
  146. #define GNU_USER_DYNAMIC_LINKER32 \
  147. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
  148. - BIONIC_DYNAMIC_LINKER32)
  149. + BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
  150. #define GNU_USER_DYNAMIC_LINKER64 \
  151. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
  152. - BIONIC_DYNAMIC_LINKER64)
  153. + BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
  154. #define GNU_USER_DYNAMIC_LINKERX32 \
  155. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
  156. - BIONIC_DYNAMIC_LINKERX32)
  157. + BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
  158. /* Determine whether the entire c99 runtime
  159. is present in the runtime library. */
  160. diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/config/linux.opt
  161. --- a/gcc/config/linux.opt Wed Nov 21 21:17:38 2012 -0500
  162. +++ b/gcc/config/linux.opt Wed Nov 21 21:19:19 2012 -0500
  163. @@ -30,3 +30,7 @@
  164. muclibc
  165. Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
  166. Use uClibc C library
  167. +
  168. +mmusl
  169. +Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
  170. +Use musl C library
  171. diff -r 193f80e01b02 -r 45cd88d4fb7b gcc/ginclude/stddef.h
  172. --- a/gcc/ginclude/stddef.h Wed Nov 21 21:17:38 2012 -0500
  173. +++ b/gcc/ginclude/stddef.h Wed Nov 21 21:19:19 2012 -0500
  174. @@ -184,6 +184,7 @@
  175. #ifndef _GCC_SIZE_T
  176. #ifndef _SIZET_
  177. #ifndef __size_t
  178. +#ifndef __DEFINED_size_t /* musl */
  179. #define __size_t__ /* BeOS */
  180. #define __SIZE_T__ /* Cray Unicos/Mk */
  181. #define _SIZE_T
  182. @@ -200,6 +201,7 @@
  183. #define ___int_size_t_h
  184. #define _GCC_SIZE_T
  185. #define _SIZET_
  186. +#define __DEFINED_size_t /* musl */
  187. #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
  188. || defined(__FreeBSD_kernel__)
  189. /* __size_t is a typedef on FreeBSD 5, must not trash it. */
  190. @@ -215,6 +217,7 @@
  191. typedef long ssize_t;
  192. #endif /* __BEOS__ */
  193. #endif /* !(defined (__GNUG__) && defined (size_t)) */
  194. +#endif /* __DEFINED_size_t */
  195. #endif /* __size_t */
  196. #endif /* _SIZET_ */
  197. #endif /* _GCC_SIZE_T */
  198. # HG changeset patch
  199. # Parent 45cd88d4fb7b0e813578c296004eaab2c2d0bfb9
  200. A fix for libgomp to correctly request a POSIX version for time support.
  201. diff -r 45cd88d4fb7b -r 0afd9d82498d libgomp/config/posix/time.c
  202. --- a/libgomp/config/posix/time.c Wed Nov 21 21:19:19 2012 -0500
  203. +++ b/libgomp/config/posix/time.c Wed Nov 21 21:20:22 2012 -0500
  204. @@ -28,6 +28,8 @@
  205. The following implementation uses the most simple POSIX routines.
  206. If present, POSIX 4 clocks should be used instead. */
  207. +#define _POSIX_C_SOURCE 199309L /* for clocks */
  208. +
  209. #include "libgomp.h"
  210. #include <unistd.h>
  211. #if TIME_WITH_SYS_TIME
  212. diff -r 2ebb44d1e6f1 libgcc/unwind-dw2-fde-dip.c
  213. --- a/libgcc/unwind-dw2-fde-dip.c Sun Jul 28 12:15:47 2013 -0400
  214. +++ b/libgcc/unwind-dw2-fde-dip.c Sun Jul 28 12:17:02 2013 -0400
  215. @@ -47,28 +47,13 @@
  216. #include "unwind-compat.h"
  217. #include "gthr.h"
  218. -#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
  219. - && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
  220. - || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
  221. +#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
  222. # define USE_PT_GNU_EH_FRAME
  223. -#endif
  224. -
  225. -#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
  226. - && defined(__FreeBSD__) && __FreeBSD__ >= 7
  227. -# define ElfW __ElfN
  228. -# define USE_PT_GNU_EH_FRAME
  229. -#endif
  230. -
  231. -#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
  232. - && defined(__OpenBSD__)
  233. -# define ElfW(type) Elf_##type
  234. -# define USE_PT_GNU_EH_FRAME
  235. -#endif
  236. -
  237. -#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
  238. - && defined(TARGET_DL_ITERATE_PHDR) \
  239. - && defined(__sun__) && defined(__svr4__)
  240. -# define USE_PT_GNU_EH_FRAME
  241. +# ifdef __OpenBSD__
  242. +# define ElfW(type) Elf_##typ
  243. +# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
  244. +# define ElfW __ElfN
  245. +# endif
  246. #endif
  247. #if defined(USE_PT_GNU_EH_FRAME)
  248. --- a/gcc/configure
  249. +++ b/gcc/configure
  250. @@ -26970,6 +26970,9 @@
  251. gcc_cv_target_dl_iterate_phdr=no
  252. fi
  253. ;;
  254. + *-linux-musl*)
  255. + gcc_cv_target_dl_iterate_phdr=yes
  256. + ;;
  257. esac
  258. if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
  259. # HG changeset patch
  260. # Parent 94e435662aff38e86c9ca0dff4bbf451e0190b34
  261. Get rid of ever-broken fixincludes on musl.
  262. diff -r 94e435662aff -r e27957848dc8 fixincludes/mkfixinc.sh
  263. --- a/fixincludes/mkfixinc.sh Sat Jul 27 23:37:20 2013 -0400
  264. +++ b/fixincludes/mkfixinc.sh Sat Jul 27 23:43:03 2013 -0400
  265. @@ -19,7 +19,8 @@
  266. powerpc-*-eabi* | \
  267. powerpc-*-rtems* | \
  268. powerpcle-*-eabisim* | \
  269. - powerpcle-*-eabi* )
  270. + powerpcle-*-eabi* | \
  271. + *-musl* )
  272. # IF there is no include fixing,
  273. # THEN create a no-op fixer and exit
  274. (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
  275. # HG changeset patch
  276. # Parent 0afd9d82498d2cd30aa78529ff25f211bdc0c3b9
  277. Support for i386-linux-musl and x86_64-linux-musl.
  278. diff -r 0afd9d82498d -r 53f3e21a7d14 gcc/config/i386/linux.h
  279. --- a/gcc/config/i386/linux.h Wed Nov 21 21:20:22 2012 -0500
  280. +++ b/gcc/config/i386/linux.h Wed Nov 21 21:21:21 2012 -0500
  281. @@ -22,3 +22,4 @@
  282. #define GNU_USER_LINK_EMULATION "elf_i386"
  283. #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  284. +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
  285. diff -r 0afd9d82498d -r 53f3e21a7d14 gcc/config/i386/linux64.h
  286. --- a/gcc/config/i386/linux64.h Wed Nov 21 21:20:22 2012 -0500
  287. +++ b/gcc/config/i386/linux64.h Wed Nov 21 21:21:21 2012 -0500
  288. @@ -31,3 +31,7 @@
  289. #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
  290. #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
  291. #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
  292. +
  293. +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
  294. +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
  295. +#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
  296. diff -r 0afd9d82498d -r 53f3e21a7d14 libitm/config/linux/x86/tls.h
  297. --- a/libitm/config/linux/x86/tls.h Wed Nov 21 21:20:22 2012 -0500
  298. +++ b/libitm/config/linux/x86/tls.h Wed Nov 21 21:21:21 2012 -0500
  299. @@ -25,16 +25,19 @@
  300. #ifndef LIBITM_X86_TLS_H
  301. #define LIBITM_X86_TLS_H 1
  302. -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
  303. +#if defined(__GLIBC_PREREQ)
  304. +#if __GLIBC_PREREQ(2, 10)
  305. /* Use slots in the TCB head rather than __thread lookups.
  306. GLIBC has reserved words 10 through 13 for TM. */
  307. #define HAVE_ARCH_GTM_THREAD 1
  308. #define HAVE_ARCH_GTM_THREAD_DISP 1
  309. #endif
  310. +#endif
  311. #include "config/generic/tls.h"
  312. -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
  313. +#if defined(__GLIBC_PREREQ)
  314. +#if __GLIBC_PREREQ(2, 10)
  315. namespace GTM HIDDEN {
  316. #ifdef __x86_64__
  317. @@ -101,5 +104,6 @@
  318. } // namespace GTM
  319. #endif /* >= GLIBC 2.10 */
  320. +#endif
  321. #endif // LIBITM_X86_TLS_H
  322. # HG changeset patch
  323. # Parent 53f3e21a7d14d0514ec7cb9ffb67b24dcf1f9fc9
  324. Support for arm-linux-musl.
  325. diff -r 53f3e21a7d14 -r 0a4e297edad6 gcc/config/arm/linux-eabi.h
  326. --- a/gcc/config/arm/linux-eabi.h Wed Nov 21 21:21:21 2012 -0500
  327. +++ b/gcc/config/arm/linux-eabi.h Wed Nov 21 21:21:54 2012 -0500
  328. @@ -64,6 +64,10 @@
  329. #undef GLIBC_DYNAMIC_LINKER
  330. #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
  331. +/* musl has no "classic" (i.e. broken) mode */
  332. +#undef MUSL_DYNAMIC_LINKER
  333. +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1"
  334. +
  335. /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
  336. use the GNU/Linux version, not the generic BPABI version. */
  337. #undef LINK_SPEC
  338. diff -r 53f3e21a7d14 -r 0a4e297edad6 libitm/config/arm/hwcap.cc
  339. --- a/libitm/config/arm/hwcap.cc Wed Nov 21 21:21:21 2012 -0500
  340. +++ b/libitm/config/arm/hwcap.cc Wed Nov 21 21:21:54 2012 -0500
  341. @@ -40,7 +40,11 @@
  342. #ifdef __linux__
  343. #include <unistd.h>
  344. +#ifdef __GLIBC__
  345. #include <sys/fcntl.h>
  346. +#else
  347. +#include <fcntl.h>
  348. +#endif
  349. #include <elf.h>
  350. static void __attribute__((constructor))
  351. # HG changeset patch
  352. # Parent 0a4e297edad6e46f4b66401b93b217aa3194af4e
  353. Support for mips-linux-musl.
  354. diff -r 0a4e297edad6 -r 78025c74c5c1 gcc/config/mips/linux.h
  355. --- a/gcc/config/mips/linux.h Wed Nov 21 21:21:54 2012 -0500
  356. +++ b/gcc/config/mips/linux.h Wed Nov 21 21:23:49 2012 -0500
  357. @@ -19,3 +19,5 @@
  358. <http://www.gnu.org/licenses/>. */
  359. #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
  360. +
  361. +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1"
  362. # HG changeset patch
  363. # Parent 78025c74c5c1705f16ce13f3645ecb86c10cc1c2
  364. Support for powerpc-linux-musl.
  365. diff -r 78025c74c5c1 gcc/config.gcc
  366. --- a/gcc/config.gcc Wed Nov 21 21:23:49 2012 -0500
  367. +++ b/gcc/config.gcc Wed Nov 21 21:45:58 2012 -0500
  368. @@ -2078,6 +2078,10 @@
  369. powerpc*-*-linux*paired*)
  370. tm_file="${tm_file} rs6000/750cl.h" ;;
  371. esac
  372. + case ${target} in
  373. + *-linux*-musl*)
  374. + enable_secureplt=yes ;;
  375. + esac
  376. if test x${enable_secureplt} = xyes; then
  377. tm_file="rs6000/secureplt.h ${tm_file}"
  378. fi
  379. diff -r 78025c74c5c1 gcc/config/rs6000/linux64.h
  380. --- a/gcc/config/rs6000/linux64.h Wed Nov 21 21:23:49 2012 -0500
  381. +++ b/gcc/config/rs6000/linux64.h Wed Nov 21 21:45:58 2012 -0500
  382. @@ -362,17 +362,21 @@
  383. #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
  384. #define UCLIBC_DYNAMIC_LINKER32 "/lib32/ld-uClibc.so.0"
  385. #define UCLIBC_DYNAMIC_LINKER64 "/lib64/ld64-uClibc.so.0"
  386. +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
  387. +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
  388. #if DEFAULT_LIBC == LIBC_UCLIBC
  389. -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
  390. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
  391. #elif DEFAULT_LIBC == LIBC_GLIBC
  392. -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
  393. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
  394. +#elif DEFAULT_LIBC == LIBC_MUSL
  395. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
  396. #else
  397. #error "Unsupported DEFAULT_LIBC"
  398. #endif
  399. #define GNU_USER_DYNAMIC_LINKER32 \
  400. - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
  401. + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
  402. #define GNU_USER_DYNAMIC_LINKER64 \
  403. - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
  404. + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
  405. #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
  406. diff -r 78025c74c5c1 gcc/config/rs6000/secureplt.h
  407. --- a/gcc/config/rs6000/secureplt.h Wed Nov 21 21:23:49 2012 -0500
  408. +++ b/gcc/config/rs6000/secureplt.h Wed Nov 21 21:45:58 2012 -0500
  409. @@ -18,3 +18,4 @@
  410. <http://www.gnu.org/licenses/>. */
  411. #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
  412. +#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
  413. diff -r 78025c74c5c1 gcc/config/rs6000/sysv4.h
  414. --- a/gcc/config/rs6000/sysv4.h Wed Nov 21 21:23:49 2012 -0500
  415. +++ b/gcc/config/rs6000/sysv4.h Wed Nov 21 21:45:58 2012 -0500
  416. @@ -566,6 +566,9 @@
  417. #ifndef CC1_SECURE_PLT_DEFAULT_SPEC
  418. #define CC1_SECURE_PLT_DEFAULT_SPEC ""
  419. #endif
  420. +#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
  421. +#define LINK_SECURE_PLT_DEFAULT_SPEC ""
  422. +#endif
  423. /* Pass -G xxx to the compiler and set correct endian mode. */
  424. #define CC1_SPEC "%{G*} %(cc1_cpu) \
  425. @@ -626,7 +629,8 @@
  426. %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
  427. %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
  428. %{mcall-i960-old: --oformat elf32-powerpcle} \
  429. - }}}}"
  430. + }}}} \
  431. +%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
  432. /* Any specific OS flags. */
  433. #define LINK_OS_SPEC "\
  434. @@ -804,15 +808,18 @@
  435. #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
  436. #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
  437. +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
  438. #if DEFAULT_LIBC == LIBC_UCLIBC
  439. -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
  440. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
  441. +#elif DEFAULT_LIBC == LIBC_MUSL
  442. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
  443. #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
  444. -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
  445. +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
  446. #else
  447. #error "Unsupported DEFAULT_LIBC"
  448. #endif
  449. #define GNU_USER_DYNAMIC_LINKER \
  450. - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
  451. + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
  452. #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
  453. %{rdynamic:-export-dynamic} \
  454. @@ -938,6 +945,7 @@
  455. { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
  456. { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \
  457. { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
  458. + { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
  459. { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
  460. { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
  461. { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
  462. diff -r 78025c74c5c1 libgcc/config/rs6000/linux-unwind.h
  463. --- a/libgcc/config/rs6000/linux-unwind.h Wed Nov 21 21:23:49 2012 -0500
  464. +++ b/libgcc/config/rs6000/linux-unwind.h Wed Nov 21 21:45:58 2012 -0500
  465. @@ -176,6 +176,7 @@
  466. }
  467. #endif
  468. +#ifdef __GLIBC__
  469. /* Find an entry in the process auxiliary vector. The canonical way to
  470. test for VMX is to look at AT_HWCAP. */
  471. @@ -207,6 +208,7 @@
  472. return auxp->a_val;
  473. return 0;
  474. }
  475. +#endif
  476. /* Do code reading to identify a signal frame, and set the frame
  477. state data appropriately. See unwind-dw2.c for the structs. */
  478. @@ -253,7 +255,11 @@
  479. if (hwcap == 0)
  480. {
  481. +#ifdef __GLIBC__
  482. hwcap = ppc_linux_aux_vector (16);
  483. +#else
  484. + hwcap = -1;
  485. +#endif
  486. /* These will already be set if we found AT_HWCAP. A nonzero
  487. value stops us looking again if for some reason we couldn't
  488. find AT_HWCAP. */
  489. # HG changeset patch
  490. # Parent 800ec1c37f610df2bfe75333ed6ec6caa905d630
  491. Support (partial) for microblaze-linux-musl.
  492. diff -r 800ec1c37f61 gcc/config.gcc
  493. --- a/gcc/config.gcc Thu Apr 11 13:23:51 2013 -0400
  494. +++ b/gcc/config.gcc Thu Apr 11 13:24:17 2013 -0400
  495. @@ -1733,6 +1733,7 @@
  496. tm_file="${tm_file} dbxelf.h gnu-user.h linux.h microblaze/linux.h"
  497. c_target_objs="${c_target_objs} microblaze-c.o"
  498. cxx_target_objs="${cxx_target_objs} microblaze-c.o"
  499. + tmake_file="${tmake_file} microblaze/t-microblaze"
  500. ;;
  501. microblaze*-*-rtems*)
  502. tm_file="${tm_file} dbxelf.h"