* [Buildroot] [PATCH] utils/genrandconfig: reject qemu user mode on hosts with large pages
@ 2026-09-29 9:07 Yegor Yefremov via buildroot
2026-10-07 7:58 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Yegor Yefremov via buildroot @ 2026-09-29 9:07 UTC (permalink / raw)
To: buildroot; +Cc: James Hilliard
Qemu in user mode cannot load target binaries laid out for 4k pages
when the host uses larger pages, as the 16k pages of the Asahi Linux
kernel on Apple Silicon. The dynamic loader then fails with e.g.:
GLib-2.0: error while loading shared libraries: libz.so.1: failed
to map segment from shared object
or, depending on the target:
qemu-aarch64: .../GLib-2.0: Error mapping file: Invalid argument
torque: error while loading shared libraries: libz.so.1: ELF load
command address/offset not page-aligned
This hits every package running target code through qemu at build
time, i.e. gobject-introspection and nodejs, on mips, sparc64 and
aarch64 alike, and is not something Buildroot can fix in the
packages themselves.
As this only depends on the build host, reject such configurations
in genrandconfig when the host page size is larger than 4k.
Fixes:
https://autobuild.buildroot.org/results/4848e735fe83dfeef4f24d32655c567951fd113a (mips)
https://autobuild.buildroot.org/results/089ddac5bdaaf5650cbc5c26d48952b5bede0ca6 (sparc64)
https://autobuild.buildroot.org/results/c30c6719a0350370ebe3cfe262123727f4057734 (aarch64)
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Assisted-by: Claude:claude-opus-5-5
---
utils/genrandconfig | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/utils/genrandconfig b/utils/genrandconfig
index 727c8193c4..8437d6342d 100755
--- a/utils/genrandconfig
+++ b/utils/genrandconfig
@@ -124,6 +124,13 @@ async def fixup_config(sysinfo, configfile):
if 'BR2_PACKAGE_LIBOPENSSL=y\n' in configlines and \
'BR2_TOOLCHAIN_HAS_ATOMIC=y\n' not in configlines:
return False
+ # Qemu in user mode cannot load target binaries laid out for 4k
+ # pages on a host with larger pages (e.g. 16k on Apple Silicon),
+ # so packages running target code at build time (gobject-
+ # introspection, nodejs) fail there.
+ if 'BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE=y\n' in configlines and \
+ os.sysconf('SC_PAGE_SIZE') > 4096:
+ return False
if 'BR2_PACKAGE_SUNXI_BOARDS=y\n' in configlines:
configlines.remove('BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE=""\n')
configlines.append('BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE="a10/hackberry.fex"\n')
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH] utils/genrandconfig: reject qemu user mode on hosts with large pages
2026-09-29 9:07 [Buildroot] [PATCH] utils/genrandconfig: reject qemu user mode on hosts with large pages Yegor Yefremov via buildroot
@ 2026-10-07 7:58 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-07 7:58 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: buildroot, James Hilliard
On Tue, Sep 29, 2026 at 11:07:53AM +0200, Yegor Yefremov via buildroot wrote:
> Qemu in user mode cannot load target binaries laid out for 4k pages
> when the host uses larger pages, as the 16k pages of the Asahi Linux
> kernel on Apple Silicon. The dynamic loader then fails with e.g.:
>
> GLib-2.0: error while loading shared libraries: libz.so.1: failed
> to map segment from shared object
>
> or, depending on the target:
>
> qemu-aarch64: .../GLib-2.0: Error mapping file: Invalid argument
> torque: error while loading shared libraries: libz.so.1: ELF load
> command address/offset not page-aligned
>
> This hits every package running target code through qemu at build
> time, i.e. gobject-introspection and nodejs, on mips, sparc64 and
> aarch64 alike, and is not something Buildroot can fix in the
> packages themselves.
>
> As this only depends on the build host, reject such configurations
> in genrandconfig when the host page size is larger than 4k.
>
> Fixes:
> https://autobuild.buildroot.org/results/4848e735fe83dfeef4f24d32655c567951fd113a (mips)
> https://autobuild.buildroot.org/results/089ddac5bdaaf5650cbc5c26d48952b5bede0ca6 (sparc64)
> https://autobuild.buildroot.org/results/c30c6719a0350370ebe3cfe262123727f4057734 (aarch64)
>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> Assisted-by: Claude:claude-opus-5-5
Applied to master, thanks!
Best regards,
Thomas Petazzoni
--
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] 2+ messages in thread
end of thread, other threads:[~2026-10-07 8:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-29 9:07 [Buildroot] [PATCH] utils/genrandconfig: reject qemu user mode on hosts with large pages Yegor Yefremov via buildroot
2026-10-07 7:58 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox