Skip to contentSkip to conversation

chromium(-wayland): Fix build with gcc7

PATCH Superseded Martin Jansa 3 participants 7 messages Jun 16, 2017 – Jun 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 chromium(-wayland): Fix build with gcc7

* add 2 patches to fix issues detected by gcc7

---
 recipes-browser/chromium/chromium-browser.inc      |  2 ++
 .../files/0001-v8-fix-build-with-gcc7.patch        | 20 ++++++++++++++
 .../files/0002-WebKit-fix-build-with-gcc7.patch    | 31 ++++++++++++++++++++++
 3 files changed, 53 insertions(+)
 create mode 100644 recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch
 create mode 100644 recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch
recipes-browser/chromium/chromium-browser.inc +2 -0
index ad8e497..08853b1 100644
@@ -26,6 +26,8 @@ SRC_URI = "\
         ${@bb.utils.contains('PACKAGECONFIG', 'disable-api-keys-info-bar', 'file://api-keys.patch;patchdir=${WORKDIR}', '', d)} \
         file://google-chrome.desktop \
         file://unset-madv-free.patch \
+        file://0001-v8-fix-build-with-gcc7.patch \
+        file://0002-WebKit-fix-build-with-gcc7.patch \
 "
 
 S = "${WORKDIR}/chromium-${PV}"
recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch new file +20 -0
new file mode 100644
index 0000000..0fc5bfb
@@ -0,0 +1,20 @@
+Use the fix from nodejs:
+https://github.com/nodejs/node/commit/2a2a5565c298639b823250b571101f51210c50e8
+
+* fixes:
+| ../../git/src/v8/src/objects-body-descriptors.h: In static member function 'static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, int)':
+| ../../git/src/v8/src/objects-body-descriptors.h:102:20: error: no matching function for call to 'v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*&)'
+|      IterateBody(obj);
+|                     ^
+
+--- chromium-54.0.2810.2.orig/v8/src/objects-body-descriptors.h	2016-07-28 12:17:37.000000000 -1000
++++ chromium-54.0.2810.2/v8/src/objects-body-descriptors.h	2017-06-16 01:20:50.026665439 -1000
+@@ -99,7 +99,7 @@
+ 
+   template <typename StaticVisitor>
+   static inline void IterateBody(HeapObject* obj, int object_size) {
+-    IterateBody(obj);
++    IterateBody<StaticVisitor>(obj);
+   }
+ };
+ 
recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch new file +31 -0
new file mode 100644
index 0000000..284a83c
@@ -0,0 +1,31 @@
+Based on qtwebengine-opensource-src-5.8.0-wtf-gcc7.patch from
+http://git.net/ml/scm-fedora-commits/2017-03/msg15697.html
+
+* Fixes:
+In file included from ../../git/src/third_party/WebKit/Source/platform/heap/ThreadingTraits.h:14:0,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/ThreadState.h:37,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/GarbageCollected.h:8,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Visitor.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/GCInfo.h:8,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Heap.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Handle.h:34,
+                 from ../../git/src/third_party/WebKit/public/platform/WebPrivatePtr.h:38,
+                 from ../../git/src/third_party/WebKit/public/platform/WebString.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/exported/FilePathConversion.cpp:8:
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h: In member function 'void WTF::LinkedHashSet<Value, HashFunctions, HashTraits, Allocator>::swap(WTF::LinkedHashSet<Value, HashFunctions, HashTraits, Allocator>&)':
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h:549:5: error: there are no arguments to 'swapAnchor' that depend on a template parameter, so a declaration of 'swapAnchor' must be available [-fpermissive]
+     swapAnchor(m_anchor, other.m_anchor);
+     ^~~~~~~~~~
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h:549:5: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
+
+--- chromium-54.0.2810.2.orig/third_party/WebKit/Source/wtf/LinkedHashSet.h	2016-07-28 12:16:12.000000000 -1000
++++ chromium-54.0.2810.2/third_party/WebKit/Source/wtf/LinkedHashSet.h	2017-06-16 02:19:37.928797121 -1000
+@@ -542,6 +542,8 @@
+     return *this;
+ }
+ 
++inline void swapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b);
++
+ template<typename T, typename U, typename V, typename W>
+ inline void LinkedHashSet<T, U, V, W>::swap(LinkedHashSet& other)
+ {
Signature · 1 line
2.13.1
#1 lore raw

I've tested this with chromium, but for chromium-wayland few more changes are needed from that v8 change.

Quoted 126 lines · Martin Jansa

* add 2 patches to fix issues detected by gcc7

---
 recipes-browser/chromium/chromium-browser.inc      |  2 ++
 .../files/0001-v8-fix-build-with-gcc7.patch        | 20 ++++++++++++++
 .../files/0002-WebKit-fix-build-with-gcc7.patch    | 31
++++++++++++++++++++++
 3 files changed, 53 insertions(+)
 create mode 100644 recipes-browser/chromium/files/0001-v8-fix-build-with-
gcc7.patch
 create mode 100644 recipes-browser/chromium/files/0002-WebKit-fix-build-

with-gcc7.patch

recipes-browser/chromium/chromium-browser.inc +2 -0
index ad8e497..08853b1 100644
@@ -26,6 +26,8 @@ SRC_URI = "\
         ${@bb.utils.contains('PACKAGECONFIG',
 'disable-api-keys-info-bar', 'file://api-keys.patch;patchdir=${WORKDIR}',
 '', d)} \
         file://google-chrome.desktop \
         file://unset-madv-free.patch \
