Page MenuHomeFreeBSD

bsd.endian.mk: Allow for the cross building case
ClosedPublic

Authored by imp on Jan 4 2022, 7:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 18, 7:47 AM
Unknown Object (File)
Thu, Oct 10, 4:43 AM
Unknown Object (File)
Sep 29 2024, 5:06 PM
Unknown Object (File)
Sep 23 2024, 11:15 PM
Unknown Object (File)
Sep 23 2024, 3:58 AM
Unknown Object (File)
Sep 19 2024, 1:06 PM
Unknown Object (File)
Sep 18 2024, 6:45 PM
Unknown Object (File)
Sep 17 2024, 11:03 AM
Subscribers

Details

Summary

We need to include bsd.endian.mk from bsd.compiler.mk to enable
compressed symbols only on FreeBSD little endian targets.

However, since we include bsd.compiler.mk from Makefile.inc1 and from
the build tools makefiles, it has to work on Linux and osx. Make the
error condition only when we're building natively (so that we are
forced to add a new architecture to the list).

Otherwise, define bogus, poisoned values and leave TARGET_ENDIANNESS
undefined. Since we don't actually use TARGET_ENDIANNESS for anything in
the cross building phase, these values are a failsafe agianst their
use. The one place that detects endian is appropriately protected.

Diff Detail

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

Event Timeline

imp requested review of this revision.Jan 4 2022, 7:51 PM

Won't referencing the variables always be an error if they're undefined, which simplifies things as you don't need to make sure nothing does .if endian == 1234 .else .endif or similar?

share/mk/bsd.endian.mk
18–29

maybe .elif to avoid a level of nesting?

19–29

these quotes are unnecessary (they're just emitted verbatim in the error output)

Won't referencing the variables always be an error if they're undefined, which simplifies things as you don't need to make sure nothing does .if endian == 1234 .else .endif or similar?

${CAP_MKDB_ENDIAN} and ${LOCALDEV_ENDIAN} are expanded to nothing in that case, and the commands will work w/o the usual arg. Some of the makefiles include them for that
without checking TARGET_ENDIANNESS.

You are right about the target endianness being undefined. I'll leave the comment and the two failsafe values, but leave that undefined. I'll also modify the bsd.compiker.mk
change to just refer to the comment in bsd.endian.mk and leave the code as-is there. I'll drop the 'assert' patch from the series too.

updated commit message

ubuntu and amd64 build, running make tinderbox now

This revision is now accepted and ready to land.Jan 4 2022, 11:06 PM
This revision was automatically updated to reflect the committed changes.