Skip to content

Commit ac9e4bc

Browse files
committed
build: Fix build for Android x86_64
1 parent ea989de commit ac9e4bc

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

depends/packages/qt.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $(package)_qt_libs=corelib network widgets gui plugins testlib
99
$(package)_linguist_tools = lrelease lupdate lconvert
1010
$(package)_patches = qt.pro qttools_src.pro
1111
$(package)_patches += fix_qt_pkgconfig.patch mac-qmake.conf fix_no_printer.patch no-xlib.patch
12-
$(package)_patches += dont_hardcode_x86_64.patch fix_montery_include.patch
12+
$(package)_patches += dont_use_avx_android_x86_64.patch dont_hardcode_x86_64.patch fix_montery_include.patch
1313
$(package)_patches += fix_android_jni_static.patch dont_hardcode_pwd.patch
1414
$(package)_patches += qtbase-moc-ignore-gcc-macro.patch fix_limits_header.patch
1515
$(package)_patches += fix_bigsur_style.patch
@@ -232,6 +232,7 @@ define $(package)_preprocess_cmds
232232
patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch && \
233233
patch -p1 -i $($(package)_patch_dir)/fix_android_jni_static.patch && \
234234
patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \
235+
patch -p1 -i $($(package)_patch_dir)/dont_use_avx_android_x86_64.patch && \
235236
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_x86_64.patch && \
236237
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
237238
patch -p1 -i $($(package)_patch_dir)/fix_limits_header.patch && \
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Android: don't use avx and avx2 when building for Android x86_64
2+
3+
AVX and AVX2 are not supported on x86_64 ABI.
4+
See:
5+
- https://developer.android.com/ndk/guides/abis#86-64
6+
- https://bugreports.qt.io/browse/QTBUG-86785
7+
8+
Upstream commits:
9+
- Qt 6.0: ff1a44be33f4bc05d502a2ca49171e0408992f61
10+
- Qt 5.15: 8b2cc0f6deb038a4c9d4f0d9b690c7726bd809a9
11+
12+
13+
--- old/qtbase/configure.json
14+
+++ new/qtbase/configure.json
15+
@@ -1098,7 +1098,7 @@
16+
},
17+
"avx": {
18+
"label": "AVX",
19+
- "condition": "features.sse4_2 && tests.avx",
20+
+ "condition": "features.sse4_2 && tests.avx && (!config.android || !arch.x86_64)",
21+
"output": [
22+
"privateConfig",
23+
{ "type": "define", "name": "QT_COMPILER_SUPPORTS_AVX", "value": 1 }
24+
@@ -1114,7 +1114,7 @@
25+
},
26+
"avx2": {
27+
"label": "AVX2",
28+
- "condition": "features.avx && tests.avx2",
29+
+ "condition": "features.avx && tests.avx2 && (!config.android || !arch.x86_64)",
30+
"output": [
31+
"privateConfig",
32+
"privateFeature",

0 commit comments

Comments
 (0)