+        file://0001-v8-fix-build-with-gcc7.patch \
+        file://0002-WebKit-fix-build-with-gcc7.patch \
 "

S = "${WORKDIR}/chromium-${PV}"

recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch new file +2 -0
new file mode 100644
index 0000000..0fc5bfb
@@ -0,0 +1,20 @@
+Use the fix from nodejs:
+https://github.com/nodejs/node/commit/2a2a5565c298639b823250b571101f

51210c50e8

recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch new file +3 -0
+
+* fixes:
+| ../../git/src/v8/src/objects-body-descriptors.h: In static member

function 'static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, int)':
+| ../../git/src/v8/src/objects-body-descriptors.h:102:20: error: no matching function for call to 'v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*&)'
+| IterateBody(obj);
+| ^
+
+--- chromium-54.0.2810.2.orig/v8/src/objects-body-descriptors.h

2016-07-28 12:17:37.000000000 -1000
++++ chromium-54.0.2810.2/v8/src/objects-body-descriptors.h
 2017-06-16 01:20:50.026665439 -1000

+@@ -99,7 +99,7 @@

recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch new file +8 -0
+
+   template <typename StaticVisitor>
+   static inline void IterateBody(HeapObject* obj, int object_size) {
+-    IterateBody(obj);
++    IterateBody<StaticVisitor>(obj);
+   }
+ };
+
recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch new file +5 -0
new file mode 100644
index 0000000..284a83c
@@ -0,0 +1,31 @@
+Based on qtwebengine-opensource-src-5.8.0-wtf-gcc7.patch from
+http://git.net/ml/scm-fedora-commits/2017-03/msg15697.html
+
+* Fixes:
+In file included from ../../git/src/third_party/

WebKit/Source/platform/heap/ThreadingTraits.h:14:0,
+ from ../../git/src/third_party/
WebKit/Source/platform/heap/ThreadState.h:37,
+ from ../../git/src/third_party/
WebKit/Source/platform/heap/GarbageCollected.h:8,
+ from ../../git/src/third_party/
WebKit/Source/platform/heap/Visitor.h:35,
+ from ../../git/src/third_party/
WebKit/Source/platform/heap/GCInfo.h:8,
+ from ../../git/src/third_party/
WebKit/Source/platform/heap/Heap.h:35,
+ from ../../git/src/third_party/
WebKit/Source/platform/heap/Handle.h:34,
+ from ../../git/src/third_party/WebKit/public/platform/
WebPrivatePtr.h:38,
+ from ../../git/src/third_party/WebKit/public/platform/
WebString.h:35,
+ from ../../git/src/third_party/WebKit/Source/platform/
exported/FilePathConversion.cpp:8:
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h: In member function 'void WTF::LinkedHashSet<Value, HashFunctions, HashTraits, Allocator>::swap(WTF::LinkedHashSet<Value, HashFunctions, HashTraits, Allocator>&)':
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h:549:5:
error: there are no arguments to 'swapAnchor' that depend on a template parameter, so a declaration of 'swapAnchor' must be available [-fpermissive]

recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch new file +3 -0
+     swapAnchor(m_anchor, other.m_anchor);
+     ^~~~~~~~~~
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h:549:5: note:

(if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
+
+--- chromium-54.0.2810.2.orig/third_party/WebKit/Source/wtf/LinkedHashSet.h

  2016-07-28 12:16:12.000000000 -1000
++++ chromium-54.0.2810.2/third_party/WebKit/Source/wtf/LinkedHashSet.h
2017-06-16 02:19:37.928797121 -1000

+@@ -542,6 +542,8 @@

recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch new file +4 -0
+     return *this;
+ }
+
++inline void swapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase&

b);
++
+ template<typename T, typename U, typename V, typename W>
+ inline void LinkedHashSet<T, U, V, W>::swap(LinkedHashSet& other)
+ {
--
2.13.1

#2 lore raw

PATCH v2 1/1 chromium(-wayland): Fix build with gcc7

* add 3 patches to fix issues detected by gcc7

---
 recipes-browser/chromium/chromium-browser.inc      |    3 +
 .../files/0001-v8-fix-build-with-gcc7.patch        |  112 ++
 .../files/0002-WebKit-fix-build-with-gcc7.patch    |   31 +
 .../files/0003-pdfium-fix-build-with-gcc7.patch    | 1317 ++++++++++++++++++++
 4 files changed, 1463 insertions(+)
 create mode 100644 recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch
 create mode 100644 recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch
 create mode 100644 recipes-browser/chromium/files/0003-pdfium-fix-build-with-gcc7.patch
recipes-browser/chromium/chromium-browser.inc +3 -0
index ad8e497..3a197b3 100644
@@ -26,6 +26,9 @@ SRC_URI = "\
         ${@bb.utils.contains('PACKAGECONFIG', 'disable-api-keys-info-bar', 'file://api-keys.patch;patchdir=${WORKDIR}', '', d)} \
         file://google-chrome.desktop \
         file://unset-madv-free.patch \
+        file://0001-v8-fix-build-with-gcc7.patch \
+        file://0002-WebKit-fix-build-with-gcc7.patch \
+	file://0003-pdfium-fix-build-with-gcc7.patch \
 "
 
 S = "${WORKDIR}/chromium-${PV}"
recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch new file +112 -0

112 lines not on this page · raw message

recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch new file +31 -0
new file mode 100644
index 0000000..284a83c
@@ -0,0 +1,31 @@
+Based on qtwebengine-opensource-src-5.8.0-wtf-gcc7.patch from
+http://git.net/ml/scm-fedora-commits/2017-03/msg15697.html
+
+* Fixes:
+In file included from ../../git/src/third_party/WebKit/Source/platform/heap/ThreadingTraits.h:14:0,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/ThreadState.h:37,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/GarbageCollected.h:8,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Visitor.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/GCInfo.h:8,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Heap.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Handle.h:34,
+                 from ../../git/src/third_party/WebKit/public/platform/WebPrivatePtr.h:38,
+                 from ../../git/src/third_party/WebKit/public/platform/WebString.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/exported/FilePathConversion.cpp:8:
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h: In member function 'void WTF::LinkedHashSet<Value, HashFunctions, HashTraits, Allocator>::swap(WTF::LinkedHashSet<Value, HashFunctions, HashTraits, Allocator>&)':
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h:549:5: error: there are no arguments to 'swapAnchor' that depend on a template parameter, so a declaration of 'swapAnchor' must be available [-fpermissive]
+     swapAnchor(m_anchor, other.m_anchor);
+     ^~~~~~~~~~
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h:549:5: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
+
+--- chromium-54.0.2810.2.orig/third_party/WebKit/Source/wtf/LinkedHashSet.h	2016-07-28 12:16:12.000000000 -1000
++++ chromium-54.0.2810.2/third_party/WebKit/Source/wtf/LinkedHashSet.h	2017-06-16 02:19:37.928797121 -1000
+@@ -542,6 +542,8 @@
+     return *this;
+ }
+ 
++inline void swapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b);
++
+ template<typename T, typename U, typename V, typename W>
+ inline void LinkedHashSet<T, U, V, W>::swap(LinkedHashSet& other)
+ {
recipes-browser/chromium/files/0003-pdfium-fix-build-with-gcc7.patch new file +1317 -0

1,317 lines not on this page · raw message

Signature · 1 line
2.13.1
#3 lore raw

PATCH v3 1/2 chromium(-wayland): Fix build with gcc7

In reply to Martin Jansa

* add 3 patches to fix issues detected by gcc7

---
 recipes-browser/chromium/chromium-browser.inc      |    2 +
 .../chromium/chromium-wayland_53.0.2785.143.bb     |    1 +
 .../files/0001-v8-fix-build-with-gcc7.patch        |  112 ++
 .../files/0002-WebKit-fix-build-with-gcc7.patch    |   31 +
 .../files/0003-pdfium-fix-build-with-gcc7.patch    | 1317 ++++++++++++++++++++
 5 files changed, 1463 insertions(+)
 create mode 100644 recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch
 create mode 100644 recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch
 create mode 100644 recipes-browser/chromium/files/0003-pdfium-fix-build-with-gcc7.patch
recipes-browser/chromium/chromium-browser.inc +2 -0
index ad8e497..08853b1 100644
@@ -26,6 +26,8 @@ SRC_URI = "\
         ${@bb.utils.contains('PACKAGECONFIG', 'disable-api-keys-info-bar', 'file://api-keys.patch;patchdir=${WORKDIR}', '', d)} \
         file://google-chrome.desktop \
         file://unset-madv-free.patch \
+        file://0001-v8-fix-build-with-gcc7.patch \
+        file://0002-WebKit-fix-build-with-gcc7.patch \
 "
 
 S = "${WORKDIR}/chromium-${PV}"
recipes-browser/chromium/chromium-wayland_53.0.2785.143.bb +1 -0
index 5fc554b..cc844c3 100644
@@ -6,6 +6,7 @@ DEPENDS += "wayland libxkbcommon"
 
 SRC_URI += "\
         file://chromium-wayland/add_missing_stat_h_include.patch \
+        file://0003-pdfium-fix-build-with-gcc7.patch \
         file://0003-Remove-hard-coded-values-for-CC-and-CXX.patch \
         file://0004-Create-empty-i18n_process_css_test.html-file-to-avoi.patch \
         file://0005-Override-root-filesystem-access-restriction.patch \
recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch new file +112 -0

112 lines not on this page · raw message

recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch new file +31 -0
new file mode 100644
index 0000000..284a83c
@@ -0,0 +1,31 @@
+Based on qtwebengine-opensource-src-5.8.0-wtf-gcc7.patch from
+http://git.net/ml/scm-fedora-commits/2017-03/msg15697.html
+
+* Fixes:
+In file included from ../../git/src/third_party/WebKit/Source/platform/heap/ThreadingTraits.h:14:0,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/ThreadState.h:37,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/GarbageCollected.h:8,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Visitor.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/GCInfo.h:8,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Heap.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Handle.h:34,
+                 from ../../git/src/third_party/WebKit/public/platform/WebPrivatePtr.h:38,
+                 from ../../git/src/third_party/WebKit/public/platform/WebString.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/exported/FilePathConversion.cpp:8:
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h: In member function 'void WTF::LinkedHashSet<Value, HashFunctions, HashTraits, Allocator>::swap(WTF::LinkedHashSet<Value, HashFunctions, HashTraits, Allocator>&)':
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h:549:5: error: there are no arguments to 'swapAnchor' that depend on a template parameter, so a declaration of 'swapAnchor' must be available [-fpermissive]
+     swapAnchor(m_anchor, other.m_anchor);
+     ^~~~~~~~~~
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h:549:5: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
+
+--- chromium-54.0.2810.2.orig/third_party/WebKit/Source/wtf/LinkedHashSet.h	2016-07-28 12:16:12.000000000 -1000
++++ chromium-54.0.2810.2/third_party/WebKit/Source/wtf/LinkedHashSet.h	2017-06-16 02:19:37.928797121 -1000
+@@ -542,6 +542,8 @@
+     return *this;
+ }
+ 
++inline void swapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b);
++
+ template<typename T, typename U, typename V, typename W>
+ inline void LinkedHashSet<T, U, V, W>::swap(LinkedHashSet& other)
+ {
recipes-browser/chromium/files/0003-pdfium-fix-build-with-gcc7.patch new file +1317 -0

1,317 lines not on this page · raw message

Signature · 1 line
2.13.1
#4 lore raw

PATCH v3 2/2 firefox: fix build with gcc7

---
 recipes-mozilla/firefox/firefox/gcc7.patch   | 259 +++++++++++++++++++++++++++
 recipes-mozilla/firefox/firefox_45.9.0esr.bb |   3 +-
 2 files changed, 261 insertions(+), 1 deletion(-)
 create mode 100644 recipes-mozilla/firefox/firefox/gcc7.patch
recipes-mozilla/firefox/firefox/gcc7.patch new file +259 -0
new file mode 100644
index 0000000..2c2b52d
@@ -0,0 +1,259 @@
+
+# HG changeset patch
+# User Mike Hommey <[email protected]>
+# Date 1463557039 -32400
+# Node ID 68da139d0866977c0ada86319fa94388f2255446
+# Parent  a640e6fa8ab9977fb6c5bcf63dc4daca6699477b
+Bug 1269171 - Change how mozalloc.h is hooked in STL wrappers. r=froydnj
+
+Since the introduction of the STL wrappers, they have included
+mozalloc.h, and multiple times, we've hit header reentrancy problems,
+and worked around them as best as we could.
+
+Taking a step back, all mozalloc.h does is:
+- declare moz_* allocator functions.
+- define inline implementations of various operator new/delete variants.
+
+The first only requires the functions to be declared before they are used,
+so mozalloc.h only needs to be included before anything that would use
+those functions.
+
+The second doesn't actually require a specific order, as long as the
+declaration for those functions comes before their use, and they are
+either declared in <new> or implicitly by the C++ compiler.
+
+So all in all, it doesn't matter that mozalloc.h is included before the
+wrapped STL headers. What matters is that it's included when STL headers
+are included. So arrange things such that mozalloc.h is included after
+the first wrapped STL header is fully preprocessed (and all its includes
+have been included).
+
+
+diff --git a/config/gcc-stl-wrapper.template.h b/config/gcc-stl-wrapper.template.h
+--- a/config/gcc-stl-wrapper.template.h
++++ b/config/gcc-stl-wrapper.template.h
+@@ -12,56 +12,54 @@
+ // compiling ObjC.
+ #if defined(__EXCEPTIONS) && __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS)
+ #  error "STL code can only be used with -fno-exceptions"
+ #endif
+ 
+ // Silence "warning: #include_next is a GCC extension"
+ #pragma GCC system_header
+ 
+-// Don't include mozalloc for cstdlib. See bug 1245076.
+-#ifndef moz_dont_include_mozalloc_for_cstdlib
+-#  define moz_dont_include_mozalloc_for_cstdlib
+-#endif
+-#ifndef moz_dont_include_mozalloc_for_${HEADER}
+-// mozalloc.h wants <new>; break the cycle by always explicitly
+-// including <new> here.  NB: this is a tad sneaky.  Sez the gcc docs:
+-//
+-//    `#include_next' does not distinguish between <file> and "file"
+-//    inclusion, nor does it check that the file you specify has the
+-//    same name as the current file. It simply looks for the file
+-//    named, starting with the directory in the search path after the
+-//    one where the current file was found.
+-#  include_next <new>
+-
+-// See if we're in code that can use mozalloc.  NB: this duplicates
+-// code in nscore.h because nscore.h pulls in prtypes.h, and chromium
+-// can't build with that being included before base/basictypes.h.
+-#  if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
+-#    include "mozilla/mozalloc.h"
+-#  else
+-#    error "STL code can only be used with infallible ::operator new()"
+-#  endif
+-
+-#endif
+-
+ #if defined(DEBUG) && !defined(_GLIBCXX_DEBUG)
+ // Enable checked iterators and other goodies
+ //
+ // FIXME/bug 551254: gcc's debug STL implementation requires -frtti.
+ // Figure out how to resolve this with -fno-rtti.  Maybe build with
+ // -frtti in DEBUG builds?
+ //
+ //  # define _GLIBCXX_DEBUG 1
+ #endif
+ 
++// Don't include mozalloc for cstdlib. See bug 1245076.
++#ifndef moz_dont_include_mozalloc_for_cstdlib
++#  define moz_dont_include_mozalloc_for_cstdlib
++#endif
++
++// Include mozalloc after the STL header and all other headers it includes
++// have been preprocessed.
++#if !defined(MOZ_INCLUDE_MOZALLOC_H) && \
++    !defined(moz_dont_include_mozalloc_for_${HEADER})
++#  define MOZ_INCLUDE_MOZALLOC_H
++#  define MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER}
++#endif
++
+ #pragma GCC visibility push(default)
+ #include_next <${HEADER}>
+ #pragma GCC visibility pop
+ 
++#ifdef MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER}
++// See if we're in code that can use mozalloc.  NB: this duplicates
++// code in nscore.h because nscore.h pulls in prtypes.h, and chromium
++// can't build with that being included before base/basictypes.h.
++#  if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
++#    include "mozilla/mozalloc.h"
++#  else
++#    error "STL code can only be used with infallible ::operator new()"
++#  endif
++#endif
++
+ // gcc calls a __throw_*() function from bits/functexcept.h when it
+ // wants to "throw an exception".  functexcept exists nominally to
+ // support -fno-exceptions, but since we'll always use the system
+ // libstdc++, and it's compiled with exceptions, then in practice
+ // these __throw_*() functions will always throw exceptions (shades of
+ // -fshort-wchar).  We don't want that and so define our own inlined
+ // __throw_*().
+ #ifndef mozilla_throw_gcc_h
+diff --git a/config/make-stl-wrappers.py b/config/make-stl-wrappers.py
+--- a/config/make-stl-wrappers.py
++++ b/config/make-stl-wrappers.py
+@@ -25,28 +25,26 @@ def header_path(header, compiler):
+ def is_comment(line):
+     return re.match(r'\s*#.*', line)
+ 
+ def main(outdir, compiler, template_file, header_list_file):
+     if not os.path.isdir(outdir):
+         os.mkdir(outdir)
+ 
+     template = open(template_file, 'r').read()
+-    path_to_new = header_path('new', compiler)
+ 
+     for header in open(header_list_file, 'r'):
+         header = header.rstrip()
+         if 0 == len(header) or is_comment(header):
+             continue
+ 
+         path = header_path(header, compiler)
+         with FileAvoidWrite(os.path.join(outdir, header)) as f:
+             f.write(string.Template(template).substitute(HEADER=header,
+-                                                         HEADER_PATH=path,
+-                                                         NEW_HEADER_PATH=path_to_new))
++                                                         HEADER_PATH=path))
+ 
+ 
+ if __name__ == '__main__':
+     if 5 != len(sys.argv):
+         print("""Usage:
+   python {0} OUT_DIR ('msvc'|'gcc') TEMPLATE_FILE HEADER_LIST_FILE
+ """.format(sys.argv[0]), file=sys.stderr)
+         sys.exit(1)
+diff --git a/config/msvc-stl-wrapper.template.h b/config/msvc-stl-wrapper.template.h
+--- a/config/msvc-stl-wrapper.template.h
++++ b/config/msvc-stl-wrapper.template.h
+@@ -3,45 +3,33 @@
+  */
+ /* This Source Code Form is subject to the terms of the Mozilla Public
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+ #ifndef mozilla_${HEADER}_h
+ #define mozilla_${HEADER}_h
+ 
+-#ifndef MOZ_HAVE_INCLUDED_ALLOC
+-#define MOZ_HAVE_INCLUDED_ALLOC
+-
+ #if _HAS_EXCEPTIONS
+ #  error "STL code can only be used with -fno-exceptions"
+ #endif
+ 
++// Include mozalloc after the STL header and all other headers it includes
++// have been preprocessed.
++#if !defined(MOZ_INCLUDE_MOZALLOC_H)
++#  define MOZ_INCLUDE_MOZALLOC_H
++#  define MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER}
++#endif
++
+ // Code built with !_HAS_EXCEPTIONS calls std::_Throw(), but the win2k
+ // CRT doesn't export std::_Throw().  So we define it.
+ #ifndef mozilla_Throw_h
+ #  include "mozilla/throw_msvc.h"
+ #endif
+ 
+-// Code might include <new> before other wrapped headers, but <new>
+-// includes <exception> and so we want to wrap it.  But mozalloc.h
+-// wants <new> also, so we break the cycle by always explicitly
+-// including <new> here.
+-#include <${NEW_HEADER_PATH}>
+-
+-// See if we're in code that can use mozalloc.  NB: this duplicates
+-// code in nscore.h because nscore.h pulls in prtypes.h, and chromium
+-// can't build with that being included before base/basictypes.h.
+-#if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
+-#  include "mozilla/mozalloc.h"
+-#else
+-#  error "STL code can only be used with infallible ::operator new()"
+-#endif
+-#endif /* MOZ_HAVE_INCLUDED_ALLOC */
+-
+ #ifdef _DEBUG
+ // From
+ //   http://msdn.microsoft.com/en-us/library/aa985982%28VS.80%29.aspx
+ // and
+ //   http://msdn.microsoft.com/en-us/library/aa985965%28VS.80%29.aspx
+ // there appear to be two types of STL container checking.  The
+ // former is enabled by -D_DEBUG (which is implied by -MDd or -MTd), and
+ // looks to be full generation/mutation checked iterators as done by
+@@ -70,9 +58,20 @@
+ //        but that's OK because we're not throwing them.
+ #pragma warning( push )
+ #pragma warning( disable : 4275 4530 )
+ 
+ #include <${HEADER_PATH}>
+ 
+ #pragma warning( pop )
+ 
++#ifdef MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER}
++// See if we're in code that can use mozalloc.  NB: this duplicates
++// code in nscore.h because nscore.h pulls in prtypes.h, and chromium
++// can't build with that being included before base/basictypes.h.
++#  if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
++#    include "mozilla/mozalloc.h"
++#  else
++#    error "STL code can only be used with infallible ::operator new()"
++#  endif
++#endif
++
+ #endif  // if mozilla_${HEADER}_h
+diff --git a/memory/mozalloc/mozalloc.h b/memory/mozalloc/mozalloc.h
+--- a/memory/mozalloc/mozalloc.h
++++ b/memory/mozalloc/mozalloc.h
+@@ -7,20 +7,27 @@
+ 
+ #ifndef mozilla_mozalloc_h
+ #define mozilla_mozalloc_h
+ 
+ /*
+  * https://bugzilla.mozilla.org/show_bug.cgi?id=427099
+  */
+ 
+-#include <stdlib.h>
+-#include <string.h>
+ #if defined(__cplusplus)
+ #  include <new>
++// Since libstdc++ 6, including the C headers (e.g. stdlib.h) instead of the
++// corresponding C++ header (e.g. cstdlib) can cause confusion in C++ code
++// using things defined there. Specifically, with stdlib.h, the use of abs()
++// in gfx/graphite2/src/inc/UtfCodec.h somehow ends up picking the wrong abs()
++#  include <cstdlib>
++#  include <cstring>
++#else
++#  include <stdlib.h>
++#  include <string.h>
+ #endif
+ 
+ #if defined(__cplusplus)
+ #include "mozilla/fallible.h"
+ #include "mozilla/TemplateLib.h"
+ #endif
+ #include "mozilla/Attributes.h"
+ #include "mozilla/Types.h"
+
recipes-mozilla/firefox/firefox_45.9.0esr.bb +2 -1
index 31baf79..54d1713 100644
@@ -42,7 +42,8 @@ SRC_URI = "https://archive.mozilla.org/pub/firefox/releases/${PV}/source/firefox
            file://0001-use-pkg-config-to-find-nss.patch \
            file://0002-use-pkg-config-to-find-nspr.patch \
            file://0003-do-not-link-against-crmf-library-it-is-not-there.patch \
