Skip to content

Commit 99c6fcd

Browse files
committed
configure.ac: don't unset LDFLAGS
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 1645041 The 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<lib dir> if you have libraries in a nonstandard directory <lib dir>" 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 the `LIBS` variable had already been copied to `EXTRA_LIBS`. Same for the last `unset LIBS LDFLAGS` command in line 1374: prior to that, `LDFLAGS` had already been copied to `EXTRA_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"`.
1 parent 002f762 commit 99c6fcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ if test "$ac_cv_lib_crypt_crypt" = "yes"; then
11761176
EXTRA_LIBS="-lcrypt $EXTRA_LIBS -lcrypt"
11771177
fi
11781178

1179-
unset LIBS LDFLAGS
1179+
unset LIBS
11801180

11811181
dnl PEAR
11821182
dnl ----------------------------------------------------------------------------
@@ -1324,7 +1324,7 @@ if test "$abs_srcdir" != "$abs_builddir"; then
13241324
fi
13251325

13261326
ZEND_EXTRA_LIBS="$LIBS"
1327-
unset LIBS LDFLAGS
1327+
unset LIBS
13281328

13291329
PHP_HELP_SEPARATOR([TSRM:])
13301330
PHP_CONFIGURE_PART(Configuring TSRM)

0 commit comments

Comments
 (0)