Skip to content

🍒 llvm: Use add_link_options for stack size flags#12896

Open
Steelskin wants to merge 1 commit intoswiftlang:stable/21.xfrom
Steelskin:fabrice/cp-add-link-options-stack-size-flags
Open

🍒 llvm: Use add_link_options for stack size flags#12896
Steelskin wants to merge 1 commit intoswiftlang:stable/21.xfrom
Steelskin:fabrice/cp-add-link-options-stack-size-flags

Conversation

@Steelskin
Copy link
Copy Markdown

Previously, LLVM was directly editing CMAKE_EXE_LINKER_FLAGS. This is a user-facing CMake cache variable not meant to be modified by project code. This was causing issues for downstream consumers building non-C/C++ targets as part of the LLVM build.

Modern CMake provides add_link_options(), a cleaner way to set linker flags that propagate to every target in a directory tree.

Generator expressions and the LINKER: prefix syntax ensure that this is only applied to executable targets with the proper language and linker argument wrapping.

Cherry-pick of llvm/llvm-project@4354248d10 (llvm#195034)

Previously, LLVM was directly editing `CMAKE_EXE_LINKER_FLAGS`. This is
a user-facing CMake cache variable not meant to be modified by project
code. This was causing issues for downstream consumers building
non-C/C++ targets as part of the LLVM build.

Modern CMake provides `add_link_options()`, a cleaner way to set linker
flags that propagate to every target in a directory tree.

Generator expressions and the `LINKER:` prefix syntax ensure that this
is only applied to executable targets with the proper language and
linker argument wrapping.

Cherry-pick of llvm/llvm-project@4354248d10 (llvm#195034)
@Steelskin Steelskin requested a review from a team as a code owner May 5, 2026 09:31
@Steelskin
Copy link
Copy Markdown
Author

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant