From 2eb5036c330fcc4fc115fe378b8211fd14711195 Mon Sep 17 00:00:00 2001 From: Akio Nakamura Date: Thu, 5 Apr 2018 18:41:46 +0900 Subject: [PATCH] macOS: Prevent Xcode 9.3 build warnings This PR solves #12867 (needs to run autogen.sh && ./configure) clang (Apple LLVM version 9.1.0 (clang-902.0.39.1)) warns unused argument '-pie' during compilation. So we check for warnings in the test using $CXXFLAG_WERROR. Windows is alse default-pie and was special-cased because it also warned, but we can also eliminate that case if warnings are caught. --- configure.ac | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index b38e480f27..c4bc061d74 100644 --- a/configure.ac +++ b/configure.ac @@ -630,11 +630,7 @@ if test x$use_hardening != xno; then AX_CHECK_LINK_FLAG([[-Wl,--high-entropy-va]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--high-entropy-va"]) AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"]) AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"]) - - if test x$TARGET_OS != xwindows; then - AX_CHECK_COMPILE_FLAG([-fPIE],[PIE_FLAGS="-fPIE"]) - AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"]) - fi + AX_CHECK_LINK_FLAG([[-fPIE -pie]], [PIE_FLAGS="-fPIE"; HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"],, [[$CXXFLAG_WERROR]]) case $host in *mingw*)