Skip to content

Commit 2eb5036

Browse files
committed
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.
1 parent 8480d41 commit 2eb5036

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

configure.ac

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,11 +630,7 @@ if test x$use_hardening != xno; then
630630
AX_CHECK_LINK_FLAG([[-Wl,--high-entropy-va]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--high-entropy-va"])
631631
AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"])
632632
AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"])
633-
634-
if test x$TARGET_OS != xwindows; then
635-
AX_CHECK_COMPILE_FLAG([-fPIE],[PIE_FLAGS="-fPIE"])
636-
AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"])
637-
fi
633+
AX_CHECK_LINK_FLAG([[-fPIE -pie]], [PIE_FLAGS="-fPIE"; HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"],, [[$CXXFLAG_WERROR]])
638634

639635
case $host in
640636
*mingw*)

0 commit comments

Comments
 (0)