-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure all our C/C++ cross compiler search for headers in $includedir
and libraries in $libdir
#3949
Comments
I think the relevant code in clang is this: https://github.com/llvm/llvm-project/blob/444513510999e4c1ea23253654196793834d53bf/clang/lib/Frontend/InitHeaderSearch.cpp#L235-L255 -- note that |
llvm/llvm-project@315c167. Not much more informative... |
FreeBSD rather strictly separates the base-system (installed into /usr) from any extra software installed via ports (into But this doesn't really apply for Yggdrasil, so I guess patching it away wont hurt. For Yggdrasil PS: I do believe that this a very reasonable default for FreeBSD, it just doesn't really fit into Yggdrasil where patching this would make it easier to add new recipes. |
Thanks @benlorenz that makes sense |
So I think it's pretty clear how to patch clang to get Or perhaps one just needs to accept this and instruct all packagers that they may have to add I think it might be still worth it to do this for GCC 4.8.5 on musl (see also PR #3969) because it is the only variant of that GCC where behavior differs. |
Just run into this again, and then noticed that part of the relevant discussions is not here on this issue. So I'll quote myself from #3969 (comment):
There is some more back and forth on this afterwards, so any readers may wish to follow the link above and read a bit more. But I still think this approach would work and be reasonably "safe". |
Yes, that's fine with me, and being in |
Currently several JLLs need to manually add `-I${includedir}` to their CPPFLAGS in order to build correctly on FreeBSD. Fix this by adjusting the clang wrapper. See JuliaPackaging/Yggdrasil#3949
Currently several JLLs need to manually add `-I${includedir}` to their CPPFLAGS in order to build correctly on FreeBSD. Fix this by adjusting the clang wrapper. See JuliaPackaging/Yggdrasil#3949
Currently several JLLs need to manually add `-I${includedir}` to their CPPFLAGS in order to build correctly on FreeBSD. Fix this by adjusting the clang wrapper. See JuliaPackaging/Yggdrasil#3949
Currently several JLLs need to manually add `-I${includedir}` to their CPPFLAGS in order to build correctly on these platforms. Fix this by adjusting the compiler wrappers. See JuliaPackaging/Yggdrasil#3949
Currently several JLLs need to manually add `-I${includedir}` to their CPPFLAGS in order to build correctly on these platforms. Fix this by adjusting the compiler wrappers. See JuliaPackaging/Yggdrasil#3949
Currently several JLLs need to manually add `-I${includedir}` to their CPPFLAGS in order to build correctly on these platforms. Fix this by adjusting the compiler wrappers. See JuliaPackaging/Yggdrasil#3949
) * Add `-isystem ${includedir}` for clang on FreeBSD, and GCC on musl Currently several JLLs need to manually add `-I${includedir}` to their CPPFLAGS in order to build correctly on these platforms. Fix this by adjusting the compiler wrappers. See JuliaPackaging/Yggdrasil#3949 Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
This was resolved some time ago, as discussed |
This is the case for most of them, because
SYSROOT/usr/local
is a symlink to/workspace/destdir
. But not all of them (see also the discussion on PR #3931).But in a few exceptions, headers are not automatically found if they are in
$includedir
. The exceptions I know about right now are:x86_64-linux-musl
GCCBootstrap@4/bundled/patches/gcc494_musl.patch
which changesINCLUDE_DEFAULTS
from its default value; it may accidentally have removedSYSROOT/usr/local
x86_64-unknown-freebsd12.2
However, it works for most other compiler variants, including GCC 4.8.5 for GNU libc, or Apple clang. I did not yet try to check this systematically, so I don't know yet what about non-Apple clang on other platforms.
Motivation: without this, one may get surprising build error that then require adding
-I$includedir
toCFLAGS
or similar; but this is not obvious and confusing ("but why does it work everywhere else?"). So I think getting this right (=uniform) will make it easier to add and maintainer builder recipes.I will try to look into the GCC 4.8.5 on musl issue. But so far, I don't even know where in the clang sources the default include search paths are defined; I simply have not yet even tried to find it, perhaps it is easy... But if anyone has insight into this, I'd appreciate a hint where to look.
The text was updated successfully, but these errors were encountered: