Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/gcc/config/riscv Re-do previous:



details:   https://anonhg.NetBSD.org/src/rev/28d2ab01093d
branches:  trunk
changeset: 450471:28d2ab01093d
user:      maya <maya%NetBSD.org@localhost>
date:      Mon Apr 15 18:49:07 2019 +0000

description:
Re-do previous:
emulate the addition of NETBSD_SUBTARGET_EXTRA_SPECS usually done by
SUBTARGET_EXTRA_SPECS (not used in risc-v) with EXTRA_SPECS.
Go back to using %(netbsd_link_spec) in our link spec, now that it's
a valid string.

Try to mimic other riscv OSes in our LINK_SPEC. they all start with
"-melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX

and a definition of LD_EMUL_SUFFIX,
let's copy the LD_EMUL_SUFFIX linux uses.

Now we can link executables.

diffstat:

 external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h |  21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diffs (33 lines):

diff -r 7c51befce2c8 -r 28d2ab01093d external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h
--- a/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h  Mon Apr 15 18:44:26 2019 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h  Mon Apr 15 18:49:07 2019 +0000
@@ -48,17 +48,20 @@
 #undef LIB_SPEC
 #define LIB_SPEC NETBSD_LIB_SPEC
 
-#undef LINK_SPEC
-#define LINK_SPEC NETBSD_LINK_SPEC_ELF
-/* Provide a LINK_SPEC appropriate for a NetBSD/mips target.
-   This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
-   the MIPS target.  */
+#define EXTRA_SPECS NETBSD_SUBTARGET_EXTRA_SPECS
+
+#define LD_EMUL_SUFFIX \
+  "%{mabi=lp64d:}" \
+  "%{mabi=lp64f:_lp64f}" \
+  "%{mabi=lp64:_lp64}" \
+  "%{mabi=ilp32d:}" \
+  "%{mabi=ilp32f:_ilp32f}" \
+  "%{mabi=ilp32:_ilp32}"
 
 #undef LINK_SPEC
-#define LINK_SPEC \
-  "%{m64:-m elf64lriscv} \
-   %{m32:-m elf32lriscv}" \
-   NETBSD_LINK_SPEC_ELF
+#define LINK_SPEC "\
+-melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \
+%(netbsd_link_spec)"
 
 #undef NETBSD_ENTRY_POINT
 #define NETBSD_ENTRY_POINT     "_start"



Home | Main Index | Thread Index | Old Index