Bug 29575 - [2.35/2.36]: Many testsuite failures when not building with "--disable-default-pie" on sparc*-linux-*
Summary: [2.35/2.36]: Many testsuite failures when not building with "--disable-defaul...
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: 2.35
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL: https://buildd.debian.org/status/fetc...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-16 08:44 UTC by John Paul Adrian Glaubitz
Modified: 2023-07-19 12:46 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2022-09-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Paul Adrian Glaubitz 2022-09-16 08:44:28 UTC
The testsuite currently fails with so many failed tests on Debian unstable on sparc64 that I assume there is some underlying issue on SPARC that needs to be addressed:

+---------------------------------------------------------------------+
|                             Testsuite summary                       |
+---------------------------------------------------------------------+
FAIL: debug/tst-fortify-c-default-2
FAIL: debug/tst-fortify-c-default-3
FAIL: debug/tst-fortify-c-lfs-2
FAIL: debug/tst-fortify-c-lfs-3
FAIL: debug/tst-fortify-c-nongnu-2
FAIL: debug/tst-fortify-c-nongnu-3
FAIL: debug/tst-fortify-cc-default-2
FAIL: debug/tst-fortify-cc-default-3
FAIL: debug/tst-fortify-cc-lfs-2
FAIL: debug/tst-fortify-cc-lfs-3
FAIL: debug/tst-fortify-cc-nongnu-2
FAIL: debug/tst-fortify-cc-nongnu-3
FAIL: dlfcn/tststatic
FAIL: dlfcn/tststatic2
FAIL: dlfcn/tststatic3
FAIL: dlfcn/tststatic4
FAIL: dlfcn/tststatic5
FAIL: elf/ifuncmain1picstatic
FAIL: elf/ifuncmain1static
FAIL: elf/ifuncmain2picstatic
FAIL: elf/ifuncmain2static
FAIL: elf/ifuncmain4picstatic
FAIL: elf/ifuncmain4static
FAIL: elf/ifuncmain5picstatic
FAIL: elf/ifuncmain5static
FAIL: elf/ifuncmain7picstatic
FAIL: elf/ifuncmain7static
FAIL: elf/ifuncmain9picstatic
FAIL: elf/ifuncmain9static
FAIL: elf/tst-array1-static
FAIL: elf/tst-array1-static-cmp
FAIL: elf/tst-array5-static
FAIL: elf/tst-audit24a
FAIL: elf/tst-audit24b
FAIL: elf/tst-audit24c
FAIL: elf/tst-audit24d
FAIL: elf/tst-bz15311
FAIL: elf/tst-dl-iter-static
FAIL: elf/tst-dl_find_object-static
FAIL: elf/tst-dso-ordering1
FAIL: elf/tst-dso-ordering10
FAIL: elf/tst-dso-ordering2
FAIL: elf/tst-dso-ordering3
FAIL: elf/tst-dso-ordering4
FAIL: elf/tst-dso-ordering5
FAIL: elf/tst-dso-ordering6
FAIL: elf/tst-dso-ordering7
FAIL: elf/tst-dso-ordering8
FAIL: elf/tst-dso-ordering9
FAIL: elf/tst-dst-static
FAIL: elf/tst-env-setuid
FAIL: elf/tst-env-setuid-tunables
FAIL: elf/tst-getauxval-static
FAIL: elf/tst-ldconfig-X
FAIL: elf/tst-linkall-static
FAIL: elf/tst-main1
FAIL: elf/tst-ptrguard1-static
FAIL: elf/tst-rtld-run-static
FAIL: elf/tst-single_threaded-pthread-static
FAIL: elf/tst-single_threaded-static
FAIL: elf/tst-single_threaded-static-dlopen
FAIL: elf/tst-stackguard1-static
FAIL: elf/tst-tls-allocation-failure-static
FAIL: elf/tst-tls1-static
FAIL: elf/tst-tls1-static-non-pie
FAIL: elf/tst-tls9-static
FAIL: elf/tst-tlsalign-extern-static
FAIL: elf/tst-tlsalign-static
FAIL: inet/tst-deadline
FAIL: inet/tst-idna_name_classify
FAIL: io/tst-statx
FAIL: libio/tst-cleanup-default-static
FAIL: libio/tst-cleanup-default-static-cmp
FAIL: libio/tst-cleanup-nostart-stop-gc-static
FAIL: libio/tst-cleanup-nostart-stop-gc-static-cmp
FAIL: libio/tst-cleanup-start-stop-gc-static
FAIL: libio/tst-cleanup-start-stop-gc-static-cmp
FAIL: libio/tst-popen1
FAIL: localedata/bug-setlocale1-static
FAIL: localedata/tst-langinfo-setlocale-static
FAIL: malloc/tst-interpose-static-nothread
FAIL: malloc/tst-interpose-static-thread
FAIL: math/atest-exp
FAIL: math/atest-exp2
FAIL: math/atest-sincos
FAIL: math/test-fpucw-ieee-static
FAIL: math/test-fpucw-static
FAIL: math/test-signgam-uchar-init-static
FAIL: math/test-signgam-uchar-static
FAIL: math/test-signgam-uint-init-static
FAIL: math/test-signgam-uint-static
FAIL: math/test-signgam-ullong-init-static
FAIL: math/test-signgam-ullong-static
FAIL: misc/tst-align-clone-internal
FAIL: misc/tst-clone2-internal
FAIL: misc/tst-clone3-internal
FAIL: misc/tst-empty
FAIL: misc/tst-fd_to_filename
FAIL: misc/tst-getpid1-internal
FAIL: misc/tst-misalign-clone-internal
FAIL: nptl/tst-cancel21-static
FAIL: nptl/tst-cancel24-static
FAIL: nptl/tst-cancel30
FAIL: nptl/tst-cond11-static
FAIL: nptl/tst-locale1
FAIL: nptl/tst-locale2
FAIL: nptl/tst-pt-popen1
FAIL: nptl/tst-pthread-gdb-attach-static
FAIL: nptl/tst-pthread_exit-nothreads-static
FAIL: nptl/tst-sem11-static
FAIL: nptl/tst-sem12-static
FAIL: nptl/tst-stackguard1-static
FAIL: nss/tst-field
FAIL: posix/tst-affinity-static
FAIL: posix/tst-posix_spawn-setsid
FAIL: resolv/tst-resolv-txnid-collision
FAIL: setjmp/tst-setjmp-static
FAIL: socket/tst-socket-timestamp
FAIL: stdio-common/test-popen
FAIL: stdio-common/tst-popen
FAIL: stdio-common/tst-popen2
FAIL: stdlib/tst-secure-getenv
FAIL: stdlib/tst-setcontext2

