250-add-musl.patch (4966B)
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 5 6 [PATCH 0/13] Add musl support to GCC 7 8 2015-05-08 Szabolcs Nagy <szabolcs.nagy@arm.com> 9 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. 17 18 19 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222905 138bc75d-0d04-0410-961f-82ee72b054a4 20 --- 21 22 --- a/gcc/config/alpha/linux.h 23 +++ b/gcc/config/alpha/linux.h 24 @@ -61,10 +61,14 @@ along with GCC; see the file COPYING3. 25 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) 26 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) 27 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) 28 +#undef OPTION_MUSL 29 +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) 30 #else 31 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) 32 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) 33 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) 34 +#undef OPTION_MUSL 35 +#define OPTION_MUSL (linux_libc == LIBC_MUSL) 36 #endif 37 38 /* Determine what functions are present at the runtime; 39 --- a/gcc/config/glibc-stdint.h 40 +++ b/gcc/config/glibc-stdint.h 41 @@ -22,6 +22,12 @@ a copy of the GCC Runtime Library Except 42 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 43 <http://www.gnu.org/licenses/>. */ 44 45 +/* Systems using musl libc should use this header and make sure 46 + OPTION_MUSL is defined correctly before using the TYPE macros. */ 47 +#ifndef OPTION_MUSL 48 +#define OPTION_MUSL 0 49 +#endif 50 + 51 #define SIG_ATOMIC_TYPE "int" 52 53 #define INT8_TYPE "signed char" 54 @@ -43,12 +49,12 @@ see the files COPYING3 and COPYING.RUNTI 55 #define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") 56 57 #define INT_FAST8_TYPE "signed char" 58 -#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") 59 -#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") 60 +#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int") 61 +#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int") 62 #define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") 63 #define UINT_FAST8_TYPE "unsigned char" 64 -#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") 65 -#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") 66 +#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int") 67 +#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int") 68 #define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") 69 70 #define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") 71 --- a/gcc/config/linux.h 72 +++ b/gcc/config/linux.h 73 @@ -32,11 +32,13 @@ see the files COPYING3 and COPYING.RUNTI 74 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) 75 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) 76 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) 77 +#undef OPTION_MUSL 78 #define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) 79 #else 80 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) 81 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) 82 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) 83 +#undef OPTION_MUSL 84 #define OPTION_MUSL (linux_libc == LIBC_MUSL) 85 #endif 86 87 --- a/gcc/config/rs6000/linux.h 88 +++ b/gcc/config/rs6000/linux.h 89 @@ -30,10 +30,14 @@ 90 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) 91 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) 92 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) 93 +#undef OPTION_MUSL 94 +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) 95 #else 96 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) 97 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) 98 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) 99 +#undef OPTION_MUSL 100 +#define OPTION_MUSL (linux_libc == LIBC_MUSL) 101 #endif 102 103 /* Determine what functions are present at the runtime; 104 --- a/gcc/config/rs6000/linux64.h 105 +++ b/gcc/config/rs6000/linux64.h 106 @@ -299,10 +299,14 @@ extern int dot_symbols; 107 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) 108 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) 109 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) 110 +#undef OPTION_MUSL 111 +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) 112 #else 113 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) 114 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) 115 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) 116 +#undef OPTION_MUSL 117 +#define OPTION_MUSL (linux_libc == LIBC_MUSL) 118 #endif 119 120 /* Determine what functions are present at the runtime;