LTO objects might compiled with different mbranch-protection flags which will cause an error in the linker.
Such a setup is allowed in the normal build with this change that is possible.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can we add logic to llvm/lib/IR/AutoUpgrade.cpp to change Error to Min if we see one of these module flags? I think that should allow old bitcode to continue working.
Thanks, I added the support there. Surprisingly the AutoUpgrade did not run in the linker.
This behavior requires that all participating modules have the module flag. In the absence of the module flag, what should be behavior be?
For module flags like "sign-return-address", I see that you just emit the flag unconditionally (which can be zero).
Absence of the "branch-target-enforcement" and "sign-return-address"` means features are off. So the flag merger will take an existing flag and the feature could be turned on, which is bad.
AutoUpdater should insert the attributes with zero value if they are missing.