[MacPorts] #52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached
#52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached ------------------------------------+-------------------------------- Reporter: kenneth.f.cunningham@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: lilypond ------------------------------------+-------------------------------- Lily pond fails to build on Snow Leopard with the <https://trac.macports.org/wiki/LibcxxOnOlderSystems> upgrade, due to missing reference to libc++. Failed build log attached. Fix Portfile diff also attached, that add reference to libc++ on Darwin Mountain Lion and lower with configure.cxx_stdlib=libc++ -- Ticket URL: <https://trac.macports.org/ticket/52002> MacPorts <https://www.macports.org/> Ports system for OS X
#52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached -------------------------------------+------------------- Reporter: kenneth.f.cunningham@… | Owner: snc@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: lilypond | -------------------------------------+------------------- Changes (by larryv@…): * owner: macports-tickets@… => snc@… * cc: snc@… (removed) Comment: The check seems overzealous. Why bother with version? Just add the flag always. {{{ platform darwin { if {${configure.cxx_stdlib} eq "libc++"} { configure.ldflags-append "-lc++" } } }}} -- Ticket URL: <https://trac.macports.org/ticket/52002#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached -------------------------------------+------------------- Reporter: kenneth.f.cunningham@… | Owner: snc@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: lilypond | -------------------------------------+------------------- Comment (by kenneth.f.cunningham@…): Thanks.Yes, more general version certainly fine with me, if there's no trouble with adding the reference to systems when not really needed -- was trying to be specific (perhaps overly careful). Presumably this additional library reference is not needed on platforms above mountain lion. Wasn't sure if adding it would cause trouble there. -- K -- Ticket URL: <https://trac.macports.org/ticket/52002#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached -------------------------------------+-------------------- Reporter: kenneth.f.cunningham@… | Owner: snc@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: lilypond | -------------------------------------+-------------------- Changes (by snc@…): * status: new => closed * resolution: => fixed Comment: Patched in r151452. -- Ticket URL: <https://trac.macports.org/ticket/52002#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached -------------------------------------+-------------------- Reporter: kenneth.f.cunningham@… | Owner: snc@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: lilypond | -------------------------------------+-------------------- Changes (by ryandesign@…): * cc: ryandesign@… (added) Old description:
Lily pond fails to build on Snow Leopard with the <https://trac.macports.org/wiki/LibcxxOnOlderSystems> upgrade, due to missing reference to libc++. Failed build log attached. Fix Portfile diff also attached, that add reference to libc++ on Darwin Mountain Lion and lower with configure.cxx_stdlib=libc++
New description: Lily pond fails to build on Snow Leopard with the LibcxxOnOlderSystems upgrade, due to missing reference to libc++. Failed build log attached. Fix Portfile diff also attached, that add reference to libc++ on Darwin Mountain Lion and lower with configure.cxx_stdlib=libc++ -- Comment: Can anyone explain why `-lc++` is used here instead of the more usual `-stdlib=libc++`? Indeed, does this need to be specific to darwin or libc++? Why not just: {{{ configure.ldflags-append -stdlib=${configure.cxx_stdlib} }}} Has anyone reported this problem to the developers of lilypond so they can fix it in their sources? MacPorts sets `-stdlib=whatever` in CXXFLAGS, lilypond just seems to be neglecting to use the CXXFLAGS variable when linking C++ code. -- Ticket URL: <https://trac.macports.org/ticket/52002#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
#52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached -------------------------------------+-------------------- Reporter: kenneth.f.cunningham@… | Owner: snc@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: lilypond | -------------------------------------+-------------------- Comment (by kenneth.f.cunningham@…): Thank for your observation -- lilypond uses the CXXFLAGS including -stdlib=libc++ all throughout the build, but not in the final link stage, where all the missing symbols appear, as per that attached log. will see if adding {{{ configure.ldflags-append -stdlib=${configure.cxx_stdlib) }}} works to fix the final link on this system and report back. Certainly want to do this the right way from the start. -- K -- Ticket URL: <https://trac.macports.org/ticket/52002#comment:5> MacPorts <https://www.macports.org/> Ports system for OS X
#52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached -------------------------------------+-------------------- Reporter: kenneth.f.cunningham@… | Owner: snc@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: lilypond | -------------------------------------+-------------------- Comment (by kenneth.f.cunningham@…): Hi Ryan, - as you suspected, adding that line to the linker flags {{{ configure.ldflags-append -stdlib=${configure.cxx_stdlib} }}} also allows lilypond to link. Without this line, the link fails. As you say, that is the more usual linker flag to add, so I'll use that from now on rather than "-lc++" (which also works, and I guess in the end does the same thing making libc++ available for linking, although admittedly less elegantly and less clearly. I don't yet understand why it is needed for only some ports, though -- unless their configure scripts are just incorrectly / incompletely written. Isn't it the case that libc++ should be one of the 'automatically' linked libraries, not usually needing to be specifically added? Perhaps that is what lilypond and other ports are expecting. I don't know if that's what the issue is here - some ports need this line added to link, others do not. The same port installs on a different system without modification to the portfile. Maybe with the libstdc++ and libc++ dichotomy on this libc++ upgraded machine, macports-clang-3.7++ is getting "confused" about which standard libraries to automatically link in, and is linking in the wrong one, or none? I'm over my head at this point. -- Ticket URL: <https://trac.macports.org/ticket/52002#comment:6> MacPorts <https://www.macports.org/> Ports system for OS X
#52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached -------------------------------------+-------------------- Reporter: kenneth.f.cunningham@… | Owner: snc@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: lilypond | -------------------------------------+-------------------- Comment (by ryandesign@…): Replying to [comment:6 kenneth.f.cunningham@…]:
I don't yet understand why it is needed for only some ports, though -- unless their configure scripts are just incorrectly / incompletely written.
It would probably be their Makefiles which are incorrectly written.
Isn't it the case that libc++ should be one of the 'automatically' linked libraries, not usually needing to be specifically added? Perhaps that is what lilypond and other ports are expecting. I don't know if that's what the issue is here - some ports need this line added to link, others do not. The same port installs on a different system without modification to the portfile. Maybe with the libstdc++ and libc++ dichotomy on this libc++ upgraded machine, macports-clang-3.7++ is getting "confused" about which standard libraries to automatically link in, and is linking in the wrong one, or none?
The default C++ library would be automatically linked. libc++ isn't the default C++ library on Snow Leopard. The other system where it worked was also using Snow Leopard? -- Ticket URL: <https://trac.macports.org/ticket/52002#comment:7> MacPorts <https://www.macports.org/> Ports system for OS X
#52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached -------------------------------------+-------------------- Reporter: kenneth.f.cunningham@… | Owner: snc@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: lilypond | -------------------------------------+-------------------- Comment (by kenneth.f.cunningham@…): Replying to [comment:7 ryandesign@…]:
libc++ isn't the default C++ library on Snow Leopard.
The crux of the issue. Much current software will assume libc++ is the default, and not specifically link it. I wonder if this can be changed somewhere in the guts of the clang-3.7 linker scripts where mortals should not venture...
The other system where it worked was also using Snow Leopard?
No - one of my El Cap machines. -- Ticket URL: <https://trac.macports.org/ticket/52002#comment:8> MacPorts <https://www.macports.org/> Ports system for OS X
#52002: lilypond build fails due to missing reference to libc++ on some Darwin systems - fix attached -------------------------------------+-------------------- Reporter: kenneth.f.cunningham@… | Owner: snc@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: lilypond | -------------------------------------+-------------------- Comment (by ryandesign@…): Replying to [comment:8 kenneth.f.cunningham@…]:
Replying to [comment:7 ryandesign@…]:
libc++ isn't the default C++ library on Snow Leopard.
The crux of the issue. Much current software will assume libc++ is the default, and not specifically link it.
Certainly, much current software will assume C++11 features are available in the C++ library. That's fine. Software developers are certainly free to make that decision for their own projects. If we offer that software in MacPorts, we will use the cxx11 1.0 port group to indicate this requirement.
I wonder if this can be changed somewhere in the guts of the clang-3.7 linker scripts where mortals should not venture...
There's nothing really to be changed there. The compiler and linker must respect the operating system's choice of default C++ library, unless told to do otherwise.
The other system where it worked was also using Snow Leopard?
No - one of my El Cap machines.
Then that makes perfect sense, since El Capitan defaults to libc++. The problem is that MacPorts informs the lilypond build system that it should use libc++, by way of adding the `-stdlib=...` flag to CXXFLAGS, and lilypond's build system is ignoring that request during the link step. The lilypond build system needs to be fixed to respect the value of CXXFLAGS at every step that involves C++ files. -- Ticket URL: <https://trac.macports.org/ticket/52002#comment:9> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts