[llvm] Revert "[BOLT] Remove --allow-stripped option" (PR #93238)
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 23 14:04:56 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-bolt
Author: Amir Ayupov (aaupov)
<details>
<summary>Changes</summary>
This reverts commit ccabbfff86a00a0b211f5d0835916a1250ebcf0f.
Reintroduce allow-stripped as a fallback mechanism after enforcement of
HasSymbolsWithFileName was fixed in
https://github.com/llvm/llvm-project/pull/92625.
---
Full diff: https://github.com/llvm/llvm-project/pull/93238.diff
1 Files Affected:
- (modified) bolt/lib/Rewrite/RewriteInstance.cpp (+10-2)
``````````diff
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index 2816f669a149c..70831f4b3787c 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -105,6 +105,12 @@ cl::opt<std::string>
"output binary via bolt info section"),
cl::cat(BoltCategory));
+cl::opt<bool>
+AllowStripped("allow-stripped",
+ cl::desc("allow processing of stripped binaries"),
+ cl::Hidden,
+ cl::cat(BoltCategory));
+
cl::opt<bool> DumpDotAll(
"dump-dot-all",
cl::desc("dump function CFGs to graphviz format after each stage;"
@@ -3206,12 +3212,14 @@ void RewriteInstance::preprocessProfileData() {
if (Error E = ProfileReader->preprocessProfile(*BC.get()))
report_error("cannot pre-process profile", std::move(E));
- if (!BC->hasSymbolsWithFileName() && ProfileReader->hasLocalsWithFileName()) {
+ if (!BC->hasSymbolsWithFileName() && ProfileReader->hasLocalsWithFileName() &&
+ !opts::AllowStripped) {
BC->errs()
<< "BOLT-ERROR: input binary does not have local file symbols "
"but profile data includes function names with embedded file "
"names. It appears that the input binary was stripped while a "
- "profiled binary was not\n";
+ "profiled binary was not. If you know what you are doing and "
+ "wish to proceed, use -allow-stripped option.\n";
exit(1);
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/93238
More information about the llvm-commits
mailing list