From c6fbbc71d88e4ed871f32c7a4fcb496c09c0d308 Mon Sep 17 00:00:00 2001 From: Don Lewis Date: Wed, 29 Apr 2015 22:13:10 +0000 Subject: [PATCH] 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 --- lang/gjs/Makefile | 3 ++- lang/spidermonkey24/Makefile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lang/gjs/Makefile b/lang/gjs/Makefile index b30b882851d7..d1f400c7af81 100644 --- a/lang/gjs/Makefile +++ b/lang/gjs/Makefile @@ -4,6 +4,7 @@ PORTNAME= gjs PORTVERSION= 1.42.0 +PORTREVISION= 1 CATEGORIES= lang gnome MASTER_SITES= GNOME DIST_SUBDIR= gnome3 @@ -14,7 +15,7 @@ COMMENT= GNOME Javascript binding LIB_DEPENDS= libdbus-glib-1.so:${PORTSDIR}/devel/dbus-glib \ libmozjs-24.so:${PORTSDIR}/lang/spidermonkey24 -USES= compiler:c11 gettext gmake libtool pathfix pkgconfig \ +USES= compiler:c++11-lib gettext gmake libtool pathfix pkgconfig \ python:build tar:xz USE_GNOME= cairo glib20 gnomeprefix introspection:build \ intlhack diff --git a/lang/spidermonkey24/Makefile b/lang/spidermonkey24/Makefile index aac83810081e..1c25f1abbf6e 100644 --- a/lang/spidermonkey24/Makefile +++ b/lang/spidermonkey24/Makefile @@ -3,6 +3,7 @@ PORTNAME= spidermonkey24 PORTVERSION= 24.2.0 +PORTREVISION= 1 CATEGORIES= lang MASTER_SITES= ${MASTER_SITE_MOZILLA} #http://people.mozilla.org/~sstangl/ @@ -18,7 +19,7 @@ LIB_DEPENDS= libnspr4.so:${PORTSDIR}/devel/nspr CONFLICTS= njs-[0-9]* GNU_CONFIGURE= yes -USES= compiler:c11 gmake pathfix perl5 python:2,build \ +USES= compiler:c++11-lib gmake pathfix perl5 python:2,build \ readline tar:bzip2 USE_PERL5= build USE_LDCONFIG= yes