History log of /freebsd-current/share/mk/bsd.compat.mk
Revision Date Author Comments
# 960b4327 02-Nov-2023 Andrew Turner <andrew@FreeBSD.org>

bsd.compat.mk: Set MACHINE before including bsd.opts.mk

In bsd.opts.mk we check MACHINE_ARCH and may want to check MACHINE to
decide which options to enable. Unfortunately this is included too
early via bsd.compiler.mk.

Move including bsd.compiler.mk until after we can set MACHINE and
MACHINE_ARCH.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42448


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 5d6cb793 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

bsd.compat.mk Extract _ALL_LIBCOMPATS and add related variables

Adding these to a new bsd.compat.pre.mk will allow other parts of the
tree to iterate over the set of possible libcompats (upper and/or lower)
rather than having to hard-code the list.

Reviewed by: brooks, jhb, emaste
Differential Revision: https://reviews.freebsd.org/D41178


# a1b67573 25-Jul-2023 Mike Karels <karels@FreeBSD.org>

arm64 lib32: enable building of lib32 on arm64

Enable LIB32 option on aarch64, defaulting to YES; it had defaulted
to "broken". Add required variables for how to compile lib32 on
arm. Use /usr/include/arm for armv7 (32-bit) headers, analogous to
/usr/include/i386 on amd64. Omit libomp from lib32; it is not
supported on armv7.

Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D40945


# 1840dc06 09-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

bsd.compat.mk: Remove obsolete COMPAT_32BIT now it's unused

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: emaste, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40932


# 8fad2cda 09-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

bsd.compat.mk: Provide new CPP and sub-make variables

Currently the only way to detect for a libcompat build is to consult
whether COMPAT_32BIT is defined (or equivalent, for downstreams with
other libcompats or past releases with libsoft as COMPAT_SOFTFP). There
are two issues with this:

1. COMPAT_32BIT is a new naming scheme that doesn't match the libcompat
name, which is unnecessary deviation.
2. When multiple libcompats exist, everywhere that needs to detect a
libcompat must check each variable in turn, despite the fact that it
normally just wants to know if this is a libcompat build and perhaps
what ${LIBCOMPAT} and/or ${libcompat} are for it.

As a result, far too many places in the tree need to know about the set
of possible libcompats.

Instead, introduce two new CPP and sub-make variables, COMPAT_LIBCOMPAT
and COMPAT_libcompat, which give the values for ${LIBCOMPAT} and
${libcompat} respectively, so that uses can be made parameterised. For
when code really does need to know the specific libcompat, Makefiles can
perform a string comparison, but the C preprocessor cannot, so introduce
an additional CPP-only COMPAT_LIB${LIBCOMPAT} which is intended to
replace the inconsistently-named COMPAT_32BIT (which will be removed in
future). Uses of this new variable should still be kept to a minimum,
however, given the code duplication needed for new libcompats.

Reviewed by: emaste, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40922


# aa856765 07-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

bsd.compat.mk: Fix indentation for alignment

Fixes: 91d7edd549f5 ("Generalise libcompat to be a list rather than a single option")


# 91d7edd5 27-Jun-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Generalise libcompat to be a list rather than a single option

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.

Reviewed by: brooks, jhb, imp
Differential Revision: https://reviews.freebsd.org/D40571


# b2dcde7e 19-Jul-2022 Ed Maste <emaste@FreeBSD.org>

Assemble .s to .o using cc, not as

As of commit fd71da37d478 we no longer have an `as` in the default
toolchain. Although we do not make use of this rule in the base system
some ports or downstream projects might. Use `cc -x assembler` instead
of as.

Reviewed by: arichardson
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35859


# 426fc376 05-Oct-2022 Brooks Davis <brooks@FreeBSD.org>

bsd.cpu.mk: Introduce MACHINE_ABI

MACHINE_ABI is a list of properties of the ABI used for MACHINE_ARCH.
It should be used in place of long conditionals on MACHINE_ARCH where
practical.

The following properties are indicated with one of the follow values:

Byte order: big-endian, little-endian
Floating point ABI: soft-float, hard-float
Size of long (size_t, etc): long32, long64
Pointer type: ptr32, ptr64
Size of time_t: time32, time64

For example, i386 targets will be:
MACHINE_ABI= big-endian hard-float long32 ptr32 time32

Reviewed by: imp
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D36421


# ac175bd3 11-Aug-2022 Alex Richardson <arichardson@FreeBSD.org>

