Module Name:    src
Committed By:   mrg
Date:           Thu Apr 18 10:07:24 UTC 2019

Modified Files:
        src/external/gpl3/binutils/dist/ld: configure.tgt
        src/external/gpl3/binutils/dist/ld/emulparams: elf32lriscv.sh
            elf32lriscv_ilp32.sh elf32lriscv_ilp32f.sh
        src/external/gpl3/binutils/usr.bin/ld: Makefile
        src/external/gpl3/binutils/usr.bin/ld/arch/riscv64: defs.mk
            ldemul-list.h

Log Message:
- 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


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/external/gpl3/binutils/dist/ld/configure.tgt
cvs rdiff -u -r1.4 -r1.5 \
    src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv.sh
cvs rdiff -u -r1.1.1.1 -r1.2 \
    src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32.sh \
    src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32f.sh
cvs rdiff -u -r1.30 -r1.31 src/external/gpl3/binutils/usr.bin/ld/Makefile
cvs rdiff -u -r1.3 -r1.4 \
    src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
    src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/ldemul-list.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/ld/configure.tgt
diff -u src/external/gpl3/binutils/dist/ld/configure.tgt:1.31 src/external/gpl3/binutils/dist/ld/configure.tgt:1.32
--- src/external/gpl3/binutils/dist/ld/configure.tgt:1.31	Fri Dec 28 20:43:25 2018
+++ src/external/gpl3/binutils/dist/ld/configure.tgt	Thu Apr 18 10:07:24 2019
@@ -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

Index: src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv.sh
diff -u src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv.sh:1.4 src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv.sh:1.5
--- src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv.sh:1.4	Wed Nov  7 01:13:55 2018
+++ src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv.sh	Thu Apr 18 10:07:24 2019
@@ -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

Index: src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32.sh
diff -u src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32.sh:1.1.1.1 src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32.sh:1.2
--- src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32.sh:1.1.1.1	Tue Nov  6 21:19:03 2018
+++ src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32.sh	Thu Apr 18 10:07:24 2019
@@ -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
Index: src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32f.sh
diff -u src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32f.sh:1.1.1.1 src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32f.sh:1.2
--- src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32f.sh:1.1.1.1	Tue Nov  6 21:19:03 2018
+++ src/external/gpl3/binutils/dist/ld/emulparams/elf32lriscv_ilp32f.sh	Thu Apr 18 10:07:24 2019
@@ -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

Index: src/external/gpl3/binutils/usr.bin/ld/Makefile
diff -u src/external/gpl3/binutils/usr.bin/ld/Makefile:1.30 src/external/gpl3/binutils/usr.bin/ld/Makefile:1.31
--- src/external/gpl3/binutils/usr.bin/ld/Makefile:1.30	Mon Feb 25 19:55:35 2019
+++ src/external/gpl3/binutils/usr.bin/ld/Makefile	Thu Apr 18 10:07:24 2019
@@ -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 ${.CUR
 
 . 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*) || \

Index: src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/defs.mk
diff -u src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/defs.mk:1.3 src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/defs.mk:1.4
--- src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/defs.mk:1.3	Tue Apr 16 06:19:54 2019
+++ src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/defs.mk	Thu Apr 18 10:07:24 2019
@@ -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

Index: src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/ldemul-list.h
diff -u src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/ldemul-list.h:1.1 src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/ldemul-list.h:1.2
--- src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/ldemul-list.h:1.1	Fri Sep 19 17:22:22 2014
+++ src/external/gpl3/binutils/usr.bin/ld/arch/riscv64/ldemul-list.h	Thu Apr 18 10:07:24 2019
@@ -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

Reply via email to