Package: musl
Version: 1.2.5-1
Severity: normal
Tags: upstream
X-Debbugs-Cc: [email protected], [email protected]

||/ Name           Version      Architecture Description
+++-==============-============-============-==========================================
ii  binutils       2.42-4       s390x        GNU assembler, linker and binary 
utilities
ii  gcc            4:13.2.0-7   s390x        GNU C compiler
ii  gcc-13         13.2.0-23    s390x        GNU C compiler

For some reason, mksh built with static-pie behaves bogus:

(sid_s390x-dchroot)tg@zelenka:~/mksh-59c$ env -i ./builddir/static-musl/mksh -c 
'echo hi'
typeset EPOCHREALTIME
typeset IFS
typeset PATH
typeset PATHSEP
typeset PS2
typeset PS3
typeset PS4
typeset PWD
typeset -i SECONDS
typeset TMOUT
hi

If I build without static-pie, just static, things work:

(sid_s390x-dchroot)tg@zelenka:~/mksh-59c$ env -i ./builddir/static-musl/mksh -c 
'echo hi'
hi

If I replace the -static with -fPIE -pie (and build the .o files with -fPIE):

(sid_s390x-dchroot)tg@zelenka:~/mksh-59c/builddir/static-musl$ file mksh
mksh: ELF 64-bit MSB pie executable, IBM S/390, version 1 (SYSV), dynamically 
linked, interpreter /lib/ld-musl-s390x.so.1, with debug_info, not stripped
(sid_s390x-dchroot)tg@zelenka:~/mksh-59c/builddir/static-musl$ ./mksh -c 'echo 
test'
test

(it was done in the same subdirectory, ignore the pathname)

Unfortunately, this is not easily reduced… it, however, i̲s̲ reproducible
on the s390x porterbox. The code works with musl and static-pie on all
other Debian architectures on which musl is available and static-pie is
not broken (see #1068302).


-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: s390x

Kernel: Linux 6.1.0-18-s390x (SMP w/2 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

-- no debconf information

Reply via email to