Skip to content
Snippets Groups Projects
Commit b63cad94 authored by Arnaud Ferraris's avatar Arnaud Ferraris
Browse files

Fix crash when building arm64 .deb-based apps

When building a Flatpak application from .deb packages, we use `flatpak`
for executing commands inside the target runtime. This results in
`flatpak` calling the runtime's `ldconfig`, which fails for arm64
runtimes: when running on an amd64 host through `qemu-user-static`, the
arm64 version of `ldconfig` crashes.

Replacing the runtime's `ldconfig` with the binary from the host is
enough to mitigate this problem, despite the architecture mismatch
(amd64 `ldconfig` running inside an arm64 environment.

References:
- https://gitlab.gnome.org/GNOME/gnome-build-meta/-/issues/132
- https://bugzilla.redhat.com/show_bug.cgi?id=1886542
- https://github.com/flatpak/flatpak/issues/3108



Signed-off-by: default avatarArnaud Ferraris <arnaud.ferraris@collabora.com>
parent 9b6c546b
No related branches found
No related tags found
1 merge request!15Fix build issues for arm64 applications
......@@ -1949,6 +1949,24 @@ class Builder:
),
packages
)
# HACK: This is required for running an ARM64 runtime
# on an x86 host due to a bug in either glibc or qemu:
# the arm64 `ldconfig` crashes when running on amd64
# through `qemu-user-static`
shutil.copy2(
os.path.join('/sbin/', 'ldconfig'),
os.path.join(scratch,
'home',
'flatpak',
'runtime',
manifest['sdk'],
self.flatpak_arch,
self.runtime_branch,
'active',
'files',
'sbin'
)
)
cmd = [
'env',
'XDG_DATA_HOME={}/home'.format(scratch),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment