Skip to content

Commit 53ff002

Browse files
authored
[CMake][Release] Enable CMAKE_POSITION_INDEPENDENT_CODE (#90139)
Set this in the cache file directly instead of via the test-release.sh script so that the release builds can be reproduced with just the cache file.
1 parent b4af01b commit 53ff002

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/cmake/caches/Release.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ set(LLVM_ENABLE_PROJECTS ${STAGE1_PROJECTS} CACHE STRING "")
8282
# stage2-instrumented and Final Stage Config:
8383
# Options that need to be set in both the instrumented stage (if we are doing
8484
# a pgo build) and the final stage.
85+
set_instrument_and_final_stage_var(CMAKE_POSITION_INDEPENDENT_CODE "ON" STRING)
8586
set_instrument_and_final_stage_var(LLVM_ENABLE_LTO "${LLVM_RELEASE_ENABLE_LTO}" STRING)
8687
if (LLVM_RELEASE_ENABLE_LTO)
8788
set_instrument_and_final_stage_var(LLVM_ENABLE_LLD "ON" BOOL)

llvm/utils/release/test-release.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,7 @@ function build_with_cmake_cache() {
353353
env CC="$c_compiler" CXX="$cxx_compiler" \
354354
cmake -G "$generator" -B $CMakeBuildDir -S $SrcDir/llvm \
355355
-C $SrcDir/clang/cmake/caches/Release.cmake \
356-
-DCLANG_BOOTSTRAP_PASSTHROUGH="CMAKE_POSITION_INDEPENDENT_CODE;LLVM_LIT_ARGS" \
357-
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
356+
-DCLANG_BOOTSTRAP_PASSTHROUGH="LLVM_LIT_ARGS" \
358357
-DLLVM_LIT_ARGS="-j $NumJobs $LitVerbose" \
359358
$ExtraConfigureFlags
360359
2>&1 | tee $LogDir/llvm.configure-$Flavor.log

0 commit comments

Comments
 (0)