Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

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!
Tasklist

FS#78161 - [musl] musl-clang wrapper chokes on <immintrin.h>

Attached to Project: Community Packages
Opened by Darjan Krijan (daren) - Monday, 10 April 2023, 14:01 GMT
Last edited by Toolybird (Toolybird) - Wednesday, 10 May 2023, 22:54 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The musl-clang wrapper breaks when a C file includes <immintrin.h>.
This is due to the wrapper disabling system and compiler include paths entirely with '-nolibinc'.

Additional info:
* musl 1.2.3-1

Steps to reproduce:
- Install 'musl' and 'clang' packages and try:
$ echo -e "#include <immintrin.h>\nint main(){return 0;}" | clang -x c -
^ works
$ echo -e "#include <immintrin.h>\nint main(){return 0;}" | musl-clang -x c -
^ breaks

Steps to fix:
Replace '-nolibinc' with '-nostdlibinc' (description in clang manpage) in wrapper so system include directories like '/usr/include' are still not searched, but compiler ones like '/usr/lib/clang/$clang_ver/include' that contain immintrin.h, etc. are.
Add just "make DESTDIR="$pkgdir" install":
sed -e "s/-nostdinc/-nostdlibinc/g" -i "${pkgdir}/usr/bin/musl-clang"

I am not sure if this could break something else, but in my opinion compiler include directories should be essential for the compiler to work properly.
This task depends upon

Closed by  Toolybird (Toolybird)
Wednesday, 10 May 2023, 22:54 GMT
Reason for closing:  Upstream
Comment by Toolybird (Toolybird) - Tuesday, 11 April 2023, 06:54 GMT
That wrapper comes from upstream. Have you reported the problem upstream?
Comment by Darjan Krijan (daren) - Tuesday, 11 April 2023, 11:40 GMT
Wrote it to the musl mailing list:
https://www.openwall.com/lists/musl/2023/04/11/4

Loading...