toolchain: gcc: add gcc 5.2.0
[openwrt.git] / toolchain / gcc / patches / 5.2.0 / 201-musl_arm.patch
1 From ec39b7c91facdd74fddea95128502c25ec3948a3 Mon Sep 17 00:00:00 2001
2 From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
3 Date: Wed, 27 May 2015 13:17:11 +0000
4 Subject: [PATCH 11/12] [PATCH 4/13] arm musl support
5
6 On behalf of szabolcs.nagy@arm.com
7
8 2015-05-27  Gregor Richards  <gregor.richards@uwaterloo.ca>
9
10         * config/arm/linux-eabi.h (MUSL_DYNAMIC_LINKER): Define.
11
12 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223749 138bc75d-0d04-0410-961f-82ee72b054a4
13 ---
14  gcc/config/arm/linux-eabi.h | 17 +++++++++++++++++
15  1 file changed, 17 insertions(+)
16
17 --- a/gcc/config/arm/linux-eabi.h
18 +++ b/gcc/config/arm/linux-eabi.h
19 @@ -77,6 +77,23 @@
20      %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
21      %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
22  
23 +/* For ARM musl currently supports four dynamic linkers:
24 +   - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
25 +   - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
26 +   - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
27 +   - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
28 +   musl does not support the legacy OABI mode.
29 +   All the dynamic linkers live in /lib.
30 +   We default to soft-float, EL. */
31 +#undef  MUSL_DYNAMIC_LINKER
32 +#if TARGET_BIG_ENDIAN_DEFAULT
33 +#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
34 +#else
35 +#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
36 +#endif
37 +#define MUSL_DYNAMIC_LINKER \
38 +  "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
39 +
40  /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
41     use the GNU/Linux version, not the generic BPABI version.  */
42  #undef  LINK_SPEC
43 --- a/libitm/config/arm/hwcap.cc
44 +++ b/libitm/config/arm/hwcap.cc
45 @@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0
46  
47  #ifdef __linux__
48  #include <unistd.h>
49 +#ifdef __GLIBC__
50  #include <sys/fcntl.h>
51 +#else
52 +#include <fcntl.h>
53 +#endif
54  #include <elf.h>
55  
56  static void __attribute__((constructor))