Skip to content

Commit

Permalink
Remove ability to override $LD.
Browse files Browse the repository at this point in the history
Since autoconf always uses $CC to link C programs, allowing users to
override LD caused mismatches between what LD_LINK_IFELSE thought worked
and what ld thought worked.  If you do need to do this kind of thing you
need to set a compiler flag such as gcc's -fuse-ld in LDFLAGS.
  • Loading branch information
daztucker committed Jun 8, 2018
1 parent e1542a8 commit f2c06ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ If you need to pass special options to the compiler or linker, you
can specify these as environment variables before running ./configure.
For example:

CFLAGS="-O -m486" LDFLAGS="-s" LIBS="-lrubbish" LD="/usr/foo/ld" ./configure
CC="/usr/foo/cc" CFLAGS="-O" LDFLAGS="-s" LIBS="-lrubbish" ./configure

3. Configuration
----------------
Expand Down
9 changes: 5 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ if test ! -z "$PATH_PASSWD_PROG" ; then
[Full path of your "passwd" program])
fi

if test -z "$LD" ; then
LD=$CC
fi
dnl Since autoconf doesn't support it very well, we no longer allow users to
dnl override LD, however keeping the hook here for now in case there's a use
dnl use case we overlooked and someone needs to re-enable it. Unless a good
dnl reason is found we'll be removing this in future.
LD="$CC"
AC_SUBST([LD])

AC_C_INLINE
Expand Down Expand Up @@ -526,7 +528,6 @@ case "$host" in
[ AC_MSG_RESULT([yes]) ],
[ AC_MSG_RESULT([no])
CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`"
LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`"
CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`"
CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`"
]
Expand Down

0 comments on commit f2c06ab

Please sign in to comment.