- use the same set of emulations for riscv* on netbsd as linux does

- for riscv64-*netbsd* hosts and 32 bit target, set LIB_PATH
- build the other target emulations for riscv32 on riscv64
- regen riscv64 mknative for ld updates
This commit is contained in:
mrg 2019-04-18 10:07:24 +00:00
parent badcd40f23
commit d12924f2c9
7 changed files with 45 additions and 7 deletions

View File

@ -669,14 +669,16 @@ powerpc-*-beos*) targ_emul=aixppc ;;
powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;;
powerpc-*-lynxos*) targ_emul=ppclynx ;;
pru*-*-*) targ_emul=pruelf ;;
riscv32*-*-linux*) targ_emul=elf32lriscv
riscv32*-*-linux* | riscv-*-netbsd* | riscv32*-*-netbsd*)
targ_emul=elf32lriscv
targ_extra_emuls="elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64"
targ_extra_libpath=$targ_extra_emuls ;;
riscv-*-* | riscv32*-*-*)
targ_emul=elf32lriscv
targ_extra_emuls="elf64lriscv"
targ_extra_libpath=$targ_extra_emuls ;;
riscv64*-*-linux*) targ_emul=elf64lriscv
riscv64*-*-linux* | riscv64*-*-netbsd*)
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

View File

@ -12,4 +12,13 @@ case "$target" in
LIBPATH_SUFFIX="/ilp32d" ;;
esac
;;
# NetBSD puts IPL32 libraries in rv32 subdirectory.
# XXX d vs f vs ""
riscv64-*-netbsd*)
case "$EMULATION_NAME" in
*32*)
LIB_PATH='=/usr/lib/rv32'
;;
esac
;;
esac

View File

@ -11,4 +11,13 @@ case "$target" in
LIBPATH_SUFFIX="/ilp32" ;;
esac
;;
# NetBSD puts IPL32 libraries in rv32 subdirectory.
# XXX d vs f vs ""
riscv64-*-netbsd*)
case "$EMULATION_NAME" in
*32*)
LIB_PATH='=/usr/lib/rv32'
;;
esac
;;
esac

View File

@ -11,4 +11,13 @@ case "$target" in
LIBPATH_SUFFIX="/ilp32f" ;;
esac
;;
# NetBSD puts IPL32 libraries in rv32 subdirectory.
# XXX d vs f vs ""
riscv64-*-netbsd*)
case "$EMULATION_NAME" in
*32*)
LIB_PATH='=/usr/lib/rv32'
;;
esac
;;
esac

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.30 2019/02/25 19:55:35 joerg Exp $
# $NetBSD: Makefile,v 1.31 2019/04/18 10:07:24 mrg Exp $
CPPFLAGS+= -I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} \
-I${DIST}/ld \
@ -74,6 +74,7 @@ e${f}.c: ${DIST}/ld/genscripts.sh ${.CURDIR}/Makefile stringify.sed
. if ${BINUTILS_MACHINE_ARCH} == "x86_64" || \
${BINUTILS_MACHINE_ARCH} == "sparc64" || \
${BINUTILS_MACHINE_ARCH} == "riscv64" || \
!empty(BINUTILS_MACHINE_ARCH:Maarch64*) || \
!empty(BINUTILS_MACHINE_ARCH:Mearm*) || \
!empty(BINUTILS_MACHINE_ARCH:Marm*) || \

View File

@ -4,9 +4,9 @@
#
G_DEFS=-DHAVE_CONFIG_H
G_EMUL=elf64lriscv
G_EMULATION_OFILES=eelf64lriscv.o eelf32lriscv.o
G_EMULATION_OFILES=eelf64lriscv.o eelf64lriscv_lp64f.o eelf64lriscv_lp64.o eelf32lriscv.o eelf32lriscv_ilp32f.o eelf32lriscv_ilp32.o
G_INCLUDES=
G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64lriscv.o eelf32lriscv.o ldbuildid.o
G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64lriscv.o eelf64lriscv_lp64f.o eelf64lriscv_lp64.o eelf32lriscv.o eelf32lriscv_ilp32f.o eelf32lriscv_ilp32.o ldbuildid.o
G_STRINGIFY=astring.sed
G_TEXINFOS=ld.texi
G_target_alias=riscv64--netbsd

View File

@ -1,12 +1,20 @@
/* This file is automatically generated. DO NOT EDIT! */
/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */
/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */
/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */
/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */
/* This file is automatically generated. DO NOT EDIT! */
extern ld_emulation_xfer_type ld_elf64lriscv_emulation;
extern ld_emulation_xfer_type ld_elf64lriscv_lp64f_emulation;
extern ld_emulation_xfer_type ld_elf64lriscv_lp64_emulation;
extern ld_emulation_xfer_type ld_elf32lriscv_emulation;
extern ld_emulation_xfer_type ld_elf32lriscv_ilp32f_emulation;
extern ld_emulation_xfer_type ld_elf32lriscv_ilp32_emulation;
#define EMULATION_LIST \
&ld_elf64lriscv_emulation, \
&ld_elf64lriscv_lp64f_emulation, \
&ld_elf64lriscv_lp64_emulation, \
&ld_elf32lriscv_emulation, \
&ld_elf32lriscv_ilp32f_emulation, \
&ld_elf32lriscv_ilp32_emulation, \
0