Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 29 Mar 2013 12:07:33 +0100
From: Daniel Cegiełka <daniel.cegielka@...il.com>
To: musl@...ts.openwall.com
Subject: Re: musl and gcc-4.8 (sabotage)

2013/3/29 Rich Felker <dalias@...ifal.cx>:
> On Fri, Mar 29, 2013 at 02:39:03AM +0100, Daniel Cegiełka wrote:
>> diff -urN gcc-4.8-20130203.orig/gcc/config/linux.h gcc-4.8-20130203/gcc/config/linux.h
>> --- gcc-4.8-20130203.orig/gcc/config/linux.h  Sun Feb 10 21:27:40 2013
>> +++ gcc-4.8-20130203/gcc/config/linux.h       Sun Feb 10 21:45:07 2013
>> @@ -32,10 +32,12 @@
>>  #define OPTION_GLIBC  (DEFAULT_LIBC == LIBC_GLIBC)
>>  #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
>>  #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
>> +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
>>  #else
>>  #define OPTION_GLIBC  (linux_libc == LIBC_GLIBC)
>>  #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
>>  #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
>> +#define OPTION_MUSL (linux_libc == LIBC_MUSL)
>>  #endif
>>
>>  #define GNU_USER_TARGET_OS_CPP_BUILTINS()                    \
>> @@ -53,18 +55,21 @@
>>     uClibc or Bionic is the default C library and whether
>>     -muclibc or -mglibc or -mbionic has been passed to change the default.  */
>>
>> -#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3)   \
>> -  "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
>> +#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4)       \
>> +  "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
>>
>>  #if DEFAULT_LIBC == LIBC_GLIBC
>> -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
>> -  CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
>> +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
>> +  CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
>>  #elif DEFAULT_LIBC == LIBC_UCLIBC
>> -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
>> -  CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
>> +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
>> +  CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
>>  #elif DEFAULT_LIBC == LIBC_BIONIC
>> -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
>> -  CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
>> +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
>> +  CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
>> +#elif DEFAULT_LIBC == LIBC_MUSL
>> +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
>> +  CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
>>  #else
>>  #error "Unsupported DEFAULT_LIBC"
>>  #endif /* DEFAULT_LIBC */
>> @@ -81,19 +86,23 @@
>>  #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
>>  #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
>>  #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32"
>> +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl.so.1"
>
> This is almost certainly wrong.

What solution do you suggest? Below is the code, which was used for gcc-4.8:

https://bitbucket.org/GregorR/musl-cross/src/74d6e78976bda668af0046f4514cbce1f363c6cd/patches/gcc-4.7.2-musl.diff?at=default

Daniel

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.