History log of /freebsd-current/tools/build/Makefile
Revision Date Author Comments
# 5d1ecf0b 08-Jan-2024 Kyle Evans <kevans@FreeBSD.org>

build: only inspect the first word of toolchain tools

CC/CXX/CPP/LD may all have arguments supplied in various circumstances,
which break the logic here. We only need to determine which of these
tools we're expecting to invoke from PATH, which just requires
examination of the first word. Limit our scope to exactly that.

Patch suggested by: jrtc27
Reviewed by: imp, jrtc27
Differential Revision: https://reviews.freebsd.org/D43372


# ff7c12c1 13-Dec-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Make kldxref a bootstrap tool and use unconditionally

Now that kldxref is a generic cross tool and can be built on non-FreeBSD
we can bootstrap it during the build and thus remove the condition for
whether it exists. We also need to make sure to add it to the METALOG
for -DNO_ROOT builds.

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


# 881ec813 13-Dec-2023 Jessica Clarke <jrtc27@FreeBSD.org>

tools/build: Provide sys/linker_set.h when cross-building

This is needed for kldxref, which will shortly become a bootstrap tool.
Linux can use the same one as FreeBSD (provided the cross-building
sys/cdefs.h is augmented appropriately), whilst macOS needs its own
Mach-O-specific implementation.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D43049


# ceefd491 20-Oct-2023 Andrew Turner <andrew@FreeBSD.org>

tools/build: Support building with glibc 2.38

Ubuntu 23.10 uses glibc 2.38. This adds strlcpy and strlcmp so we need
to remove them from the cross build environment.

Reviewed by: jrtc27 (earlier version), arichardson
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42303


# f9df6097 23-Sep-2023 Simon J. Gerraty <sjg@FreeBSD.org>

Add support for host32 for DIRDEPS_BUILD

Allow building 32bit libs for host.

Move CFLAGS additions from local.sys.dirdeps.mk (which is too early
and impacts CFLAGS defaults) to local.sys.mk

Reviewed by: stevek
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D41946


# 968a3db7 22-Aug-2023 Jessica Clarke <jrtc27@FreeBSD.org>

kbdcontrol: Support building as a bootstrap tool on old and non-FreeBSD

Systems that predate 971bac5ace7a ("kbd: consolidate kb interfaces
(phase one)") cannot build kbdcontrol since kbdelays and kbrates moved
to sys/kbio.h. Moreover, on non-FreeBSD, it requires all kinds of ioctls
and sysctls that are highly FreeBSD-specific to build, but we use it as
a bootstrap tool to generate the keymaps used by some kernels (LINT ones
in particular). Thus, when bootstrapping kbdcontrol, disable everything
that's not needed for that singular use, and use the in-tree kbio.h to
get the definitions of the necessary structures.

This allows KBDMUX_DFLT_KEYMAP, UKBD_DFLT_KEYMAP and ATKBD_DFLT_KEYMAP
to be enabled when building on non-FreeBSD, and thus LINT kernels.

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


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

Remove $FreeBSD$: one-line sh pattern

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


# 01718a2e 31-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

tools/build: Work around broken Clang FreeBSD resource dir logic pre-13

Prior to Clang 13 (e.g. in the Clang 11 present in 13.0-RELEASE), the
resource directory logic for FreeBSD was broken and would not resolve
symlinks, meaning symlinks would only work if in a directory next to the
containing lib directory. Therefore we cannot even use a symlink for
worldtmp, we have to make a wrapper script that execs the real binary
via an absolute path.

Reported by: markj
Reviewed by: markj
Fixes: 65f28f63a73d ("tools/build: Create toolchain symlinks for non-absolute compiler/linker")
Differential Revision: https://reviews.freebsd.org/D41238


# 65f28f63 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

tools/build: Create toolchain symlinks for non-absolute compiler/linker

If any of the toolchain variables are not absolute then we need to
create a symlink in WORLDTMP/legacy/bin in order to make them available
during a BUILD_WITH_STRICT_TMPPATH build.

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


# dd3ad7c2 25-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

tools/build: Tidy up whitespace and comments, and delete duplicate code

We already handle the make and bmake links unconditionally above.


# 644d346d 24-Apr-2023 Simon J. Gerraty <sjg@FreeBSD.org>

We do not need readpassphrase from openssh

When building tar for linux, just disable HAVE_READPASSPHRASE
in config_freebsd.h and libarchive will provide for readpassphrase
Otherwise the two conflict.


# 976ba7f0 24-Apr-2023 Simon J. Gerraty <sjg@FreeBSD.org>

Enable building tar for non-FreeBSD host

For DIRDEPS_BUILD we need Makefile.depend.options to
force libegacy to be built on older FreeBSD and non-FreeBSD hosts.

Add readpassphrase to libegacy to avoid the need for libbsd on Linux

src.opts.mk disable TESTS for host if MK_host_egacy is yes

Reviewed by: imp
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39766


# db98bc2c 22-Apr-2023 Simon J. Gerraty <sjg@FreeBSD.org>

Allow tools/build to work for DIRDEPS_BUILD

We want to be able to build some host tools for non-FreeBSD hosts
without building more than we need. The DIRDEPS_BUILD lets us
do that.

We use the pseudo MACHINE "host" when building
for the host - deal with that when setting _host_arch.

Reviewed by: jrtc27
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39751


# 0ec03c0b 28-Mar-2023 Mark Johnston <markj@FreeBSD.org>

cross-build: Add secure_getenv() for MacOS cross builds

Reviewed by: arichardson
Fixes: 68ca8363c7a1 ("libc: Use secure_getenv(3) where appropriate")
Differential Revision: https://reviews.freebsd.org/D39295


# 7d8e1e8d 29-Mar-2023 John Baldwin <jhb@FreeBSD.org>

libcasper: Move helper libraries from /lib/casper to /lib.

These libraries are linked to directly by applications rather than
opened at runtime via dlopen().

Discussed with: oshogbo
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D39245


# ac6b2b43 27-Mar-2023 John Baldwin <jhb@FreeBSD.org>

build: glibc on Linux defines explicit_bzero in <string.h>.

Don't install strings.h on such systems. The local prototype doesn't
match the native Linux one when built as C++ breaking the build of
config(8) as a bootstrap tool on some Linux systems. If the missing
prototype becomes a problem in the future,
tools/build/cross-build/include/linux/strings.h can be patched to add
it.

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


# c5e54e56 24-Feb-2023 Ed Maste <emaste@FreeBSD.org>

tools/build: Hide spurious errors if sys/stat.h does not exist

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38757


# 3b073d2e 09-Jan-2023 Brooks Davis <brooks@FreeBSD.org>

tools/build: Always bootstrap (sys/)bitstring.h

Older, supported FreeBSD versions lack bit_ntest() so hoist the boostrap
installation out of the OS!=FreeBSD case and always install it. A more
precise criteria is possible, but would add little value.

This fixes bootstrapping makefs as a build tool on 13.1.

Reviewed by: jrtc27, emaste
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D37951


# 548f8a65 17-Aug-2022 Jessica Clarke <jrtc27@FreeBSD.org>

tools/build: Provide fls* when cross-building on Linux

flsll is needed for makefs's new ZFS support, and the others are added
for completeness.

Reviewed by: emaste, arichardson
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Differential Revision: https://reviews.freebsd.org/D36134


# e9ba1fd5 17-Aug-2022 Jessica Clarke <jrtc27@FreeBSD.org>

tools/build: Provide FreeBSD's bitstring API when cross-building

This is needed for building makefs as a cross-tool since the ZFS code
uses these APIs.

Reviewed by: emaste
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Differential Revision: https://reviews.freebsd.org/D36133


# 000321ba 17-May-2022 Reid Linnemann <rlinnemann@netgate.com>

namespace nv names, version libnv and libnvpair library symbols

libnv and libnvpair have aliased symbols, and as a result a single process which
dlopens a shared object that is dynamically linked to libnv and another to
libnvpair will wind up with a single set of resolved symbols for those in
conflict. A source file also cannot include both libnv and libnvpair headers
because of aliased identifiers. To resolve the situation, libnv types and
functions are namespaced via nv_namespace.h, and libnv symbols are
versioned. The msgio functions are not namespaced or exported as they are not
part of the external API.

Reviewed by: kevans
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35261


# 2d5d2a98 07-Mar-2022 Mark Johnston <markj@FreeBSD.org>

ctf: Import ctf.h from OpenBSD

Use it instead of the existing ctf.h from OpenSolaris. This makes it
easier to use CTF in the core kernel, and to extend the CTF format to
support wider type IDs.

The imported ctf.h is modified to depend only on _types.h, and also to
provide macros which use the "parent" bit of a type ID to refer to types
in a parent CTF container.

No functional change intended.

Reviewed by: Domagoj Stolfa, emaste
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34358


# ddf312e8 26-Jan-2022 Mark Johnston <markj@FreeBSD.org>

tools/build: Fix the error message used when a host tool is not present

MFC after: 1 week


# 6f6fbfa3 15-Jan-2022 Ed Maste <emaste@FreeBSD.org>

Remove quotes around Makefile .error/.warn/.info strings

The text after .error et al is emitted verbatim.

Reviewed by: sjg
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33904


# 7ba31d58 06-Dec-2021 Jessica Clarke <jrtc27@FreeBSD.org>

tools: Also create ${WORLDTMP}/legacy/usr/libdata/pkgonfig

This is needed for the next commit which will make libz a bootstrap
library as needed by ctfconvert. We could just not install the .pc file
as it's not needed, but that requires a per-library hack every time a
bootstrap library gains a .pc file, so this keeps bootstrap-tools
looking as much like a normal build as possible.

MFC after: 1 week


# 8c22b9f3 17-Oct-2021 Kyle Evans <kevans@FreeBSD.org>

Fix cross-building on Linux/aarch64

Add necessary bits to detect ELF format on Linux/aarch64; note that
Linux calls it aarch64 where we would typically call it arm64 (uname -m)

Reviewed by: arichardson, emaste, imp
Sponsored by: Ampere Computing LLC
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D32542


# 7b81e6c7 04-Sep-2021 Justin Hibbits <jhibbits@FreeBSD.org>

Support bootstrapping from Linux/ppc*


# 5425ba83 24-Aug-2021 Ka Ho Ng <khng@FreeBSD.org>

truncate(1): Fix cross-build CI failure due to missing fspacectl

For other platforms, fspacectl(2) is absent. This commit masks out the
calls to fspacectl(2) and replace them with a ENODEV errno.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31619


# 5c9cb96a 02-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Fix BUILD_WITH_STRICT_TMPPATH build after adding time to ITOOLS

This is needed after bbd16236e986ef1b0e1da37c9c8a7f9dd2d63b5d (and
99feb137f5f66f903bba816c1d98ced2a92bef12).


# 8c9e4550 20-Mar-2021 Jessica Clarke <jrtc27@FreeBSD.org>

tools/build: Improve host-symlinks failure mode

Since set -e is enabled by sys.mk, if the tool cannot be found in PATH
then the entire shell command line fails, causing us to not print the
error message below and instead silently (due to the @) fail, only
getting the usual "Error code 1" print from bmake. Thus, provide a dummy
default that will never exist (the same as is used by meta2deps.sh) if
which fails so that we get the error message as intended.

MFC after: 1 week


# 962a3814 17-Feb-2021 Alex Richardson <arichardson@FreeBSD.org>

Fix bootstrap tools build on macOS after 02af91c52e71e8a0f47251e637c9687f35d45dd9

After changing the namespace.h header we need to provide _err on macOS, too.
Previously we used the system libc err*/warn*, but that does not provide
_err/_warn (which is used by other bootstrapped files from libc).
To fix this problem bootstrap err.c on macOS as well.

Fixes: 02af91c52 (Fix crossbuild bootstrap tools build with Clang 12)


# a8b20f4f 25-Jan-2021 Alexander Richardson <Alexander.Richardson@cl.cam.ac.uk>

Create symlinks to host tools on non-FreeBSD hosts

This is unnecessary when cross-building from Linux/macOS.
Additionally, cp -p appears to be broken on macOS Big Sur
(https://openradar.appspot.com/8957219).

For some unknown reason this commit appears to fix
freezes when building on macOS Big Sur.
This also fixes building in docker with volume mounts
with ACLs, since setting the ACL with cp -p fails otherwise.

Obtained From: CheriBSD
Tested By: gnn (macOS Big Sur), Nathaniel Wesley Filardo (docker)
Reviewed By: jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D28267


# aefe30c5 15-Jan-2021 Mariusz Zaborski <oshogbo@FreeBSD.org>

cat: capsicumize it

Reviewed by: markj, arichardson
Differential Revision: https://reviews.freebsd.org/D28083


# 4e64fb9f 14-Dec-2020 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>

Fix warnings during bootstrap on Linux systems

Most warnings are currently off for the boostrap phase, but once D27598
lands they will be enabled again.


# ed845580 06-Jan-2021 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>

Fix all warnings emitted in `make kernel-toolchain`

With this change and D27598 make kernel-toolchain no longer emits any
warnings for me.

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D27599


# a5252831 13-Oct-2020 Alex Richardson <arichardson@FreeBSD.org>

Fix more -Wundef warnings during bootstrap


# 5bb9250e 25-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD

The most awkward bit in this patch is the bootstrapping of m4:
We can't simply use the host version of m4 since that is not compatible
with the flags passed by lex (at least on macOS, possibly also on Linux).
Therefore we need to bootstrap m4, but lex needs m4 to build and m4 also
depends on lex (which needs m4 to generate any files). To work around this
cyclic dependency we can build a bootstrap version of m4 (with pre-generated
files) then use that to build the real m4.

This patch also changes the xz/unxz/dd tools to always use the host version
since the version in the source tree cannot easily be bootstrapped on macOS
or Linux.

Reviewed By: brooks, imp (earlier version)
Differential Revision: https://reviews.freebsd.org/D25992


# 7ec1ec4f 25-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Add missing FreeBSD functions to -legacy when building on macOS/Linux

In most cases this simply builds the file from lib/libc for missing
functions (e.g. strlcpy on Linux etc.). In cases where this is not possible
I've added an implementation to tools/build/cross-build.

The fgetln.c/fgetwln.c/closefrom.c compatibility code was obtained from
https://gitlab.freedesktop.org/libbsd/libbsd, but I'm not sure it makes
sense to import it into to contrib just for these three bootstrap files.

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D25978


# 0e533c72 24-Aug-2020 Warner Losh <imp@FreeBSD.org>

When copying over the binaries, use '-p' to preserve date/time

Although I can't reproduce it, others are seeing different lex/yacc
programs always regenerated after my change to copy rather than
symlink the files. The reported fix is to add '-p' to the copies.
Since it doesn't hurt, go head and add it, though the reasons for
this mattering remain at best obscure and poorly articulated.


# 0d5e6518 14-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

crunchgen: use pwd -P without env

The -P flag is required by POSIX so we don't have to care whether pwd is
a shell builtin or not. This also allows removing pwd from the list of
bootstrap tools since all shells we care about for building have a
builtin pwd command. This effectively reverts r364190.

Suggested By: rgrimes, jrtc27


# 54f7867b 13-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Add pwd to the list of tools that are linked to $WORLDTMP/legacy

After r364166 and r364174, crunchgen needs a pwd binary in $PATH instead
of using a hardcoded absolute path. This commit is needed for
BUILD_WITH_STRICT_TMPPATH builds (currently not on by default).


# 313232dd 11-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Fix bootstrapping ldd after r362152

r362152 started using DF_1_PIE, which is not present in older versions
of sys/elf_common.h. To fix this include the ELF headers as part of -legacy.


# 33176cdc 07-Aug-2020 Warner Losh <imp@FreeBSD.org>

The practice of creating symbolic links is somewhat fragile. Always
make copies instead.

There's too many times that we can't run the new binaries with old
libraries. Making the links when things are known to be 'safe' is a
nice optimization, but a copy of all the binaries is only 30MB, so
saving the copies at the cost of increased support when new symbols
are added and used as part of the bootstrap seems to be unwise.

There may be additional optimizations possible here, especially for
!FreeBSD hosts. However, that's beyond the scope of the problem I'm
trying to fix with make failing mid-way through an installworld across
change r363679. This optimization there caused us to run a new binary
with an old library once a new make was installed due to the symbolic
link. One could just copy make, but then other binaries fail as well,
so rather than play whack-a-mole, I opted to take us back to the old
way. Before r340157 or so we did copies (thogh of a lot fewer
artifacts), and we didn't have issues like this.

Reviewed by: arichards@
Differential Revision: https://reviews.freebsd.org/D25967


# ea6c594c 14-Jul-2020 Alex Richardson <arichardson@FreeBSD.org>

Fix BUILD_WITH_STRICT_TMPPATH builds

We need dd in $PATH for some of the MK_BOOT code and some tests also use it.

Obtained from: CheriBSD


# 94a82666 21-Jun-2020 Ryan Moeller <freqlabs@FreeBSD.org>

flua: add ucl library

libucl comes with a Lua library binding. Build it into flua.

This lets us parse/generate config files in the various formats supported by
libucl with flua. For example, the following script will detect the format of
an object written to stdin as one of UCL config, JSON, or YAML and write it to
stdout as pretty-printed JSON:

local ucl = require('ucl')
local parser = ucl.parser()
parser:parse_string(io.read('*a'))
local obj = parser:get_object()
print(ucl.to_format(obj, 'json'))

Reviewed by: kevans, pstef
Approved by: mmacy (mentor)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D25009


# e7fd9688 14-Jun-2020 Toomas Soome <tsoome@FreeBSD.org>

Move font related data structured to sys/font.c and update vtfontcvt

Prepare support to be able to handle font data in loader, consolidate
data structures to sys/font.h and update vtfontcvt.

vtfontcvt update is about to output set of glyphs in form of C source,
the implementation does allow to output compressed or uncompressed font
bitmaps.

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D24189


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

Allow bootstrapping makefs on older FreeBSD hosts and Linux/macOS

In order to do so we need to install the msdosfs headers to the bootstrap
sysroot and avoid includes of kernel headers that may not exist on every
host (e.g. sys/lockmgr.h). This change should allow bootstrapping of makefs
on FreeBSD 11+ as well as Linux and macOS.

We also have to avoid using the IO_SYNC macro since that may not be
available. In makefs it is only used to switch between calling
bwrite() and bdwrite() which both call the same function. Therefore we
can simply always call bwrite().

For our CheriBSD builds we always bootstrap makefs by setting
LOCAL_XTOOL_DIRS='lib/libnetbsd usr.sbin/makefs' and use the makefs binary
from the build tree to create a bootable disk image.

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D23201


# 4f47920e 11-Jan-2020 Kyle Evans <kevans@FreeBSD.org>

Makefile.inc1: push /usr/libexec into the BPATH/TMPPATH

${WORLDTMP}/legacy/usr/libexec will only have libexec/ bits that we've
pushed as bootstrap tools, so this is generally safe to include prior to
PATH. The following are the ramifications of this change:

- BPATH addition gets us at least bootstrap flua in WMAKEENV path for
buildenv, for those earlier systems where it's bootstrapped still

- Reworked the sysent target to just set PATH and let it get worked out in
src.lua.mk or individual sysent makefiles -- this gives us back the
ability to overwrite LUA_CMD and use a different/external lua for these
targets. sysent can also now work cleanly in buildenv.

- tools/build/Makefile will now symlink the host flua into build's host
tools so that the above can work without needing to add the host's
/usr/libexec explicitly into TMPPATH.

Reviewed by: arichardson, brooks, imp (all slightly earlier version)
Differential Revision: https://reviews.freebsd.org/D22464


# f22a5921 18-Nov-2019 Kyle Evans <kevans@FreeBSD.org>

Convert in-tree sysent targets to use new makesyscalls.lua

flua is bootstrapped as part of the build for those on older
versions/revisions that don't yet have flua installed. Once upgraded past
r354833, "make sysent" will again naturally work as expected.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D21894


# 17adf17b 28-Oct-2019 Simon J. Gerraty <sjg@FreeBSD.org>

Building head on stable/11 requires libzstd

Add lib/libzstd to _elftoolchain_libs

tools/build/Makefile needs to create the install dir for libzstd
Since this would make the line too long, rework to use a list
in one per line format (easier to add in future)
and dispense with the .for loop

Reviewed by: emaste bapt
Differential Revision: https://reviews.freebsd.org/D220134


# fbe12f20 01-Aug-2019 Mark Johnston <markj@FreeBSD.org>

Include caph_rights_limit() in libegacy if need be.

Reported by: jenkins
Sponsored by: The FreeBSD Foundation


# c36f4276 15-Jun-2019 Marius Strobl <marius@FreeBSD.org>

Add <sys/dnv.h> required for libnv to SYSINCS, too, apparently missed
in r336335.


# 6389bef8 17-Apr-2019 Cy Schubert <cy@FreeBSD.org>

As an interim measure until a more permanent solution is implemented
workaround the following error:

/usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of
undeclared identifier
'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);

Reported by: O. Hartmann <ohartmann@walstatt.org>
Reported by: Michael Butler <imb@protected-networks.net>
Reported by: gjb@ & cy@ (implicit)
Reviewed by: emaste@
Noted by: rgrimes@


# d5f4dd1b 03-Apr-2019 Mariusz Zaborski <oshogbo@FreeBSD.org>

Add cap_fileargs.h to -legacy if needed.

Reviewed by: arichardson
Differential Revision: https://reviews.freebsd.org/D19685


# 3b7e9bfe 19-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Add capsicum_helpers.h to -legacy if needed

This fixes bootstrap of capsicumized strings on FreeBSD 11.

Reviewed By: oshogbo, bdrewery
Differential Revision: https://reviews.freebsd.org/D17971


# b25c7179 05-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Fix -DNO_CLEAN build after r340157

Approved By: jhb (mentor)


# 8f62bca4 05-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Allow building world without inheriting $PATH

Inheriting $PATH during the build phase can cause the build to fail when
compiling on a different system due to missing build tools or incompatible
versions somewhere in $PATH. This has cause build failures for us before
due to the jenkins slaves still running FreeBSD 10.
Listing the tools we depend on explicitly instead of just using whatever
happens to be in $PATH allows us to check that we don't accidentally add a
new build dependency.

All tools that do no need to be bootstrapped will now be symlinked to
${WORLDTMP}/legacy/bin and during the build phase $PATH will only contain
${WORLDTMP}. There is also a new variable "BOOTSTRAP_ALL_TOOLS" which can
be set to force compiling almost all bootstrap tools instead of symlinking
them. This will not bootstrap tools such as cp,mv, etc. since they may be
used during the build and for those we should really only be using POSIX
compatible options.

Furthermore, this change is required in order to be able to build on
non-FreeBSD hosts. While the same binaries may exist on Linux/MacOS they
often accept different flags or produce incompatible output.

Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16815


# 4acc8a67 20-Aug-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't create directories in ${WORLDTMP}/legacy with mtree

This has two advantages:
1) We no longer create lots of empty directories that are not needed
2) This is a requirement for building on non-FreeBSD hosts since mtree will
only exist after the bootstrap-tools phase there.

