This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PING: Re: [PATCH] ld: Override default linker emulation at configure time
- From: Andrew Burgess <andrew dot burgess at embecosm dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: Alan Modra <amodra at gmail dot com>, Cupertino Miranda <Cupertino dot Miranda at synopsys dot com>, Nick Clifton <nickc at redhat dot com>, Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>, Francois Bedard <Francois dot Bedard at synopsys dot com>
- Date: Wed, 8 Feb 2017 00:28:51 +0000
- Subject: PING: Re: [PATCH] ld: Override default linker emulation at configure time
- Authentication-results: sourceware.org; auth=none
- References: <20170120010728.GX32333@bubble.grove.modra.org> <20170120085844.GZ26941@embecosm.com> <20170124003558.GC28669@bubble.grove.modra.org> <20170124105525.GF21576@embecosm.com> <20170125025248.GK28669@bubble.grove.modra.org> <20170126104103.GK21576@embecosm.com> <EB86EB452ADE4B44B294F7149B8A27770224CF32@DE02WEMBXB.internal.synopsys.com> <20170126145541.GM21576@embecosm.com> <EB86EB452ADE4B44B294F7149B8A27770224D0C6@DE02WEMBXB.internal.synopsys.com> <20170130115912.GT21576@embecosm.com>
Ping! I think that everyone is happy with the latest version.
Thanks,
Andrew
* Andrew Burgess <andrew.burgess@embecosm.com> [2017-01-30 11:59:12 +0000]:
> * Cupertino Miranda <Cupertino.Miranda@synopsys.com> [2017-01-26 16:25:04 +0000]:
>
> > Hi Andrew,
> >
> > Fair, over-engineering was an over-statement. ;-)
> >
> > I was simply, advocating for the triplet use in this case, however, I do
> > agree with your reasoning.
> > > My two mains dislikes for switching on the vendor string are, first,
> > > it ties us to the vendor string, what if we don't want to use the
> > > vendor name in the target for whatever reason, or what if the vendor
> > > name changes in the future? Second, having worked so hard to make the
> > > configuration NOT depend on the vendor string in all other parts of
> > > the toolchain, having the linker be the odd-one out feels like a
> > > likely source of confusion. Some end user builds the toolchain with
> > > --with-cpu=nps400, but miss-spells, or drops the vendor string.
> > > Everything else has configured/built correctly, except for the default
> > > emulation.
> > >
> > I was also with the impression that:
> > - there was some other patch to expose the "with_cpu" variable and
>
> This confusion was caused by me :-/ When I originally proposed my
> patch I couldn't remember how --with-cpu was passed from the top level
> configure script to the ld specific configure script, I didn't know if
> extra code was required in ld/configure.ac to make --with-cpu an
> option. It's not. Sorry for the confusion there.
>
> > - that no other target checked more than the triplet (I now see that
> > powerpc*-*-elf* already does something).
> >
> > Just a suggestion, they do it with a "case" construct instead of the "if
> > then else" ... seems cleaner. :-)
>
> I think you're right. Using "case" will make any future growth
> easier. I've reworked the patch inline with your suggestion.
>
> Thanks for taking the time to review.
>
> Andrew
>
> ---
>
> 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.
>
> ld/ChangeLog:
>
> * 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 | 11 +++++++++--
> 3 files changed, 18 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..8e34b1f 100644
> --- a/ld/configure.tgt
> +++ b/ld/configure.tgt
> @@ -80,8 +80,15 @@ 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*) case "${with_cpu}" in
> + nps400) targ_emul=arclinux_nps
> + targ_extra_emuls=arclinux
> + ;;
> + *) targ_emul=arclinux
> + targ_extra_emuls=arclinux_nps
> + ;;
> + esac
> + 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"
> --
> 2.5.1
>