Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#76017 - [clang] Sysroot and triplet misdetection fix

Attached to Project: Arch Linux
Opened by Adrian (adirat) - Monday, 26 September 2022, 10:19 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 27 September 2022, 05:58 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
Assigned To Evangelos Foutras (foutrelis)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No



Hi, while building the Linux kernel tools on ArchLinux with Clang, I've noticed there are Clang bugs when detecting the sysroot and parsing the triplet. I've created review on the LLVM phabricator to fix these bugs and would like to have the patch added to the PKGBUILD once it gets accepted upstream so I can cleanup the kernel build tree as well. Any feedback from the ArchLinux clang maintainers is welcome, thanks!

Additional info:
* Affects 14.0.6 and later

Steps to reproduce:
Run `make ARCH=arm64 CC=clang CROSS_COMPILE=aarch64-linux-gnu- bpf`
This task depends upon

Comment by Adrian (adirat) - Thursday, 06 October 2022, 08:43 GMT
According to the LLVM maintainers [1] the sysroot auto-detection code in Clang is wrong by design and should not be used (it will be removed in the future).

Instead, each distribution will need to add a configuration file via a mechanism which has landed in LLVM mainline to specify distro-specific configurations like sysroot locations [2].

Once ArchLinux llvm/clang is updated to include commit [2]. Can you please add a config file to specify sysroots like the `/usr/aarch64-linux-gnu` location? Thank you!

Comment by Adrian (adirat) - Thursday, 06 October 2022, 11:18 GMT