RISC-V: New emulations to make path searches follow glibc ABI.
ld/ PR ld/22962 * Makefile.am (ALL_EMULATION_SOURCES): Add eelf32lriscv_ilp32f.c, eelf32lriscv_ilp32.c, eelf64lriscv_lp64f.c, eelf64lriscv_lp64.c. (eelf32lriscv_ilp32f.c, eelf32lriscv_ilp32.c): New build rules. (eelf64lriscv_lp64f.c, eelf64lriscv_lp64.c): New build rules. * Makefile.in: Regenerated. * configure.tgt (riscv32*-*-linux*, riscv64*-*-linux*): New. * ld/emulparams/elf32lriscv.sh: Set LIBPATH_SUFFIX. * ld/emulparams/elf32lriscv_ilp32.sh: New. * ld/emulparams/elf32lriscv_ilp32f.sh: New. * ld/emulparams/elf64lriscv-defs.sh: Don't set LIBPATH_SUFFIX here. * ld/emulparams/elf64lriscv.sh: Set LIBPATH_SUFFIX. * ld/emulparams/elf64lriscv_lp64.sh: New. * ld/emulparams/elf64lriscv_lp64f.sh: New. * ld/genscripts.sh (append_to_lib_path): Change LIBPATH_SUFFIX test to a for. Inside loop, change LIBPATH_SUFFIX uses to libpath_suffix. (LIB_PATH): In LIB_PATH if, add loop for LIBPATH_SUFFIX, changes uses inside loop to libpath_suffix.
This commit is contained in:
parent
8ee22052f6
commit
10d9808829
21
ld/ChangeLog
21
ld/ChangeLog
@ -1,3 +1,24 @@
|
||||
2018-05-08 Jim Wilson <jimw@sifive.com>
|
||||
|
||||
PR ld/22962
|
||||
* Makefile.am (ALL_EMULATION_SOURCES): Add eelf32lriscv_ilp32f.c,
|
||||
eelf32lriscv_ilp32.c, eelf64lriscv_lp64f.c, eelf64lriscv_lp64.c.
|
||||
(eelf32lriscv_ilp32f.c, eelf32lriscv_ilp32.c): New build rules.
|
||||
(eelf64lriscv_lp64f.c, eelf64lriscv_lp64.c): New build rules.
|
||||
* Makefile.in: Regenerated.
|
||||
* configure.tgt (riscv32*-*-linux*, riscv64*-*-linux*): New.
|
||||
* ld/emulparams/elf32lriscv.sh: Set LIBPATH_SUFFIX.
|
||||
* ld/emulparams/elf32lriscv_ilp32.sh: New.
|
||||
* ld/emulparams/elf32lriscv_ilp32f.sh: New.
|
||||
* ld/emulparams/elf64lriscv-defs.sh: Don't set LIBPATH_SUFFIX here.
|
||||
* ld/emulparams/elf64lriscv.sh: Set LIBPATH_SUFFIX.
|
||||
* ld/emulparams/elf64lriscv_lp64.sh: New.
|
||||
* ld/emulparams/elf64lriscv_lp64f.sh: New.
|
||||
* ld/genscripts.sh (append_to_lib_path): Change LIBPATH_SUFFIX test to
|
||||
a for. Inside loop, change LIBPATH_SUFFIX uses to libpath_suffix.
|
||||
(LIB_PATH): In LIB_PATH if, add loop for LIBPATH_SUFFIX, changes uses
|
||||
inside loop to libpath_suffix.
|
||||
|
||||
2018-05-03 Jim Wilson <jimw@sifive.com>
|
||||
|
||||
* Makefile.am (earmelfb_linux_fdpiceabi.c): Fix typo in dependencies.
|
||||
|
@ -266,6 +266,8 @@ ALL_EMULATION_SOURCES = \
|
||||
eelf32ppcvxworks.c \
|
||||
eelf32ppcwindiss.c \
|
||||
eelf32lriscv.c \
|
||||
eelf32lriscv_ilp32f.c \
|
||||
eelf32lriscv_ilp32.c \
|
||||
eelf32rl78.c \
|
||||
eelf32rx.c \
|
||||
eelf32tilegx.c \
|
||||
@ -434,6 +436,8 @@ ALL_64_EMULATION_SOURCES = \
|
||||
eelf64hppa.c \
|
||||
eelf64lppc.c \
|
||||
eelf64lriscv.c \
|
||||
eelf64lriscv_lp64f.c \
|
||||
eelf64lriscv_lp64.c \
|
||||
eelf64ltsmip.c \
|
||||
eelf64ltsmip_fbsd.c \
|
||||
eelf64mmix.c \
|
||||
@ -1103,6 +1107,16 @@ eelf32lriscv.c: $(srcdir)/emulparams/elf32lriscv.sh \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf32lriscv_ilp32f.c: $(srcdir)/emulparams/elf32lriscv_ilp32f.sh \
|
||||
$(srcdir)/emulparams/elf32lriscv-defs.sh $(ELF_DEPS) \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf32lriscv_ilp32.c: $(srcdir)/emulparams/elf32lriscv_ilp32.sh \
|
||||
$(srcdir)/emulparams/elf32lriscv-defs.sh $(ELF_DEPS) \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
|
||||
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
|
||||
@ -1748,6 +1762,18 @@ eelf64lriscv.c: $(srcdir)/emulparams/elf64lriscv.sh \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf64lriscv_lp64f.c: $(srcdir)/emulparams/elf64lriscv_lp64f.sh \
|
||||
$(srcdir)/emulparams/elf64lriscv-defs.sh \
|
||||
$(srcdir)/emulparams/elf32lriscv-defs.sh $(ELF_DEPS) \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf64lriscv_lp64.c: $(srcdir)/emulparams/elf64lriscv_lp64.sh \
|
||||
$(srcdir)/emulparams/elf64lriscv-defs.sh \
|
||||
$(srcdir)/emulparams/elf32lriscv-defs.sh $(ELF_DEPS) \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \
|
||||
$(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf64bmip-defs.sh \
|
||||
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
|
||||
|
@ -635,6 +635,8 @@ ALL_EMULATION_SOURCES = \
|
||||
eelf32ppcvxworks.c \
|
||||
eelf32ppcwindiss.c \
|
||||
eelf32lriscv.c \
|
||||
eelf32lriscv_ilp32f.c \
|
||||
eelf32lriscv_ilp32.c \
|
||||
eelf32rl78.c \
|
||||
eelf32rx.c \
|
||||
eelf32tilegx.c \
|
||||
@ -802,6 +804,8 @@ ALL_64_EMULATION_SOURCES = \
|
||||
eelf64hppa.c \
|
||||
eelf64lppc.c \
|
||||
eelf64lriscv.c \
|
||||
eelf64lriscv_lp64f.c \
|
||||
eelf64lriscv_lp64.c \
|
||||
eelf64ltsmip.c \
|
||||
eelf64ltsmip_fbsd.c \
|
||||
eelf64mmix.c \
|
||||
@ -1180,6 +1184,8 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lr5900.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lr5900n32.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lriscv.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lriscv_ilp32.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lriscv_ilp32f.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lsmip.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmip.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmip_fbsd.Po@am__quote@
|
||||
@ -1234,6 +1240,8 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64hppa.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lppc.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv_lp64.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv_lp64f.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64ltsmip.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64ltsmip_fbsd.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64mmix.Po@am__quote@
|
||||
@ -2604,6 +2612,16 @@ eelf32lriscv.c: $(srcdir)/emulparams/elf32lriscv.sh \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf32lriscv_ilp32f.c: $(srcdir)/emulparams/elf32lriscv_ilp32f.sh \
|
||||
$(srcdir)/emulparams/elf32lriscv-defs.sh $(ELF_DEPS) \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf32lriscv_ilp32.c: $(srcdir)/emulparams/elf32lriscv_ilp32.sh \
|
||||
$(srcdir)/emulparams/elf32lriscv-defs.sh $(ELF_DEPS) \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
|
||||
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
|
||||
$(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
|
||||
@ -3249,6 +3267,18 @@ eelf64lriscv.c: $(srcdir)/emulparams/elf64lriscv.sh \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf64lriscv_lp64f.c: $(srcdir)/emulparams/elf64lriscv_lp64f.sh \
|
||||
$(srcdir)/emulparams/elf64lriscv-defs.sh \
|
||||
$(srcdir)/emulparams/elf32lriscv-defs.sh $(ELF_DEPS) \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf64lriscv_lp64.c: $(srcdir)/emulparams/elf64lriscv_lp64.sh \
|
||||
$(srcdir)/emulparams/elf64lriscv-defs.sh \
|
||||
$(srcdir)/emulparams/elf32lriscv-defs.sh $(ELF_DEPS) \
|
||||
$(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc \
|
||||
${GEN_DEPENDS}
|
||||
|
||||
eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \
|
||||
$(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf64bmip-defs.sh \
|
||||
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
|
||||
|
@ -627,9 +627,15 @@ powerpc-*-beos*) targ_emul=aixppc ;;
|
||||
powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;;
|
||||
powerpc-*-lynxos*) targ_emul=ppclynx ;;
|
||||
pru*-*-*) targ_emul=pruelf ;;
|
||||
riscv32*-*-linux*) targ_emul=elf32lriscv
|
||||
targ_extra_emuls="elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64"
|
||||
targ_extra_libpath=$targ_extra_emuls ;;
|
||||
riscv32*-*-*) targ_emul=elf32lriscv
|
||||
targ_extra_emuls="elf64lriscv"
|
||||
targ_extra_libpath=$targ_extra_emuls ;;
|
||||
riscv64*-*-linux*) targ_emul=elf64lriscv
|
||||
targ_extra_emuls="elf64lriscv_lp64f elf64lriscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32"
|
||||
targ_extra_libpath=$targ_extra_emuls ;;
|
||||
riscv64*-*-*) targ_emul=elf64lriscv
|
||||
targ_extra_emuls="elf32lriscv"
|
||||
targ_extra_libpath=$targ_extra_emuls ;;
|
||||
|
@ -1,2 +1,15 @@
|
||||
# RV32 code using ILP32D ABI.
|
||||
# ABI not in emulation name to avoid breaking backward compatibility.
|
||||
. ${srcdir}/emulparams/elf32lriscv-defs.sh
|
||||
OUTPUT_FORMAT="elf32-littleriscv"
|
||||
|
||||
# On Linux, first look for 32 bit ILP32D target libraries in /lib/ilp32d as per
|
||||
# the glibc ABI.
|
||||
case "$target" in
|
||||
riscv32*-linux*)
|
||||
case "$EMULATION_NAME" in
|
||||
*32*)
|
||||
LIBPATH_SUFFIX="/ilp32d" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
14
ld/emulparams/elf32lriscv_ilp32.sh
Normal file
14
ld/emulparams/elf32lriscv_ilp32.sh
Normal file
@ -0,0 +1,14 @@
|
||||
# RV32 code using ILP32 ABI.
|
||||
. ${srcdir}/emulparams/elf32lriscv-defs.sh
|
||||
OUTPUT_FORMAT="elf32-littleriscv"
|
||||
|
||||
# On Linux, first look for 32 bit ILP32 target libraries in /lib/ilp32 as per
|
||||
# the glibc ABI.
|
||||
case "$target" in
|
||||
riscv32*-linux*)
|
||||
case "$EMULATION_NAME" in
|
||||
*32*)
|
||||
LIBPATH_SUFFIX="/ilp32" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
14
ld/emulparams/elf32lriscv_ilp32f.sh
Normal file
14
ld/emulparams/elf32lriscv_ilp32f.sh
Normal file
@ -0,0 +1,14 @@
|
||||
# RV32 code using ILP32F ABI.
|
||||
. ${srcdir}/emulparams/elf32lriscv-defs.sh
|
||||
OUTPUT_FORMAT="elf32-littleriscv"
|
||||
|
||||
# On Linux, first look for 32 bit ILP32F target libraries in /lib/ilp32f as per
|
||||
# the glibc ABI.
|
||||
case "$target" in
|
||||
riscv32*-linux*)
|
||||
case "$EMULATION_NAME" in
|
||||
*32*)
|
||||
LIBPATH_SUFFIX="/ilp32f" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
@ -1,13 +1,2 @@
|
||||
. ${srcdir}/emulparams/elf32lriscv-defs.sh
|
||||
ELFSIZE=64
|
||||
|
||||
# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first
|
||||
# on Linux.
|
||||
case "$target" in
|
||||
riscv64*-linux*)
|
||||
case "$EMULATION_NAME" in
|
||||
*64*)
|
||||
LIBPATH_SUFFIX=64 ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
@ -1,2 +1,15 @@
|
||||
# RV64 code using LP64D ABI.
|
||||
# ABI not in emulation name to avoid breaking backward compatibility.
|
||||
. ${srcdir}/emulparams/elf64lriscv-defs.sh
|
||||
OUTPUT_FORMAT="elf64-littleriscv"
|
||||
|
||||
# On Linux, first look for 64 bit LP64D target libraries in /lib64/lp64d as per
|
||||
# the glibc ABI, and then /lib64 for backward compatility.
|
||||
case "$target" in
|
||||
riscv64*-linux*)
|
||||
case "$EMULATION_NAME" in
|
||||
*64*)
|
||||
LIBPATH_SUFFIX="64/lp64d 64";;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
14
ld/emulparams/elf64lriscv_lp64.sh
Normal file
14
ld/emulparams/elf64lriscv_lp64.sh
Normal file
@ -0,0 +1,14 @@
|
||||
# RV64 code using LP64 ABI.
|
||||
. ${srcdir}/emulparams/elf64lriscv-defs.sh
|
||||
OUTPUT_FORMAT="elf64-littleriscv"
|
||||
|
||||
# On Linux, first look for 64 bit LP64 target libraries in /lib64/lp64 as per
|
||||
# the glibc ABI, and then /lib64 for backward compatility.
|
||||
case "$target" in
|
||||
riscv64*-linux*)
|
||||
case "$EMULATION_NAME" in
|
||||
*64*)
|
||||
LIBPATH_SUFFIX="64/lp64 64";;
|
||||
esac
|
||||
;;
|
||||
esac
|
14
ld/emulparams/elf64lriscv_lp64f.sh
Normal file
14
ld/emulparams/elf64lriscv_lp64f.sh
Normal file
@ -0,0 +1,14 @@
|
||||
# RV64 code using LP64F ABI.
|
||||
. ${srcdir}/emulparams/elf64lriscv-defs.sh
|
||||
OUTPUT_FORMAT="elf64-littleriscv"
|
||||
|
||||
# On Linux, first look for 64 bit LP64F target libraries in /lib64/lp64f as per
|
||||
# the glibc ABI, and then /lib64 for backward compatility.
|
||||
case "$target" in
|
||||
riscv64*-linux*)
|
||||
case "$EMULATION_NAME" in
|
||||
*64*)
|
||||
LIBPATH_SUFFIX="64/lp64f 64";;
|
||||
esac
|
||||
;;
|
||||
esac
|
@ -155,9 +155,9 @@ append_to_lib_path()
|
||||
lib="=${lib}"
|
||||
fi
|
||||
skip_lib=no
|
||||
if test -n "${LIBPATH_SUFFIX}"; then
|
||||
for libpath_suffix in ${LIBPATH_SUFFIX}; do
|
||||
case "${lib}" in
|
||||
*${LIBPATH_SUFFIX})
|
||||
*${libpath_suffix})
|
||||
case :${lib_path1}: in
|
||||
*:${lib}:*) ;;
|
||||
::) lib_path1=${lib} ;;
|
||||
@ -171,13 +171,13 @@ append_to_lib_path()
|
||||
fi
|
||||
if test "${skip_lib}" = "no"; then
|
||||
case :${lib_path1}: in
|
||||
*:${lib}${LIBPATH_SUFFIX}:*) ;;
|
||||
::) lib_path1=${lib}${LIBPATH_SUFFIX} ;;
|
||||
*) lib_path1=${lib_path1}:${lib}${LIBPATH_SUFFIX} ;;
|
||||
*:${lib}${libpath_suffix}:*) ;;
|
||||
::) lib_path1=${lib}${libpath_suffix} ;;
|
||||
*) lib_path1=${lib_path1}:${lib}${libpath_suffix} ;;
|
||||
esac
|
||||
fi ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
if test "${skip_lib}" = "no"; then
|
||||
case :${lib_path1}:${lib_path2}: in
|
||||
*:${lib}:*) ;;
|
||||
@ -203,10 +203,12 @@ if [ "${LIB_PATH}" != ":" ] ; then
|
||||
# because 64bit libraries may be in both places, depending on
|
||||
# cross-development setup method (e.g.: /usr/s390x-linux/lib64
|
||||
# vs. /usr/s390-linux/lib64)
|
||||
case "${NATIVE}:${LIBPATH_SUFFIX}:${TOOL_LIB}" in
|
||||
:* | *::* | *:*:*${LIBPATH_SUFFIX}) ;;
|
||||
*) libs="${exec_prefix}/${target_alias}/lib${LIBPATH_SUFFIX}" ;;
|
||||
esac
|
||||
for libpath_suffix in ${LIBPATH_SUFFIX}; do
|
||||
case "${NATIVE}:${libpath_suffix}:${TOOL_LIB}" in
|
||||
:* | *::* | *:*:*${libpath_suffix}) ;;
|
||||
*) libs="${exec_prefix}/${target_alias}/lib${libpath_suffix}" ;;
|
||||
esac
|
||||
done
|
||||
libs="${exec_prefix}/${TOOL_LIB}/lib ${libs}"
|
||||
fi
|
||||
append_to_lib_path ${libs}
|
||||
|
Loading…
x
Reference in New Issue
Block a user