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
22 Index: b/gcc/config/alpha/linux.h
23 ===================================================================
24 --- a/gcc/config/alpha/linux.h
25 +++ b/gcc/config/alpha/linux.h
27 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
28 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
29 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
31 +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
33 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
34 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
35 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
37 +#define OPTION_MUSL (linux_libc == LIBC_MUSL)
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
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. */
52 +#define OPTION_MUSL 0
55 #define SIG_ATOMIC_TYPE "int"
57 #define INT8_TYPE "signed char"
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
80 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
81 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
82 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
84 #define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
86 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
87 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
88 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
90 #define OPTION_MUSL (linux_libc == LIBC_MUSL)
93 Index: b/gcc/config/rs6000/linux.h
94 ===================================================================
95 --- a/gcc/config/rs6000/linux.h
96 +++ b/gcc/config/rs6000/linux.h
98 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
99 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
100 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
102 +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
104 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
105 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
106 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
108 +#define OPTION_MUSL (linux_libc == LIBC_MUSL)
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)
121 +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
123 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
124 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
125 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
127 +#define OPTION_MUSL (linux_libc == LIBC_MUSL)
130 /* Determine what functions are present at the runtime;