-           "
+           file://gcc7.patch \
+"
 
 SRC_URI[archive.md5sum] = "f4d83c5150fc5085db20d71862497eb8"
 SRC_URI[archive.sha256sum] = "2afb02029e115fae65dbe1d9c562cbfeb761a6807338bbd30dbffba616cb2d20"
Signature · 1 line
2.13.1
#6 lore raw
In reply to Martin Jansa
Quoted 2 lines · Martin Jansa

* add 2 patches to fix issues detected by gcc7

both patches look ok to me

Quoted 93 lines
---
 recipes-browser/chromium/chromium-browser.inc      |  2 ++
 .../files/0001-v8-fix-build-with-gcc7.patch        | 20 ++++++++++++++
 .../files/0002-WebKit-fix-build-with-gcc7.patch    | 31 ++++++++++++++++++++++
 3 files changed, 53 insertions(+)
 create mode 100644 recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch
 create mode 100644 recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch
recipes-browser/chromium/chromium-browser.inc +2 -0
index ad8e497..08853b1 100644
@@ -26,6 +26,8 @@ SRC_URI = "\
         ${@bb.utils.contains('PACKAGECONFIG', 'disable-api-keys-info-bar', 'file://api-keys.patch;patchdir=${WORKDIR}', '', d)} \
         file://google-chrome.desktop \
         file://unset-madv-free.patch \
+        file://0001-v8-fix-build-with-gcc7.patch \
+        file://0002-WebKit-fix-build-with-gcc7.patch \
 "
 
 S = "${WORKDIR}/chromium-${PV}"
