[CMake][Release] Enable CMAKE_POSITION_INDEPENDENT_CODE (#90139)
authorTom Stellard <tstellar@redhat.com>
Sat, 27 Apr 2024 22:32:58 +0000 (15:32 -0700)
committerTom Stellard <tstellar@redhat.com>
Thu, 9 May 2024 02:47:50 +0000 (19:47 -0700)
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.

(cherry picked from commit 53ff002c6f7ec64a75ab0990b1314cc6b4bb67cf)

clang/cmake/caches/Release.cmake
llvm/utils/release/test-release.sh

index c164d5497275f39aad374dff0aa55bdcbc3dc2cf..c0bfcbdfc1c2ae6cb32edfcb26e376baa1dd2641 100644 (file)
@@ -82,6 +82,7 @@ set(LLVM_ENABLE_PROJECTS ${STAGE1_PROJECTS} CACHE STRING "")
 # stage2-instrumented and Final Stage Config:
 # Options that need to be set in both the instrumented stage (if we are doing
 # a pgo build) and the final stage.
+set_instrument_and_final_stage_var(CMAKE_POSITION_INDEPENDENT_CODE "ON" STRING)
 set_instrument_and_final_stage_var(LLVM_ENABLE_LTO "${LLVM_RELEASE_ENABLE_LTO}" STRING)
 if (LLVM_RELEASE_ENABLE_LTO)
   set_instrument_and_final_stage_var(LLVM_ENABLE_LLD "ON" BOOL)
index 4314b565e11b03b03c1dfab6189b9c8634d884fe..050004aa08c493eb4e27bbdb54e89671dc796f1f 100755 (executable)
@@ -353,8 +353,7 @@ function build_with_cmake_cache() {
   env CC="$c_compiler" CXX="$cxx_compiler" \
   cmake -G "$generator" -B $CMakeBuildDir -S $SrcDir/llvm \
         -C $SrcDir/clang/cmake/caches/Release.cmake \
-       -DCLANG_BOOTSTRAP_PASSTHROUGH="CMAKE_POSITION_INDEPENDENT_CODE;LLVM_LIT_ARGS" \
-        -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+       -DCLANG_BOOTSTRAP_PASSTHROUGH="LLVM_LIT_ARGS" \
         -DLLVM_LIT_ARGS="-j $NumJobs $LitVerbose" \
         $ExtraConfigureFlags
         2>&1 | tee $LogDir/llvm.configure-$Flavor.log