Page MenuHomeFreeBSD

libthr: filter rather than link with libsys
ClosedPublic

Authored by brooks on Feb 7 2024, 3:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 9, 3:45 AM
Unknown Object (File)
Sat, May 4, 1:17 PM
Unknown Object (File)
Apr 27 2024, 7:52 AM
Unknown Object (File)
Apr 27 2024, 7:52 AM
Unknown Object (File)
Apr 27 2024, 7:52 AM
Unknown Object (File)
Apr 27 2024, 6:15 AM
Unknown Object (File)
Apr 14 2024, 5:37 PM
Unknown Object (File)
Mar 19 2024, 4:51 PM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

brooks requested review of this revision.Feb 7 2024, 3:48 PM

This fixes devel/gcc* with MULTILIBS enabled. If it turns out to be a binutils bug we might eventually be able to revert (assuming that's desirable), but it's its gcc we can't patch every version so we need this.

I've verified I can build gcc12 amd64 and R-cran-xml2 (since that exercises threading). libthr tests also pass.

It is not clear to me why the symbol is not resolved (or rather, why -lsys needs to be explicitly specified). But ok for now.

This revision is now accepted and ready to land.Feb 7 2024, 4:23 PM
This revision was automatically updated to reflect the committed changes.