-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Homebrew Clang does not have correct search path for system include directory on MacOS Catalina #45061
Comments
There is a CMake variable |
I think @mistydemeo was looking at that issue |
What I did to fix this is pass |
@tschoonj After days of trying to figure this out, setting CPPFLAGS finally did it. I would suggest that appending this to the LLVM build would stifle the sound of people crying all over the world. |
The problem with |
I opened a PR. and I can't build it in my environment... (don't have enough spec) So if you want to try it, please checkout the branch. |
I was finally able to build it. and it seems to be working correctly. |
With the compiler from this pull request, can you take a simple C file (one line With an unpatched llvm, I get:
|
The issue is still there? I still get the error after completely uninstalling llvm, updating brew, reinstalling after deleting the install cache. |
@fxcoudert I added comment on #45304. |
@dulvinw Yes. |
Since Command-Line-Tools >= 10.14, there is no /usr/include path. And after macOS Catalina, '/' partition is read-only. So I finally fix it by my self. I diff the
So do the following things:
|
Do NOT disable SIP even if it's temporary. and it's not good solution for many people who work for companies. Some not bad solutions are already listed #45304. |
Yeah, I think we're looking for a solution that does not involve disabling a major security feature. |
PR Statuses
|
@ssbanerje Could you try latest llvm package? |
@imbsky It works with the version from 9/24
|
with |
I am not entirely sure what you mean. I just "clang test.c" without any other parameters or environment variables. |
Oh, I'm sorry. You can set the |
Information for other users: The current latest build containing the fix must be |
Yeah the latest build works. I dont know why but |
@ssbanerje Sorry, It's definitely our mistake and has already been fixed in the latest brew! |
Finally, all LLVM versions except llvm@4 have been fixed and now available. |
Does this issue been fixed ? I still found the search path with clang (actually I use libclang): Code:
Compile:
Log:
The problem maybe this strange include ? Xcode 11 does not have that SDK/usr/local/include, only SDK/usr/include
|
Setting |
Homebrew Clang does not search the correct include directories in MacOS Catalina.
What you were trying to do (and why)
If I try to compile the following C file after installing LLVM+Clang from homebrew
What happened
I get the error
What you expected to happen
The program to compile correctly.
However, if I alias clang to the system clang, everything works!
By default the Homebrew clang has the following search paths
The system clang looks in different folders
I think the problem is that until recently
/usr/include
would have the header files that the compiler requires, however, that directory does not exist anymore (since Catalina update).I can currently work around this by explicitly setting
CPATH
. But I think this is a bug, not sure if it is a homebrew problem or upstream in LLVM.Step-by-step reproduction instructions (by running brew commands)
My homebrew is updated to the latest version and doctor does not report any problems.
The text was updated successfully, but these errors were encountered: