Set -fcommon compile option

--
In gcc 10, the default was changed to -fno-common, triggering linker
errors since the code indeed uses extern declarations in such a way.

Turns out fixing these isn't easy, so rather just restore the previous
behaviour.

GnuPG-bug-id: 5215
Signed-off-by: Christoph Biedl <cb@gnupg.org>
This commit is contained in:
Christoph Biedl 2021-01-22 11:50:32 +01:00
parent c8ad567e7c
commit 809f2473c2
1 changed files with 14 additions and 0 deletions

View File

@ -1439,6 +1439,20 @@ if test "$GCC" = yes; then
if test x"$_gcc_psign" = xyes ; then
CFLAGS="$CFLAGS -Wno-pointer-sign"
fi
AC_MSG_CHECKING([if gcc supports -fcommon])
_gcc_cflags_save=$CFLAGS
CFLAGS="-fcommon"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],_gcc_fcommon=yes,_gcc_fcommon=no)
AC_MSG_RESULT($_gcc_fcommon)
CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_fcommon" = xyes ; then
CFLAGS="$CFLAGS -fcommon"
fi
fi
CL_AS_NOEXECSTACK