From 1c55f26a4493e7a88de9114be2c29b3406a71f56 Mon Sep 17 00:00:00 2001 From: Juergen Buchmueller Date: Sat, 17 Sep 2016 15:21:27 +0200 Subject: [PATCH] firefox-esr: fix gcc6 build Cherry picked patches from the openembedded mailing list: http://lists.openembedded.org/pipermail/openembedded-devel/2016-July/108029.html Also see #4748 --- .../patches/fix-gcc6-cpluplus_scope.patch | 15 +++++++++++++++ srcpkgs/firefox-esr/template | 13 ++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/firefox-esr/patches/fix-gcc6-cpluplus_scope.patch diff --git a/srcpkgs/firefox-esr/patches/fix-gcc6-cpluplus_scope.patch b/srcpkgs/firefox-esr/patches/fix-gcc6-cpluplus_scope.patch new file mode 100644 index 00000000000..f472be6e1eb --- /dev/null +++ b/srcpkgs/firefox-esr/patches/fix-gcc6-cpluplus_scope.patch @@ -0,0 +1,15 @@ +Add patch to to correct the source to be compatible with gcc6 by +preventing c++ scope errors. + +--- nsprpub/config/make-system-wrappers.pl 2016-05-12 19:10:05.000000000 +0200 ++++ nsprpub/config/make-system-wrappers.pl 2016-09-17 15:03:53.901400739 +0200 +@@ -19,7 +19,9 @@ + open OUT, ">$output_dir/$_"; + print OUT "#pragma GCC system_header\n"; # suppress include_next warning + print OUT "#pragma GCC visibility push(default)\n"; ++ print OUT "#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS\n"; + print OUT "#include_next \<$_\>\n"; ++ print OUT "#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS\n"; + print OUT "#pragma GCC visibility pop\n"; + close OUT; + } diff --git a/srcpkgs/firefox-esr/template b/srcpkgs/firefox-esr/template index e48b2f115f2..cbd6cc9cc3a 100644 --- a/srcpkgs/firefox-esr/template +++ b/srcpkgs/firefox-esr/template @@ -1,7 +1,7 @@ # Template build file for 'firefox-esr'. pkgname=firefox-esr version=45.3.0 -revision=1 +revision=2 wrksrc="firefox-${version}esr" short_desc="Lightweight gecko-based web browser" maintainer="Eivind Uggedal " @@ -27,6 +27,17 @@ makedepends=" depends="nss>=3.21 desktop-file-utils hicolor-icon-theme" conflicts="firefox>=0" +CXXFLAGS="-std=c++11" + +_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') +if [ "${_gccver%%.*}" -gt 5 ]; then + # Append CFLAGS and CXXFLAGS to set work around code which gcc6 would + # otherwise regard as out-of-specification and allow it to produce a + # working program. + CFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2" + CXXFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2" +fi + pre_configure() { case "$XBPS_TARGET_MACHINE" in *-musl)