recipes-browser/chromium/files/0001-v8-fix-build-with-gcc7.patch new file +20 -0
new file mode 100644
index 0000000..0fc5bfb
@@ -0,0 +1,20 @@
+Use the fix from nodejs:
+https://github.com/nodejs/node/commit/2a2a5565c298639b823250b571101f51210c50e8
+
+* fixes:
+| ../../git/src/v8/src/objects-body-descriptors.h: In static member function 'static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, int)':
+| ../../git/src/v8/src/objects-body-descriptors.h:102:20: error: no matching function for call to 'v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*&)'
+|      IterateBody(obj);
+|                     ^
+
+--- chromium-54.0.2810.2.orig/v8/src/objects-body-descriptors.h        2016-07-28 12:17:37.000000000 -1000
++++ chromium-54.0.2810.2/v8/src/objects-body-descriptors.h     2017-06-16 01:20:50.026665439 -1000
+@@ -99,7 +99,7 @@
+
+   template <typename StaticVisitor>
+   static inline void IterateBody(HeapObject* obj, int object_size) {
+-    IterateBody(obj);
++    IterateBody<StaticVisitor>(obj);
+   }
+ };
+
recipes-browser/chromium/files/0002-WebKit-fix-build-with-gcc7.patch new file +31 -1
new file mode 100644
index 0000000..284a83c
@@ -0,0 +1,31 @@
+Based on qtwebengine-opensource-src-5.8.0-wtf-gcc7.patch from
+http://git.net/ml/scm-fedora-commits/2017-03/msg15697.html
+
+* Fixes:
+In file included from ../../git/src/third_party/WebKit/Source/platform/heap/ThreadingTraits.h:14:0,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/ThreadState.h:37,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/GarbageCollected.h:8,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Visitor.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/GCInfo.h:8,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Heap.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/heap/Handle.h:34,
+                 from ../../git/src/third_party/WebKit/public/platform/WebPrivatePtr.h:38,
+                 from ../../git/src/third_party/WebKit/public/platform/WebString.h:35,
+                 from ../../git/src/third_party/WebKit/Source/platform/exported/FilePathConversion.cpp:8:
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h: In member function 'void WTF::LinkedHashSet<Value, HashFunctions, HashTraits, Allocator>::swap(WTF::LinkedHashSet<Value, HashFunctions, HashTraits, Allocator>&)':
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h:549:5: error: there are no arguments to 'swapAnchor' that depend on a template parameter, so a declaration of 'swapAnchor' must be available [-fpermissive]
+     swapAnchor(m_anchor, other.m_anchor);
+     ^~~~~~~~~~
+../../git/src/third_party/WebKit/Source/wtf/LinkedHashSet.h:549:5: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
+
+--- chromium-54.0.2810.2.orig/third_party/WebKit/Source/wtf/LinkedHashSet.h    2016-07-28 12:16:12.000000000 -1000
++++ chromium-54.0.2810.2/third_party/WebKit/Source/wtf/LinkedHashSet.h 2017-06-16 02:19:37.928797121 -1000
+@@ -542,6 +542,8 @@
+     return *this;
+ }
+
++inline void swapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b);
++
+ template<typename T, typename U, typename V, typename W>
+ inline void LinkedHashSet<T, U, V, W>::swap(LinkedHashSet& other)
+ {
--

2.13.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel