Opened 6 years ago

Last modified 6 years ago

#55639 assigned defect

QtCore unusable with Apple LLVM version 9.0.0

Reported by: janstary (Jan Starý) Owned by: easieste@…
Priority: Normal Milestone:
Component: ports Version: 2.4.99
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), sami.laine@…
Port: bitcoin

Description

Building bitcoin +gui fails for me on 10.13.2 with XCode 9.2 The log (attached) says

:info:build /usr/bin/clang++ -std=c++11 -DHAVE_CONFIG_H -I. -I../src/config   -I. -I./obj -I/opt/local/include/db48/ -DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC -pthread -I/opt/local/include -I./leveldb/include -I./leveldb/helpers/memenv   -I./secp256k1/include -I./univalue/include -I./qt -I./qt -I./qt/forms -I./qt/forms -DQT_NO_KEYWORDS -I/opt/local/libexec/qt5/include/QtNetwork -I/opt/local/libexec/qt5/include -I/opt/local/libexec/qt5/include/QtWidgets -I/opt/local/libexec/qt5/include -I/opt/local/libexec/qt5/include/QtGui -I/opt/local/libexec/qt5/include -I/opt/local/libexec/qt5/include/QtCore -I/opt/local/libexec/qt5/include -D_THREAD_SAFE  -I/opt/local/include -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -isystem /opt/local/include -I/opt/local/include/db48 -DMAC_OSX  -Werror=vla  -pipe -Os -stdlib=libc++ -arch x86_64 -MT qt/qt_bitcoin_qt-bitcoin.o -MD -MP -MF qt/.deps/qt_bitcoin_qt-bitcoin.Tpo -c -o qt/qt_bitcoin_qt-bitcoin.o `test -f 'qt/bitcoin.cpp' || echo './'`qt/bitcoin.cpp
:info:build /opt/local/libexec/qt5/include/QtCore/qcompilerdetection.h:567:6: error: Qt requires a C++11 compiler and yours does not seem to be that.
:info:build #    error Qt requires a C++11 compiler and yours does not seem to be that.

Looking at QtCore/qcompilerdetection.h:

#ifdef __cplusplus
#  if __cplusplus < 201103L && !(defined(Q_CC_MSVC) && Q_CC_MSVC >= 1800)
#    error Qt requires a C++11 compiler and yours does not seem to be that.
#  endif
#endif

My compiler is

$ c++ -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

which is

$ clang++ -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

which is

$ g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

under whichever name.

I am putting 'bitcoin' as the port here, because that's where it bit me, but perhaps this is a QtCore bug, or something more general with compiler detection.

Attachments (1)

main.log (353.6 KB) - added by janstary (Jan Starý) 6 years ago.
the log log of the failed build

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by janstary (Jan Starý)

Attachment: main.log added

the log log of the failed build

comment:1 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: MarcusCalhoun-Lopez added

Marcus, any idea why Qt would be claiming that a recent clang is not C++11 capable?

comment:2 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: sami.laine@… added
Owner: set to easieste@…
Status: newassigned

comment:3 in reply to:  1 Changed 6 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to ryandesign:

Marcus, any idea why Qt would be claiming that a recent clang is not C++11 capable?

This does not seem to be a Qt issue.
The configure script for bitcoin adds -std=c++11 the the c++ compiler name (not the C++ compiler flags).
It then uses the same compiler name for both C++ and Objective-C++ but only if OBJCXX is undefined.
MacPorts, however defines OBJCXX.
In the configure.ac file, there is the following comment

dnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures                                                                                                                        
dnl that we get the same -std flags for both.

To make matters even stranger, the C++ and Objective-C++ flags are always the same.
In the configure.ac file:

OBJCXXFLAGS="$CXXFLAGS"

There seem to be two options:

  1. Do not define OBJCXX so that the configure script figures it out for itself: configure.objcxx
  2. Manually do what the configure script does: configure.objcxx-append -std=c++11

We could also modify configure.cxxflags, but this would mean -std=c++11 would be added twice for the C++ compiler.

comment:4 Changed 6 years ago by janstary (Jan Starý)

If the bitcoin ./configure adds `-std=c++11 to the compiler _name_, as opposed to the flags, it's an upstream bug I believe.

Last edited 6 years ago by janstary (Jan Starý) (previous) (diff)

comment:5 Changed 6 years ago by janstary (Jan Starý)

Last edited 6 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:6 Changed 6 years ago by Miguel Herranz <miguel@…>

In 73b282ec9ad664c97b6ea08a4e67ca8d9ab3fc63/macports-ports:

bitcoin: update to 0.16.0, fix issue

  • Update to version 0.16.0
  • Fix GUI build, #55639
Note: See TracTickets for help on using tickets.