python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / gcc / 5.4.0 / 905-add-musl-support-to-gcc.patch
blob92e743685b1c4c525e08a868db8ededab5cce6ee
1 From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
2 Date: Fri, 8 May 2015 08:30:40 +0000 (+0000)
3 Subject: [PATCH 0/13] Add musl support to GCC
4 X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=f2d678afa5b8385d763b93772d73d6bf80a9739e
6 [PATCH 0/13] Add musl support to GCC
8 2015-05-08 Szabolcs Nagy <szabolcs.nagy@arm.com>
10 * config/glibc-stdint.h (OPTION_MUSL): Define.
11 (INT_FAST16_TYPE, INT_FAST32_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE):
12 Change the definition based on OPTION_MUSL for 64 bit targets.
13 * config/linux.h (OPTION_MUSL): Redefine.
14 * config/alpha/linux.h (OPTION_MUSL): Redefine.
15 * config/rs6000/linux.h (OPTION_MUSL): Redefine.
16 * config/rs6000/linux64.h (OPTION_MUSL): Redefine.
19 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222905 138bc75d-0d04-0410-961f-82ee72b054a4
20 ---
22 Index: b/gcc/config/alpha/linux.h
23 ===================================================================
24 --- a/gcc/config/alpha/linux.h
25 +++ b/gcc/config/alpha/linux.h
26 @@ -61,10 +61,14 @@
27 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
28 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
29 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
30 +#undef OPTION_MUSL
31 +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
32 #else
33 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
34 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
35 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
36 +#undef OPTION_MUSL
37 +#define OPTION_MUSL (linux_libc == LIBC_MUSL)
38 #endif
40 /* Determine what functions are present at the runtime;
41 Index: b/gcc/config/glibc-stdint.h
42 ===================================================================
43 --- a/gcc/config/glibc-stdint.h
44 +++ b/gcc/config/glibc-stdint.h
45 @@ -22,6 +22,12 @@
46 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
47 <http://www.gnu.org/licenses/>. */
49 +/* Systems using musl libc should use this header and make sure
50 + OPTION_MUSL is defined correctly before using the TYPE macros. */
51 +#ifndef OPTION_MUSL
52 +#define OPTION_MUSL 0
53 +#endif
55 #define SIG_ATOMIC_TYPE "int"
57 #define INT8_TYPE "signed char"
58 @@ -43,12 +49,12 @@
59 #define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
61 #define INT_FAST8_TYPE "signed char"
62 -#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
63 -#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
64 +#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int")
65 +#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int")
66 #define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
67 #define UINT_FAST8_TYPE "unsigned char"
68 -#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
69 -#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
70 +#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int")
71 +#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int")
72 #define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
74 #define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
75 Index: b/gcc/config/linux.h
76 ===================================================================
77 --- a/gcc/config/linux.h
78 +++ b/gcc/config/linux.h
79 @@ -32,11 +32,13 @@
80 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
81 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
82 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
83 +#undef OPTION_MUSL
84 #define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
85 #else
86 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
87 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
88 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
89 +#undef OPTION_MUSL
90 #define OPTION_MUSL (linux_libc == LIBC_MUSL)
91 #endif
93 Index: b/gcc/config/rs6000/linux.h
94 ===================================================================
95 --- a/gcc/config/rs6000/linux.h
96 +++ b/gcc/config/rs6000/linux.h
97 @@ -30,10 +30,14 @@
98 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
99 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
100 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
101 +#undef OPTION_MUSL
102 +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
103 #else
104 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
105 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
106 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
107 +#undef OPTION_MUSL
108 +#define OPTION_MUSL (linux_libc == LIBC_MUSL)
109 #endif
111 /* Determine what functions are present at the runtime;
112 Index: b/gcc/config/rs6000/linux64.h
113 ===================================================================
114 --- a/gcc/config/rs6000/linux64.h
115 +++ b/gcc/config/rs6000/linux64.h
116 @@ -299,10 +299,14 @@
117 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
118 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
119 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
120 +#undef OPTION_MUSL
121 +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
122 #else
123 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
124 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
125 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
126 +#undef OPTION_MUSL
127 +#define OPTION_MUSL (linux_libc == LIBC_MUSL)
128 #endif
130 /* Determine what functions are present at the runtime;