This is the mail archive of the binutils@sourceware.org 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


Hi Andrew & Alan,

I apologize for just coming with such a question now. I don't really
know how I missed this thread.
But why not to specify the triplet with melanox to use the particular
emulation?

IMHO, although it is discouraged, as a general rule, to use the vendor
name to classify a target, in this particular case it makes total sense
to me.
It is clear that no one else apart from melanox will ever be using this
particular linker script.

Moreover, the required over enginering for the default ARC configure
process looks to me like a very good reason for to break that rule.

The second thing is that, there is already other target / vendor in
configure.tgt that does this for the same reason:
    vax-dec-ultrix* | vax-dec-bsd*) targ_emul=vax ;;

If we follow the path to check the "with_cpu" flag on the configure.tgt,
we will also be doing something that certainly should be avoided and
perhaps lead to future problems.
Moreover, ARC will be the only target to do this kind of thing.

Best regards,
Cupertino

On 01/26/2017 11:41 AM, Andrew Burgess wrote:
> * Alan Modra <amodra@gmail.com> [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/configure.ac 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.
>
> Thanks,
> 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 | 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]