This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/13] microblaze musl support



On 29/04/15 14:51, Szabolcs Nagy wrote:
> 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)
>>>
>>
>> Are you building with both glibc and musl to verify these patches?
>>
...
> 
> 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)
> 

Patch v3.

I changed the patch to use GNU_USER_DYNAMIC_LINKER like
other platforms do.

I built gcc with musl and glibc default libc as well and verified
that -mmusl and -mglibc sets the dynamic linker as expected.

gcc/Changelog:

2015-05-06  Gregor Richards  <gregor.richards@uwaterloo.ca>
	    Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* config/microblaze/linux.h (MUSL_DYNAMIC_LINKER): Define.
	(DYNAMIC_LINKER): Renamed to ...
	(GLIBC_DYNAMIC_LINKER): This.
	(SUBTARGET_EXTRA_SPECS): Use GNU_USER_DYNAMIC_LINKER.
diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h
index a7faa7d..95e2940 100644
--- a/gcc/config/microblaze/linux.h
+++ b/gcc/config/microblaze/linux.h
@@ -25,10 +25,20 @@
 #undef TLS_NEEDS_GOT
 #define TLS_NEEDS_GOT 1
 
-#define DYNAMIC_LINKER "/lib/ld.so.1"
+#define GLIBC_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"
+
 #undef  SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
-  { "dynamic_linker", DYNAMIC_LINKER }
+  { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
 
 #undef LINK_SPEC
 #define LINK_SPEC "%{shared:-shared} \

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]