Message ID | 553E492B.1040706@arm.com |
---|---|
State | New |
Headers | show |
On 04/27/2015 07:35 AM, Szabolcs Nagy wrote: > > On 20/04/15 19:54, Szabolcs Nagy wrote: >> Set up dynamic linker name for microblaze. >> > > Patch v2. > (undef MUSL_DYNAMIC_LINKER that comes from config/linux.h) > > gcc/Changelog: > > 2015-04-24 Gregor Richards <gregor.richards@uwaterloo.ca> > > * config/microblaze/linux.h (MUSL_DYNAMIC_LINKER): Define. > (DYNAMIC_LINKER): Change. > Are you building with both glibc and musl to verify these patches?
On 29/04/15 14:17, Michael Eager wrote: > On 04/27/2015 07:35 AM, Szabolcs Nagy wrote: >> >> On 20/04/15 19:54, Szabolcs Nagy wrote: >>> Set up dynamic linker name for microblaze. >>> >> >> Patch v2. >> (undef MUSL_DYNAMIC_LINKER that comes from config/linux.h) >> >> gcc/Changelog: >> >> 2015-04-24 Gregor Richards <gregor.richards@uwaterloo.ca> >> >> * config/microblaze/linux.h (MUSL_DYNAMIC_LINKER): Define. >> (DYNAMIC_LINKER): Change. >> > > Are you building with both glibc and musl to verify these patches? > i tested various aarch64 and x86 configurations with both glibc and musl, but not everything was tested. in particular microblaze (big and little endian) was only built with musl. note that microblaze does not use the GNU_USER_DYNAMIC_LINKER macro so the -mglibc etc options don't work. (that should be changed probably, assuming -muclibc and -mbionic have no side effects when they are not supported)
diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h index a7faa7d..3e08138 100644 --- a/gcc/config/microblaze/linux.h +++ b/gcc/config/microblaze/linux.h @@ -25,7 +25,22 @@ #undef TLS_NEEDS_GOT #define TLS_NEEDS_GOT 1 -#define DYNAMIC_LINKER "/lib/ld.so.1" +#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */ +#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:;:el}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:el}" +#endif + +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1" +#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + +#if DEFAULT_LIBC == LIBC_MUSL +#define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER +#else +#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER +#endif + #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ { "dynamic_linker", DYNAMIC_LINKER }