@@ -341,10 +341,10 @@ dnl
341
341
dnl LDFLAG_WERROR Should only be used when testing -Wl,*
342
342
case $host in
343
343
*darwin*)
344
- AX_CHECK_LINK_FLAG ( [ -Wl,-fatal_warnings] ,[ LDFLAG_WERROR="-Wl,-fatal_warnings"] ,[ LDFLAG_WERROR=""] )
344
+ AX_CHECK_LINK_FLAG ( [ -Wl,-fatal_warnings] , [ LDFLAG_WERROR="-Wl,-fatal_warnings"] , [ LDFLAG_WERROR=""] )
345
345
;;
346
346
*)
347
- AX_CHECK_LINK_FLAG ( [ -Wl,--fatal-warnings] ,[ LDFLAG_WERROR="-Wl,--fatal-warnings"] ,[ LDFLAG_WERROR=""] )
347
+ AX_CHECK_LINK_FLAG ( [ -Wl,--fatal-warnings] , [ LDFLAG_WERROR="-Wl,--fatal-warnings"] , [ LDFLAG_WERROR=""] )
348
348
;;
349
349
esac
350
350
@@ -385,8 +385,8 @@ if test x$use_sanitizers != x; then
385
385
dnl the sanitize flags are supported by the compiler but the actual sanitizer
386
386
dnl libs are missing.
387
387
AX_CHECK_LINK_FLAG (
388
- [ [ -fsanitize=$use_sanitizers] ] ,
389
- [ [ SANITIZER_LDFLAGS=-fsanitize=$use_sanitizers] ] ,
388
+ [ -fsanitize=$use_sanitizers] ,
389
+ [ SANITIZER_LDFLAGS=" -fsanitize=$use_sanitizers" ] ,
390
390
[ AC_MSG_ERROR ( [ linker did not accept requested flags, you are missing required libraries] ) ] ,
391
391
[ ] ,
392
392
[ AC_LANG_PROGRAM ( [ [
@@ -645,7 +645,7 @@ case $host in
645
645
646
646
dnl -static is interpreted by libtool, where it has a different meaning.
647
647
dnl In libtool-speak, it's -all-static.
648
- AX_CHECK_LINK_FLAG ( [ [ -static] ] , [ LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"] )
648
+ AX_CHECK_LINK_FLAG ( [ -static] , [ LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"] )
649
649
650
650
AC_PATH_PROG ( [ MAKENSIS] , [ makensis] , none )
651
651
if test x$MAKENSIS = xnone; then
@@ -668,7 +668,7 @@ case $host in
668
668
postdeps_CXX=
669
669
670
670
dnl We require Windows 7 (NT 6.1) or later
671
- AX_CHECK_LINK_FLAG ( [ [ -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1] ] , [ LDFLAGS="$LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"] ,, [ [ $LDFLAG_WERROR] ] )
671
+ AX_CHECK_LINK_FLAG ( [ -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1] , [ LDFLAGS="$LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"] , [ ] , [ $LDFLAG_WERROR] )
672
672
;;
673
673
*darwin*)
674
674
TARGET_OS=darwin
@@ -749,7 +749,7 @@ case $host in
749
749
esac
750
750
fi
751
751
752
- AX_CHECK_LINK_FLAG ( [ [ -Wl,-headerpad_max_install_names] ] , [ LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"] ,, [ [ $LDFLAG_WERROR] ] )
752
+ AX_CHECK_LINK_FLAG ( [ -Wl,-headerpad_max_install_names] , [ LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"] , [ ] , [ $LDFLAG_WERROR] )
753
753
CPPFLAGS="$CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0"
754
754
OBJCXXFLAGS="$CXXFLAGS"
755
755
;;
@@ -816,7 +816,7 @@ if test x$use_lcov = xyes; then
816
816
AC_SUBST ( COV_TOOL_WRAPPER , "cov_tool_wrapper.sh" )
817
817
LCOV="$LCOV --gcov-tool $(pwd)/$COV_TOOL_WRAPPER"
818
818
819
- AX_CHECK_LINK_FLAG ( [ [ --coverage] ] , [ LDFLAGS="$LDFLAGS --coverage"] ,
819
+ AX_CHECK_LINK_FLAG ( [ --coverage] , [ LDFLAGS="$LDFLAGS --coverage"] ,
820
820
[ AC_MSG_ERROR ( "lcov testing requested but -- coverage linker flag does not work" ) ] )
821
821
AX_CHECK_COMPILE_FLAG ( [ --coverage] ,[ CXXFLAGS="$CXXFLAGS --coverage"] ,
822
822
[ AC_MSG_ERROR ( "lcov testing requested but -- coverage flag does not work" ) ] )
@@ -869,9 +869,9 @@ if test "x$enable_gprof" = xyes; then
869
869
AX_CHECK_COMPILE_FLAG ( [ -pg] ,[ GPROF_CXXFLAGS="-pg"] ,
870
870
[ AC_MSG_ERROR ( gprof profiling requested but not available ) ] , [ [ $CXXFLAG_WERROR] ] )
871
871
872
- AX_CHECK_LINK_FLAG ( [ [ -no-pie] ] , [ GPROF_LDFLAGS="-no-pie"] )
873
- AX_CHECK_LINK_FLAG ( [ [ -pg] ] , [ GPROF_LDFLAGS="$GPROF_LDFLAGS -pg"] ,
874
- [ AC_MSG_ERROR ( gprof profiling requested but not available ) ] , [ [ $GPROF_LDFLAGS] ] )
872
+ AX_CHECK_LINK_FLAG ( [ -no-pie] , [ GPROF_LDFLAGS="-no-pie"] )
873
+ AX_CHECK_LINK_FLAG ( [ -pg] , [ GPROF_LDFLAGS="$GPROF_LDFLAGS -pg"] ,
874
+ [ AC_MSG_ERROR ( gprof profiling requested but not available ) ] , [ $GPROF_LDFLAGS] )
875
875
fi
876
876
877
877
if test x$TARGET_OS != xwindows; then
@@ -891,7 +891,7 @@ if test x$use_hardening != xno; then
891
891
dnl -fcf-protection used with Clang 7 causes ld to emit warnings:
892
892
dnl ld: error: ... <corrupt x86 feature size: 0x8>
893
893
dnl Use CHECK_LINK_FLAG & --fatal-warnings to ensure we won't use the flag in this case.
894
- AX_CHECK_LINK_FLAG ( [ -fcf-protection=full] ,[ HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fcf-protection=full"] ,, [ [ $LDFLAG_WERROR] ] )
894
+ AX_CHECK_LINK_FLAG ( [ -fcf-protection=full] , [ HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fcf-protection=full"] , [ ] , [ $LDFLAG_WERROR] )
895
895
896
896
case $host in
897
897
*mingw*)
@@ -916,14 +916,14 @@ if test x$use_hardening != xno; then
916
916
] )
917
917
fi
918
918
919
- AX_CHECK_LINK_FLAG ( [ [ -Wl,--enable-reloc-section] ] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--enable-reloc-section"] ,, [ [ $LDFLAG_WERROR] ] )
920
- AX_CHECK_LINK_FLAG ( [ [ -Wl,--dynamicbase] ] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"] ,, [ [ $LDFLAG_WERROR] ] )
921
- AX_CHECK_LINK_FLAG ( [ [ -Wl,--nxcompat] ] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"] ,, [ [ $LDFLAG_WERROR] ] )
922
- AX_CHECK_LINK_FLAG ( [ [ -Wl,--high-entropy-va] ] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--high-entropy-va"] ,, [ [ $LDFLAG_WERROR] ] )
923
- AX_CHECK_LINK_FLAG ( [ [ -Wl,-z,relro] ] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"] ,, [ [ $LDFLAG_WERROR] ] )
924
- AX_CHECK_LINK_FLAG ( [ [ -Wl,-z,now] ] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"] ,, [ [ $LDFLAG_WERROR] ] )
925
- AX_CHECK_LINK_FLAG ( [ [ -Wl,-z,separate-code] ] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,separate-code"] ,, [ [ $LDFLAG_WERROR] ] )
926
- AX_CHECK_LINK_FLAG ( [ [ -fPIE -pie] ] , [ PIE_FLAGS="-fPIE"; HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"] ,, [ [ $CXXFLAG_WERROR] ] )
919
+ AX_CHECK_LINK_FLAG ( [ -Wl,--enable-reloc-section] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--enable-reloc-section"] , [ ] , [ $LDFLAG_WERROR] )
920
+ AX_CHECK_LINK_FLAG ( [ -Wl,--dynamicbase] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"] , [ ] , [ $LDFLAG_WERROR] )
921
+ AX_CHECK_LINK_FLAG ( [ -Wl,--nxcompat] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"] , [ ] , [ $LDFLAG_WERROR] )
922
+ AX_CHECK_LINK_FLAG ( [ -Wl,--high-entropy-va] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--high-entropy-va"] , [ ] , [ $LDFLAG_WERROR] )
923
+ AX_CHECK_LINK_FLAG ( [ -Wl,-z,relro] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"] , [ ] , [ $LDFLAG_WERROR] )
924
+ AX_CHECK_LINK_FLAG ( [ -Wl,-z,now] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"] , [ ] , [ $LDFLAG_WERROR] )
925
+ AX_CHECK_LINK_FLAG ( [ -Wl,-z,separate-code] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,separate-code"] , [ ] , [ $LDFLAG_WERROR] )
926
+ AX_CHECK_LINK_FLAG ( [ -fPIE -pie] , [ PIE_FLAGS="-fPIE"; HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"] , [ ] , [ $CXXFLAG_WERROR] )
927
927
928
928
case $host in
929
929
*mingw*)
@@ -936,9 +936,9 @@ dnl These flags are specific to ld64, and may cause issues with other linkers.
936
936
dnl For example: GNU ld will interpret -dead_strip as -de and then try and use
937
937
dnl "ad_strip" as the symbol for the entry point.
938
938
if test x$TARGET_OS = xdarwin; then
939
- AX_CHECK_LINK_FLAG ( [ [ -Wl,-dead_strip] ] , [ LDFLAGS="$LDFLAGS -Wl,-dead_strip"] ,, [ [ $LDFLAG_WERROR] ] )
940
- AX_CHECK_LINK_FLAG ( [ [ -Wl,-dead_strip_dylibs] ] , [ LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"] ,, [ [ $LDFLAG_WERROR] ] )
941
- AX_CHECK_LINK_FLAG ( [ [ -Wl,-bind_at_load] ] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-bind_at_load"] ,, [ [ $LDFLAG_WERROR] ] )
939
+ AX_CHECK_LINK_FLAG ( [ -Wl,-dead_strip] , [ LDFLAGS="$LDFLAGS -Wl,-dead_strip"] , [ ] , [ $LDFLAG_WERROR] )
940
+ AX_CHECK_LINK_FLAG ( [ -Wl,-dead_strip_dylibs] , [ LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"] , [ ] , [ $LDFLAG_WERROR] )
941
+ AX_CHECK_LINK_FLAG ( [ -Wl,-bind_at_load] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-bind_at_load"] , [ ] , [ $LDFLAG_WERROR] )
942
942
fi
943
943
944
944
AC_CHECK_HEADERS ( [ endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h] )
@@ -1274,10 +1274,9 @@ if test "x$enable_fuzz" = "xyes"; then
1274
1274
1275
1275
AC_MSG_CHECKING ( [ whether main function is needed for fuzz binary] )
1276
1276
AX_CHECK_LINK_FLAG (
1277
- [ [ -fsanitize=$use_sanitizers] ] ,
1277
+ [ -fsanitize=$use_sanitizers] ,
1278
1278
[ AC_MSG_RESULT ( [ no] ) ] ,
1279
- [ AC_MSG_RESULT ( [ yes] )
1280
- CPPFLAGS="$CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"] ,
1279
+ [ AC_MSG_RESULT ( [ yes] ) ; CPPFLAGS="$CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"] ,
1281
1280
[ ] ,
1282
1281
[ AC_LANG_PROGRAM ( [ [
1283
1282
#include <cstdint>
@@ -1452,7 +1451,7 @@ dnl Check for reduced exports
1452
1451
if test x$use_reduce_exports = xyes; then
1453
1452
AX_CHECK_COMPILE_FLAG ( [ -fvisibility=hidden] ,[ CXXFLAGS="$CXXFLAGS -fvisibility=hidden"] ,
1454
1453
[ AC_MSG_ERROR ( [ Cannot set hidden symbol visibility. Use --disable-reduce-exports.] ) ] ,[ [ $CXXFLAG_WERROR] ] )
1455
- AX_CHECK_LINK_FLAG ( [ [ -Wl,--exclude-libs,ALL] ] , [ RELDFLAGS="-Wl,--exclude-libs,ALL"] ,, [ [ $LDFLAG_WERROR] ] )
1454
+ AX_CHECK_LINK_FLAG ( [ -Wl,--exclude-libs,ALL] , [ RELDFLAGS="-Wl,--exclude-libs,ALL"] , [ ] , [ $LDFLAG_WERROR] )
1456
1455
fi
1457
1456
1458
1457
if test x$use_tests = xyes; then
0 commit comments