Aproved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16773


# 8d14ced6 16-Jul-2018 Alex Richardson <arichardson@FreeBSD.org>

Fix buildworld on FreeBSD 10

Since r336126 we depend on explicit_bzero() for the libmd
bootstrap. Add it to -legacy if it is not found in /usr/include/strings.h.

Reviewed By: ian
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16245


# 63889bbd 16-Jul-2018 Alex Richardson <arichardson@FreeBSD.org>

No longer install sys/nv.h and sys/cnv.h in lib/libnv/Makefile

Use tools/build/Makefile to install the headers into ${WORLDTMP}/legacy
instead. Compared to r336026 this has the minor advantage that it avoids
unncessary header installation when building the non-bootstrap libnv.

Reviewed By: bdrewery, kevans
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16187


# b4b4b530 28-Jan-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Revert crap accidentally committed


# 814aaaa7 28-Jan-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Revert r312923 a better approach will be taken later


# d80f1dd1 09-Jun-2016 Jilles Tjoelker <jilles@FreeBSD.org>

build: Add legacy support for futimens() and utimensat().

In order to allow using utimensat() in install(1), add futimens() and
utimensat() to -legacy.

The files futimens.c and utimensat.c are modified copies of the files under
lib/libc/sys/ since the libc versions use symbols that do not exist in the
libc on the build system (sys_futimens and sys_utimensat) . I expect the
next non-sweeping change to both sets of files to be to delete them, anyway.

