-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
CPU features are not passed to clang when assembling #10411
Comments
Just some info: // The Clang assembler does not accept the list of CPU features like the
// compiler frontend does. Therefore we must hard-code the -m flags for
// all CPU features here. I'm not sure what exactly this comment is referring to, but I suspect it is due to clang's So manually adding exceptions is the current state. I expect Zig could pass (P.S. There's also a corresponding |
Very helpful - thanks for all the context! I was able to run the clang compiler frontend and pass in the target feature in the example in the format you described. I'm going to try and get the various assembly flags right and put up a PR. |
found this stalled patch from '2014, though we'd need a few more passthru-args enabled: https://reviews.llvm.org/D6170 |
Can we expect this in 0.11.1 or 0.12? :) |
Don't build for Windows and some Linux versions: - Building HTSlib on Windows is not possible. - Building HTSlib does not work on Linux: - x86: len() as u64 is not valid on 32-bit - aarch64 and ppc64le: - expected `*mut u8`, found `&mut i8` - Fixed by: rust-bio/rust-htslib#415 - Building zlib-ng does not work for all Linux targets: - armv7: - Might get fixed in the future if zig gets fixed: ziglang/zig#10411
Don't build for Windows and some Linux versions: - Building HTSlib on Windows is not possible. - Building HTSlib does not work on Linux: - x86: - len() as u64 is not valid on 32-bit - aarch64 and ppc64le: - expected `*mut u8`, found `&mut i8` - Fixed by: rust-bio/rust-htslib#415 - Building zlib-ng does not work for all Linux targets: - armv7: - Might get fixed in the future if zig gets fixed: ziglang/zig#10411 - s390: - Error: Unrecognized opcode: `stfle'
Started a discussion at llvm/llvm-project#97517 to move this forward. |
There is a clean long-term solution to this problem that does not rely on any changes from LLVM: This is already planned. My suggestion is to put effort into the long-term solution rather than the short-term one, especially now that the upstream issue has been closed by LLVM maintainers who have no interest in fixing this problem. |
Just FYI for anyone affected by this: #21574 (comment) |
Zig Version
0.10.0-dev.40+303bad998
Steps to Reproduce
Create an ARM assembly file named
test.s
with the following contents:Compile that file to an object using
zig build-obj --verbose-cc -target arm-freestanding -mcpu cortex_m0plus+thumb2 test.s
Expected Behavior
Zig passes the
+thumb2
option to clang, which correctly assembles the thumb2 instruction (though this particular CPU feature won't work until llvm/llvm-project#52878 is fixed).Actual Behavior
The
+thumb2
feature is not passed tozig clang
:The text was updated successfully, but these errors were encountered: