aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2018-04-17 10:58:22 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2018-04-17 10:58:42 +0200
commit307699304886ba5ab67487780463b238edabd744 (patch)
tree9133fc0657546c6a12927f6cd52fab9144812e35
parent07825088f9cfd8abece774b9d978c36ab90ce3d1 (diff)
parent2eb5036c330fcc4fc115fe378b8211fd14711195 (diff)
Merge #12899: macOS: Prevent Xcode 9.3 build warnings
2eb5036c3 macOS: Prevent Xcode 9.3 build warnings (Akio Nakamura) Pull request description: This PR intends to solve #12867 1. clang (Apple LLVM version 9.1.0 (clang-902.0.39.1)) warns unused argument '-pie' during compilation. This parameter should pass to the linker, so use '-Wl,-pie' style in configure.ac. 2. The other hand, when linking libbitcoinconsensus.la with passing '-Wl,-pie', ld warns that '-pie' being ignored because not link a main executable. So remove it from $libbitcoinconsensus_la_LDFLAGS in src/Makefile.am. - In order to apply this change to Makefile, you need to run autogen.sh and ./configure. - I think no need to add if-clause by target-os because also g++ can recognize/handle '-Wl,-pie'. - I confirmed that the build was successful on macos10.13.4/XCode9.3 and ubuntu 17.10/g++7.2.0 and that warning was not issued. Tree-SHA512: 45b7c3881f3ad92172eb2ff6fa90c4dc70a42037450ea4b6fd87613b10c0aa90ebcffd54e7c50b70ba876b7c2e356825950fbf5a7a4e8e25118688d98d7b6ee0
-rw-r--r--configure.ac6
1 files changed, 1 insertions, 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*)