This will allow reverting r299942 (which is a revert of r299850) enabling
nanosecond timestamps in install(1).

Reviewed by: bdrewery


# 804baa38 16-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r290944. It was wrong.


# 5a16e0b4 16-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix error case for bmake to echo 0.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division


# 8e7e3163 15-May-2015 Dimitry Andric <dim@FreeBSD.org>

Provide reallocarray() in -legacy, if needed, to allow building head on
previous releases.

Also add a stdlib.h wrapper, which declares the function, otherwise the
compiler may assume it returns int, which can cause segfaults on LP64
architectures.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D2558


# e1a85b31 12-Apr-2014 Warner Losh <imp@FreeBSD.org>

Check the right file for pwcache_groupdb.


# 2ed29669 12-Apr-2014 Warner Losh <imp@FreeBSD.org>

Up the minimum system to build FreeBSD current to 8.0-RELEASE. The
issues with vendors that needed 7.x support have been resolved. Many
vendors are still using 8.x build platforms, however, so bumping this
up to 9.0 will have to wait until that is resolved. Actual support for
building from 8.x still relies on those vendors fixing bugs that are
present as most developers have moved onto 9.x or newer platforms.

Reviewed by: marcel@


# 79626055 11-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Add pwcache(3) and vis(3) to libegacy as install(1) is about to grow a
dependency on them.

