[llvm] [BOLT] Detect Linux kernel version if the binary is a Linux kernel (PR #119088)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 8 07:39:32 PST 2024


================
@@ -1205,6 +1225,9 @@ void RewriteInstance::discoverFileObjects() {
     PreviousFunction = BF;
   }
 
+  if (BC->IsLinuxKernel && !std::get<0>(BC->LinuxKernelVersion))
+    BC->errs() << "BOLT-WARNING: Linux kernel version is unknown\n";
----------------
FLZ101 wrote:

If BOLT errors out here, then all Linux kernel related tests need to specify a proper version.

It would be better to do that latter when functions like `readAltInstructions()` and `readStaticKeysJumpTable()` have been modified to utilize `LinuxKernelVersion` to handle differences between Linux kernel versions.

https://github.com/llvm/llvm-project/pull/119088


More information about the llvm-commits mailing list