Bug#930008: clang-8: --target=arm-linux-gnueabihf should target armv7 instead of armv6

Mike Hommey mh at glandium.org
Thu Jun 6 08:31:55 BST 2019


On Thu, Jun 06, 2019 at 09:15:31AM +0200, Sylvestre Ledru wrote:
> 
> Le 05/06/2019 à 11:10, Sylvestre Ledru a écrit :
> > 
> > Le 05/06/2019 à 04:14, Mike Hommey a écrit :
> > > Package: clang-8
> > > Version: 1:8-3
> > > Severity: wishlist
> > > 
> > > Dear Maintainer,
> > > 
> > > The target that one gives to clang needs, to some extent, to match what
> > > the toolchain prefix is for binutils. For armhf, that is
> > > arm-linux-gnueabihf. When using clang --target=arm-linux-gnueabihf,
> > > clang still targets armv6, when the baseline for the armhf Debian
> > > architecture is armv7. It should arguably target armv7.
> > 
> > agreed
> > 
> > this is because clang/llvm thinks that the arch version is
> > v6kz-unknown-linux-gnueabihf
> > 
> > This should be easy to fix, I will have a look to fix that.
> > 
> It was indeed trivial to fix:
> 
> Index: llvm-toolchain-8-8.0.1~+rc1/lib/Support/Triple.cpp
> ===================================================================
> --- llvm-toolchain-8-8.0.1~+rc1.orig/lib/Support/Triple.cpp
> +++ llvm-toolchain-8-8.0.1~+rc1/lib/Support/Triple.cpp
> @@ -1620,7 +1620,7 @@ StringRef Triple::getARMCPUForArch(Strin
>      case llvm::Triple::EABIHF:
>      case llvm::Triple::GNUEABIHF:
>      case llvm::Triple::MuslEABIHF:
> -      return "arm1176jzf-s";
> +      return "cortex-a7";
>      default:
>        return "arm7tdmi";
>      }
> 
> 
> Mike, is cortex-a7 the good default?

I don't actually know. I don't know all the values LLVM triples can use.

> I will probably forward this upstream.

I'm not entirely sure whether that's something for upstream. That is,
the definition of the armhf architecture in Debian might not match what
it is elsewhere, but I don't know that either.

Mike



More information about the Pkg-llvm-team mailing list