-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Different -Wpoison-system-directories behavior between macOS x86_64 and macOS arm64 #14031
Comments
It sounds to like maybe a bug in clang that its adding /usr/local/include at all given that we running clang with One thing, does |
By the way, thanks for pointing out the existence of |
|
This line in the M1's verbose output seems to indicate
|
No.. I think that is clang internally passing to to |
The clang command line run by emscripten starts with |
Internally clang then calls |
Ah, my mistake. Thanks for the explanation. |
Its a shame that |
The only place in clang I can see that would add that path is https://github.com/llvm/llvm-project/blob/b19136e35256c5b21aff93ea5b55b4c142408c40/clang/lib/Frontend/InitHeaderSearch.cpp#L214. If you are able to re-built perhaps you could see if you are hitting that.. it seems impossible since that calling function returns early of the OS is emscripten. |
I'm willing to give this a shot, but I've only ever used the prebuilt tools. I haven't been able to find any instructions on how to get, build, and install the correct version of clang for use by Emscripten. Is this documentation available somewhere? |
But if you are using M1 mac hardware aren't you building llvm from source anyway? At least I don't think we provide pre-built binaries in emsdk yet. How are you installing llvm? |
I'm doing the same installation I would on an Intel Mac. It is installing x86-64 binaries, which are run through translation. |
Well that is even more odd! The exact same clang binaries are doing different things here... |
The prebuilt binaries are still x86_64 only for Mac as of Emcripten version 2.0.32 (and this issue is still visible). Is there something holding up a native arm64 version of clang? |
We do now build and upload arm64 binaries for macos. It looks like they were added to manifest file in emscripten-core/emsdk#816. I confirmed that this tar archive does indeed contain arm binaries:
So perhaps there is an issue where |
It's downloading
My system
Is the architecture being detected by Emscripten's |
Yes, python is used to detect the current architecture. I looks like its using |
Indeed, it does:
|
OK, I think we should open a separate issue to get arm64 working. This issue is still a completely mystery (why the emulated version of clang adds Admittedly fixing the former might fix that latter. |
That's what I was hoping. Thanks for the help with this. |
I have my emsdk installation fixed so I now have an arm64 native clang compiler, but this issue still persists. Here's the current verbose output:
|
I have an Intel Mac and a M1 Mac, both with the same OS version (macOS 11.3), both with the same version of
emsdk
(2.0.18).em++
with-Wpoison-system-directories
behaves differently between the two. With the following simple source code:And the following compiler invocation:
/usr/local/opt/emsdk/upstream/emscripten/em++ -Wpoison-system-directories a.cpp
I get no warnings on the Intel Mac, but I get the following warning on the M1 Mac:
Looking at the verbose (
-v
) output on the two machines, the only differences are that-I/usr/local/include
is added on the M1 Mac, and the version ofnode
differs between the two (/usr/local/opt/emsdk/node/14.15.5_64bit/bin/node
on the M1,/usr/local/opt/emsdk/node/12.18.1_64bit/bin/node
on the Intel).Here is the full verbose output on the M1 Mac:
Here is the full verbose output on the Intel Mac:
The text was updated successfully, but these errors were encountered: