Bug 31701 - sparc64: qemu bootup fails
Summary: sparc64: qemu bootup fails
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.39
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-05 00:53 UTC by wbx
Modified: 2024-05-06 15:44 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wbx 2024-05-05 00:53:53 UTC
Hi,

Bootup in Qemu fails with following segfault:
[    1.913421] Run /init as init process
[    1.996616] init[1]: segfault at 2610ec ip 00000000002610ec (rpc fffff80100b30474) sp 000007feffa311f1 error 1 in busybox[3fe000+2000]
[    2.002084] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    2.003136] Press Stop-A (L1-A) from sun keyboard or send break
[    2.003136] twice on console to return to the boot prom
[    2.004048] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

Commands to reproduce:
wget https://debug.openadk.org/qemu-sparc64-initramfspiggyback-kernel
qemu-system-sparc64 -M sun4u -nographic -net nic,model=e1000 -net user -kernel qemu-sparc64-initramfspiggyback-kernel

Binutils 2.42, Gcc 13.2.0 and Linux Kernel 6.6.28 is used.

./toolchain_qemu-sparc64_glibc_v9/usr/bin/sparc64-openadk-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=./toolchain_qemu-sparc64_glibc_v9/usr/bin/sparc64-openadk-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/browa22-ext/sparc64-glibc/toolchain_qemu-sparc64_glibc_v9/usr/libexec/gcc/sparc64-openadk-linux-gnu/13.2.0/lto-wrapper
Target: sparc64-openadk-linux-gnu
Configured with: /home/browa22-ext/sparc64-glibc/toolchain_build_qemu-sparc64_glibc_v9/w-gcc-13.2.0-1/gcc-13.2.0/configure --prefix=/home/browa22-ext/sparc64-glibc/toolchain_qemu-sparc64_glibc_v9/usr --with-bugurl=https://openadk.org --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc64-openadk-linux-gnu --with-gmp=/home/browa22-ext/sparc64-glibc/host_x86_64-linux-gnu/usr --with-mpfr=/home/browa22-ext/sparc64-glibc/host_x86_64-linux-gnu/usr --enable-__cxa_atexit --with-system-zlib --with-gnu-ld --with-gnu-as --disable-libsanitizer --disable-install-libiberty --disable-libitm --disable-libmudflap --disable-libgomp --disable-libcc1 --disable-libmpx --disable-libcilkrts --disable-libquadmath --disable-libquadmath-support --disable-decimal-float --disable-gcov --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-ppl --without-cloog --without-isl --disable-werror --disable-nls --enable-obsolete --disable-lto --with-cpu=ultrasparc --enable-tls --enable-threads --enable-libatomic --enable-shared --enable-cxx-flags=-fPIC --disable-libssp --disable-biarch --disable-multilib --enable-languages=c --with-build-sysroot='/../../target_qemu-sparc64_glibc_v9' --with-sysroot='/../../target_qemu-sparc64_glibc_v9'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (GCC) 

What could be the reason for it? Anyone use Sparc64 GLibc in Qemu?

best regards
 Waldemar
Comment 1 Adhemerval Zanella 2024-05-06 12:00:43 UTC
We have a longstanding issue where static build fails when glibc is built for static-pie (check https://sourceware.org/bugzilla/show_bug.cgi?id=29575). Could it be related (not sue if init is static built)?

There is some couple week since I checked sparc, but I haven't see any more regressions than the usual ones.
Comment 2 wbx 2024-05-06 12:46:49 UTC
I checked with Buildroot and that is working. I don't understand while my cross toolchain does not generate working binaries. I tried a static hello world as init and get a segfault. I am now trying to debug this hello world on a Buildroot system, but have some issues with gdb. In parallel I am installing Debian in Qemu and updating it to latest.
Comment 3 wbx 2024-05-06 15:44:11 UTC
Okay, you are right. I added --disable-static-pie to glibc configure and now it is working! Thanks.