Public bug reported:

While doing regression-testing for glibc 2.43 built on Ubuntu 26.04, it appears 
the code generated for
static-pie binaries crashes on the call to _ld_relocate_static_pie().
This makes static-pie unusable on riscv.
dynamic -fPIE do not seem to be affected.
It is unclear to me whether the Ubuntu delta, or toolchain defaults, or 
compiler versions are to blame here.

I'm keeping a nostrip build of glibc for riscv to reproduce and trace the issue.
https://launchpad.net/~simpoir/+archive/ubuntu/glibcriscv

Reproduction:

# set VM
wget 
https://cloud-images.ubuntu.com/resolute/current/resolute-server-cloudimg-riscv64.img
qemu-system-riscv64  -netdev user,id=n0,hostfwd=tcp::2222-:22 -device 
virtio-net,netdev=n0 -m 15G -smp 8 -drive 
file=resolute-server-cloudimg-riscv64.img -cdrom ~/seed.iso -machine virt 
-kernel /usr/lib/u-boot/qemu-riscv64_smode/u-boot.bin  -cpu max -nographic 
-snapshot

ssh -p 2222 localhost
apt install gcc
add-apt-repository ppa:simpoir/glibcriscv
apt upgrade

# libc-bin postinst will crash due to ldconfig being compile with static-pie.
# From there we can get a simpler reproducer built against that version of 
glibc.
echo 'void main() {}' >foo.c && gcc -static-pie foo.c && ./a.out

** Affects: glibc (Ubuntu)
     Importance: Undecided
         Status: Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2142067

Title:
  static-pie binaries crash on riscv64 with glibc 2.43 on resolute.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2142067/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to