* [Buildroot] [PATCH v3 1/2] package/qt5webengine: fix compile flags for arm
@ 2020-03-06 20:34 Peter Seiderer
2020-03-06 20:34 ` [Buildroot] [PATCH v3 2/2] package/qt5webengine: use buildroot cflags/ldflags " Peter Seiderer
2022-01-09 14:03 ` [Buildroot] [PATCH v3 1/2] package/qt5webengine: fix compile flags " Thomas Petazzoni
0 siblings, 2 replies; 6+ messages in thread
From: Peter Seiderer @ 2020-03-06 20:34 UTC (permalink / raw)
To: buildroot
The qt5webengine configure simple takes QT_ARCH ('arm') to determine the
chromium compiler flags and uses some hard coded ARMv7 default values
for the compiler command line: '... -march=armv7-a -mfloat-abi=hard
-mtune=generic-armv7-a -mfpu=vfpv3-d16 ...'.
This results e.g. in an illegal instruction failure for rpi zero
(reported on the mailing list, see [1]).
Disable all arm custom cpu flags (march/mfloat-abi/mtune/mfpu/mthumb) as
these are already set by the compiler wrapper (via a patch to the chromium
GN build system BUILD.gn file).
Despite the patch set all known values in the chromium GN build
system config file chromium/build/config/arm.gni to not disturb
the compile defines settings logic.
Fixes:
$ /usr/lib/qt/examples/webengine/minimal/minimal
Illegal instruction
[1] http://lists.busybox.net/pipermail/buildroot/2020-February/274587.html
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v1 -> v2:
- use new introduced BR2_GCC_TARGET_ARCH for arm_arch as the
previous simple approach did not work (alternative would
be to extract the arch at runtime via gcc invocation)
Changes v2 -> v3:
- disable all custom arm cpu flags (suggested by Thomas Petazzoni)
Notes:
- patches tested on top of the following two patches from
Nathan Ford
https://patchwork.ozlabs.org/patch/1246679/
https://patchwork.ozlabs.org/patch/1246678/
- to prevent OOM compiled with reduced PARALLEL_JOBS via the following patch:
--- a/package/qt5/qt5webengine/qt5webengine.mk
+++ b/package/qt5/qt5webengine/qt5webengine.mk
@@ -98,7 +98,8 @@ define QT5WEBENGINE_PYTHON2_SYMLINK
endef
QT5WEBENGINE_PRE_CONFIGURE_HOOKS += QT5WEBENGINE_PYTHON2_SYMLINK
-QT5WEBENGINE_ENV += NINJAFLAGS="-j$(PARALLEL_JOBS)"
+# limit to 2/3 PARALLEL_JOBS to prevent OOM situation
+QT5WEBENGINE_ENV += NINJAFLAGS="-j$(shell echo $(PARALLEL_JOBS)*2/3+1 | bc )"
ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
define QT5WEBENGINE_CREATE_HOST_PKG_CONFIG
- to check the compiler inokations enabeld ninja verbose mode via the
following patch:
--- a/package/qt5/qt5webengine/qt5webengine.mk
+++ b/package/qt5/qt5webengine/qt5webengine.mk
@@ -99,7 +99,7 @@ endef
QT5WEBENGINE_PRE_CONFIGURE_HOOKS += QT5WEBENGINE_PYTHON2_SYMLINK
# limit to 2/3 PARALLEL_JOBS to prevent OOM situation
-QT5WEBENGINE_ENV += NINJAFLAGS="-j$(shell echo $(PARALLEL_JOBS)*2/3+1 | bc )"
+QT5WEBENGINE_ENV += NINJAFLAGS="-v -j$(shell echo $(PARALLEL_JOBS)*2/3+1 | bc )"
ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
define QT5WEBENGINE_CREATE_HOST_PKG_CONFIG
---
...n-disable-all-custom-arm-cpu-compile.patch | 79 +++++++++++++++++++
package/qt5/qt5webengine/qt5webengine.mk | 69 ++++++++++++++++
2 files changed, 148 insertions(+)
create mode 100644 package/qt5/qt5webengine/5.12.7/0002-chromium-BUILD.gn-disable-all-custom-arm-cpu-compile.patch
diff --git a/package/qt5/qt5webengine/5.12.7/0002-chromium-BUILD.gn-disable-all-custom-arm-cpu-compile.patch b/package/qt5/qt5webengine/5.12.7/0002-chromium-BUILD.gn-disable-all-custom-arm-cpu-compile.patch
new file mode 100644
index 0000000000..e69ce40696
--- /dev/null
+++ b/package/qt5/qt5webengine/5.12.7/0002-chromium-BUILD.gn-disable-all-custom-arm-cpu-compile.patch
@@ -0,0 +1,79 @@
+From 51e83c5619cedecabcce41f9d2a1e0016ea72e00 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Mon, 2 Mar 2020 21:29:58 +0100
+Subject: [PATCH] chromium/BUILD.gn: disable all custom arm cpu compiler flags
+
+Disable all custom arm cpu compiler flags as these are already set
+by the buildroot compiler wrapper:
+
+ - march
+ - mfloat-abi
+ - mtune
+ - mfpu
+ - mthumb
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ .../chromium/build/config/compiler/BUILD.gn | 23 ++++++++++++-------
+ 1 file changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/src/3rdparty/chromium/build/config/compiler/BUILD.gn b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+index d223a4f6f..16dec5c6a 100644
+--- a/src/3rdparty/chromium/build/config/compiler/BUILD.gn
++++ b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+@@ -672,7 +672,8 @@ config("compiler") {
+ # TODO(pcc): The contents of .ARM.attributes should be based on the
+ # -march flag passed at compile time (see llvm.org/pr36291).
+ if (current_cpu == "arm") {
+- ldflags += [ "-march=$arm_arch" ]
++ # disabled for the buildroot compile
++ # ldflags += [ "-march=$arm_arch" ]
+ }
+ }
+
+@@ -752,13 +753,15 @@ config("compiler_cpu_abi") {
+ ldflags += [ "--target=arm-linux-gnueabihf" ]
+ }
+ if (!is_nacl) {
+- cflags += [
+- "-march=$arm_arch",
+- "-mfloat-abi=$arm_float_abi",
+- ]
++ # disabled for the buildroot compile
++ # cflags += [
++ # "-march=$arm_arch",
++ # "-mfloat-abi=$arm_float_abi",
++ # ]
+ }
+ if (arm_tune != "") {
+- cflags += [ "-mtune=$arm_tune" ]
++ # disabled for the buildroot compile
++ # cflags += [ "-mtune=$arm_tune" ]
+ }
+ } else if (current_cpu == "arm64") {
+ if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
+@@ -1130,7 +1133,9 @@ config("clang_revision") {
+
+ config("compiler_arm_fpu") {
+ if (current_cpu == "arm" && !is_ios && !is_nacl) {
+- cflags = [ "-mfpu=$arm_fpu" ]
++ # disabled for the buildroot compile
++ # cflags = [ "-mfpu=$arm_fpu" ]
++ cflags = []
+ asmflags = cflags
+ }
+ }
+@@ -1138,7 +1143,9 @@ config("compiler_arm_fpu") {
+ config("compiler_arm_thumb") {
+ if (current_cpu == "arm" && arm_use_thumb && is_posix &&
+ !(is_mac || is_ios || is_nacl)) {
+- cflags = [ "-mthumb" ]
++ # disabled for the buildroot compile
++ # cflags = [ "-mthumb" ]
++ cflags = []
+ if (is_android && !is_clang) {
+ # Clang doesn't support this option.
+ cflags += [ "-mthumb-interwork" ]
+--
+2.25.1
+
diff --git a/package/qt5/qt5webengine/qt5webengine.mk b/package/qt5/qt5webengine/qt5webengine.mk
index 45d175cfb1..7337b67e9d 100644
--- a/package/qt5/qt5webengine/qt5webengine.mk
+++ b/package/qt5/qt5webengine/qt5webengine.mk
@@ -109,7 +109,76 @@ QT5WEBENGINE_PRE_CONFIGURE_HOOKS += QT5WEBENGINE_CREATE_HOST_PKG_CONFIG
QT5WEBENGINE_ENV += GN_PKG_CONFIG_HOST=$(@D)/host-bin/host-pkg-config
endif
+# configure arm architecture paramter for chromium compile
+ifeq ($(BR2_arm),y)
+ifeq ($(BR2_ARM_CPU_ARMV4),y)
+define QT5WEBENGINE_CONFIGURE_ARM_VERSION
+ $(SED) 's/^ arm_version = 7$$/ arm_version = 4/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+endif
+
+ifeq ($(BR2_ARM_CPU_ARMV5),y)
+define QT5WEBENGINE_CONFIGURE_ARM_VERSION
+ $(SED) 's/^ arm_version = 7$$/ arm_version = 5/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+endif
+
+ifeq ($(BR2_ARM_CPU_ARMV6),y)
+define QT5WEBENGINE_CONFIGURE_ARM_VERSION
+ $(SED) 's/^ arm_version = 7$$/ arm_version = 6/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+endif
+
+# no entriy for BR2_ARM_CPU_ARMV7A/BR2_ARM_CPU_ARMV7M, arm_vesion = 7 is already set by default
+
+ifeq ($(BR2_ARM_CPU_ARMV8A),y)
+define QT5WEBENGINE_CONFIGURE_ARM_VERSION
+ $(SED) 's/^ arm_version = 7$$/ arm_version = 8/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+endif
+
+# not known by buildroot, set to some dummy to disable all default logic
+define QT5WEBENGINE_CONFIGURE_ARM_ARCH
+ $(SED) 's/^ arm_arch = ""$$/ arm_arch = "arm-dummy-arch"/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+
+define QT5WEBENGINE_CONFIGURE_ARM_FPU
+ $(SED) 's/^ arm_fpu = ""$$/ arm_fpu = $(BR2_GCC_TARGET_FPU)/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+
+define QT5WEBENGINE_CONFIGURE_ARM_FLOAT_ABI
+ $(SED) 's/^ arm_float_abi = ""$$/ arm_float_abi = $(BR2_GCC_TARGET_FLOAT_ABI)/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+
+define QT5WEBENGINE_CONFIGURE_ARM_TUNE
+ $(SED) 's/^ arm_tune = ""$$/ arm_tune = $(BR2_GCC_TARGET_CPU)/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+
+ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
+define QT5WEBENGINE_CONFIGURE_ARM_NEON
+ $(SED) 's/^ arm_use_neon = ""$$/ arm_use_neon = "true"/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+else
+define QT5WEBENGINE_CONFIGURE_ARM_NEON
+ $(SED) 's/^ arm_use_neon = ""$$/ arm_use_neon = "false"/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+endif
+
+ifeq ($(BR2_ARM_CPU_HAS_THUMB),)
+define QT5WEBENGINE_CONFIGURE_ARM_THUMB
+ $(SED) 's/^ arm_use_thumb = true$$/ arm_use_thumb = false/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
+endef
+endif
+endif
+
define QT5WEBENGINE_CONFIGURE_CMDS
+ $(QT5WEBENGINE_CONFIGURE_ARM_VERSION)
+ $(QT5WEBENGINE_CONFIGURE_ARM_ARCH)
+ $(QT5WEBENGINE_CONFIGURE_ARM_FPU)
+ $(QT5WEBENGINE_CONFIGURE_ARM_FLOAT_ABI)
+ $(QT5WEBENGINE_CONFIGURE_ARM_TUNE)
+ $(QT5WEBENGINE_CONFIGURE_ARM_NEON)
+ $(QT5WEBENGINE_CONFIGURE_ARM_THUMB)
(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBENGINE_ENV) $(HOST_DIR)/bin/qmake $(QT5WEBENGINE_QMAKEFLAGS))
endef
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [Buildroot] [PATCH v3 2/2] package/qt5webengine: use buildroot cflags/ldflags for arm
2020-03-06 20:34 [Buildroot] [PATCH v3 1/2] package/qt5webengine: fix compile flags for arm Peter Seiderer
@ 2020-03-06 20:34 ` Peter Seiderer
2022-01-09 14:03 ` Thomas Petazzoni
2022-01-09 14:03 ` [Buildroot] [PATCH v3 1/2] package/qt5webengine: fix compile flags " Thomas Petazzoni
1 sibling, 1 reply; 6+ messages in thread
From: Peter Seiderer @ 2020-03-06 20:34 UTC (permalink / raw)
To: buildroot
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v2 -> v3:
- new patch
Notes:
- optional patch, maybe the whole setting of the additional
buildroot cflags/ldflags is to much?
Example command line without this additional patch:
.../host/bin/arm-buildroot-linux-gnueabihf-g++ -MMD -MF obj/base/base/base_jumbo_4.o.d -DUSE_SYMBOLIZE -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCR_SYSROOT_HASH=b2165ab47ab9c4cc780db53ace1b08607d68ae31 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBASE_IMPLEMENTATION -I. -Igen -I../../3rdparty/chromium -Igen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -pthread -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-dangling-else -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-unused-parameter -fno-omit-frame-pointer -g0 -fvisibility=hidden -O2 -fno-ident -fdata-sections -ffunction-sections -std=gnu++14 -Wno-narrowing -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -fno-exceptions -fno-rtti --sysroot=../../../../../host/arm-buildroot-linux-gnueabihf/sysroot -fvisibility-inlines-hidden -c gen/base/base_jumbo_4.cc -o obj/base/base/base_jumbo_4.o
Example command line with this additional patch:
.../host/bin/arm-buildroot-linux-gnueabihf-g++ -MMD -MF obj/base/base/base_jumbo_4.o.d -DUSE_SYMBOLIZE -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCR_SYSROOT_HASH=b2165ab47ab9c4cc780db53ace1b08607d68ae31 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBASE_IMPLEMENTATION -I. -Igen -I../../3rdparty/chromium -Igen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -pthread -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-dangling-else -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-unused-parameter -fno-omit-frame-pointer -g0 -fvisibility=hidden -O2 -fno-ident -fdata-sections -ffunction-sections -std=gnu++14 -Wno-narrowing -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -fno-exceptions -fno-rtti --sysroot=../../../../../host/arm-buildroot-linux-gnueabihf/sysroot -fvisibility-inlines-hidden -c gen/base/base_jumbo_4.cc -o obj/base/base/base_jumbo_4.o
---
...n-use-buildroot-provided-cflags-ldfl.patch | 42 +++++++++++++++++++
package/qt5/qt5webengine/qt5webengine.mk | 6 +++
2 files changed, 48 insertions(+)
create mode 100644 package/qt5/qt5webengine/5.12.7/0003-chromium-BUILD.gn-use-buildroot-provided-cflags-ldfl.patch
diff --git a/package/qt5/qt5webengine/5.12.7/0003-chromium-BUILD.gn-use-buildroot-provided-cflags-ldfl.patch b/package/qt5/qt5webengine/5.12.7/0003-chromium-BUILD.gn-use-buildroot-provided-cflags-ldfl.patch
new file mode 100644
index 0000000000..52ddc2d878
--- /dev/null
+++ b/package/qt5/qt5webengine/5.12.7/0003-chromium-BUILD.gn-use-buildroot-provided-cflags-ldfl.patch
@@ -0,0 +1,42 @@
+From f647383e9af9896a7a0247d20b3db480c14863f3 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Fri, 6 Mar 2020 18:55:02 +0100
+Subject: [PATCH] chromium/BUILD.gn: use buildroot provided cflags/ldflags
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ src/3rdparty/chromium/build/config/compiler/BUILD.gn | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/src/3rdparty/chromium/build/config/compiler/BUILD.gn b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+index 16dec5c6a..e2c5982f5 100644
+--- a/src/3rdparty/chromium/build/config/compiler/BUILD.gn
++++ b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+@@ -672,8 +672,8 @@ config("compiler") {
+ # TODO(pcc): The contents of .ARM.attributes should be based on the
+ # -march flag passed at compile time (see llvm.org/pr36291).
+ if (current_cpu == "arm") {
+- # disabled for the buildroot compile
+- # ldflags += [ "-march=$arm_arch" ]
++ # will be set by buildroot
++ ldflags += [ @TARGET_LDFLAGS@ ]
+ }
+ }
+
+@@ -753,11 +753,8 @@ config("compiler_cpu_abi") {
+ ldflags += [ "--target=arm-linux-gnueabihf" ]
+ }
+ if (!is_nacl) {
+- # disabled for the buildroot compile
+- # cflags += [
+- # "-march=$arm_arch",
+- # "-mfloat-abi=$arm_float_abi",
+- # ]
++ # will be set by buildroot
++ cflags += [ @TARGET_CXXFLAGS@ ]
+ }
+ if (arm_tune != "") {
+ # disabled for the buildroot compile
+--
+2.25.1
+
diff --git a/package/qt5/qt5webengine/qt5webengine.mk b/package/qt5/qt5webengine/qt5webengine.mk
index 7337b67e9d..a60a19df88 100644
--- a/package/qt5/qt5webengine/qt5webengine.mk
+++ b/package/qt5/qt5webengine/qt5webengine.mk
@@ -169,6 +169,11 @@ define QT5WEBENGINE_CONFIGURE_ARM_THUMB
$(SED) 's/^ arm_use_thumb = true$$/ arm_use_thumb = false/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
endef
endif
+
+define QT5WEBENGINE_CONFIGURE_COMPILER_FLAGS
+ $(SED) 's%@TARGET_CXXFLAGS@%$(call make-comma-list,$(TARGET_CXXFLAGS))%g' $(@D)/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+ $(SED) 's%@TARGET_LDFLAGS@%$(call make-comma-list,$(TARGET_LDFLAGS))%g' $(@D)/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+endef
endif
define QT5WEBENGINE_CONFIGURE_CMDS
@@ -179,6 +184,7 @@ define QT5WEBENGINE_CONFIGURE_CMDS
$(QT5WEBENGINE_CONFIGURE_ARM_TUNE)
$(QT5WEBENGINE_CONFIGURE_ARM_NEON)
$(QT5WEBENGINE_CONFIGURE_ARM_THUMB)
+ $(QT5WEBENGINE_CONFIGURE_COMPILER_FLAGS)
(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBENGINE_ENV) $(HOST_DIR)/bin/qmake $(QT5WEBENGINE_QMAKEFLAGS))
endef
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [Buildroot] [PATCH v3 2/2] package/qt5webengine: use buildroot cflags/ldflags for arm
2020-03-06 20:34 ` [Buildroot] [PATCH v3 2/2] package/qt5webengine: use buildroot cflags/ldflags " Peter Seiderer
@ 2022-01-09 14:03 ` Thomas Petazzoni
2022-01-15 22:57 ` Peter Seiderer
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2022-01-09 14:03 UTC (permalink / raw)
To: Peter Seiderer; +Cc: buildroot, Julien Corjon, Gaël Portay
On Fri, 6 Mar 2020 21:34:10 +0100
Peter Seiderer <ps.report@gmx.net> wrote:
> +define QT5WEBENGINE_CONFIGURE_COMPILER_FLAGS
> + $(SED) 's%@TARGET_CXXFLAGS@%$(call make-comma-list,$(TARGET_CXXFLAGS))%g' $(@D)/src/3rdparty/chromium/build/config/compiler/BUILD.gn
> + $(SED) 's%@TARGET_LDFLAGS@%$(call make-comma-list,$(TARGET_LDFLAGS))%g' $(@D)/src/3rdparty/chromium/build/config/compiler/BUILD.gn
> +endef
This looks like a good thing. Could it replace the ARM-specific logic
you had in your PATCH 1/2 ?
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH v3 2/2] package/qt5webengine: use buildroot cflags/ldflags for arm
2022-01-09 14:03 ` Thomas Petazzoni
@ 2022-01-15 22:57 ` Peter Seiderer
0 siblings, 0 replies; 6+ messages in thread
From: Peter Seiderer @ 2022-01-15 22:57 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot, Julien Corjon, Gaël Portay
Hello Thomas,
On Sun, 9 Jan 2022 15:03:59 +0100, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> On Fri, 6 Mar 2020 21:34:10 +0100
> Peter Seiderer <ps.report@gmx.net> wrote:
>
> > +define QT5WEBENGINE_CONFIGURE_COMPILER_FLAGS
> > + $(SED) 's%@TARGET_CXXFLAGS@%$(call make-comma-list,$(TARGET_CXXFLAGS))%g' $(@D)/src/3rdparty/chromium/build/config/compiler/BUILD.gn
> > + $(SED) 's%@TARGET_LDFLAGS@%$(call make-comma-list,$(TARGET_LDFLAGS))%g' $(@D)/src/3rdparty/chromium/build/config/compiler/BUILD.gn
> > +endef
>
> This looks like a good thing. Could it replace the ARM-specific logic
> you had in your PATCH 1/2 ?
Not sure as there is more optional and/or compile defines logic depending on
the various arm-options logic..., the save way seems to be the right setting
of the various arm-options (but did not find a better way as to edit/sed the
GN files...
Regards,
Peter
>
> Thomas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH v3 1/2] package/qt5webengine: fix compile flags for arm
2020-03-06 20:34 [Buildroot] [PATCH v3 1/2] package/qt5webengine: fix compile flags for arm Peter Seiderer
2020-03-06 20:34 ` [Buildroot] [PATCH v3 2/2] package/qt5webengine: use buildroot cflags/ldflags " Peter Seiderer
@ 2022-01-09 14:03 ` Thomas Petazzoni
2022-01-15 22:53 ` Peter Seiderer
1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2022-01-09 14:03 UTC (permalink / raw)
To: Peter Seiderer; +Cc: buildroot, James Hilliard, Julien Corjon, Gaël Portay
Hello Peter,
On Fri, 6 Mar 2020 21:34:09 +0100
Peter Seiderer <ps.report@gmx.net> wrote:
> The qt5webengine configure simple takes QT_ARCH ('arm') to determine the
> chromium compiler flags and uses some hard coded ARMv7 default values
> for the compiler command line: '... -march=armv7-a -mfloat-abi=hard
> -mtune=generic-armv7-a -mfpu=vfpv3-d16 ...'.
>
> This results e.g. in an illegal instruction failure for rpi zero
> (reported on the mailing list, see [1]).
>
> Disable all arm custom cpu flags (march/mfloat-abi/mtune/mfpu/mthumb) as
> these are already set by the compiler wrapper (via a patch to the chromium
> GN build system BUILD.gn file).
>
> Despite the patch set all known values in the chromium GN build
> system config file chromium/build/config/arm.gni to not disturb
> the compile defines settings logic.
It's been a very long time since this patch was posted. Does the
problem still occur? There is a patch series from James Hilliard
upgrading qt5webengine:
https://patchwork.ozlabs.org/project/buildroot/list/?series=279766
Some more questions below.
> +diff --git a/src/3rdparty/chromium/build/config/compiler/BUILD.gn b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
> +index d223a4f6f..16dec5c6a 100644
> +--- a/src/3rdparty/chromium/build/config/compiler/BUILD.gn
> ++++ b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
> +@@ -672,7 +672,8 @@ config("compiler") {
> + # TODO(pcc): The contents of .ARM.attributes should be based on the
> + # -march flag passed at compile time (see llvm.org/pr36291).
> + if (current_cpu == "arm") {
> +- ldflags += [ "-march=$arm_arch" ]
> ++ # disabled for the buildroot compile
> ++ # ldflags += [ "-march=$arm_arch" ]
> + }
> + }
> +
> +@@ -752,13 +753,15 @@ config("compiler_cpu_abi") {
> + ldflags += [ "--target=arm-linux-gnueabihf" ]
> + }
> + if (!is_nacl) {
> +- cflags += [
> +- "-march=$arm_arch",
> +- "-mfloat-abi=$arm_float_abi",
> +- ]
> ++ # disabled for the buildroot compile
> ++ # cflags += [
> ++ # "-march=$arm_arch",
> ++ # "-mfloat-abi=$arm_float_abi",
> ++ # ]
> + }
> + if (arm_tune != "") {
> +- cflags += [ "-mtune=$arm_tune" ]
> ++ # disabled for the buildroot compile
> ++ # cflags += [ "-mtune=$arm_tune" ]
> + }
> + } else if (current_cpu == "arm64") {
> + if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
> +@@ -1130,7 +1133,9 @@ config("clang_revision") {
> +
> + config("compiler_arm_fpu") {
> + if (current_cpu == "arm" && !is_ios && !is_nacl) {
> +- cflags = [ "-mfpu=$arm_fpu" ]
> ++ # disabled for the buildroot compile
> ++ # cflags = [ "-mfpu=$arm_fpu" ]
> ++ cflags = []
> + asmflags = cflags
> + }
> + }
> +@@ -1138,7 +1143,9 @@ config("compiler_arm_fpu") {
> + config("compiler_arm_thumb") {
> + if (current_cpu == "arm" && arm_use_thumb && is_posix &&
> + !(is_mac || is_ios || is_nacl)) {
> +- cflags = [ "-mthumb" ]
> ++ # disabled for the buildroot compile
> ++ # cflags = [ "-mthumb" ]
> ++ cflags = []
> + if (is_android && !is_clang) {
> + # Clang doesn't support this option.
> + cflags += [ "-mthumb-interwork" ]
You're fixing the problem for ARM, but is there some similar mess for
other CPU architectures?
> +# configure arm architecture paramter for chromium compile
> +ifeq ($(BR2_arm),y)
> +ifeq ($(BR2_ARM_CPU_ARMV4),y)
> +define QT5WEBENGINE_CONFIGURE_ARM_VERSION
> + $(SED) 's/^ arm_version = 7$$/ arm_version = 4/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +endif
> +
> +ifeq ($(BR2_ARM_CPU_ARMV5),y)
> +define QT5WEBENGINE_CONFIGURE_ARM_VERSION
> + $(SED) 's/^ arm_version = 7$$/ arm_version = 5/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +endif
> +
> +ifeq ($(BR2_ARM_CPU_ARMV6),y)
> +define QT5WEBENGINE_CONFIGURE_ARM_VERSION
> + $(SED) 's/^ arm_version = 7$$/ arm_version = 6/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +endif
> +
> +# no entriy for BR2_ARM_CPU_ARMV7A/BR2_ARM_CPU_ARMV7M, arm_vesion = 7 is already set by default
> +
> +ifeq ($(BR2_ARM_CPU_ARMV8A),y)
> +define QT5WEBENGINE_CONFIGURE_ARM_VERSION
> + $(SED) 's/^ arm_version = 7$$/ arm_version = 8/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +endif
> +
> +# not known by buildroot, set to some dummy to disable all default logic
> +define QT5WEBENGINE_CONFIGURE_ARM_ARCH
> + $(SED) 's/^ arm_arch = ""$$/ arm_arch = "arm-dummy-arch"/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +
> +define QT5WEBENGINE_CONFIGURE_ARM_FPU
> + $(SED) 's/^ arm_fpu = ""$$/ arm_fpu = $(BR2_GCC_TARGET_FPU)/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +
> +define QT5WEBENGINE_CONFIGURE_ARM_FLOAT_ABI
> + $(SED) 's/^ arm_float_abi = ""$$/ arm_float_abi = $(BR2_GCC_TARGET_FLOAT_ABI)/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +
> +define QT5WEBENGINE_CONFIGURE_ARM_TUNE
> + $(SED) 's/^ arm_tune = ""$$/ arm_tune = $(BR2_GCC_TARGET_CPU)/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +
> +ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
> +define QT5WEBENGINE_CONFIGURE_ARM_NEON
> + $(SED) 's/^ arm_use_neon = ""$$/ arm_use_neon = "true"/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +else
> +define QT5WEBENGINE_CONFIGURE_ARM_NEON
> + $(SED) 's/^ arm_use_neon = ""$$/ arm_use_neon = "false"/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +endif
> +
> +ifeq ($(BR2_ARM_CPU_HAS_THUMB),)
> +define QT5WEBENGINE_CONFIGURE_ARM_THUMB
> + $(SED) 's/^ arm_use_thumb = true$$/ arm_use_thumb = false/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> +endef
> +endif
> +endif
What are all those variables doing in the GN Chromium stuff?
I'm kind of worried by two aspects:
- This is all very ARM specific, but we have other CPU architectures
supported in Buildroot
- We already pass the proper CFLAGS, so it's always annoying to
duplicate this logic into package-specific flags
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Buildroot] [PATCH v3 1/2] package/qt5webengine: fix compile flags for arm
2022-01-09 14:03 ` [Buildroot] [PATCH v3 1/2] package/qt5webengine: fix compile flags " Thomas Petazzoni
@ 2022-01-15 22:53 ` Peter Seiderer
0 siblings, 0 replies; 6+ messages in thread
From: Peter Seiderer @ 2022-01-15 22:53 UTC (permalink / raw)
To: Thomas Petazzoni
Cc: buildroot, James Hilliard, Julien Corjon, Gaël Portay
Hello Thomas,
On Sun, 9 Jan 2022 15:03:04 +0100, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> Hello Peter,
>
> On Fri, 6 Mar 2020 21:34:09 +0100
> Peter Seiderer <ps.report@gmx.net> wrote:
>
> > The qt5webengine configure simple takes QT_ARCH ('arm') to determine the
> > chromium compiler flags and uses some hard coded ARMv7 default values
> > for the compiler command line: '... -march=armv7-a -mfloat-abi=hard
> > -mtune=generic-armv7-a -mfpu=vfpv3-d16 ...'.
> >
> > This results e.g. in an illegal instruction failure for rpi zero
> > (reported on the mailing list, see [1]).
> >
> > Disable all arm custom cpu flags (march/mfloat-abi/mtune/mfpu/mthumb) as
> > these are already set by the compiler wrapper (via a patch to the chromium
> > GN build system BUILD.gn file).
> >
> > Despite the patch set all known values in the chromium GN build
> > system config file chromium/build/config/arm.gni to not disturb
> > the compile defines settings logic.
>
> It's been a very long time since this patch was posted. Does the
> problem still occur? There is a patch series from James Hilliard
> upgrading qt5webengine:
>
> https://patchwork.ozlabs.org/project/buildroot/list/?series=279766
Problem still exits with qt5webengine-5.15.2 and qt5webengine-5.15.8...
>
> Some more questions below.
>
> > +diff --git a/src/3rdparty/chromium/build/config/compiler/BUILD.gn b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
> > +index d223a4f6f..16dec5c6a 100644
> > +--- a/src/3rdparty/chromium/build/config/compiler/BUILD.gn
> > ++++ b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
> > +@@ -672,7 +672,8 @@ config("compiler") {
> > + # TODO(pcc): The contents of .ARM.attributes should be based on the
> > + # -march flag passed at compile time (see llvm.org/pr36291).
> > + if (current_cpu == "arm") {
> > +- ldflags += [ "-march=$arm_arch" ]
> > ++ # disabled for the buildroot compile
> > ++ # ldflags += [ "-march=$arm_arch" ]
> > + }
> > + }
> > +
> > +@@ -752,13 +753,15 @@ config("compiler_cpu_abi") {
> > + ldflags += [ "--target=arm-linux-gnueabihf" ]
> > + }
> > + if (!is_nacl) {
> > +- cflags += [
> > +- "-march=$arm_arch",
> > +- "-mfloat-abi=$arm_float_abi",
> > +- ]
> > ++ # disabled for the buildroot compile
> > ++ # cflags += [
> > ++ # "-march=$arm_arch",
> > ++ # "-mfloat-abi=$arm_float_abi",
> > ++ # ]
> > + }
> > + if (arm_tune != "") {
> > +- cflags += [ "-mtune=$arm_tune" ]
> > ++ # disabled for the buildroot compile
> > ++ # cflags += [ "-mtune=$arm_tune" ]
> > + }
> > + } else if (current_cpu == "arm64") {
> > + if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
> > +@@ -1130,7 +1133,9 @@ config("clang_revision") {
> > +
> > + config("compiler_arm_fpu") {
> > + if (current_cpu == "arm" && !is_ios && !is_nacl) {
> > +- cflags = [ "-mfpu=$arm_fpu" ]
> > ++ # disabled for the buildroot compile
> > ++ # cflags = [ "-mfpu=$arm_fpu" ]
> > ++ cflags = []
> > + asmflags = cflags
> > + }
> > + }
> > +@@ -1138,7 +1143,9 @@ config("compiler_arm_fpu") {
> > + config("compiler_arm_thumb") {
> > + if (current_cpu == "arm" && arm_use_thumb && is_posix &&
> > + !(is_mac || is_ios || is_nacl)) {
> > +- cflags = [ "-mthumb" ]
> > ++ # disabled for the buildroot compile
> > ++ # cflags = [ "-mthumb" ]
> > ++ cflags = []
> > + if (is_android && !is_clang) {
> > + # Clang doesn't support this option.
> > + cflags += [ "-mthumb-interwork" ]
>
> You're fixing the problem for ARM, but is there some similar mess for
> other CPU architectures?
>
> > +# configure arm architecture paramter for chromium compile
> > +ifeq ($(BR2_arm),y)
> > +ifeq ($(BR2_ARM_CPU_ARMV4),y)
> > +define QT5WEBENGINE_CONFIGURE_ARM_VERSION
> > + $(SED) 's/^ arm_version = 7$$/ arm_version = 4/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +endif
> > +
> > +ifeq ($(BR2_ARM_CPU_ARMV5),y)
> > +define QT5WEBENGINE_CONFIGURE_ARM_VERSION
> > + $(SED) 's/^ arm_version = 7$$/ arm_version = 5/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +endif
> > +
> > +ifeq ($(BR2_ARM_CPU_ARMV6),y)
> > +define QT5WEBENGINE_CONFIGURE_ARM_VERSION
> > + $(SED) 's/^ arm_version = 7$$/ arm_version = 6/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +endif
> > +
> > +# no entriy for BR2_ARM_CPU_ARMV7A/BR2_ARM_CPU_ARMV7M, arm_vesion = 7 is already set by default
> > +
> > +ifeq ($(BR2_ARM_CPU_ARMV8A),y)
> > +define QT5WEBENGINE_CONFIGURE_ARM_VERSION
> > + $(SED) 's/^ arm_version = 7$$/ arm_version = 8/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +endif
> > +
> > +# not known by buildroot, set to some dummy to disable all default logic
> > +define QT5WEBENGINE_CONFIGURE_ARM_ARCH
> > + $(SED) 's/^ arm_arch = ""$$/ arm_arch = "arm-dummy-arch"/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +
> > +define QT5WEBENGINE_CONFIGURE_ARM_FPU
> > + $(SED) 's/^ arm_fpu = ""$$/ arm_fpu = $(BR2_GCC_TARGET_FPU)/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +
> > +define QT5WEBENGINE_CONFIGURE_ARM_FLOAT_ABI
> > + $(SED) 's/^ arm_float_abi = ""$$/ arm_float_abi = $(BR2_GCC_TARGET_FLOAT_ABI)/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +
> > +define QT5WEBENGINE_CONFIGURE_ARM_TUNE
> > + $(SED) 's/^ arm_tune = ""$$/ arm_tune = $(BR2_GCC_TARGET_CPU)/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +
> > +ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
> > +define QT5WEBENGINE_CONFIGURE_ARM_NEON
> > + $(SED) 's/^ arm_use_neon = ""$$/ arm_use_neon = "true"/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +else
> > +define QT5WEBENGINE_CONFIGURE_ARM_NEON
> > + $(SED) 's/^ arm_use_neon = ""$$/ arm_use_neon = "false"/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +endif
> > +
> > +ifeq ($(BR2_ARM_CPU_HAS_THUMB),)
> > +define QT5WEBENGINE_CONFIGURE_ARM_THUMB
> > + $(SED) 's/^ arm_use_thumb = true$$/ arm_use_thumb = false/' $(@D)/src/3rdparty/chromium/build/config/arm.gni
> > +endef
> > +endif
> > +endif
>
> What are all those variables doing in the GN Chromium stuff?
Setting compiler flags e.g.
arm_use_thumb --> -mthumb
arm_use_neon --> -DUSE_NEON and influences arm_fpu setting (if not already set)...
>
> I'm kind of worried by two aspects:
>
> - This is all very ARM specific, but we have other CPU architectures
> supported in Buildroot
Yes there is a although some x86/x64 logic setting e.g. -m32/-m64 and
-msse2/-mfpmath=sse/-mmmx and some mips/ppc/s390 and more..., but did
only take a deeper look at the arm part as the reported failure was
about rpi-zero...
>
> - We already pass the proper CFLAGS, so it's always annoying to
> duplicate this logic into package-specific flags
Yes... ;-)
Regards,
Peter
>
> Thomas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-01-15 22:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-06 20:34 [Buildroot] [PATCH v3 1/2] package/qt5webengine: fix compile flags for arm Peter Seiderer
2020-03-06 20:34 ` [Buildroot] [PATCH v3 2/2] package/qt5webengine: use buildroot cflags/ldflags " Peter Seiderer
2022-01-09 14:03 ` Thomas Petazzoni
2022-01-15 22:57 ` Peter Seiderer
2022-01-09 14:03 ` [Buildroot] [PATCH v3 1/2] package/qt5webengine: fix compile flags " Thomas Petazzoni
2022-01-15 22:53 ` Peter Seiderer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.