Bug#904059: clang-6.0: default target on armhf is armv8l-unknown-linux-gnueabihf

peter green plugwash at p10link.net
Sun Sep 23 14:32:26 BST 2018


> clang-6.0 and friends advertise their default target on armhf as
> armv8l-unknown-linux-gnueabihf, which sounds like nonsense.
Not really "nonsense", armv8 is best known for adding 64-bit mode but it did also add some enhancements for the 32-bit architecture. I don't know if clang has the ability to use any of these new instructions but if it does it could well mean binaries are being built that won't run on baseline armhf.
> This might depend on the cpu/chroot on the buildd that built the
> llvm-toolchain-6.0 package:
Right, we ran into issues with clang building for the wrong CPU target in raspbian (and I suspect armel has a problem too).

The cmake-based build system used by the llvm-toolchain package (IIRC llvm has multiple build-systems or at least did at one point) seems to use config.guess to determine what target to build for and I couldn't find any way to override this externally (though i'm no LLVM expert so I may well have missed one). The trouble with config.guess is it gives you a description of the hardware you are running on, NOT the hardware you are supposed to be building for.

I dealt with it in raspbian by.

1. Modifying cmake/modules/GetHostTriple.cmake to call config.guess.hack instead of config.guess
2. Writing a script config.guess.hack to call config.guess and then use sed on the result to switch the arm version to the one I wanted.

If you search for config.guess in http://debdiffs.raspbian.org/main/l/llvm-toolchain-6.0/llvm-toolchain-6.0_6.0.1-6%2brpi1.debdiff you should find the relavent changes.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-llvm-team/attachments/20180923/d5fd33a4/attachment.html>


More information about the Pkg-llvm-team mailing list