In all the qemu packages, which ones to take to have a qemu in static user mode emulation to make a x86-64 schroot ?
It seems to be the qemu-user package but it does not provide the static libraries and in its pkgbuild we find :
# TODO: qemu-user-static
# 'qemu-user-static: for static user mode emulation of QEMU targets'
# TODO: qemu-user-static
# (
# cd build-static
# ../$pkgbase-$pkgver/configure \
# --enable-attr \
# --enable-linux-user\
# --enable-tcg \
# --disable-install-blobs\
# --static
# ninjas
# )
}
There is a reason why it stays in todo ?
I used the qemu-user-static AUR package but since version 7 it no longer compiles with all the target except to do its own compilation with
--target-list=x86_64-linux-user,i386-linux-user \
A comment on arch talks about having to use gcc12 ?
In the meantime if I have to do my own pkgbuild there is a big difference between qemu-user’s configure and this one which has :
--enable-linux-user\
--target-list=x86_64-linux-user,i386-linux-user \
--disable-debug-info \
--disable-bsd-user\
--disable-werror \
--disable-system\
--disable-tools\
--disable-docs\
--disable-gtk\
--disable-gnutls\
--disable-net \
--disable-gcrypt\
--disable-glusterfs\
--disable-libnfs\
--disable-libiscsi\
--disable-vnc\
--disable-kvm \
--disable-libssh\
--disable-vde\
--disable-sdl \
--disable-xen \
--disable-fdt \
--disable-vhost-net\
--disable-vhost-crypto\
--disable-vhost-user\
--disable-vhost-vsock\
--disable-vhost-scsi\
--disable-tpm \
--disable-qom-cast-debug\
--disable-capstone \
--disable-zstd \
--disable-linux-io-uring\
--disable-bpf \
--static
An opinion ?
After looking at the different configure, the main difference is that the AUR package removes opengl and does not disable blobs (–disable-install-blobs)/ EXTRA package. Under ubuntu in addition to disabling blobs there is --disable-pie and --disable-strip) …
Similar to Apple’s Rosetta 2? Can it improve the efficiency of running X86 programs on ARM devices?
I’m not sure the term efficient is the right one. But like rosetta, qemu-user translate the library transparently, in my case for x86-64. For those who only have a arm device like a raspberry, it can be useful.
I have tested today with GCC updated to 12. And no success with another target specifically --target-list=arm-linux-user \
FAILED: qemu-arm
c++ -o qemu-arm libcommon.fa.p/cpus-common.c.o libcommon.fa.p/page-vary-common.c.o libcommon.fa.p/disas_arm-a64.cc.o libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o libcommon.fa.p/disas_libvixl_vixl_a64_disasm-a64.cc.o libcommon.fa.p/disas_libvixl_vixl_a64_instructions-a64.cc.o libcommon.fa.p/disas_libvixl_vixl_compiler-intrinsics.cc.o libcommon.fa.p/disas_libvixl_vixl_utils.cc.o libcommon.fa.p/disas_arm.c.o libcommon.fa.p/disas_capstone.c.o libcommon.fa.p/hw_core_cpu-common.c.o libcommon.fa.p/hw_core_machine-smp.c.o libcommon.fa.p/accel_accel-user.c.o libcommon.fa.p/common-user_safe-syscall.S.o libcommon.fa.p/common-user_safe-syscall-error.c.o libqemu-arm-linux-user.fa.p/linux-user_arm_signal.c.o libqemu-arm-linux-user.fa.p/linux-user_arm_cpu_loop.c.o libqemu-arm-linux-user.fa.p/target_arm_cpu.c.o libqemu-arm-linux-user.fa.p/target_arm_crypto_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_debug_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_gdbstub.c.o libqemu-arm-linux-user.fa.p/target_arm_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_iwmmxt_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_m_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_mve_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_neon_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_op_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_tlb_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_translate.c.o libqemu-arm-linux-user.fa.p/target_arm_translate-m-nocp.c.o libqemu-arm-linux-user.fa.p/target_arm_translate-mve.c.o libqemu-arm-linux-user.fa.p/target_arm_translate-neon.c.o libqemu-arm-linux-user.fa.p/target_arm_translate-vfp.c.o libqemu-arm-linux-user.fa.p/target_arm_vec_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_vfp_helper.c.o libqemu-arm-linux-user.fa.p/target_arm_cpu_tcg.c.o libqemu-arm-linux-user.fa.p/target_arm_kvm-stub.c.o libqemu-arm-linux-user.fa.p/trace_control-target.c.o libqemu-arm-linux-user.fa.p/cpu.c.o libqemu-arm-linux-user.fa.p/disas.c.o libqemu-arm-linux-user.fa.p/gdbstub.c.o libqemu-arm-linux-user.fa.p/page-vary.c.o libqemu-arm-linux-user.fa.p/semihosting_arm-compat-semi.c.o libqemu-arm-linux-user.fa.p/tcg_optimize.c.o libqemu-arm-linux-user.fa.p/tcg_region.c.o libqemu-arm-linux-user.fa.p/tcg_tcg.c.o libqemu-arm-linux-user.fa.p/tcg_tcg-common.c.o libqemu-arm-linux-user.fa.p/tcg_tcg-op.c.o libqemu-arm-linux-user.fa.p/tcg_tcg-op-gvec.c.o libqemu-arm-linux-user.fa.p/tcg_tcg-op-vec.c.o libqemu-arm-linux-user.fa.p/fpu_softfloat.c.o libqemu-arm-linux-user.fa.p/accel_accel-common.c.o libqemu-arm-linux-user.fa.p/accel_tcg_tcg-all.c.o libqemu-arm-linux-user.fa.p/accel_tcg_cpu-exec-common.c.o libqemu-arm-linux-user.fa.p/accel_tcg_cpu-exec.c.o libqemu-arm-linux-user.fa.p/accel_tcg_tcg-runtime-gvec.c.o libqemu-arm-linux-user.fa.p/accel_tcg_tcg-runtime.c.o libqemu-arm-linux-user.fa.p/accel_tcg_translate-all.c.o libqemu-arm-linux-user.fa.p/accel_tcg_translator.c.o libqemu-arm-linux-user.fa.p/accel_tcg_user-exec.c.o libqemu-arm-linux-user.fa.p/accel_tcg_user-exec-stub.c.o libqemu-arm-linux-user.fa.p/linux-user_elfload.c.o libqemu-arm-linux-user.fa.p/linux-user_exit.c.o libqemu-arm-linux-user.fa.p/linux-user_fd-trans.c.o libqemu-arm-linux-user.fa.p/linux-user_linuxload.c.o libqemu-arm-linux-user.fa.p/linux-user_main.c.o libqemu-arm-linux-user.fa.p/linux-user_mmap.c.o libqemu-arm-linux-user.fa.p/linux-user_signal.c.o libqemu-arm-linux-user.fa.p/linux-user_strace.c.o libqemu-arm-linux-user.fa.p/linux-user_syscall.c.o libqemu-arm-linux-user.fa.p/linux-user_thunk.c.o libqemu-arm-linux-user.fa.p/linux-user_uaccess.c.o libqemu-arm-linux-user.fa.p/linux-user_uname.c.o libqemu-arm-linux-user.fa.p/linux-user_flatload.c.o libqemu-arm-linux-user.fa.p/linux-user_semihost.c.o libqemu-arm-linux-user.fa.p/linux-user_arm_nwfpe_double_cpdo.c.o libqemu-arm-linux-user.fa.p/linux-user_arm_nwfpe_extended_cpdo.c.o libqemu-arm-linux-user.fa.p/linux-user_arm_nwfpe_fpa11.c.o libqemu-arm-linux-user.fa.p/linux-user_arm_nwfpe_fpa11_cpdo.c.o libqemu-arm-linux-user.fa.p/linux-user_arm_nwfpe_fpa11_cpdt.c.o libqemu-arm-linux-user.fa.p/linux-user_arm_nwfpe_fpa11_cprt.c.o libqemu-arm-linux-user.fa.p/linux-user_arm_nwfpe_fpopcode.c.o libqemu-arm-linux-user.fa.p/linux-user_arm_nwfpe_single_cpdo.c.o libqemu-arm-linux-user.fa.p/meson-generated_.._arm-linux-user-gdbstub-xml.c.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,--whole-archive libhwcore.fa libqom.fa -Wl,--no-whole-archive -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -static-pie -fstack-protector-strong -march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -Wp,-D_GLIBCXX_ASSERTIONS -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,--start-group libcapstone.a libqemuutil.a libhwcore.fa libqom.fa /usr/lib/libz.a -lrt -lutil -lm -pthread -lgthread-2.0 -lglib-2.0 -lpcre -lsysprof-capture-4 -lstdc++ -Wl,--end-group
/usr/bin/ld: /usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/../../../../lib/libglib-2.0.a(gutils.c.o) : dans la fonction « g_get_user_database_entry » :
gutils.c:(.text+0x324): avertissement : Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: gutils.c:(.text+0xf4): avertissement : Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: gutils.c:(.text+0xe0): avertissement : Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/../../../../lib/libc.a(init-first.o) : dans la fonction « __libc_init_first » :
(.text+0x10): relocalisation tronquée pour concorder : R_AARCH64_LD64_GOTPAGE_LO15 vers le symbole « __environ » défini sans la section .bss dans /usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/../../../../lib/libc.a(environ.o)
/usr/bin/ld: (.text+0x10): avertissement : trop d'entrées GOT pour -fpic, recompilez avec -fPIC
collect2: erreur: ld a retourné le statut de sortie 1
[612/995] Compiling C object tests/fp/libsoftfloat.a.p/berkeley-softfloat-3_source_s_sub128.c.o
[613/995] Compiling C object tests/fp/libsoftfloat.a.p/berkeley-softfloat-3_source_s_add256M.c.o
[614/995] Compiling C object tests/fp/libsoftfloat.a.p/berkeley-softfloat-3_source_s_add128.c.o
[615/995] Compiling C object tests/fp/libsoftfloat.a.p/berkeley-softfloat-3_source_s_sub256M.c.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:163 : run-ninja] Erreur 1
==> ERREUR : Une erreur s’est produite dans build().
Abandon…