Closed Chilledheart closed 1 month ago
I built yass on Docker (docker run --platform armhf --rm -it ubuntu:24.04
) with the following CMake options
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DGUI=on -DENABLE_GOLD=off -DUSE_LIBCXX=off -DUSE_GTK4=off -DBUILD_TESTS=1 ..
with mold 2.34.0 that I downloaded from the release notes page (https://github.com/rui314/mold/releases/download/v2.34.0/mold-2.34.0-arm-linux.tar.gz), but it seems I cannot reproduce the issue. yass_test
just passed without crashing.
Can you reproduce the issue on a ARM32 Docker image? If so, how?
I can give it a try with native compiling but I don't have arm32 machine. So I will try your way.
In the failing GitHub action job, yass is cross-compiled to target armel/armhf in an x64 machine and runs the unittest via qemu.
If you can reproduce the issue on a x86-64 Docker image, that would work for me too. I just need to reproduce the issue locally.
Okay. Steps to reproduce locally.
(Make sure your install go,python,cmake,ninja-build,qemu-user-static previously)
git clone https://github.com/Chilledheart/yass
cd yass
# download sysroot
./scripts/install-sysroot.py --arch armel
# download toolchain
./scripts/download-clang-prebuilt-binaries.py
cd tools
go build
cd ..
./tools/build --variant gui --arch armel --sysroot $PWD/debian_bullseye_armel-sysroot --system linux --cmake-build-type Release -build-benchmark -build-test --no-packaging -use-mold -nc -enable-lto=false
qemu-armel-static -L $PWD/debian_bullseye_armel-sysroot $PWD/build-linux-armel/yass_test
Output:
ā yass git:(develop) qemu-armel-static -L $PWD/debian_bullseye_armel-sysroot $PWD/build-linux-armel/yass_test
[1] 24118 segmentation fault (core dumped) qemu-armel-static -L $PWD/debian_bullseye_armel-sysroot
For your interests: cmake's option:
cmake .. -DOFFICIAL_BUILD=on -DENABLE_LLD=on -DUSE_ZLIB=on -DUSE_JSONCPP=on -DGUI=ON -DCLI=ON -DSERVER=ON -DCMAKE_BUILD_TYPE=Release -G Ninja -DUSE_HOST_TOOLS=on -DBUILD_BENCHMARKS=on -DBUILD_TESTS=on -DUSE_LIBCXX=on -DENABLE_LTO=off -DUSE_MOLD=on -DUSE_CARES=ON -DCMAKE_TOOLCHAIN_FILE=/home/hky/yass-develop/build-linux-armel/../cmake/platforms/Linux.cmake -DLLVM_SYSROOT=/home/hky/yass-develop/third_party/llvm-build/Release+Asserts -DGCC_SYSROOT=/home/hky/yass-develop/debian_bullseye_armel-sysroot -DGCC_SYSTEM_PROCESSOR=armel -DGCC_TARGET=arm-linux-gnueabi -DUSE_TCMALLOC=on -DENABLE_FORTIFY=on
PS I use the mold from https://github.com/rui314/mold/releases/download/v2.34.0/mold-2.34.0-x86_64-linux.tar.gz and extract it to /usr/local
directory.
PS2 you need to cd tools and run go build to build tools/build executable. Sorry for missing it at my first glance.
PS3 It takes sometime for me to download required component from internet here to give docker a try and I need some time to rebuild qemu with static-user flag in my Gentoo.
ā ~ sudo systemctl status systemd-binfmt
ā systemd-binfmt.service - Set Up Additional Binary Formats
Loaded: loaded (/usr/lib/systemd/system/systemd-binfmt.service; static)
Active: active (exited) since Thu 2024-10-03 18:02:13 CST; 1min 45s ago
Docs: man:systemd-binfmt.service(8)
man:binfmt.d(5)
https://docs.kernel.org/admin-guide/binfmt-misc.html
https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
Process: 106839 ExecStart=/usr/lib/systemd/systemd-binfmt (code=exited, status=0/SUCCESS)
Main PID: 106839 (code=exited, status=0/SUCCESS)
CPU: 10ms
Oct 03 18:02:13 define7 systemd[1]: Starting Set Up Additional Binary Formats...
Oct 03 18:02:13 define7 systemd[1]: Finished Set Up Additional Binary Formats.
ā ~ docker run --platform armhf --rm -it ubuntu:24.04 /bin/echo
exec /bin/echo: no such file or directory
Somehow it doesn't work. I will re-try native compiling if I have time later.
Thank you for the instruction. With that, I could reproduce the issue. It looks like it was a regression introduced in 431fc39db00afb6b5dc9ac7260cd49823fa19160. I think I managed to fix the issue. Can you try again to verify?
I think this bug is worth a new maintenance release.
I can confirm the issue is gone at 186272a (after failing 5fcbf252) locally
ā build-linux-armel git:(develop) mold --version
mold 2.34.0 (186272a425a36d12fd25897aa3628631f3df0099; compatible with GNU ld)
Cool. I'll release 2.34.1 soon.
PS
From the documentation available online, it seems there is some exception to handling TARGET1 as ABS32 such as cpp init.
For kernel space, it is true that it is alias to ABS32 https://patchwork.kernel.org/project/linux-arm-kernel/patch/1407498836-2797-1-git-send-email-a.ryabinin@samsung.com/
We've been handling R_ARM_TARGET1
as a synonym for R_ARM_ABS32
since the first release of mold with ARM support. So it's been working correctly as far as I know, and we don't want to change that at least in a point release.
Previous:
working linked program:
Now:
coredumped program:
Output of qemu:
Using qemu 8.2.5+ds-1 (from debian sid, not available outside build cache for now)