Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <114dbabd-9745-3655-9c21-486afa2b8d7c@gmx.de>
Date: Tue, 11 Apr 2023 12:05:15 +0200
From: Darjan Krijan <darjan_krijan@....de>
To: musl@...ts.openwall.com
Subject: musl-clang wrapper chokes on <immintrin.h> (Linux x86_64)

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.