[cpullvm] Build some aarch64 configs using initial exec TLS model#228
Closed
Jonathon Penix (jonathonpenix) wants to merge 1 commit into
Closed
Conversation
local-exec is the default TLS model in picolibc when thread-local-storage is configured. However, we have a few cases where local-exec cannot be used, so change the configs used in those cases to be initial-exec. This adds a new `TLS_MODEL` variable to control this. There's a few things to note here: 1. This is intentionally done without multilib support for now as we don't want to be shipping separate per-TLS-model configs right now. 2. Ideally we'd use a consistent TLS model across most/all aarch64 configs (or all configs in general) but a) we're missing some TLS model optimizations in the linker (initial-exec to local-exec when the pre-requisites are met, etc.) and b) we've recently had some correctness issues pop up when testing initial-exec configs. So limit this to only the configs where we know we need this. 3. The TLS_MODEL option is only handled by picolibc. Other projects (compiler-rt, libc++) don't force this in a way that causes issues (or, generally don't seem to use TLS for the things we're building). So, leave those projects alone for now and address only picolibc. This should be easy to extend if we find out those projects need this set as well. Signed-off-by: Jonathon Penix <jpenix@qti.qualcomm.com>
| --buildtype=${LIBRARY_MESON_BUILD_TYPE} | ||
| -Dsingle-thread=${single_thread} | ||
| -Dthread-local-storage=${thread_local_storage} | ||
| -Dtls-model=${TLS_MODEL} |
Contributor
Author
There was a problem hiding this comment.
Just a side note: tls-model is and is documented in picolibc to be a no-op when thread-local-storage is not selected.
pzhengqc
added a commit
to pzhengqc/cpullvm-toolchain
that referenced
this pull request
Mar 5, 2026
This patch borrowed the `TLS_MODEL` variable Jonathon implemented in qualcomm#228. This also needs clang support to allow multilib selection based on `-ftls-model` (qualcomm#241). Signed-off-by: Pengxuan Zheng <pzheng@qti.qualcomm.com>
pzhengqc
added a commit
to pzhengqc/cpullvm-toolchain
that referenced
this pull request
Mar 6, 2026
This patch borrowed the `TLS_MODEL` variable Jonathon implemented in qualcomm#228. Signed-off-by: Pengxuan Zheng <pzheng@qti.qualcomm.com>
Contributor
Author
|
Closing in favor of #242 |
pzhengqc
added a commit
to pzhengqc/cpullvm-toolchain
that referenced
this pull request
Mar 6, 2026
This patch borrowed the `TLS_MODEL` variable Jonathon implemented in qualcomm#228. Signed-off-by: Pengxuan Zheng <pzheng@qti.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
local-exec is the default TLS model in picolibc when thread-local-storage is configured. However, we have a few cases where local-exec cannot be used, so change the configs used in those cases to be initial-exec.
This adds a new
TLS_MODELvariable to control this.There's a few things to note here: