Skip to content

Commit

Permalink
configure.ac: use link instead of compile for gcc flags test
Browse files Browse the repository at this point in the history
The logic that tests whether gcc supports or not certain flags uses
AC_COMPILE_IFELSE(). However, when checking for stack smashing
protection support, an AC_LINK_IFELSE() test is needed, since the
build might work but not the link stage if certain libraries are
missing for proper stack smashing protection support.

Therefore, this commit switches to use AC_LINK_IFELSE().

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: James Knight <james.d.knight@live.com>
  • Loading branch information
tpetazzoni authored and jdknight committed Sep 13, 2016
1 parent 19dbaff commit b5f1895
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -43,7 +43,7 @@ if test "$GCC" = yes; then
echo
for flag in $cflags_to_try; do
CFLAGS="$CFLAGS $flag -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[
echo " $flag"
RPMCFLAGS="$RPMCFLAGS $flag"
],[])
Expand Down

0 comments on commit b5f1895

Please sign in to comment.