Repository navigation
don't explicitly --enable-pic for ZTS - #1692
Merged
Merged
Conversation
tianon
reviewed
Oct 12, 2026
Comment on lines
+382
to
385
| {{ ) else ( -}} | ||
| # Forcing PIC also removes -fpie from executable objects, preventing local-exec TLS. | ||
| # So do not --enable-pic | ||
| {{ ) end -}} |
Member
There was a problem hiding this comment.
You put some good detail in this PR description so I think we should link to it, and I think we can go a little bit tighter on the note:
Suggested change
| {{ ) else ( -}} | |
| # Forcing PIC also removes -fpie from executable objects, preventing local-exec TLS. | |
| # So do not --enable-pic | |
| {{ ) end -}} | |
| {{ ) else ( -}} | |
| # no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 | |
| {{ ) end -}} |
Contributor
Author
There was a problem hiding this comment.
I've applied the suggestion and updated the PR comment.
I will also upstream a fix to libtool, but it won't land in php 8.6.
Co-authored-by: Tianon Gravi <admwiggin@gmail.com>
tianon
approved these changes
Oct 12, 2026
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.
When libtool sees --enable-pic, it goes through flags, adds -fpic if not supplied and removes -fpie from cflags, putting it in pie_flags instead, which aren't passed to the compilation. This results in
__PIC__being defined but__PIE__undefined, causing initial-exec to be selected instead of local-exec. Every tls variable access requires 2 instructions instead of one.When not passing
--enable-pic, our cflags which contain-fpic fpieanyways are honoured and php selects local-exec.