This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ld: Override default linker emulation at configure time

* Alan Modra <> [2017-01-25 13:22:48 +1030]:

> On Tue, Jan 24, 2017 at 10:55:25AM +0000, Andrew Burgess wrote:
> > I might end up having to add some code to ld/ to make
> > --with-cpu=NAME visible in the ld configure script.... but how would
> > this look to you?
> Works for me.

Thanks for all your time reviewing this patch.

Here's a revised version in line with the previous discussion.



If we are configuring for an arc/linux target, and --with-cpu=nps400 is
used at configure time then change the default linker emulation to the
nps specific version.  All of the alternative linker emulations are
still available using the -mNAME option for ld.


	* configure.tgt (arc*-*-linux*): Change the default linker
	emulation based on --with-cpu selection.
	* NEWS: Mention new configuration option.
 ld/ChangeLog     |  6 ++++++
 ld/NEWS          |  3 +++
 ld/configure.tgt | 10 ++++++++--
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ld/NEWS b/ld/NEWS
index d43f846..23ca25a 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -2,6 +2,9 @@
 * Add support for the Texas Instruments PRU processor.
+* When configuring for arc*-*-linux* targets the default linker emulation will
+  change if --with-cpu=nps400 is used at configure time.
 Changes in 2.28:
 * The EXCLUDE_FILE linker script construct can now be applied outside of the
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 5a68083..cfb2689 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -80,8 +80,14 @@ alpha*-*-*vms*)		targ_emul=alphavms
 arc*-*-elf*)		targ_emul=arcelf
 			targ_extra_emuls="arcelf_prof arclinux arclinux_nps arclinux_prof arcv2elf arcv2elfx"
-arc*-*-linux*)		targ_emul=arclinux
-			targ_extra_emuls="arclinux_nps arclinux_prof arcelf arcelf_prof arcv2elf arcv2elfx"
+arc*-*-linux*)		if test "${with_cpu}" = "nps400"; then
+			   targ_emul=arclinux_nps
+			   targ_extra_emuls=arclinux
+			else
+			   targ_emul=arclinux
+			   targ_extra_emuls=arclinux_nps
+			fi
+			targ_extra_emuls="${targ_extra_emuls} arclinux_prof arcelf arcelf_prof arcv2elf arcv2elfx"
 arm-epoc-pe)		targ_emul=arm_epoc_pe ;	targ_extra_ofiles="deffilep.o pe-dll.o" ;;
 arm*-*-cegcc*)		targ_emul=arm_wince_pe ; targ_extra_ofiles="deffilep.o pe-dll.o"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]