[PATCH] RISC-V: Use new linker emulations for glibc ABI.
authorJim Wilson <jimw@sifive.com>
Tue, 8 May 2018 21:27:04 +0000 (21:27 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 8 May 2018 21:27:04 +0000 (14:27 -0700)
gcc/
* config/riscv/linux.h (MUSL_ABI_SUFFIX): Delete unnecessary backslash.
(LD_EMUL_SUFFIX): New.
(LINK_SPEC): Use it.

From-SVN: r260056

gcc/ChangeLog
gcc/config/riscv/linux.h

index 7b9d5a3c461af7b3e107c15234892994d0e522ee..56004866e9eb47267ee2ad697a39d01cdbd13d04 100644 (file)
@@ -1,3 +1,9 @@
+2018-05-08  Jim Wilson  <jimw@sifive.com>
+
+       * config/riscv/linux.h (MUSL_ABI_SUFFIX): Delete unnecessary backslash.
+       (LD_EMUL_SUFFIX): New.
+       (LINK_SPEC): Use it.
+
 2018-05-08  Kelvin Nilsen  <kelvin@gcc.gnu.org>
 
        * doc/extend.texi (PowerPC Built-in Functions): Rename this
index aa8a28d5d31edda5d0f2646c4753702c1e33ffa4..85561846dad2b9e455a2cd88beeeb62d5da05545 100644 (file)
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3.  If not see
   "%{mabi=ilp32d:}" \
   "%{mabi=lp64:-sf}" \
   "%{mabi=lp64f:-sp}" \
-  "%{mabi=lp64d:}" \
+  "%{mabi=lp64d:}"
 
 #undef MUSL_DYNAMIC_LINKER
 #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-riscv" XLEN_SPEC MUSL_ABI_SUFFIX ".so.1"
@@ -49,8 +49,16 @@ along with GCC; see the file COPYING3.  If not see
 
 #define CPP_SPEC "%{pthread:-D_REENTRANT}"
 
+#define LD_EMUL_SUFFIX \
+  "%{mabi=lp64d:}" \
+  "%{mabi=lp64f:_lp64f}" \
+  "%{mabi=lp64:_lp64}" \
+  "%{mabi=ilp32d:}" \
+  "%{mabi=ilp32f:_ilp32f}" \
+  "%{mabi=ilp32:_ilp32}"
+
 #define LINK_SPEC "\
--melf" XLEN_SPEC "lriscv \
+-melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \
 %{mno-relax:--no-relax} \
 %{shared} \
   %{!shared: \