diff options
author | Fangrui Song <i@maskray.me> | 2022-12-22 12:32:59 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-22 12:32:59 -0800 |
commit | 69243cdb926b1057c54522df305ffc195b2863ec (patch) | |
tree | ee02576f1b5456ed6999fe10db315a78b2ebfc0e /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 23bc8f730d99960c93946286f03d97d2fc54e8fe (diff) | |
download | llvm-69243cdb926b1057c54522df305ffc195b2863ec.zip llvm-69243cdb926b1057c54522df305ffc195b2863ec.tar.gz llvm-69243cdb926b1057c54522df305ffc195b2863ec.tar.bz2 |
Remove incorrectly implemented -mibt-seal
The option from D116070 does not work as intended and will not be needed when
hidden visibility is used. A function needs ENDBR if it may be reached
indirectly. If we make ThinLTO combine the address-taken property (close to
`!GV.use_empty() && !GV.hasAtLeastLocalUnnamedAddr()`), then the condition can
be expressed with:
`AddressTaken || (!F.hasLocalLinkage() && (VisibleToRegularObj || !F.hasHiddenVisibility()))`
The current `F.hasAddressTaken()` condition does not take into acount of
address-significance in another bitcode file or ELF relocatable file.
For the Linux kernel, it uses relocatable linking. lld/ELF uses a
conservative approach by setting all `VisibleToRegularObj` to true.
Using the non-relocatable semantics may under-estimate
`VisibleToRegularObj`. As @pcc mentioned on
https://github.com/ClangBuiltLinux/linux/issues/1737#issuecomment-1343414686
, we probably need a symbol list to supply additional
`VisibleToRegularObj` symbols (not part of the relocatable LTO link).
Reviewed By: samitolvanen
Differential Revision: https://reviews.llvm.org/D140363
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index d89a80e..1cabf28 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1495,9 +1495,6 @@ void CompilerInvocation::GenerateCodeGenArgs( else if (Opts.CFProtectionBranch) GenerateArg(Args, OPT_fcf_protection_EQ, "branch", SA); - if (Opts.IBTSeal) - GenerateArg(Args, OPT_mibt_seal, SA); - if (Opts.FunctionReturnThunks) GenerateArg(Args, OPT_mfunction_return_EQ, "thunk-extern", SA); @@ -1857,9 +1854,6 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.FunctionReturnThunks = static_cast<unsigned>(Val); } - if (Opts.PrepareForLTO && Args.hasArg(OPT_mibt_seal)) - Opts.IBTSeal = 1; - for (auto *A : Args.filtered(OPT_mlink_bitcode_file, OPT_mlink_builtin_bitcode)) { CodeGenOptions::BitcodeFileToLink F; |