From 809f2473c2c3b653ff9b3a3961135a554948d7fb Mon Sep 17 00:00:00 2001 From: Christoph Biedl Date: Fri, 22 Jan 2021 11:50:32 +0100 Subject: [PATCH] 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 --- configure.ac | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/configure.ac b/configure.ac index e5bf1bc1a..9a14c4e28 100644 --- a/configure.ac +++ b/configure.ac @@ -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