aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorDaniel Kiss <daniel.kiss@arm.com>2024-07-10 10:06:14 +0200
committerDaniel Kiss <daniel.kiss@arm.com>2024-07-10 11:32:41 +0200
commit1782810b8440144a0141c24192acbaeb55a1545d (patch)
tree81456705676308eda13180239c79b82f84eec3d0 /clang/lib/Frontend/CompilerInvocation.cpp
parent5c09dda5070f1114480d450fdfb528f0b08e6df6 (diff)
downloadllvm-1782810b8440144a0141c24192acbaeb55a1545d.zip
llvm-1782810b8440144a0141c24192acbaeb55a1545d.tar.gz
llvm-1782810b8440144a0141c24192acbaeb55a1545d.tar.bz2
[Clang][ARM][AArch64] Alway emit protection attributes for functions. (#82819)
So far branch protection, sign return address, guarded control stack attributes are only emitted as module flags to indicate the functions need to be generated with those features. The problem is in case of an LTO build the module flags are merged with the `min` rule which means if one of the module is not build with sign return address then the features will be turned off for all functions. Due to the functions take the branch-protection and sign-return-address features from the module flags. The sign-return-address is function level option therefore it is expected functions from files that is compiled with -mbranch-protection=pac-ret to be protected. The inliner might inline functions with different set of flags as it doesn't consider the module flags. This patch adds the attributes to all functions and drops the checking of the module flags for the code generation. Module flag is still used for generating the ELF markers. Also drops the "true"/"false" values from the branch-protection-enforcement, branch-protection-pauth-lr, guarded-control-stack attributes as presence of the attribute means it is on absence means off and no other option. Releand with test fixes.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions