[MacPorts] #44129: cmake: fix build against libc++ on Lion
#44129: cmake: fix build against libc++ on Lion ---------------------+------------------- Reporter: mojca@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: lion | Port: cmake ---------------------+------------------- Building CMake against `libc++` seems to be broken on Lion. The reason is that the bootstrap cmake sometimes cuts the lines at 1024 characters. See: * http://public.kitware.com/pipermail/cmake- developers/2014-June/010712.html The dirty workaround is to run a few commands manually, but it would be nice to find a proper patch. -- Ticket URL: <https://trac.macports.org/ticket/44129> MacPorts <http://www.macports.org/> Ports system for OS X
#44129: cmake: fix build against libc++ on Lion ----------------------+------------------- Reporter: mojca@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: lion Port: cmake | ----------------------+------------------- Changes (by mojca@…): * cc: ryandesign@… (added) Comment: `graphite2` is also affected by this bug. -- Ticket URL: <https://trac.macports.org/ticket/44129#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#44129: cmake: fix build against libc++ on Lion ----------------------+------------------- Reporter: mojca@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: lion Port: cmake | ----------------------+------------------- Description changed by mojca@…: Old description:
Building CMake against `libc++` seems to be broken on Lion. The reason is that the bootstrap cmake sometimes cuts the lines at 1024 characters.
See: * http://public.kitware.com/pipermail/cmake- developers/2014-June/010712.html
The dirty workaround is to run a few commands manually, but it would be nice to find a proper patch.
New description: Building CMake against `libc++` seems to be broken on Lion. The reason is that the bootstrap cmake sometimes cuts the lines at 1024 characters. See: * http://public.kitware.com/pipermail/cmake- developers/2014-June/010712.html * http://www.cmake.org/Bug/view.php?id=15039 The dirty workaround is to run a few commands manually, but it would be nice to find a proper patch. -- -- Ticket URL: <https://trac.macports.org/ticket/44129#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#44129: cmake: fix build against libc++ on Lion ----------------------+------------------- Reporter: mojca@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: lion Port: cmake | ----------------------+------------------- Comment (by mojca@…): I found out what the problem was. CMake uses complicated code (as a workaround to compiler bugs) to read lines and `istream.gcount()` in clang 3.3 with libc++ is buggy. The following code: {{{ #include <iostream> #include <fstream> #include <string> int main() { std::ifstream is("test.txt"); std::string line; const int bufferSize = 11; char buffer[bufferSize]; is.getline(buffer, bufferSize); std::cout << is.gcount() << std::endl; return 0; } }}} returns 11 instead of 10 (for input text with > 10 characters). Until the problem gets fixed the workaround is to use clang 3.4 or 3.5. Would something like that work? {{{ platform darwin 11 { if {${configure.cxx_stdlib} eq "libc++"} { # everything but macports-clang-3.4 macports-clang-3.5 compiler.blacklist-append *gcc* {clang < 500} macports- clang-2.9 macports-clang-3.0 macports-clang-3.1 macports-clang-3.2 macports-clang-3.3 compiler.fallback-append macports-clang-3.4 macports-clang-3.5 } } }}} We probably need to blacklist just clang 3.3 (`{clang < 500} macports- clang-3.3`). (I'm not sure if other compilers even work with libc++.) On the other hand we can simply wait for an upstream fix. -- Ticket URL: <https://trac.macports.org/ticket/44129#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#44129: cmake: fix build against libc++ on Lion ----------------------+------------------- Reporter: mojca@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: lion Port: cmake | ----------------------+------------------- Comment (by jeremyhu@…): Good find. I don't see anything obviously releated in istream when comparing the STL (/opt/local/libexec/llvm-3.[34]/lib/c++/v1/istream), but if you figure out the cause, we can rev clang-3.3 with the fix. Note that macports-clang-3.4 should already be in the fallback list, so you really just need the compiler.blacklist-append line. -- Ticket URL: <https://trac.macports.org/ticket/44129#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#44129: cmake: fix build against libc++ on Lion ----------------------+------------------- Reporter: mojca@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: lion Port: cmake | ----------------------+------------------- Comment (by egall@…): Replying to [comment:5 jeremyhu@…]:
Note that macports-clang-3.4 should already be in the fallback list
Could you remind me where the contents of the fallback list are documented again? -- Ticket URL: <https://trac.macports.org/ticket/44129#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#44129: cmake: fix build against libc++ on Lion ----------------------+------------------- Reporter: mojca@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: lion Port: cmake | ----------------------+------------------- Comment (by larryv@…): [[browser:tags/release_2_3_1/base/src/port1.0/portconfigure.tcl#L426]] -- Ticket URL: <https://trac.macports.org/ticket/44129#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#44129: cmake: fix build against libc++ on Lion ----------------------+------------------- Reporter: mojca@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: lion Port: cmake | ----------------------+------------------- Comment (by mojca@…): The compile is even more broken than what I though: * http://www.cmake.org/Bug/view.php?id=15039#c36490 Anyway, if we would start "officially supporting" `libc++` for the sake of better support for C++11, I would suggest to pick clang-3.4 as the default compiler (if that is feasible). -- Ticket URL: <https://trac.macports.org/ticket/44129#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#44129: cmake: fix build against libc++ on Lion ----------------------+------------------- Reporter: mojca@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: lion Port: cmake | ----------------------+------------------- Comment (by jeremyhu@…): That's a good idea. We can conditionalize the fallback list based on cxx_stdlib. -- Ticket URL: <https://trac.macports.org/ticket/44129#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts