mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] musl-clang wrapper chokes on <immintrin.h> (Linux x86_64)
@ 2023-04-11 10:05 Darjan Krijan
  2023-04-11 17:04 ` Gabriel Ravier
  0 siblings, 1 reply; 2+ messages in thread
From: Darjan Krijan @ 2023-04-11 10:05 UTC (permalink / raw)
  To: musl

Hello,

(Mostly copying the bug description I filed in the Arch Linux
Bugtracker. Was suggested to report upstream.)

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

Additional info:
* musl 1.2.3-1 on Arch Linux, built like this:
https://github.com/archlinux/svntogit-community/blob/5af625a2c6e62f211fd59d8df974e457d615613d/trunk/PKGBUILD

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.

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.

Regards,
Darjan


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [musl] musl-clang wrapper chokes on <immintrin.h> (Linux x86_64)
  2023-04-11 10:05 [musl] musl-clang wrapper chokes on <immintrin.h> (Linux x86_64) Darjan Krijan
@ 2023-04-11 17:04 ` Gabriel Ravier
  0 siblings, 0 replies; 2+ messages in thread
From: Gabriel Ravier @ 2023-04-11 17:04 UTC (permalink / raw)
  To: musl, Darjan Krijan

On 4/11/23 12:05, Darjan Krijan wrote:
> Hello,
>
> (Mostly copying the bug description I filed in the Arch Linux
> Bugtracker. Was suggested to report upstream.)
>
> The musl-clang wrapper breaks when a C file includes <immintrin.h> (and
> the likes).
> This is due to the wrapper disabling both system and compiler include
> paths entirely with '-nolibinc'.
>
> Additional info:
> * musl 1.2.3-1 on Arch Linux, built like this:
> https://github.com/archlinux/svntogit-community/blob/5af625a2c6e62f211fd59d8df974e457d615613d/trunk/PKGBUILD 
>
>
> 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.
>
> 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.
>
> Regards,
> Darjan
>
I can second this bug report, as I've just encountered a bug that seems 
to be exactly this on my Fedora laptop and was myself thinking about 
making a bug report, but this one sums it up quite well.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-11 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-11 10:05 [musl] musl-clang wrapper chokes on <immintrin.h> (Linux x86_64) Darjan Krijan
2023-04-11 17:04 ` Gabriel Ravier

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).