This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to tell linker to use minimum ISA?
- From: Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- To: noloader at gmail dot com
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 16 Oct 2019 21:30:59 +0100
- Subject: Re: How to tell linker to use minimum ISA?
- References: <CAH8yC8nTi3tg1u=gO9F=ChZ8C79vreRXo9UpD6AV++_5qG1H2g@mail.gmail.com>
On Wed, Oct 16, 2019 at 8:54 PM Jeffrey Walton <noloader@gmail.com> wrote:
>
> Hi Everyone,
>
> I have object files from different ISAs. The higher ISAs are guarded
> at runtime though getauxval.
>
> Compile is OK. For example:
>
> a.o # -march=armv7a
> b_simd.o # -march=armv7a -mfpu=vfpv3-d16 -mfpu=neon
>
What is your compiler / toolchain configured as ? $PREFIX-gcc will
give you the answer.
> On Android link is failing when using only -march=armv7a with:
>
> .../arm-linux-androideabi/bin/ld: error: aria_simd.o uses VFP
> register arguments, output does not
Is aria_simd.o compiled with -mfloat-abi=hard ?
>
> To fix it I need to add -march=armv7a -mfpu=vfpv3-d16 -mfpu=neon to LDFLAGS.
>
That seems very odd.
> I'm concerned the linker may want to perform optimizations, especially
> now that LTO is becoming more popular. That could cause a lot of
> problems, especially if the linker uses the wrong ISA.
>
> How do I tell the linker to use the minimum ISA, and not the ISA I am using?
Firstly it's not because of the ISA levels you are getting the error,
it's because you are mixing calling conventions. At object file levels
you cannot mix object files compiled for one pcs against object files
compiled for a different pcs. i.e. floating point values are sent in
FP registers in one object file because it was compiled with the VFP
PCS in mind while the other one expects this in integer registers
because it was compiled for the base PCS .
Ramana