This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 5/13] microblaze musl support
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Michael Eager <eager at eagerm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Gregor Richards <gregor dot richards at uwaterloo dot ca>, Rich Felker <dalias at libc dot org>, Szabolcs Nagy <nsz at port70 dot net>
- Date: Wed, 06 May 2015 12:25:40 +0100
- Subject: Re: [PATCH 5/13] microblaze musl support
- Authentication-results: sourceware.org; auth=none
- References: <55354A4A dot 4060702 at arm dot com> <55354B4E dot 8050508 at arm dot com> <553E492B dot 1040706 at arm dot com> <5540DA07 dot 1000709 at eagerm dot com> <5540E1DC dot 6090600 at arm dot com>
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} \