[MacPorts] #45307: clang-3.4 not picking up C++11 headers on 10.6.8
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 -------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: | Port: clang-3.4 -------------------------+-------------------------------- 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 . -- Ticket URL: <https://trac.macports.org/ticket/45307> MacPorts <http://www.macports.org/> Ports system for OS X
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 --------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: clang-3.4 | --------------------------+-------------------------------- Comment (by rjvbertin@…): 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 . -- Ticket URL: <https://trac.macports.org/ticket/45307#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 --------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: clang-3.4 | --------------------------+-------------------------------- Comment (by jmr@…): There’s your problem: {{{ CXXFLAGS='-Os -arch x86_64 -stdlib=libstdc++’ }}} You need -stdlib=libc++ to use C++11. -- Ticket URL: <https://trac.macports.org/ticket/45307#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 --------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: duplicate | Keywords: Port: clang-3.4 | --------------------------+-------------------------------- Changes (by nicos@…): * status: new => closed * resolution: => duplicate Comment: Duplicate of #45300. -- Ticket URL: <https://trac.macports.org/ticket/45307#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 --------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: duplicate | Keywords: Port: clang-3.4 | --------------------------+-------------------------------- Comment (by rjvbertin@…): Replying to [comment:2 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++). -- Ticket URL: <https://trac.macports.org/ticket/45307#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 --------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: duplicate | Keywords: Port: clang-3.4 | --------------------------+-------------------------------- Comment (by rjvbertin@…): Replying to [comment:3 nicos@…]:
Duplicate of #45300.
Actually, #45300 is a result of this .... -- Ticket URL: <https://trac.macports.org/ticket/45307#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 --------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: duplicate | Keywords: Port: clang-3.4 | --------------------------+-------------------------------- Comment (by jeremyhu@…):
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. -- Ticket URL: <https://trac.macports.org/ticket/45307#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 --------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: duplicate | Keywords: Port: clang-3.4 | --------------------------+-------------------------------- Comment (by 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?
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? -- Ticket URL: <https://trac.macports.org/ticket/45307#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 --------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: duplicate | Keywords: Port: clang-3.4 | --------------------------+-------------------------------- Comment (by jeremyhu@…): Replying to [comment:7 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++. -- Ticket URL: <https://trac.macports.org/ticket/45307#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 --------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: duplicate | Keywords: Port: clang-3.4 | --------------------------+-------------------------------- Comment (by rjvbertin@…): Replying to [comment:8 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 ... -- Ticket URL: <https://trac.macports.org/ticket/45307#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#45307: clang-3.4 not picking up C++11 headers on 10.6.8 --------------------------+-------------------------------- Reporter: rjvbertin@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: duplicate | Keywords: Port: clang-3.4 | --------------------------+-------------------------------- Comment (by jeremyhu@…): Replying to [comment:9 rjvbertin@…]:
Replying to [comment:8 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. -- Ticket URL: <https://trac.macports.org/ticket/45307#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts