Use error-on-mismatch policy for PAuth module flags.
This agrees with Clang, and avoids an error when using LTO with mixed C/Rust. LLVM considers different behaviour flags to be a mismatch, even when the flag value itself is the same. This also makes the flag setting explicit for all uses of LLVMRustAddModuleFlag.
This commit is contained in:
parent
7bc7be860f
commit
e02e9582d2
4 changed files with 73 additions and 13 deletions
|
@ -722,9 +722,12 @@ extern "C" bool LLVMRustIsRustLLVM() {
|
|||
#endif
|
||||
}
|
||||
|
||||
extern "C" void LLVMRustAddModuleFlag(LLVMModuleRef M, const char *Name,
|
||||
uint32_t Value) {
|
||||
unwrap(M)->addModuleFlag(Module::Warning, Name, Value);
|
||||
extern "C" void LLVMRustAddModuleFlag(
|
||||
LLVMModuleRef M,
|
||||
Module::ModFlagBehavior MergeBehavior,
|
||||
const char *Name,
|
||||
uint32_t Value) {
|
||||
unwrap(M)->addModuleFlag(MergeBehavior, Name, Value);
|
||||
}
|
||||
|
||||
extern "C" LLVMValueRef LLVMRustMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue