-
Notifications
You must be signed in to change notification settings - Fork 767
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
wasm-builder: Also set mcpu
for c deps
#3777
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this could in theory break builds if someone has non-Rust dependencies in their build deps, in which case it would use this flag to compile them too, and since mvp
is only valid for WASM it might break them**.
I don't know of a better way of doing this though.
** - interestingly, if I pass -mcpu=mvp
to clang I get this and it compiles just fine (it completely ignores the flags, which, AFAIK, it shouldn't?):
$ clang -mcpu=mvp --target=x86_64-unknown-linux-gnu hello.c
clang-16: warning: argument unused during compilation: '-mcpu=mvp' [-Wunused-command-line-argument]
but if I change the target to something else then I get this:
$ clang -mcpu=mvp --target=aarch64-unknown-linux-gnu hello.c
clang-16: error: unsupported argument 'mvp' to option '-mcpu='
...which is a little strange that it's specifically hardcoded to ignore this only on AMD64.
Closes: #3192