-
-
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
Fix MIPS PIC level and work around an LLVM bug for mips(el)-linux-gnueabi(hf)
#21224
Conversation
Can you share the |
I don't recall the exact failure, but it was one of the Lines 1273 to 1289 in 1a178d4
|
For hysterical raisins, MIPS always uses 1, regardless of `-fpic` vs `-fPIC`.
Until llvm/llvm-project#106231 trickles down.
This reverts commit 149aa9a.
mips(el)-linux-gnueabi(hf)
mips(el)-linux-gnueabi(hf)
pub const setModulePICLevel = ZigLLVMSetModulePICLevel; | ||
extern fn ZigLLVMSetModulePICLevel(module: *Module) void; | ||
extern fn ZigLLVMSetModulePICLevel(module: *Module, big: bool) void; | ||
|
||
pub const setModulePIELevel = ZigLLVMSetModulePIELevel; | ||
extern fn ZigLLVMSetModulePIELevel(module: *Module) void; | ||
extern fn ZigLLVMSetModulePIELevel(module: *Module, large: bool) void; | ||
|
||
pub const setModuleCodeModel = ZigLLVMSetModuleCodeModel; | ||
extern fn ZigLLVMSetModuleCodeModel(module: *Module, code_model: CodeModel) void; |
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.
This API usage should not exist, we already have the ability to modify the module freely.
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.
As I understand it, similar to float ABI, you can't set a code model on a bitcode module. So for these, we're stuck with the API (or llc
later).
PIC/PIE are just module flags though, so I can look into emitting the module flags on our side in a follow-up PR if that's ok.
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.
As I understand it, similar to float ABI, you can't set a code model on a bitcode module.
Correct for float ABI, but not for code model:
!7 = !{i32 1, !"Code Model", i32 1}
Generally anything being set on llvm::Module
is part of the module, anything just being passed to codegen is not.
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.
Filed #21238 so this isn't forgotten.
|
This makes
zig build test-modules -fqemu --glibc-runtimes <...> -Dtest-slow-targets -Dtest-target-filter=mips-linux.4.19...6.10.3-gnueabi -Dtest-target-filter=mipsel-linux.4.19...6.10.3-gnueabi
mostly work, save for anfchmodat
test failure that I still need to investigate.