[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Autoconf protype breaks GCC builtin inlining
From: |
Jeffrey Walton |
Subject: |
Re: Autoconf protype breaks GCC builtin inlining |
Date: |
Thu, 25 Jan 2018 12:06:42 -0500 |
On Thu, Jan 25, 2018 at 11:47 AM, Ferenc Wágner <address@hidden> wrote:
> Zack Weinberg <address@hidden> writes:
>
>> ...
>>> You could try setting -Wl,--as-needed (which really should be the
>>> default) in your makefiles.
>>
>> That was unnecessarily cryptic, sorry.
>
> Nevermind, it was fine, I met --as-needed before, but I was somewhat
> wary about using it for no concrete reason (FUD).
>
>> The GNU linker accepts an option --as-needed
Testing for -Wl,--as-needed is like testing for other linker options
like -Wl,--exclude-libs,ALL. The extra gyrations below are due to
problems on AIX, OS X and Solaris. The tools report "illegal option"
or similar but Autotools does not detect the failure.
if test "$IS_APPLE_OS" -eq "0"; then
if test "$IS_SUN_OS" -eq "0"; then
if test "$IS_AIX_OS" -eq "0"; then
SAVED_LDFLAGS="$LDFLAGS"
LDFLAGS="-Wl,--as-needed"
AC_MSG_CHECKING([if $LDNAME supports $LDFLAGS])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes]); AC_SUBST([tr_RESULT], [1])],
[AC_MSG_RESULT([no]); AC_SUBST([tr_RESULT], [0])]
)
if test "$tr_RESULT" -eq "1"; then
AM_LDFLAGS="$AM_LDFLAGS $LDFLAGS"
fi
LDFLAGS="$SAVED_LDFLAGS"
fi
fi
fi