* [PATCH, gcc-7] Add riscv musl support.
@ 2017-11-28 20:44 Jim Wilson
0 siblings, 0 replies; only message in thread
From: Jim Wilson @ 2017-11-28 20:44 UTC (permalink / raw)
To: gcc-patches; +Cc: Jim Wilson
This adds MUSL support to the riscv port in gcc-7, as we had a request for it.
Tested with a glibc toolchain build to verify it doesn't break anything, and a
musl gcc build to verify that the dynamic linker names are right for each -mabi
option value. Committed.
gcc/
Backport from mainline
2017-11-07 Michael Clark <michaeljclark@mac.com>
* config/riscv/linux.h (MUSL_ABI_SUFFIX): New define.
(MUSL_DYNAMIC_LINKER): Likewise.
---
gcc/config/riscv/linux.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index ecf424d..6c7e3c4 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -24,6 +24,17 @@ along with GCC; see the file COPYING3. If not see
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-riscv" XLEN_SPEC "-" ABI_SPEC ".so.1"
+#define MUSL_ABI_SUFFIX \
+ "%{mabi=ilp32:-sf}" \
+ "%{mabi=ilp32f:-sp}" \
+ "%{mabi=ilp32d:}" \
+ "%{mabi=lp64:-sf}" \
+ "%{mabi=lp64f:-sp}" \
+ "%{mabi=lp64d:}" \
+
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-riscv" XLEN_SPEC MUSL_ABI_SUFFIX ".so.1"
+
/* Because RISC-V only has word-sized atomics, it requries libatomic where
others do not. So link libatomic by default, as needed. */
#undef LIB_SPEC
--
2.7.4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-11-28 19:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 20:44 [PATCH, gcc-7] Add riscv musl support Jim Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).