Skip to content

Commit 2b2120d

Browse files
arnoutjolivain
authored andcommitted
package/qt5/qt5webengine: fix thumb detection logic
Add a patch that removes part of the logic that attempts to detect if thumb is supported. This logic simply doesn't work at all in the Buildroot context. In fact, thumb is supported on all 32-bit ARM on which we can build qt5webengine. Fixes: WARNING: Thumb instruction set is required to build ffmpeg for QtWebEngine. [...] FAILED: obj/third_party/ffmpeg/ffmpeg_internal/vp8.o [...] -c ../../3rdparty/chromium/third_party/ffmpeg/libavcodec/vp8.c -o obj/third_party/ffmpeg/ffmpeg_internal/vp8.o {standard input}: Assembler messages: {standard input}:1119: Error: bad instruction `ldrhcs r0,[ip],#2' {standard input}:1156: Error: bad instruction `ldrhcs r9,[ip],#2' {standard input}:1190: Error: bad instruction `ldrhcs lr,[ip],#2' {standard input}:1253: Error: bad instruction `ldrhcs r9,[r7],#2' [...] Signed-off-by: Arnout Vandecappelle <arnout@rnout.be> Cc: Gaël PORTAY <gael.portay@rtone.fr> Signed-off-by: Julien Olivain <ju.o@free.fr>
1 parent c9ae932 commit 2b2120d

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From b00f7b41ffdee03f9982287d61c2fa21ebee5e6b Mon Sep 17 00:00:00 2001
2+
From: Arnout Vandecappelle <arnout@rnout.be>
3+
Date: Sat, 17 May 2025 22:09:32 +0200
4+
Subject: [PATCH] configure.pri: remove some of the thumb detection logic
5+
6+
The hasThumbFlag test has a roundabout way of discovering whether thumb
7+
is available. It looks at the -mthumb and -marm flag (which does make
8+
some sense), but then it tries to look at -march to determine which ARM
9+
architecture version is used. That test doesn't work if GCC is
10+
configured for a default target architecture and no -march is passed on
11+
the command line.
12+
13+
In Buildroot, we don't pass any -mthumb, -marm or -march in CFLAGS
14+
because all of that is included in the toolchain wrapper. Therefore, the
15+
logic has nothing to determine the target ARM ISA version and returns
16+
false.
17+
18+
As a result, nothing is passed down to gn, and gn adds -marm to the
19+
build. There is in fact a warning about this:
20+
21+
WARNING: Thumb instruction set is required to build ffmpeg for QtWebEngine.
22+
23+
but since it's just a warning, it gets ignored.
24+
25+
Indeed, the build does fail (when ffmpeg is built, i.e. when
26+
BR2_PACKAGE_QT5WEBENGINE_PROPRIETARY_CODECS is enabled) with:
27+
28+
FAILED: obj/third_party/ffmpeg/ffmpeg_internal/vp8.o
29+
[...]
30+
{standard input}: Assembler messages:
31+
{standard input}:1119: Error: bad instruction `ldrhcs r0,[ip],#2'
32+
{standard input}:1156: Error: bad instruction `ldrhcs r9,[ip],#2'
33+
34+
In practice, the architecture version doesn't really matter, because all
35+
the architectures supported by JSCore have thumb.
36+
37+
Therefore, remove the logic for detecting if the CPU architecture
38+
supports thumb. Do keep the -marm and -mthumb logic, even though in
39+
Buildroot it doesn't do anything, and the warning gets ignored.
40+
41+
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
42+
Upstream: It's not clear if the same logic about JSCore applies in
43+
upstream, so not sent.
44+
---
45+
configure.pri | 8 --------
46+
1 file changed, 8 deletions(-)
47+
48+
diff --git a/configure.pri b/configure.pri
49+
index 8da334c83..3ff298e9f 100644
50+
--- a/configure.pri
51+
+++ b/configure.pri
52+
@@ -370,14 +370,6 @@ defineTest(qtConfTest_hasThumbFlag) {
53+
!isEmpty(FLAG): return(true)
54+
FLAG = $$qtwebengine_extractCFlag("-marm")
55+
!isEmpty(FLAG): return(false)
56+
-
57+
- MARCH = $$qtwebengine_extractCFlag("-march=.*")
58+
- MARMV = $$replace(MARCH, "armv",)
59+
- !isEmpty(MARMV) {
60+
- MARMV = $$split(MARMV,)
61+
- MARMV = $$member(MARMV, 0)
62+
- }
63+
- if (isEmpty(MARMV) | lessThan(MARMV, 7)): return(false)
64+
# no flag assume mthumb
65+
return(true)
66+
}
67+
--
68+
2.49.0
69+

0 commit comments

Comments
 (0)