a18bdccb105c2bb44884765527abd5bfa51429de
[openwrt/staging/yousong.git] / toolchain / gcc / patches / 5.2.0 / 205-musl_x86.patch
1 From 606b5b76926d42d26c08c7400c38afe07e18e3cd Mon Sep 17 00:00:00 2001
2 From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
3 Date: Fri, 15 May 2015 13:20:01 +0000
4 Subject: [PATCH 10/12] [PATCH 9/13] x86 musl support
5
6 On behalf of Szabolcs Nagy.
7
8 2015-05-15 Gregor Richards <gregor.richards@uwaterloo.ca>
9
10 * config/i386/linux.h (MUSL_DYNAMIC_LINKER): Define.
11 * config/i386/linux64.h (MUSL_DYNAMIC_LINKER32): Define.
12 (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32): Define.
13
14 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223218 138bc75d-0d04-0410-961f-82ee72b054a4
15 ---
16 gcc/config/i386/linux.h | 3 +++
17 gcc/config/i386/linux64.h | 7 +++++++
18 2 files changed, 10 insertions(+)
19
20 --- a/gcc/config/i386/linux.h
21 +++ b/gcc/config/i386/linux.h
22 @@ -21,3 +21,6 @@ along with GCC; see the file COPYING3.
23
24 #define GNU_USER_LINK_EMULATION "elf_i386"
25 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
26 +
27 +#undef MUSL_DYNAMIC_LINKER
28 +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
29 --- a/gcc/config/i386/linux64.h
30 +++ b/gcc/config/i386/linux64.h
31 @@ -30,3 +30,10 @@ see the files COPYING3 and COPYING.RUNTI
32 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
33 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
34 #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
35 +
36 +#undef MUSL_DYNAMIC_LINKER32
37 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
38 +#undef MUSL_DYNAMIC_LINKER64
39 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
40 +#undef MUSL_DYNAMIC_LINKERX32
41 +#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
42 --- a/libitm/config/linux/x86/tls.h
43 +++ b/libitm/config/linux/x86/tls.h
44 @@ -25,16 +25,19 @@
45 #ifndef LIBITM_X86_TLS_H
46 #define LIBITM_X86_TLS_H 1
47
48 -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
49 +#if defined(__GLIBC_PREREQ)
50 +#if __GLIBC_PREREQ(2, 10)
51 /* Use slots in the TCB head rather than __thread lookups.
52 GLIBC has reserved words 10 through 13 for TM. */
53 #define HAVE_ARCH_GTM_THREAD 1
54 #define HAVE_ARCH_GTM_THREAD_DISP 1
55 #endif
56 +#endif
57
58 #include "config/generic/tls.h"
59
60 -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
61 +#if defined(__GLIBC_PREREQ)
62 +#if __GLIBC_PREREQ(2, 10)
63 namespace GTM HIDDEN {
64
65 #ifdef __x86_64__
66 @@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a
67
68 } // namespace GTM
69 #endif /* >= GLIBC 2.10 */
70 +#endif
71
72 #endif // LIBITM_X86_TLS_H