7
0

Accepting request 903240 from devel:languages:javascript

- Fix build on openSUSE 15.3
- Allow to build on Fedora (not fully working yet)
- Build with gcc
  * add chromium-91-GCC_fix_vector_types_in_pcscan.patch
  * add electron-13-gcc-fix-v8-nodiscard.patch
  * add electron-13-blink-gcc-ambiguous-nodestructor.patch
  * add chromium-gcc11.patch
  * This fixes speed issues

OBS-URL: https://build.opensuse.org/request/show/903240
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/nodejs-electron?expand=0&rev=2
This commit is contained in:
2021-07-01 05:05:47 +00:00
committed by Git OBS Bridge
parent 4a7868ca52
commit 14acc2eb19
6 changed files with 251 additions and 14 deletions

View File

@@ -0,0 +1,36 @@
From: Stephan Hartmann <stha09@googlemail.com>
Subject: GCC: fix vector types in pcscan
Date: Sat Apr 10 17:02:49 2021
References: https://chromium.googlesource.com/chromium/src/+/429e6f78a88473208e96689afa2f6e91f07a4f8c%5E!/#F0
Index: chromium-91.0.4472.57/base/allocator/partition_allocator/starscan/pcscan.cc
===================================================================
--- chromium-91.0.4472.57.orig/base/allocator/partition_allocator/starscan/pcscan.cc
+++ chromium-91.0.4472.57/base/allocator/partition_allocator/starscan/pcscan.cc
@@ -1143,7 +1143,7 @@ class PCScanTask::ScanLoop final {
const __m128i maybe_ptrs =
_mm_loadu_si128(reinterpret_cast<__m128i*>(payload));
const __m128i vand = _mm_and_si128(maybe_ptrs, cage_mask);
- const __m128d vcmp = _mm_cmpeq_epi64(vand, vbase);
+ const __m128i vcmp = _mm_cmpeq_epi64(vand, vbase);
const int mask = _mm_movemask_pd(_mm_castsi128_pd(vcmp));
if (LIKELY(!mask))
continue;
@@ -1153,15 +1153,14 @@ class PCScanTask::ScanLoop final {
if (mask & 0b01) {
quarantine_size +=
pcscan_task_.TryMarkObjectInNormalBuckets<GigaCageLookupPolicy>(
- _mm_cvtsi128_si64(_mm_castpd_si128(maybe_ptrs)));
+ _mm_cvtsi128_si64(maybe_ptrs));
}
if (mask & 0b10) {
// Extraction intrinsics for qwords are only supported in SSE4.1, so
// instead we reshuffle dwords with pshufd. The mask is used to move the
// 4th and 3rd dwords into the second and first position.
static constexpr int kSecondWordMask = (3 << 2) | (2 << 0);
- const __m128i shuffled =
- _mm_shuffle_epi32(_mm_castpd_si128(maybe_ptrs), kSecondWordMask);
+ const __m128i shuffled = _mm_shuffle_epi32(maybe_ptrs, kSecondWordMask);
quarantine_size +=
pcscan_task_.TryMarkObjectInNormalBuckets<GigaCageLookupPolicy>(
_mm_cvtsi128_si64(shuffled));

127
chromium-gcc11.patch Normal file
View File

@@ -0,0 +1,127 @@
diff --git a/third_party/angle/src/libANGLE/HandleAllocator.cpp b/third_party/angle/src/libANGLE/HandleAllocator.cpp
index 013f1dfb2..3ce63c192 100644
--- a/third_party/angle/src/libANGLE/HandleAllocator.cpp
+++ b/third_party/angle/src/libANGLE/HandleAllocator.cpp
@@ -9,6 +9,7 @@
#include "libANGLE/HandleAllocator.h"
+#include <limits>
#include <algorithm>
#include <functional>
diff --git a/third_party/perfetto/src/trace_processor/containers/string_pool.cc b/third_party/perfetto/src/trace_processor/containers/string_pool.cc
index fd651958f..1e8d0606c 100644
--- a/third_party/perfetto/src/trace_processor/containers/string_pool.cc
+++ b/third_party/perfetto/src/trace_processor/containers/string_pool.cc
@@ -14,9 +14,9 @@
* limitations under the License.
*/
+#include <limits>
#include "src/trace_processor/containers/string_pool.h"
-#include <limits>
#include "perfetto/base/logging.h"
#include "perfetto/ext/base/utils.h"
diff --git a/third_party/perfetto/src/trace_processor/db/column.cc b/third_party/perfetto/src/trace_processor/db/column.cc
index 00496b335..0dccfeb8a 100644
--- a/third_party/perfetto/src/trace_processor/db/column.cc
+++ b/third_party/perfetto/src/trace_processor/db/column.cc
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <limits>
#include "src/trace_processor/db/column.h"
#include "src/trace_processor/db/compare.h"
diff --git a/third_party/perfetto/src/trace_processor/types/variadic.cc b/third_party/perfetto/src/trace_processor/types/variadic.cc
index 837bfeba9..cdd56817d 100644
--- a/third_party/perfetto/src/trace_processor/types/variadic.cc
+++ b/third_party/perfetto/src/trace_processor/types/variadic.cc
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <limits>
#include "src/trace_processor/types/variadic.h"
namespace perfetto {
diff --git a/ui/accessibility/platform/ax_platform_atk_hyperlink.cc b/ui/accessibility/platform/ax_platform_atk_hyperlink.cc
index be91def6b..73f202356 100644
--- a/ui/accessibility/platform/ax_platform_atk_hyperlink.cc
+++ b/ui/accessibility/platform/ax_platform_atk_hyperlink.cc
@@ -245,7 +245,7 @@ static void AXPlatformAtkHyperlinkInit(AXPlatformAtkHyperlink* self, gpointer) {
}
GType ax_platform_atk_hyperlink_get_type() {
- static volatile gsize type_volatile = 0;
+ static gsize type_volatile = 0;
AXPlatformNodeAuraLinux::EnsureGTypeInit();
diff --git a/ui/accessibility/platform/ax_platform_node_auralinux.cc b/ui/accessibility/platform/ax_platform_node_auralinux.cc
index 04125c6fd..6c64e5d8e 100644
--- a/ui/accessibility/platform/ax_platform_node_auralinux.cc
+++ b/ui/accessibility/platform/ax_platform_node_auralinux.cc
@@ -2274,7 +2274,7 @@ void ClassInit(gpointer class_pointer, gpointer /* class_data */) {
GType GetType() {
AXPlatformNodeAuraLinux::EnsureGTypeInit();
- static volatile gsize type_volatile = 0;
+ static gsize type_volatile = 0;
if (g_once_init_enter(&type_volatile)) {
static const GTypeInfo type_info = {
sizeof(AXPlatformNodeAuraLinuxClass), // class_size
diff --git a/ui/gtk/gtk_key_bindings_handler.cc b/ui/gtk/gtk_key_bindings_handler.cc
index c663a2074..38a342484 100644
--- a/ui/gtk/gtk_key_bindings_handler.cc
+++ b/ui/gtk/gtk_key_bindings_handler.cc
@@ -141,7 +141,7 @@ void GtkKeyBindingsHandler::HandlerClassInit(HandlerClass* klass) {
}
GType GtkKeyBindingsHandler::HandlerGetType() {
- static volatile gsize type_id_volatile = 0;
+ static gsize type_id_volatile = 0;
if (g_once_init_enter(&type_id_volatile)) {
GType type_id = g_type_register_static_simple(
GTK_TYPE_TEXT_VIEW, g_intern_static_string("GtkKeyBindingsHandler"),
diff --git a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
index c0b5a805b..e6f921926 100644
--- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
+++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <cstddef>
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
#include "base/observer_list.h"
diff --git a/components/bookmarks/browser/bookmark_expanded_state_tracker.cc b/components/bookmarks/browser/bookmark_expanded_state_tracker.cc
index 4ad2afa1f..5c4596e12 100644
--- a/components/bookmarks/browser/bookmark_expanded_state_tracker.cc
+++ b/components/bookmarks/browser/bookmark_expanded_state_tracker.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <cstddef>
#include "components/bookmarks/browser/bookmark_expanded_state_tracker.h"
#include <stdint.h>
diff --git a/components/bookmarks/browser/base_bookmark_model_observer.cc b/components/bookmarks/browser/base_bookmark_model_observer.cc
index 657a3c96b..ad641a082 100644
--- a/components/bookmarks/browser/base_bookmark_model_observer.cc
+++ b/components/bookmarks/browser/base_bookmark_model_observer.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <cstddef>
+
#include "components/bookmarks/browser/base_bookmark_model_observer.h"
namespace bookmarks {

View File

@@ -0,0 +1,17 @@
Index: electron-13.1.4/media/blink/multibuffer_data_source.cc
===================================================================
--- electron-13.1.4.orig/media/blink/multibuffer_data_source.cc 2021-06-25 10:21:41.234607393 +0200
+++ electron-13.1.4/media/blink/multibuffer_data_source.cc 2021-06-28 15:52:42.017709873 +0200
@@ -62,10 +62,10 @@ const int kUpdateBufferSizeFrequency = 3
constexpr base::TimeDelta kSeekDelay = base::TimeDelta::FromMilliseconds(20);
std::vector<std::string>* GetStreamingSchemes() {
- static base::NoDestructor<std::vector<std::string>> streaming_schemes({
+ static base::NoDestructor<std::vector<std::string>> streaming_schemes{{
url::kHttpsScheme,
url::kHttpScheme
- });
+ }};
return streaming_schemes.get();
}

View File

@@ -0,0 +1,13 @@
Index: electron-13.1.4/v8/include/v8config.h
===================================================================
--- electron-13.1.4.orig/v8/include/v8config.h 2021-06-25 16:40:49.550560838 +0200
+++ electron-13.1.4/v8/include/v8config.h 2021-06-25 16:40:59.258618575 +0200
@@ -336,7 +336,7 @@ path. Add it with -I<path> to the comman
# define V8_HAS_ATTRIBUTE_UNUSED 1
# define V8_HAS_ATTRIBUTE_VISIBILITY 1
# define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT (!V8_CC_INTEL)
-# define V8_HAS_CPP_ATTRIBUTE_NODISCARD (V8_HAS_CPP_ATTRIBUTE(nodiscard))
+# define V8_HAS_CPP_ATTRIBUTE_NODISCARD 0
# define V8_HAS_BUILTIN_ASSUME_ALIGNED 1
# define V8_HAS_BUILTIN_CLZ 1

View File

@@ -1,3 +1,19 @@
-------------------------------------------------------------------
Tue Jun 29 07:01:44 UTC 2021 - Andreas Schneider <asn@cryptomilk.org>
- Fix build on openSUSE 15.3
- Allow to build on Fedora (not fully working yet)
-------------------------------------------------------------------
Fri Jun 25 15:10:42 UTC 2021 - Andreas Schneider <asn@cryptomilk.org>
- Build with gcc
* add chromium-91-GCC_fix_vector_types_in_pcscan.patch
* add electron-13-gcc-fix-v8-nodiscard.patch
* add electron-13-blink-gcc-ambiguous-nodestructor.patch
* add chromium-gcc11.patch
* This fixes speed issues
-------------------------------------------------------------------
Fri Jun 25 11:14:11 UTC 2021 - Andreas Schneider <asn@cryptomilk.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package nodejs-electron
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2020 SUSE LLC, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%define mod_name electron
%ifarch x86_64
%if %{?suse_version} > 1500
%if 0%{?suse_version} > 1500 || 0%{?fedora_version}
%bcond_without lto
# else suse_version
%else
@@ -30,7 +30,7 @@
%bcond_with lto
# endif arch x86_64
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200 || 0%{?fedora_version}
%bcond_without pipewire
%else
%bcond_with pipewire
@@ -42,7 +42,7 @@
%endif
# vaapi still requires bundled libvpx
%bcond_with system_vpx
%bcond_without clang
%bcond_with clang
Name: nodejs-electron
Version: 13.1.4
Release: 0
@@ -56,7 +56,11 @@ Source10: electron-launcher.sh
Source11: electron.desktop
Source12: electron-logo-symbolic.svg
Patch0: chromium-90-compiler.patch
%if 0%{?sle_version} < 150300 || 0%{?fedora_version} < 34
# Fixed with ld.gold >= 2.36
# https://sourceware.org/bugzilla/show_bug.cgi?id=26200
Patch1: chromium-disable-parallel-gold.patch
%endif
Patch2: chromium-glibc-2.33.patch
Patch3: chromium-lp152-missing-includes.patch
Patch4: chromium-norar.patch
@@ -67,6 +71,8 @@ Patch8: chromium-91-system-icu.patch
Patch10: chromium-88-gcc-fix-swiftshader-libEGL-visibility.patch
Patch11: chromium-vaapi.patch
Patch12: chromium-86-fix-vaapi-on-intel.patch
Patch13: chromium-91-GCC_fix_vector_types_in_pcscan.patch
Patch14: chromium-gcc11.patch
# Fix building sql recover_module
Patch20: electron-13-fix-sql-virtualcursor-type.patch
# Always disable use_thin_lto which is an lld feature
@@ -77,6 +83,10 @@ Patch21: electron-13-fix-use-thin-lto.patch
# 'nomerge' attribute cannot be applied to a declaration
# See https://reviews.llvm.org/D92800
Patch22: electron-13-fix-base-check-nomerge.patch
# Mark [nodiscard] as unsupported
Patch23: electron-13-gcc-fix-v8-nodiscard.patch
# Fix blink nodestructor
Patch24: electron-13-blink-gcc-ambiguous-nodestructor.patch
BuildRequires: SDL-devel
BuildRequires: binutils-gold
BuildRequires: bison
@@ -92,22 +102,33 @@ BuildRequires: java-openjdk-headless
BuildRequires: libcap-devel
BuildRequires: libdc1394
BuildRequires: libgcrypt-devel
%if 0%{?suse_version}
BuildRequires: libgsm-devel
%else
BuildRequires: gsm-devel
%endif
BuildRequires: libpng-devel
BuildRequires: memory-constraints
BuildRequires: nasm
BuildRequires: ncurses-devel
%if 0%{?suse_version}
BuildRequires: ninja >= 1.7.2
%else
BuildRequires: ninja-build >= 1.7.2
%endif
BuildRequires: nodejs >= 8.0
BuildRequires: npm
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: python
BuildRequires: python-xml
BuildRequires: python2-setuptools
BuildRequires: python2
%if 0%{?suse_version}
BuildRequires: python2-xml
%endif
BuildRequires: rsync
BuildRequires: snappy-devel
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
BuildRequires: util-linux
BuildRequires: wdiff
BuildRequires: perl(Switch)
@@ -115,7 +136,6 @@ BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(cairo) >= 1.6
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(dirac) >= 1.0.0
BuildRequires: pkgconfig(dri)
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(flac++)
@@ -133,10 +153,12 @@ BuildRequires: pkgconfig(jack)
BuildRequires: pkgconfig(kadm-client)
BuildRequires: pkgconfig(kdb)
BuildRequires: pkgconfig(krb5)
%if 0%{?suse_version}
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavfilter)
BuildRequires: pkgconfig(libavformat) >= 58
BuildRequires: pkgconfig(libavutil)
%endif
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libdc1394-2)
@@ -207,7 +229,7 @@ BuildRequires: pkgconfig(vpx) >= 1.8.2
# Always required for clang-format
BuildRequires: clang >= 8.0.0
%if %{without clang}
%if %{?suse_version} > 1500
%if 0%{?suse_version} >= 1550 || 0%{?fedora_version}
BuildRequires: gcc >= 10
BuildRequires: gcc-c++ >= 10
%else
@@ -236,15 +258,15 @@ Nodejs application: Build cross platform desktop apps with JavaScript, HTML, and
# Required for third_party/blink/renderer/bindings/scripts/generate_bindings.py
ln -sf %{_bindir}/clang-format buildtools/linux64/clang-format
# Fix the path to nodejs binary
mkdir -p third_party/node/linux/node-linux-x64/bin
ln -sf %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node
# Fix shim header generation
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
tools/generate_shim_headers/generate_shim_headers.py
%build
# Fix the path to nodejs binary
mkdir -p third_party/node/linux/node-linux-x64/bin
ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node
# GN sets lto on its own and we need just ldflag options, not cflags
%define _lto_cflags %{nil}
@@ -263,7 +285,7 @@ export CXX=clang++
# REDUCE DEBUG as it gets TOO large
ARCH_FLAGS="`echo %{optflags} | sed -e 's/^-g / /g' -e 's/ -g / /g' -e 's/ -g$//g'`"
export CXXFLAGS="${ARCH_FLAGS} -Wno-return-type"
export CXXFLAGS="${CXXFLAGS} ${ARCH_FLAGS} -Wno-return-type"
# extra flags to reduce warnings that aren't very useful
export CXXFLAGS="${CXXFLAGS} -Wno-pedantic -Wno-unused-result -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-deprecated-declarations"
# ignore warnings for minor mistakes that are too common
@@ -277,8 +299,14 @@ export CXXFLAGS="${CXXFLAGS} -Wno-address -Wno-dangling-else -Wno-packed-not-ali
export CFLAGS="${CXXFLAGS}"
export CXXFLAGS="${CXXFLAGS} -Wno-subobject-linkage -Wno-class-memaccess -Wno-invalid-offsetof -fpermissive"
%if 0%{?suse_version} >= 1550 || 0%{?fedora_version}
export CC=gcc
export CXX=g++
%else
export CC=gcc-10
export CXX=g++-10
%endif
# endif with clang
%endif