diff mbox

[5/13] microblaze musl support

Message ID 553E492B.1040706@arm.com
State New
Headers show

Commit Message

Szabolcs Nagy April 27, 2015, 2:35 p.m. UTC
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.

Comments

Michael Eager April 29, 2015, 1:17 p.m. UTC | #1
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?
Szabolcs Nagy April 29, 2015, 1:51 p.m. UTC | #2
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 mbox

Patch

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 }