Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMake][Release] Enable CMAKE_POSITION_INDEPENDENT_CODE #90139

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

tstellar
Copy link
Collaborator

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.

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.
@tstellar tstellar requested a review from tru April 25, 2024 22:35
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 25, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 25, 2024

@llvm/pr-subscribers-clang

Author: Tom Stellard (tstellar)

Changes

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.


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

2 Files Affected:

  • (modified) clang/cmake/caches/Release.cmake (+1)
  • (modified) llvm/utils/release/test-release.sh (+1-2)
diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake
index c164d5497275f3..c0bfcbdfc1c2ae 100644
--- a/clang/cmake/caches/Release.cmake
+++ b/clang/cmake/caches/Release.cmake
@@ -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)
diff --git a/llvm/utils/release/test-release.sh b/llvm/utils/release/test-release.sh
index 4314b565e11b03..050004aa08c493 100755
--- a/llvm/utils/release/test-release.sh
+++ b/llvm/utils/release/test-release.sh
@@ -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

@tstellar tstellar merged commit 53ff002 into llvm:main Apr 27, 2024
5 of 6 checks passed
@tstellar tstellar added this to the LLVM 18.X Release milestone Apr 27, 2024
@tstellar
Copy link
Collaborator Author

/cherry-pick 53ff002

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 27, 2024

Failed to cherry-pick: 53ff002

https://github.com/llvm/llvm-project/actions/runs/8863031679

Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request

tstellar added a commit to tstellar/llvm-project that referenced this pull request May 4, 2024
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 53ff002)
tstellar added a commit to tstellar/llvm-project that referenced this pull request May 9, 2024
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 53ff002)
@tstellar
Copy link
Collaborator Author

tstellar commented May 11, 2024

This was backported to the release branch: b7e2397.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category release:cherry-pick-failed
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants