libcamera, libqmi, modemmanager: build for the cores the phone has

Same string as the kernel commit, for the three compiled aports this image
builds itself: -march=armv8.6-a+fp16fml+aes+sha3+sm4 -mtune=cortex-a720
appended to CFLAGS (and CXXFLAGS for libcamera). abuild builds these with
Alpine's GCC; the string is gcc's own -march=native expansion on the phone
re-based on armv8.6-a, and it assembles on GCC 15 with binutils 2.45.1 and
on GCC 16 (whose -mcpu=cortex-a720 expansion binutils 2.45 rejects). On the
phone itself gcc -flto, g++ and clang all compile, link and run it.

The base stops at 8.6 on purpose: this phone exposes neither SVE nor MTE
(userspace autovectorised for SVE2 would SIGILL), and not WFxT either.

pkgrel bumps so apk upgrade delivers the rebuilt binaries.
This commit is contained in:
Jorijn van der Graaf 2026-09-06 00:02:19 +02:00
commit cb089bcad1
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
3 changed files with 19 additions and 16 deletions

View file

@ -84,12 +84,13 @@ builddir="$srcdir/$pkgname-v$_pkgver"
# manual strip because ipa .sign files depend on the file contents- have to re-sign after strip
options="!strip !check"
# fp6-img: this package only ever runs on the FP6 (4x Cortex-A520 + 4x
# Cortex-A720), so tune for it. Spelled -march/-mtune, not -mcpu: GCC 16
# expands -mcpu=cortex-a720 into a +sve-bitperm token that binutils 2.45
# rejects at the assembler. +nosve+nomemtag: the FP6 exposes neither SVE nor
# MTE (no sve/mte hwcaps), and without them the code would SIGILL.
export CFLAGS="$CFLAGS -march=armv9.2-a+nosve+nomemtag -mtune=cortex-a720"
export CXXFLAGS="$CXXFLAGS -march=armv9.2-a+nosve+nomemtag -mtune=cortex-a720"
# Cortex-A720), so build for it. armv8.6-a is the highest level whose
# mandatory set the phone exposes (8.7 would assume WFxT, 9.x SVE2; neither
# is in its hwcaps); +fp16fml+aes+sha3+sm4 are the optional extensions it
# has, the same set `gcc -march=native` derives on the phone. One spelling
# for gcc and clang, and the same string the kernel aport uses.
export CFLAGS="$CFLAGS -march=armv8.6-a+fp16fml+aes+sha3+sm4 -mtune=cortex-a720"
export CXXFLAGS="$CXXFLAGS -march=armv8.6-a+fp16fml+aes+sha3+sm4 -mtune=cortex-a720"
case "$CARCH" in
arm*|aarch64)

View file

@ -28,11 +28,12 @@ makedepends="
# failure), same as modemmanager; build under plain qemu.
options="!pmb:crossdirect"
# fp6-img: this package only ever runs on the FP6 (4x Cortex-A520 + 4x
# Cortex-A720), so tune for it. Spelled -march/-mtune, not -mcpu: GCC 16
# expands -mcpu=cortex-a720 into a +sve-bitperm token that binutils 2.45
# rejects at the assembler. +nosve+nomemtag: the FP6 exposes neither SVE nor
# MTE (no sve/mte hwcaps), and without them the code would SIGILL.
export CFLAGS="$CFLAGS -march=armv9.2-a+nosve+nomemtag -mtune=cortex-a720"
# Cortex-A720), so build for it. armv8.6-a is the highest level whose
# mandatory set the phone exposes (8.7 would assume WFxT, 9.x SVE2; neither
# is in its hwcaps); +fp16fml+aes+sha3+sm4 are the optional extensions it
# has, the same set `gcc -march=native` derives on the phone. One spelling
# for gcc and clang, and the same string the kernel aport uses.
export CFLAGS="$CFLAGS -march=armv8.6-a+fp16fml+aes+sha3+sm4 -mtune=cortex-a720"
subpackages="
$pkgname-dev
$pkgname-doc

View file

@ -43,11 +43,12 @@ checkdepends="glib-dev py3-gobject3 py3-dbus"
# on-device validation is the real test.
options="!pmb:crossdirect !check"
# fp6-img: this package only ever runs on the FP6 (4x Cortex-A520 + 4x
# Cortex-A720), so tune for it. Spelled -march/-mtune, not -mcpu: GCC 16
# expands -mcpu=cortex-a720 into a +sve-bitperm token that binutils 2.45
# rejects at the assembler. +nosve+nomemtag: the FP6 exposes neither SVE nor
# MTE (no sve/mte hwcaps), and without them the code would SIGILL.
export CFLAGS="$CFLAGS -march=armv9.2-a+nosve+nomemtag -mtune=cortex-a720"
# Cortex-A720), so build for it. armv8.6-a is the highest level whose
# mandatory set the phone exposes (8.7 would assume WFxT, 9.x SVE2; neither
# is in its hwcaps); +fp16fml+aes+sha3+sm4 are the optional extensions it
# has, the same set `gcc -march=native` derives on the phone. One spelling
# for gcc and clang, and the same string the kernel aport uses.
export CFLAGS="$CFLAGS -march=armv8.6-a+fp16fml+aes+sha3+sm4 -mtune=cortex-a720"
subpackages="
$pkgname-lang
$pkgname-doc