Full build log: https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=sparc64&ver=2.35-0experimental3&stamp=1662895877&raw=0
Comment 1 Carlos O'Donell 2022-09-16 11:43:34 UTC
(In reply to John Paul Adrian Glaubitz from comment #0)
> The testsuite currently fails with so many failed tests on Debian unstable
> on sparc64 that I assume there is some underlying issue on SPARC that needs
> to be addressed:

Please reach out to the debian-glibc team discuss these issues. The distro team is best placed to understand the test results of Debian's glibc given the context of the previous build results.

> Full build log:
> https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=sparc64&ver=2.35-
> 0experimental3&stamp=1662895877&raw=0

There were no distribution or machine maintainers that did any testing for sparc64 in glibc 2.36: https://sourceware.org/glibc/wiki/Release/2.36#SPARC_.2864-bit.29

I'd say the sparc64 support is at risk of being removed if maintainers and developers are not testing or supporting the architecture.
Comment 2 John Paul Adrian Glaubitz 2022-09-30 08:53:01 UTC
The issue is alleviated by building with "--disable-default-pie".
Comment 3 Adhemerval Zanella 2022-10-04 17:32:22 UTC
On sparc, where static PIE is not supported but PIE is, both libc and static binaries are built with -DPIC. It leads to wrong startup code for static binaries. I will send a patch.
Comment 4 John Paul Adrian Glaubitz 2022-11-06 15:08:06 UTC
FWIW, this issue affects sh4 as well.

Unless glibc is built with "--disable-default-pie", building a static busybox binary on sh4 fails with the following linker errors:

(...)
/usr/bin/ld: /usr/lib/gcc/sh4-linux-gnu/12/../../../sh4-linux-gnu/libc.a(kill.o)(.text+0x3a): unexpected instruction 0XA005 (expected 0xd0??: mov.l)
/usr/bin/ld: /usr/lib/gcc/sh4-linux-gnu/12/../../../sh4-linux-gnu/libc.a(kill.o)(.text+0x3c): unexpected instruction 0XE0FF (expected 0x0?12: stc)
/usr/bin/ld: /usr/lib/gcc/sh4-linux-gnu/12/../../../sh4-linux-gnu/libc.a(kill.o)(.text+0x3e): unexpected instruction 0X09 (expected 0x0?ce: mov.l)
/usr/bin/ld: /usr/lib/gcc/sh4-linux-gnu/12/../../../sh4-linux-gnu/libc.a(uname.o)(.text+0x3a): unexpected instruction 0XA005 (expected 0xd0??: mov.l)
/usr/bin/ld: /usr/lib/gcc/sh4-linux-gnu/12/../../../sh4-linux-gnu/libc.a(uname.o)(.text+0x3c): unexpected instruction 0XE0FF (expected 0x0?12: stc)
/usr/bin/ld: /usr/lib/gcc/sh4-linux-gnu/12/../../../sh4-linux-gnu/libc.a(uname.o)(.text+0x3e): unexpected instruction 0X09 (expected 0x0?ce: mov.l)
/usr/bin/ld: /usr/lib/gcc/sh4-linux-gnu/12/../../../sh4-linux-gnu/libc.a(alarm.o)(.text+0x3a): unexpected instruction 0XA005 (expected 0xd0??: mov.l)
/usr/bin/ld: /usr/lib/gcc/sh4-linux-gnu/12/../../../sh4-linux-gnu/libc.a(alarm.o)(.text+0x3c): unexpected instruction 0XE0FF (expected 0x0?12: stc)
/usr/bin/ld: /usr/lib/gcc/sh4-linux-gnu/12/../../../sh4-linux-gnu/libc.a(alarm.o)(.text+0x3e): unexpected instruction 0X09 (expected 0x0?ce: mov.l)
/usr/bin/ld: /usr/lib/gcc/sh4-linux-gnu/12/../../../sh4-linux-gnu/libc.a(vfork.o)(.text+0x26): unexpected instruction 0XA005 (expected 0xd0??: mov.l)
(...)

See: https://buildd.debian.org/status/fetch.php?pkg=busybox&arch=sh4&ver=1%3A1.35.0-4&stamp=1667730661&raw=0
Comment 5 John Paul Adrian Glaubitz 2022-11-12 23:44:29 UTC
Similar segfaults observed on alpha as well starting with 2.34:

> https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=alpha&ver=2.34-8&stamp=1662963628&raw=0
> https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=alpha&ver=2.35-4&stamp=1666729919&raw=0
> https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=alpha&ver=2.36-4&stamp=1667607306&raw=0

However, building with "--disable-default-pie" doesn't seem to help in this case.
Comment 6 John Paul Adrian Glaubitz 2023-07-19 11:48:36 UTC
(In reply to Adhemerval Zanella from comment #3)
> On sparc, where static PIE is not supported but PIE is, both libc and static
> binaries are built with -DPIC. It leads to wrong startup code for static
> binaries. I will send a patch.

Wasn't this issue fixed a year ago? Can we close this bug?
Comment 7 Adhemerval Zanella 2023-07-19 12:46:21 UTC
(In reply to John Paul Adrian Glaubitz from comment #6)
> (In reply to Adhemerval Zanella from comment #3)
> > On sparc, where static PIE is not supported but PIE is, both libc and static
> > binaries are built with -DPIC. It leads to wrong startup code for static
> > binaries. I will send a patch.
> 
> Wasn't this issue fixed a year ago? Can we close this bug?

The issue is even if static-pie is disabled for sparc64, it changes some build flags that end up using the wrong flags on the start files build. So currently we still require --disable-default-pie.