configure.ac: don't unset LDFLAGS
#10678
Closed
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.
The
LDFLAGS
variable was initially cleared by commit c4d84aa in 2009, and reverted in commit 21a6e1f later that year, but the revert was reverted one day later in commit 937358e; the edit war continued another day later with another revert by commit 477649c, but was reverted again on the same day by commit 1645041The reverts (don't clear) were documented:
"unsetting LIBS and LDFLAGS just makes it impossible to specify
LDFLAGS from the environment"
... but none of the "unset LDFLAGS" commits had any explanation in the commit message.
Clearing
LDFLAGS
obviously breaks a feature that is documented by./configure --help
:"Some influential environment variables:
[...]
LDFLAGS linker flags, e.g. -L if you have libraries in a
nonstandard directory "
This feature is used by several CI scripts, e.g.
.cirrus.yml
,.github/actions/configure-x32/action.yml
and.github/nightly_matrix.php
- but there, it didn't ever work. Apparently, nobody ever noticed this.Unlike the other reverts, this patch keeps the
unset LIBS
, because theLIBS
variable had already been copied toEXTRA_LIBS
. Same for the lastunset LIBS LDFLAGS
command in line 1374: prior to that,LDFLAGS
had already been copied toEXTRA_LDFLAGS
. Maybe that's enough to keep people from revert it again and again?With this patch, I can use the
mold
linker for the first time by simply doing./configure .... LDFLAGS="-fuse-ld=mold"
.(php-internals thread: https://news-web.php.net/php.internals/119593)