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: Jeffrey Walton <noloader at gmail dot com>
- To: Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 16 Oct 2019 16:51:05 -0400
- Subject: Re: How to tell linker to use minimum ISA?
- References: <CAH8yC8nTi3tg1u=gO9F=ChZ8C79vreRXo9UpD6AV++_5qG1H2g@mail.gmail.com> <CAJA7tRYx3jMgrBKi2Soo9vr-crhF4H0oVxGEtRKZXjvU_PbrWg@mail.gmail.com>
- Reply-to: noloader at gmail dot com
On Wed, Oct 16, 2019 at 4:31 PM Ramana Radhakrishnan
<ramana.gcc@googlemail.com> wrote:
>
> On Wed, Oct 16, 2019 at 8:54 PM Jeffrey Walton <noloader@gmail.com> wrote:
> >
> > 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.
$ arm-linux-androideabi-ld --version
GNU gold (GNU Binutils 2.27.0.20170315) 1.12
Copyright (C) 2016 Free Software Foundation, Inc.
And:
$ armv7a-linux-androideabi23-clang++ --version
Android (5058415 based on r339409) clang version 8.0.2
(https://android.googlesource.com/toolchain/clang
40173bab62ec746213857d083c0e8b0abb568790)
(https://android.googlesource.com/toolchain/llvm
7a6618d69e7e8111e1d49dc9e7813767c5ca756a) (based on LLVM 8.0.2svn)
Target: armv7a-unknown-linux-android23
> > 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 ?
Oh, this could be the problem. I had a typo that added hard floats to
non-NEON source files. It came from reusing a makefile used for Debian
ARM. Debian ARM uses hard floats.
> > 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 .
Thanks Ramana.
Cancel the request.
Jeff