[llvm] [BOLT] Fix test with -DCLANG_DEFAULT_PIE_ON_LINUX=OFF (PR #185047)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 6 08:59:12 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-bolt

Author: Nikita Popov (nikic)

<details>
<summary>Changes</summary>

Explicitly pass `-fPIC -pie` to ensure the test behavior is the same regardless of cmake configuration. We do similar in many other BOLT tests.

---
Full diff: https://github.com/llvm/llvm-project/pull/185047.diff


1 Files Affected:

- (modified) bolt/test/max-funcs.test (+1-1) 


``````````diff
diff --git a/bolt/test/max-funcs.test b/bolt/test/max-funcs.test
index c7cd7be12476f..c7fc985c1c9a2 100644
--- a/bolt/test/max-funcs.test
+++ b/bolt/test/max-funcs.test
@@ -3,7 +3,7 @@
 
 REQUIRES: system-linux
 
-RUN: %clangxx %p/Inputs/bolt_icf.cpp -g -Wl,-q -o %t.exe
+RUN: %clangxx %p/Inputs/bolt_icf.cpp -g -Wl,-q -fPIC -pie -o %t.exe
 RUN: llvm-bolt %t.exe --relocs -o %t --max-funcs=2
 RUN: llvm-objdump -d -j .text %t | FileCheck %s
 

``````````

</details>


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


More information about the llvm-commits mailing list