Support the min of module flags when linking, use for AArch64 BTI/PAC-RET
authorDaniel Kiss <daniel.kiss@arm.com>
Wed, 13 Apr 2022 07:31:25 +0000 (09:31 +0200)
committerDaniel Kiss <daniel.kiss@arm.com>
Wed, 13 Apr 2022 07:31:51 +0000 (09:31 +0200)
commitb0343a38a5910e980bb031e4014655d77cd0c162
treeb2d4417f19ce2b5700b413d789ef23d7433c0fca
parente5000624933e11e56a1530f1561efa136c9c8bd7
Support the min of module flags when linking, use for AArch64 BTI/PAC-RET

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.

Reviewed By: pcc

Differential Revision: https://reviews.llvm.org/D123493
56 files changed:
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGen/aarch64-sign-return-address.c
clang/test/CodeGen/arm-branch-protection-attr-2.c
clang/test/Frontend/arm-ignore-branch-protection-option.c
llvm/include/llvm/IR/Module.h
llvm/lib/IR/AutoUpgrade.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/Linker/IRMover.cpp
llvm/test/Bitcode/upgrade-branch-protection.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/debug-info-sve-dbg-declare.mir
llvm/test/CodeGen/AArch64/live-debugvalues-sve.mir
llvm/test/CodeGen/AArch64/memsize-remarks.ll
llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-0.ll
llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-1.ll
llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-2.ll
llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-3.ll
llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-4.ll
llvm/test/CodeGen/AArch64/pacbti-llvm-generated-funcs-2.ll
llvm/test/CodeGen/AArch64/pacbti-module-attrs.ll
llvm/test/CodeGen/AArch64/setjmp-bti-no-enforcement.ll
llvm/test/CodeGen/AArch64/setjmp-bti-outliner.ll
llvm/test/CodeGen/AArch64/setjmp-bti.ll
llvm/test/CodeGen/ARM/pacbti-module-attrs.ll
llvm/test/CodeGen/ARM/setjmp-bti-basic.ll
llvm/test/CodeGen/ARM/setjmp-bti-outliner.ll
llvm/test/CodeGen/Thumb2/LowOverheadLoops/skip-vpt-debug.mir
llvm/test/CodeGen/Thumb2/bti-const-island-multiple-jump-tables.mir
llvm/test/CodeGen/Thumb2/bti-const-island.mir
llvm/test/CodeGen/Thumb2/bti-entry-blocks.ll
llvm/test/CodeGen/Thumb2/bti-indirect-branches.ll
llvm/test/CodeGen/Thumb2/bti-jump-table.mir
llvm/test/CodeGen/Thumb2/bti-outliner-1.ll
llvm/test/CodeGen/Thumb2/bti-outliner-2.ll
llvm/test/CodeGen/Thumb2/bti-outliner-cost-1.ll
llvm/test/CodeGen/Thumb2/bti-outliner-cost-2.ll
llvm/test/CodeGen/Thumb2/bti-pac-replace-1.mir
llvm/test/CodeGen/Thumb2/bti-pac-replace-2.ll
llvm/test/CodeGen/Thumb2/pacbti-m-basic.ll
llvm/test/CodeGen/Thumb2/pacbti-m-indirect-tail-call.ll
llvm/test/CodeGen/Thumb2/pacbti-m-outliner-1.ll
llvm/test/CodeGen/Thumb2/pacbti-m-outliner-2.ll
llvm/test/CodeGen/Thumb2/pacbti-m-outliner-3.ll
llvm/test/CodeGen/Thumb2/pacbti-m-outliner-4.ll
llvm/test/CodeGen/Thumb2/pacbti-m-outliner-5.ll
llvm/test/CodeGen/Thumb2/pacbti-m-overalign.ll
llvm/test/CodeGen/Thumb2/pacbti-m-unsupported-arch.ll
llvm/test/CodeGen/Thumb2/pacbti-m-varargs-1.ll
llvm/test/CodeGen/Thumb2/pacbti-m-varargs-2.ll
llvm/test/CodeGen/Thumb2/pacbti-m-vla.ll
llvm/test/DebugInfo/AArch64/debugline-endsequence.ll
llvm/test/Instrumentation/InstrProfiling/debug-info-correlate-coverage.ll
llvm/test/Instrumentation/InstrProfiling/debug-info-correlate.ll
llvm/test/LTO/AArch64/Inputs/foo.ll [new file with mode: 0644]
llvm/test/LTO/AArch64/link-branch-target-enforcement.ll [new file with mode: 0644]
llvm/test/LTO/AArch64/lit.local.cfg [new file with mode: 0644]
llvm/test/Verifier/module-flags-1.ll