Install working pkgconfig .pc files for compat libraries

The default ones are install them to /usr/libdata/pkgconfig, and we can't
use this path for compat libraries, so we use /usr/lib<suffix>/pkgconfigi here.

Test Plan: grep -rn libdir= ./usr/lib32/pkgconfig/*.pc
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34939


# 724123b9 01-Jul-2022 Brooks Davis <brooks@FreeBSD.org>

libcompat: Use WORLDTMP sysroot

Now that -m32 is fixed, just install libs in ${WORLDTMP}/lib/lib32
and use the installed headers.

Reviewed by: imp, jhb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D34697


# f9ee4156 03-May-2022 Alfredo Dal'Ava Junior <alfredo@FreeBSD.org>

build target triple variable from sys/conf/newvers.sh

Retrieve FreeBSD revision number directly from sys/conf/newvers.sh
when building the compiler target triple value, avoiding manual
intervention on other files every new release.

Reviewed by: imp
MFC after: 2 months
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D34429


# ffe74ab7 04-Feb-2022 John Baldwin <jhb@FreeBSD.org>

bsd.compat.mk: A few cosmetic fixes.

- Add a missing ')' to a warning.

- Consistently use {} when expanding variables.

- Remove a spurious blank line.

Reviewed by: imp, emaste
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D34172


# b68d6892 06-Jan-2022 Warner Losh <imp@FreeBSD.org>

libsoft: Remove targets to generate libsoft

Remove the targets needed to make and install libsoft.

Sponsored by: Netflix


# 539d3220 01-Jan-2022 Warner Losh <imp@FreeBSD.org>

bsd.compat.mk: Remove support for mips64

No longer need to care about mips32 binaries on mips64 for lib32
support.

Sponsored by: Netflix


# 7bc797e3 02-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Add build system support for ASAN+UBSAN instrumentation

This adds two new options WITH_ASAN/WITH_UBSAN that can be set to
enable instrumentation of all binaries with AddressSanitizer and/or
UndefinedBehaviourSanitizer. This current patch is almost sufficient
to get a complete buildworld with sanitizer instrumentation but in
order to actually build and boot a system it depends on a few more
follow-up commits.

Reviewed By: brooks, kib, markj
Differential Revision: https://reviews.freebsd.org/D31043


# a53ce3fc 21-Jan-2021 Glen Barber <gjb@FreeBSD.org>

Bump CURRENT to 14.0

This one goes to 14.

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")


# 556fcdce 16-Dec-2020 Bryan Drewery <bdrewery@FreeBSD.org>

bsd.compat.mk: Allow finding non-internal libraries

Currently only libexec/rtld-elf32 uses internal LIBC_NOSSP_PIC during
the build but it gets it directly from the objdir rather than a sysroot.
For example, /usr/obj/usr/src/amd64.amd64/obj-lib32/lib/libc/libc_nossp_pic.a.
We don't stage lib32 libraries in WORLDTMP/usr/lib32 and doing so doesn't
buy much. If we want to use a staged lib32 library then we need to look in
LIBCOMPATTMP where they were staged. For example if LIBC_PIC were wanted then
look for /usr/obj/usr/src/amd64.amd64/obj-lib32/tmp/usr/lib32/libc_pic.a.

Reported by: rlibby
Reviewed by: rlibby
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27648


# e2ec0743 17-Aug-2020 John Baldwin <jhb@FreeBSD.org>

Move -L${LIBCOMPATTMP}/usr/lib${libcompat} from CFLAGS to LDFLAGS.

This is only needed when linking and fixes various "unused command
line argument" warnings during the lib32 build.

Reviewed by: bdrewery
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26068


# 4d94781b 27-Mar-2020 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC] Fix LIB32WMAKEFLAGS definition

When I modified the LIB32WMAKEFLAGS= definition, I trimmed too much off.
-m is meant to be a parameter to LD.

Reported by: arichardson


# a04ec978 26-Mar-2020 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC] Switch powerpc and powerpcspe to lld

Now that LLD 10 is out, and required patches have landed, we are now ready
to finally switch away from the ancient in-tree ld.bfd.

Special thanks to Fangrui Song for many hours of work on getting the
32-bit powerpc lld ready for prime-time.

Reviewed by: emaste (earlier revision), jhibbits
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D24111


# dc0a7e13 06-Mar-2020 Justin Hibbits <jhibbits@FreeBSD.org>

compat: Allow explicit overriding of COMPAT_ARCH and COMPAT_CPUTYPE

Summary:
Allow src.conf to override the inferred COMPAT_ARCH and COMPAT_CPUTYPE
variables, such that a different CPU target can be specified explicitly
for the general target vs the compat target.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D23992


# d2c32def 26-Jan-2020 Alex Richardson <arichardson@FreeBSD.org>

Build hard-float lib32 for mips64hf/mips64elhf

This should fix linker errors when building with clang+lld.
After this change the lib32 compat libraries are now buildt with
-mhard-float instead of -msoft-float

Reviewed By: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D23229


# 64a3ba61 03-Jan-2020 John Baldwin <jhb@FreeBSD.org>

Set correct lib32 MACHINE_ARCH for mips64el*.

Use "mipsel" instead of "mips" as the 32-bit MACHINE_ARCH when
building lib32 for little-endian 64-bit MIPS targets. This fixes an
error where some objects were compiled as LE and others compiled as BE
causing a link error for rtld32.

Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D23028


# b451cd45 24-Dec-2019 Justin Hibbits <jhibbits@FreeBSD.org>

[PowerPC64] Use ld.bfd to build LIB32 and STAND - when using llvm

Summary:
This patch is to support ongoing work for replacing "GCC/BFD" by "CLANG/LLD" on
target PowerPC64 [1], by proposing a way to specify and/or locate a secondary
ld.bfd linker.
This is necessary as LLD currently doesn't support PowerPC 32 bits, so we keep
using BFD for the 32 bit stuff on PowePC64(LIB32 compatibility and
STAND/slof/loader.)

- creates LD_BFD variable pointing to ld.bfd
- use LD_BFD as linker for LIB32/compat
- Default behavior for other platforms aren't changed.

[1] https://wiki.freebsd.org/powerpc/llvm-elfv2

Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D20261


# 97671666 07-Nov-2019 Brooks Davis <brooks@FreeBSD.org>

Turn the error about a lack of LIBCOMPAT into a warning.

Add some diagnostic output.

This works around the fact that buildworld calls cleandir in libexec
with the wrong MACHINE_ARCH (i386 on amd64) when the OBJ directory is empty.

Reported by: bdragon, jkim


# a4330302 07-Nov-2019 Brooks Davis <brooks@FreeBSD.org>

libcompat: build 32-bit rtld and ldd as part of "everything"

Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included
directly so MD paths in Makefiles work. In the process centralize
setting them in LIBCOMPATWMAKEENV.

Alter .PATH and CFLAGS settings in work when the Makefile is included.

While here only support LIB32 on supported platforms rather than always
enabling it and requiring users of MK_LIB32 to filter based
TARGET/MACHINE_ARCH.

The net effect of this change is to make Makefile.libcompat only build
compatability libraries.

Changes relative to r354449:

Correct detection of the compiler type when bsd.compat.mk is used
outside Makefile.libcompat. Previously it always matched the clang
case.

Set LDFLAGS including the linker emulation for mips where -m32 seems to
be insufficent.

Reviewed by: imp, kib (origional version in r354449)
Obtained from: CheriBSD (conceptually)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22251


# ccad77fe 07-Nov-2019 Brooks Davis <brooks@FreeBSD.org>

Revert r354449: libcompat: build 32-bit rtld and ldd as part of "everything"

Additional testing is required..


# 36712a94 07-Nov-2019 Brooks Davis <brooks@FreeBSD.org>

libcompat: build 32-bit rtld and ldd as part of "everything"

Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included
directly so MD paths in Makefiles work. In the process centralize
setting them in LIBCOMPATWMAKEENV.

Alter .PATH and CFLAGS settings in work when the Makefile is included.

While here only support LIB32 on supported platforms rather than always
enabling it and requiring users of MK_LIB32 to filter based
TARGET/MACHINE_ARCH.

The net effect of this change is to make Makefile.libcompat only build
compatability libraries.

Reviewed by: imp, kib
Obtained from: CheriBSD (conceptually)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22251


# c09aa214 31-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Allow bsd.compat.mk to be reliably included outside Makefile.inc1.

Replace explicit TARGET_* variables with COMPAT_* versions defined based
on where the file is being included.

Also, require that bsd.compat.mk be included directly. It's not going to
be widely used so always loading it in bsd.prog.mk doesn't make sense.
Instead users can include it directly.

Reviewed by: imp, bdrewery (prior revision)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22059


# 5626bc0a 15-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Fix including bsd.compat.mk outside Makefile.libcompat on mips64.

Reported by: jhb, jenkins


# 6b53d510 15-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Add the ability to link programs against a compat ABI.

Linkage is controlled by two make knobs:
WANT_COMPAT - Prefer to link against the compat ABI.
NEED_COMPAT - Link against the compat ABI or fail to build.

Supported values are "32", "soft", and "any". The latter meaning pick
the first[0] supported compat ABI.

This can be used to provide test binaries for compat ABIs or to link
ABI-specific programs.

[0] We currently support only one compat ABI at a time, but this may
change in the future and some code in this commit is structured to ease
that change.

Reviewed by: bdrewery, jhb
Obtained from: CheriBSD (in concept)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22023


# ad2dd70b 15-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Rename top-level LIBCOMPAT to _LIBCOMPAT.

This avoids a conflict with LIBCOMPAT defined in bsd.libnames.mk.

Reviewed by: bdrewery
Sponsored by: DARPA, AFRL


# bbcf7edd 15-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Move the per-ARCH definitions to bsd.compat.mk.

This is the first step if refactoring the definitions to allow programs
to be selectively linked against libcompat libraries.

Reviewed by: bdrewery
Sponsored by: DARPA, AFRL


# edd42017 10-Jan-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove all support for legacy NOFOO and NO_FOO build options.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 2e0a54d6 20-Oct-2007 Ruslan Ermilov <ru@FreeBSD.org>

Align the warning message with the one in bsd.own.mk.


# 946367b8 09-Oct-2007 David E. O'Brien <obrien@FreeBSD.org>

Tweak the handling of "WITHOUT_LIBPTHREAD". Also remove the accidental
treatment of 'LIBKSE' as an "old style" knob.

Submitted by: ru
Approved by: re(kensmith)


# 65c045e9 09-Oct-2007 David E. O'Brien <obrien@FreeBSD.org>

Repo copy libpthreads to libkse.
This introduces the WITHOUT_LIBKSE nob,
and changes WITHOUT_LIBPTHREADS to mean with neither threading libs.
Approved by: re(kensmith)


# 2e975006 30-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Removed libc_r build support.


# c71158d4 02-Mar-2005 Tom Rhodes <trhodes@FreeBSD.org>

Wrap BSD r* commands in NO_RCMDS.
Change NO_RCMDNS to NO_RCMDS and do the switch in bsd.compat.mk.

Discussed with: ru, nectar


# 30d7f067 28-Feb-2005 David E. O'Brien <obrien@FreeBSD.org>

Accept the old user interface for NO_CLEAN as it is a POLA violation as
we've eventually changed the user interface of a common command.


# b5b0bba4 20-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOPAM -> NO_PAM


# cbbdcac7 20-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOFORTH -> NO_FORTH


# f45a5bbd 20-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOCLEAN -> NO_CLEAN
NOCLEANDIR -> NO_CLEANDIR


# 6495335e 20-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOSHARE -> NO_SHARE


# 582ef25f 20-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOHTML -> NO_HTML


# 731db6a4 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOINET6 -> NO_INET6


# 39a855c2 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOGAMES -> NO_GAMES


# a2161735 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOCRYPT -> NO_CRYPT


# 83c7ade9 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOSHARED -> NO_SHARED


# 00fbd407 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOFSCHG -> NO_FSCHG


# 2c74b2cb 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOINSTALLLIB -> NO_INSTALLLIB


# 9a9bc31f 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOMLINKS -> NO_MLINKS


# 6260f1d8 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOTAGS -> NO_TAGS


# a399b3b4 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOEXTRADEPEND -> NO_EXTRADEPEND


# ab7a2947 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NODOCCOMPRESS -> NO_DOCCOMPRESS
NOINFO -> NO_INFO
NOINFOCOMPRESS -> NO_INFOCOMPRESS
NOLINT -> NO_LINT
NOPIC -> NO_PIC
NOPROFILE -> NO_PROFILE


# 07736e20 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOATM -> NO_ATM


# f1f6253f 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

NOLIBC_R -> NO_LIBC_R
NOLIBPTHREAD -> NO_LIBPTHREAD
NOLIBTHR -> NO_LIBTHR


# e653b48c 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

Start the dreaded NOFOO -> NO_FOO conversion.

OK'ed by: core