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.
Add patch to to correct the source to be compatible with gcc6 by
preventing c++ scope errors.

Signed-off-by: Fabio Berton <fabio.ber...@ossystems.com.br>
---
 ...-source-to-be-compatible-with-gcc6-by-pre.patch | 29 ++++++++++++++++++++++
 recipes-mozilla/firefox/firefox_38.8.0esr.bb       | 19 +++-----------
 2 files changed, 33 insertions(+), 15 deletions(-)
 create mode 100644 
recipes-mozilla/firefox/firefox/fixes/Correct-the-source-to-be-compatible-with-gcc6-by-pre.patch

diff --git 
a/recipes-mozilla/firefox/firefox/fixes/Correct-the-source-to-be-compatible-with-gcc6-by-pre.patch
 
b/recipes-mozilla/firefox/firefox/fixes/Correct-the-source-to-be-compatible-with-gcc6-by-pre.patch
new file mode 100644
index 0000000..643fef2
--- /dev/null
+++ 
b/recipes-mozilla/firefox/firefox/fixes/Correct-the-source-to-be-compatible-with-gcc6-by-pre.patch
@@ -0,0 +1,29 @@
+From fd21526d36bd579f2a227b3add38bd615e59db5e Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.ber...@ossystems.com.br>
+Date: Thu, 30 Jun 2016 16:57:00 -0300
+Subject: [PATCH] Correct the source to be compatible with gcc6 by preventing
+ c++ scope errors
+Organization: O.S. Systems Software LTDA.
+
+Signed-off-by: Fabio Berton <fabio.ber...@ossystems.com.br>
+---
+ nsprpub/config/make-system-wrappers.pl | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/nsprpub/config/make-system-wrappers.pl 
b/nsprpub/config/make-system-wrappers.pl
+index fa0873a..bf09583 100644
+--- a/nsprpub/config/make-system-wrappers.pl
++++ b/nsprpub/config/make-system-wrappers.pl
+@@ -19,7 +19,9 @@ while (<STDIN>) {
+     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;
+ }
+-- 
+2.1.4
+
diff --git a/recipes-mozilla/firefox/firefox_38.8.0esr.bb 
b/recipes-mozilla/firefox/firefox_38.8.0esr.bb
index bd9b82c..58ff9d8 100644
--- a/recipes-mozilla/firefox/firefox_38.8.0esr.bb
+++ b/recipes-mozilla/firefox/firefox_38.8.0esr.bb
@@ -48,6 +48,7 @@ SRC_URI = 
"https://archive.mozilla.org/pub/firefox/releases/${PV}/source/firefox
            file://debian-hacks/Work-around-binutils-assertion-on-mips.patch \
            
file://debian-hacks/Revert-Bump-search-engine-max-icon-size-to-35kB.patch \
            file://fixes/Fix-firefox-install-dir.patch \
+           
file://fixes/Correct-the-source-to-be-compatible-with-gcc6-by-pre.patch \
            "
 
 SRC_URI[archive.md5sum] = "af46898414a433f8260c5373efb97d19"
@@ -63,6 +64,9 @@ EXTRA_OEMAKE += "installdir=${libdir}/${PN}"
 
 ARM_INSTRUCTION_SET = "arm"
 
+CFLAGS +=" -fno-delete-null-pointer-checks -fno-lifetime-dse"
+CXXFLAGS +=" -fno-delete-null-pointer-checks -fno-lifetime-dse"
+
 do_install_append() {
     install -d ${D}${datadir}/applications
     install -d ${D}${datadir}/pixmaps
@@ -105,18 +109,3 @@ PRIVATE_LIBS += " \
     libssl3.so \
     libsoftokn3.so \
 "
-
-# | i586-oe-linux-gcc  -m32 -march=i586 
--sysroot=/home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemux86 -o 
WebMElement.o -c
-#  -I../../dist/system_wrappers -include 
/home/jenkins/oe/world/shr-core/tmp-glibc/work/i586-oe-linux/firefox/38.7.1esr-r0/mozilla-esr38/config/gcc_hidden.h
 -DMOZ_GLUE_IN_PROGRAM -DAB_CD=en-US -DNO_NSPR_10_SUPPORT
-#  
-I/home/jenkins/oe/world/shr-core/tmp-glibc/work/i586-oe-linux/firefox/38.7.1esr-r0/mozilla-esr38/media/libmkv
 -I. 
-#  -I../../dist/include   
-I/home/jenkins/oe/world/shr-core/tmp-glibc/work/i586-oe-linux/firefox/38.7.1esr-r0/mozilla-esr38/firefox-build-dir/dist/include/nspr
 
-I/home/jenkins/oe/world/shr-core/tmp-glibc/work/i586-oe-linux/firefox/38.7.1esr-r0/mozilla-esr38/firefox-build-dir/dist/include/nss
   
-#  
-I/home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemux86/usr/include/pixman-1
   -fPIC   -include ../../mozilla-config.h -DMOZILLA_CLIENT -MD -MP -MF 
.deps/WebMElement.o.pp  -Wall -Wdeclaration-after-statement -Wempty-body 
-Wpointer-to-int-cast -Wsign-compare -Wtype-limits -Wno-unused -Wcast-align -Os 
-fsigned-char -fno-strict-aliasing -std=gnu99 -fgnu89-inline 
-fno-strict-aliasing -fno-math-errno -pthread -pipe  -DNDEBUG -DTRIMMED 
-freorder-blocks -Os -fomit-frame-pointer     
/home/jenkins/oe/world/shr-core/tmp-glibc/work/i586-oe-linux/firefox/38.7.1esr-r0/mozilla-esr38/media/libmkv/WebMElement.c
-# | In file included from ../../../dist/system_wrappers/stdlib.h:3:0,
-# |                  from ../../../dist/include/mozilla/mozalloc.h:15,
-# |                  from ../../../dist/stl_wrappers/cstdlib:39,
-# |                  from 
/home/jenkins/oe/world/shr-core/tmp-glibc/work/i586-oe-linux/firefox/38.7.1esr-r0/mozilla-esr38/gfx/graphite2/src/inc/Main.h:29,
-# |                  from 
/home/jenkins/oe/world/shr-core/tmp-glibc/work/i586-oe-linux/firefox/38.7.1esr-r0/mozilla-esr38/gfx/graphite2/src/CmapCache.cpp:28,
-# |                  from 
/home/jenkins/oe/world/shr-core/tmp-glibc/work/i586-oe-linux/firefox/38.7.1esr-r0/mozilla-esr38/firefox-build-dir/gfx/graphite2/src/Unified_cpp_gfx_graphite2_src0.cpp:11:
-# | 
/home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemux86/usr/include/c++/6.1.1/stdlib.h:38:12:
 error: 'std::abort' has not been declared
-# |  using std::abort;
-PNBLACKLIST[firefox] ?= "BROKEN: fails to build with gcc-6"
-- 
2.1.4

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Reply via email to