Created attachment 155578 [details] patch to convert gjs to USES=compiler:c++11-lib On FreeBSD 8 and 9, USES=compiler:c11 causes gjs to be built with clang and linked the old version of libstdc++ in base. The x11-fm/sushi port links to both gjs and webkit-gtk3. On FreeBSD 8 and 9, webkit-gdk3 must now be compiled with gcc48 from ports and linked to the version of libstdc++ from ports. sushi itself only appears to contain C code and doesn't require a c++ library. When it is linked, the linker choses libstdc++ based on the order of the shared libraries, and ends up linking to libstdc++ from base. This causes the build to fail with a link error because the base version of libstdc++ does not support the newer c++ ABI version required by webkit-gtk3. Even if the sushi port is hacked to link to the newer libstdc++, the application segfaults inside a deeply nested series of libmozjs and libgjs function calls. See <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196078> for more detail. Changing spidermonkey24 and gjs to USES=compiler:c++11-lib, which causes them to be built with gcc48 and linked to its bundled libstdc++, allows the un-modified sushi port to successfully build, and not segfault when run. See also <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199434>
A commit references this bug: Author: truckman Date: Wed Apr 29 22:13:12 UTC 2015 New revision: 385016 URL: https://svnweb.freebsd.org/changeset/ports/385016 Log: Convert lang/gjs and lang/spidermonkey24 to USES=compiler:c++11-lib to unbreak x11-fm/sushi on FreeBSD 8 and 9. lang/gjs and lang/spidermonkey24 are currently built with USES=compiler:c11. On FreeBSD 8, this causes them to be compiled with clang from ports, and on FreeBSD 9, they are built with clang from base. In both cases, they are linked to libstdc++ from base. These two ports are dependencies of x11-fm/sushi, which also depends on webkit-gtk3, which is compiled with USES=compiler:c++11-lib. On FreeBSD 8 and 9 webkit-gtk3 is compiled with gcc from ports and linked to its newer bundled libstdc++. Sushi is compiled with gcc from base and consists of pure C code, so it does not link directly to libstdc++. The build fails because ld links in the base version of libstdc++ before it links in webkit-gtk3, and then discovers that the newer libstdc++ ABI needed by webkit-gtk3 is missing. Converting sushi to USES=compiler:c++11-lib does not fix the build failure, and just changes the error message, probably because sushi does not directly link to any version of libstdc++. If sushi is further hacked to force it to link directly to the newer version of libstdc++ bundled with the gcc port, the build succeeds, but the resulting executable segfaults inside libstdc++ with a stack trace that traverses a bunch of functions contained in the gjs and spidermonkey24 libraries. Converting gjs and spidermonkey24 to USES=compiler:c++11-lib forces them to be compiled with the ports version of gcc on FreeBSD 8 and 9 and link to its bundled libstdc++ (and is a no-op on FreeBSD 10 and higher). Because these libraries are linked into sushi before webkit-gtk3, they load the version of libstdc++ which meets the requirements of webkit-gtk3, and the resulting executable is functional. No modifications to sushi are necessary. PR: 196078, 199434, 199435 Differential Revision: https://reviews.freebsd.org/D2396 Approved by: mat (mentor) MFH: 2015Q2 Changes: head/lang/gjs/Makefile head/lang/spidermonkey24/Makefile
A commit references this bug: Author: truckman Date: Wed Apr 29 23:50:29 UTC 2015 New revision: 385017 URL: https://svnweb.freebsd.org/changeset/ports/385017 Log: MFH: r385016 Convert lang/gjs and lang/spidermonkey24 to USES=compiler:c++11-lib to unbreak x11-fm/sushi on FreeBSD 8 and 9. This change causes these libraries to link to the newer version of libstdc++ bundled with lang/gcc. This causes rtld to load this version when it is linking sushi at runtime, which is needed by webkit-gtk3, another shared library linked into sushi. PR: 196078, 199434, 199435 Approved by: portmgr (delphij) Changes: _U branches/2015Q2/ branches/2015Q2/lang/gjs/Makefile branches/2015Q2/lang/spidermonkey24/Makefile