libthr: filter rather than link with libsys

The allows gcc + GNU ld to link programs with -m32 -pthread without
erroring out due to _umtx_op_err being undefined (unless -lsys is added
to the link command.

We now always link _umtx_op_err into libthr (not just when it's static)
and filter it with libsys so we call that implementation.  The dynamic
implementations (at least the assembly ones) should likely become stubs
as a further refinement.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D43783
This commit is contained in:
Brooks Davis 2024-02-07 19:38:16 +00:00
parent 49076f376a
commit 49d684369c
2 changed files with 5 additions and 3 deletions

View file

@ -13,8 +13,6 @@ MK_SSP= no
LIB=thr
SHLIB_MAJOR= 3
LIBADD= sys
NO_WTHREAD_SAFETY=1
NO_WCAST_ALIGN.gcc=1 # for gcc 4.2
CFLAGS+=-DPTHREAD_KERNEL
@ -47,6 +45,7 @@ CFLAGS+=-D_PTHREAD_FORCED_UNWIND
.endif
LDFLAGS+=-Wl,-znodelete
LDFLAGS+=-Wl,--auxiliary,libsys.so.7
VERSION_DEF=${SRCTOP}/lib/libc/Versions.def
SYMBOL_MAPS=${.CURDIR}/pthread.map
@ -76,7 +75,7 @@ LIBSYS_SRCTOP= ${.CURDIR:H}/libsys
.else
.PATH: ${LIBSYS_SRCTOP}
.endif
STATICOBJS+= _umtx_op_err.o
OBJS+= _umtx_op_err.o
.if ${MK_INSTALLLIB} != "no"
SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a

View file

@ -298,6 +298,9 @@ FBSDprivate_1.0 {
/* ABI bug workaround, indicate that pli->rtli_version is valid */
_pli_rtli_version;
/* Expose stub for libsys filter */
_umtx_op_err;
};
FBSD_1.1 {