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)
Tue, Oct 29, 2:37 AM
Unknown Object (File)
Tue, Oct 29, 2:37 AM
Unknown Object (File)
Tue, Oct 29, 2:37 AM
Unknown Object (File)
Tue, Oct 29, 2:22 AM
Unknown Object (File)
Tue, Oct 22, 5:18 PM
Unknown Object (File)
Mon, Oct 21, 5:14 PM
Unknown Object (File)
Mon, Oct 21, 12:08 PM
Unknown Object (File)
Oct 2 2024, 2:57 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.