Page MenuHomeFreeBSD

Generalise libcompat to be a list rather than a single option
ClosedPublic

Authored by jrtc27 on Jun 15 2023, 9:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 11, 4:02 PM
Unknown Object (File)
Tue, Jun 11, 2:52 PM
Unknown Object (File)
Tue, Jun 11, 8:37 AM
Unknown Object (File)
Tue, Jun 11, 8:37 AM
Unknown Object (File)
Tue, Jun 11, 8:33 AM
Unknown Object (File)
Tue, Jun 11, 8:32 AM
Unknown Object (File)
Tue, Jun 11, 8:19 AM
Unknown Object (File)
Tue, Jun 11, 6:23 AM

Details

Summary

Whilst the kernel can support any number of COMPAT_FOO, world can only
build a single libfoo. Upstream this isn't such an issue, since the only
option is lib32 anyway, but downstreams, such as CheriBSD, may wish to
support multiple at the same time. Thus, adjust the top-level Makefiles
to turn _LIBCOMPAT into a _LIBCOMPATS list that gets iterated over, and
adjust bsd.compat.mk to support this use-case.

For the normal NEED_COMPAT/WANT_COMPAT case, LIBCOMPATFOO remain set and
refer to the requested compat's, preserving the current interface. For
the top-level Makefiles those variables are no longer set (since there
is no longer "the" compat) and only the per-compat ones are available.

Diff Detail

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

Event Timeline

Makefile.inc1
854

How do others get added?

1183

Where does through lowercase version of this get set?

Makefile.inc1
854
.if ${MK_LIB64} == "yes"
_LIBCOMPATS+=	64
.endif

etc; I actually tested this by adding a (pointless) lib64 to amd64 in https://github.com/jrtc27/freebsd-src/commit/b5123f22133f09451edd04ef1a3fca4ff2feb547

1183

Line 107 of bsd.compat.mk (akin to how line 102 used to set libcompat singular)

This revision is now accepted and ready to land.Jun 16 2023, 5:43 PM

That is less painful than I thought it was going to be.

  • Fix build for compat-less arches
  • Fix WMAKE_TGTS filtering, including for universe-toolchain

(tinderbox now succeeds)

This revision now requires review to proceed.Jun 19 2023, 3:26 PM

My questions are answered. Don't see anything else noteworthy

This revision is now accepted and ready to land.Jun 24 2023, 9:39 PM