Sponsored by: DARPA, AFRL


# c2774610 11-Sep-2012 David E. O'Brien <obrien@FreeBSD.org>

r235638 is not the clean way to add support for building on ancient FreeBSD
versions. Instead use Imp's good work on "legacy" and follow the outcome
of the previous TRB discussions on this topic.

Now use the libc getline() if it exists, and only where it doesn't
create a bootstraping version.


# fd75cb79 17-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Revert r227538, since it doesn't compile with clang at all (it doesn't
allow the built-in operations to be redefined, at least not without
excessive force).

Instead, just disable LLVM's support for atomic operations for now.
Nothing in either clang or the tablegen tools currently depends on it.

This still allows users of head built before r198344 to upgrade to
top-of-head seamlessly.


# 5a880d34 15-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

LLVM uses atomic operations, which are not supported on i386 and GCC
emits calls for them, rather than expanding them inline. Older FreeBSD
versions compile for i386 by default and as such we end up with
unresolved symbols when we build LLVM's TableGen utility as a build
tool on them. Add the functions that GCC emits here, but don't bother
to make them atomic. Such is not needed.

Submitted by: marcel
MFC after: 1 week


# 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.


# 57087c93 21-Jan-2008 David E. O'Brien <obrien@FreeBSD.org>

Remove 5.x and 6.x cruft - source upgrades to RELENG_8 from versions prior
to RELENG_7 are not supported.


