This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use Min behavior for cf-protection-{return,branch}/ibt-seal module flags
ClosedPublic

Authored by MaskRay on Jul 19 2022, 1:35 AM.

Details

Summary

These features require that all object files are compiled with the support. When
the feature is disabled for an object file, the merge behavior should treat the
file having a value of 0 (see D129911).

Diff Detail

Event Timeline

MaskRay created this revision.Jul 19 2022, 1:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2022, 1:35 AM
MaskRay requested review of this revision.Jul 19 2022, 1:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2022, 1:35 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
xiangzhangllvm added inline comments.Jul 19 2022, 6:03 PM
clang/lib/CodeGen/CodeGenModule.cpp
746

Take "cf-protection-return" for example:
I pass the "-fcf-protection=none" for following test x86-cf-protection.c
It doesn't has "!{i32 Module::Min, !"cf-protection-return", i32 0}".

clang/test/CodeGen/X86/x86-cf-protection.c
11–12

Seems we miss check the "llvm::Module::Override" (4) before, now is better.

xiangzhangllvm added inline comments.Jul 19 2022, 6:11 PM
clang/lib/CodeGen/CodeGenModule.cpp
746

ah! I got it at https://reviews.llvm.org/D129911 line 1489, thanks

xiangzhangllvm accepted this revision.Jul 19 2022, 6:11 PM
This revision is now accepted and ready to land.Jul 19 2022, 6:11 PM
MaskRay marked 3 inline comments as done.Jul 19 2022, 9:18 PM

Thanks:)

This revision was landed with ongoing or failed builds.Jul 19 2022, 9:20 PM
This revision was automatically updated to reflect the committed changes.