lib/60535: 32-bit libpthread lacks __libc_thr_join

"Rainer Orth via gnats" <[email protected]> Mon, 3 Aug 2026 21:20:01 +0000 (UTC)
Newsgroups gmane.os.netbsd.bugs
Message-ID <[email protected]>
>Number:         60535
>Category:       lib
>Synopsis:       32-bit libpthread lacks __libc_thr_join
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 03 21:20:01 +0000 2026
>Originator:     Rainer Orth
>Release:        NetBSD 11.0
>Organization:
Bielefeld University, Center for Biotechnology
	<organization of PR author (multiple lines)>
>Environment:
	<The following information is extracted from your kernel. Please>
	<append output of "ldd", "ident" where relevant (multiple lines).>
System: NetBSD nbsd-amd64.gcc 11.0 NetBSD 11.0 (GENERIC) #0: Thu Jul 30 15:23:12 UTC 2026 [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
When testing libgomp on GCC trunk, 5000+ testcases fail to link:

FAIL: libgomp.c++/../libgomp.c-c++-common/alloc-1.c (test for excess errors)    
Excess errors:
gld-2.47: libgomp.so: undefined reference to `__libc_t hr_detach'
gld-2.47: libgomp.so: undefined reference to `__libc_t hr_join'
gld-2.47: libgomp.so: undefined reference to `__libc_t hr_attr_destroy'
gld-2.47: libgomp.so: undefined reference to `__libc_t hr_attr_init'

UNRESOLVED: libgomp.c++/../libgomp.c-c++-common/alloc-1.c compilation failed to
produce executable

>How-To-Repeat:
The following (nonsensical) example demonstrates the problem:

$ cat pt.c
#include <pthread.h>

int
main (void)
{
  return pthread_join ((pthread_t) 0, (void **)0);
}
$ gcc -m32 -pthread -o pt pt.c -lpthread
ld: /tmp//ccdgMyQ3.o: in function `main':
pt.c:(.text+0x19): undefined reference to `__libc_thr_join'

With -m64, the test links just fine.  libgomp testing also worked seamlessly
on 32-bit NetBSD/amd64 10.0.
>Fix:
	<how to correct or work around the problem, if known (multiple lines)>

>Unformatted:
 	<Please check that the above is correct for the bug being reported,>
 	<and append source date of snapshot, if applicable (one line).>