# 228f8c4f 16-May-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make <runefile.h> internal to libc.

Suggested by: phantom


# f09a3cc4 02-Mar-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add hacks that I use to test cross-builds (by building on
native and foreign architectures and comparing products).
They eliminate most of the differences caused by different
object directory paths, timestamping, and identification.

(Note WORLDTMP was renamed to ${OBJTREE}${.CURDIR}/tmp.)


# 8945135e 27-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap gencat(1).

OK'ed by: phantom


# 6ad80d4f 27-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

As threatened, drop support for source upgrades from pre-5.3.

Inspired by: obrien


# 3fb3a430 26-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make the format of LC_CTYPE files architecture independent by
introducing the disk formats for _RuneLocale and friends.

The disk formats do not have (useless) pointers and have 32-bit
quantities instead of rune_t and long. (htonl(3) only works
with 32-bit quantities, so there's no loss).

Bootstrap mklocale(1) when necessary. (Bootstrapping from 4.x
would be trivial (verified), but we no longer provide pre-5.3
source upgrades and this is the first commit to actually break
it.)


# 4fca7bd3 01-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Removed extraneous parentheses.


# e9ba0718 28-Feb-2004 Andrey A. Chernov <ache@FreeBSD.org>

Add getopt_long.c if ${BOOTSTRAPPING} < 502104


# f3b62198 20-Feb-2004 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak the upgrade path from 4.9 after removal of GNU getopt and
<gnuregex.h>.


# 9b3f5f77 15-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

A version of <sys/endian.h> in RELENG_4 doesn't have 64-bit functions.

Spotted by: simokawa


# 7552a592 11-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

libc_gen/basename.c depends on include/libgen.h.


# 1c62f923 06-Apr-2003 Warner Losh <imp@FreeBSD.org>

-legacy and /.../legacy/... looks better than build or bootstrap in
the logs, so use that instead.

Submitted by: obrien.


# 30aaff11 05-Apr-2003 Warner Losh <imp@FreeBSD.org>

Migrate to a new way of dealing with building from old revisions of
FreeBSD. This method attempts to centralize all the necessary hacks
or work arounds in one of two places in the tree (src/Makefile.inc1
and src/tools/build). We build a small compatibility library
(libbuild.a) as well as selectively installing necessary include
files. We then include this directory when building host binaries.

This removes all the past release compatibilty hacks from various
places in the tree. We still build on tip of stable and current. I
will work with those that want to support more, although I anticipate
it will just work.

Many thanks to ru@, obrien@ and jhb@ for providing valuable input at
various stage of implementation, as well as for working together to
positively effect a change for the better.