#45307 closed defect (duplicate)
clang-3.4 not picking up C++11 headers on 10.6.8
Reported by: | RJVB (René Bertin) | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | jeremyhu (Jeremy Huddleston Sequoia), bitpup | |
Port: | clang-3.4 |
Description
Is this a known issue? When building the QtCurve 1.8.18 port, clang++-mp-3.4 -std=c++11
will pick up a version of #include <utility> that apparently does not define std::forward ... There *is* a utility header in llvm-3.4's install tree (in a "v1" subdirectory), but it's not being found.
In other words, macports-clang-3.4 cannot be used to build C++11 projects on OS X 10.6.8, not even with -std=c++0x. Apple's version, basically the same compiler, works fine for those projects on 10.9 .
Attachments (1)
Change History (12)
comment:1 Changed 10 years ago by RJVB (René Bertin)
Changed 10 years ago by RJVB (René Bertin)
example: full log of failed build of port:akonadi 1.13.0
comment:2 follow-up: 4 Changed 10 years ago by jmroot (Joshua Root)
There’s your problem:
CXXFLAGS='-Os -arch x86_64 -stdlib=libstdc++’
You need -stdlib=libc++ to use C++11.
comment:3 follow-up: 5 Changed 10 years ago by NicosPavlov
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Duplicate of #45300.
comment:4 Changed 10 years ago by RJVB (René Bertin)
Replying to jmr@…:
You need -stdlib=libc++ to use C++11.
On 10.8 or 10.9 and higher, yes. 10.6.8 doesn't have libc++ (and gcc-mp-4.8 does fine without it).
Besides, the issue at hand is a compilation issue, not a linker issue (which could have been addressed with -stdlib=libc++).
comment:5 Changed 10 years ago by RJVB (René Bertin)
comment:6 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)
10.6.8 doesn't have libc++
That's why you need to install it via the libcxx port.
(and gcc-mp-4.8 does fine without it).
That's because gcc-mp-4.8 is using libstdcxx or libstdcxx-devel depending on which port you installed.
There is no underlying issue. You need to use libc++ for C++11 with clang. There is no intention of supporting libstdc++ for C++11 in clang.
comment:7 follow-up: 8 Changed 10 years ago by RJVB (René Bertin)
I recall why I don't have libcxx installed: it has a build depency on clang-3.3 ..
Will installing port:libcxx and port:libcxxabi (mostly containing libraries) address the issue of clang-3.4 not finding the correct headerfiles?
There is no intention of supporting libstdc++ for C++11 in clang.
I'm a bit at a loss here. That support is there on Linux, and should be platform-agnostic, no?
comment:8 follow-up: 9 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)
Replying to rjvbertin@…:
I recall why I don't have libcxx installed: it has a build depency on clang-3.3 ..
Will installing port:libcxx and port:libcxxabi (mostly containing libraries) address the issue of clang-3.4 not finding the correct headerfiles?
Yes, assuming you use -stdlib=libc++ as well
There is no intention of supporting libstdc++ for C++11 in clang.
I'm a bit at a loss here. That support is there on Linux, and should be platform-agnostic, no?
The clang compilers will only use the C++ runtimes in /usr/lib. There is no intention of supporting other C++ runtimes due to the huge can of worms that opens up. Going forward, MacPorts should only support libc++ on new platforms, and we have a way for users on SnowLeopard through Mountain Lion to also use libc++.
comment:9 follow-up: 10 Changed 10 years ago by RJVB (René Bertin)
Replying to jeremyhu@…:
Will installing port:libcxx and port:libcxxabi (mostly containing libraries) address the issue of clang-3.4 not finding the correct headerfiles?
Yes, assuming you use -stdlib=libc++ as well
Can one have port:libcxx and port:libcxxabi installed and activated without interference with existing binaries or builds as long as one does NOT use -stdlib=libc++, on 10.6?
The clang compilers will only use the C++ runtimes in /usr/lib. There is no intention of supporting other C++ runtimes
It seems it shouldn't be that hard to create a backwards compatible updated libstdc++ that can replace the one in /usr/lib, but priorities are priorities ...
we have a way for users on SnowLeopard through Mountain Lion to also use libc++.
One that requires rebuilding all binaries that contain compiled C++ code, right?
Maybe that could be an automatic process comparable to +universal ... but backed up by the build bots? Still a huge pile of work, esp. with clang-mp-3.4 being as slow as it is ...
comment:10 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)
Replying to rjvbertin@…:
Replying to jeremyhu@…:
Will installing port:libcxx and port:libcxxabi (mostly containing libraries) address the issue of clang-3.4 not finding the correct headerfiles?
Yes, assuming you use -stdlib=libc++ as well
Can one have port:libcxx and port:libcxxabi installed and activated without interference with existing binaries or builds as long as one does NOT use -stdlib=libc++, on 10.6?
Of course. If you don't use -stdlib=libc++, clang will use libstdc++ on Snow Leopard.
The clang compilers will only use the C++ runtimes in /usr/lib. There is no intention of supporting other C++ runtimes
It seems it shouldn't be that hard to create a backwards compatible updated libstdc++ that can replace the one in /usr/lib, but priorities are priorities ...
It actually is not only difficult but license-restrictive.
we have a way for users on SnowLeopard through Mountain Lion to also use libc++.
One that requires rebuilding all binaries that contain compiled C++ code, right?
Yes.
Maybe that could be an automatic process comparable to +universal ... but backed up by the build bots? Still a huge pile of work, esp. with clang-mp-3.4 being as slow as it is ...
That was discussed a few months ago.
NB: this is becoming an issue now that more and more KDE ports require C++11, and have to be built using a manual compiler specification to use macports-gcc-4.8 . And that makes unattended
port upgrade outdated
runs neigh impossible.