Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: Xcode 9.3 build warnings #12867

Closed
fanquake opened this issue Apr 3, 2018 · 2 comments
Closed

macOS: Xcode 9.3 build warnings #12867

fanquake opened this issue Apr 3, 2018 · 2 comments

Comments

@fanquake
Copy link
Member

fanquake commented Apr 3, 2018

Building master (c564424), these warnings are new as of macOS 10.13.4 and Xcode 9.3:

  OBJCXX   qt/bitcoin_qt-macdockiconhandler.o
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  OBJCXX   qt/bitcoin_qt-macnotificationhandler.o
...
  CXXLD    bitcoind
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CXXLD    test/test_bitcoin
  CXXLD    bench/bench_bitcoin
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  AR       qt/libbitcoinqt.a
  OBJCXXLD qt/bitcoin-qt
  CXXLD    qt/test/test_bitcoin-qt
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
@fanquake fanquake added the macOS label Apr 3, 2018
@maflcko maflcko added this to the 0.17.0 milestone Apr 3, 2018
@AkioNak
Copy link
Contributor

AkioNak commented Apr 3, 2018

The same warning was output in my environment (master ad960f5/macos 10.13.4/clang-902.0.39.1)
So, I tried to pass "-Wl, -pie" instead of "-pie" via $HARDENED_LDFLAGS,then the clang warning disappeared, but one new warning occurred in ld.

....
  CXXLD    libbitcoinconsensus.la
ld: warning: -pie being ignored. It is only used when linking a main executable
  AR       libbitcoin_server.a
...

AkioNak added a commit to AkioNak/bitcoin that referenced this issue Apr 13, 2018
This PR solves bitcoin#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.
jonasschnelli added a commit that referenced this issue Apr 17, 2018
2eb5036 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
jonasschnelli pushed a commit to jonasschnelli/bitcoin that referenced this issue Apr 17, 2018
This PR solves bitcoin#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.
@fanquake
Copy link
Member Author

Fixed by #12899.

stamhe pushed a commit to stamhe/bitcoin that referenced this issue Jun 27, 2018
This PR solves bitcoin#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.
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this issue Sep 5, 2018
This PR solves bitcoin#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.
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jun 17, 2020
2eb5036 macOS: Prevent Xcode 9.3 build warnings (Akio Nakamura)

Pull request description:

  This PR intends to solve bitcoin#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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jun 27, 2020
2eb5036 macOS: Prevent Xcode 9.3 build warnings (Akio Nakamura)

Pull request description:

  This PR intends to solve bitcoin#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
gades pushed a commit to cosanta/cosanta-core that referenced this issue Jun 26, 2021
2eb5036 macOS: Prevent Xcode 9.3 build warnings (Akio Nakamura)

Pull request description:

  This PR intends to solve bitcoin#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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants