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: How to tell linker to use minimum ISA?


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


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