History log of /freebsd-current/Makefile.inc1
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 2c35c867 18-Apr-2024 Andrew Turner <andrew@FreeBSD.org>

showconfig: Set MACHINE for src.opts.mk

Also set MACHINE and MACHINE_ARCH when reading config options from
src.opts.mk. This ensures any machine-dependent options are reported
correctly.

Reviewed by: emaste, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44838


# f092a54f 11-Apr-2024 Elyes Haouas <ehaouas@noos.fr>

Makefile.inc1: Fix typo

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/882


# 45d83c39 20-Mar-2024 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: add a mechanism to be able to force a give ucl include

This is made in order to be able to find add the post-install scripts
for the kernel, where PKGNAME varies for each KERNCONF but we don't want
to dynamically duplicated the kernel.ucl file.

At the same time we don't want the *-dbg* packages to actually include
those post-install scripts


# 02b25ccf 19-Mar-2024 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: fix packaging of dtb


# 2addba5c 19-Mar-2024 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: fix typo preventing packaging kernels


# 76229061 19-Mar-2024 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: fix kernel packing after switch ucl rework


# f8e46fd6 31-Jan-2024 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: rework certctl package to only run rehash on the main package

Rework how ucl manifest are generated leveraging ucl features and flua

now the ucl generation is done via a lua script which uses libucl to
ingest the template and use variables as defined in its command line.

the template will include only if it exist a ucl file named after the
package name which will complement the template or overwrite what was
defined in the template if defined in this specific ucl file

this allows to overwrite license, but add script only to the packages
who actually needs them.

As a results the post install scripts are now only added to the right
package and not also added to the subpackages like -man or -dev

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44374


# 0d4f7723 15-Nov-2023 Brooks Davis <brooks@FreeBSD.org>

libc: link libsys as a auxiliary filter library

At runtime, when rtld loads libc it will also load libsys. For each
symbol that is present in both, the libsys one will override the libc
one. It continues to be the case that program need only link against
libc (usually implicitly). The linkage to libsys is automatic.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908


# b6e9a7a2 02-Feb-2024 Emmanuel Vadot <manu@FreeBSD.org>

Reapply "pkgbase: Create a FreeBSD-dtb package"

This reverts commit 9bbe06b004e2cadb55a3792c77991ee640bf0f52.

Before that dtbs where included in each kernel packages which prevents
us to install multiple kernels.

Fix mtree-to-plist.awk to only generate a dtb.plist when we create
the kernel one (because dtb are installed during make installkernel).

Sponsored by: Beckhoff Automation GmbH & Co. KG


# 9bbe06b0 02-Feb-2024 Emmanuel Vadot <manu@FreeBSD.org>

Revert "pkgbase: Create a FreeBSD-dtb package"

Somehow this doesn't work iwth make packages due to some kind of a race.
The package is first created correctly but later in the process it is
overwritten by a badly created empty package.
Revert in the mean time so we can have working pkgbase on arm/arm64

This reverts commit a5afd7920d50ff23f91bdbabb1f0fd7ba028ba9e.


# a5afd792 27-Jan-2024 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Create a FreeBSD-dtb package

Before that dtbs where included in each kernel packages which prevents
us to install multiple kernels.

Differential Revision: https://reviews.freebsd.org/D43632
Reviewed by: bapt
Sponsored by: Beckhoff Automation GmbH & Co. KG


# a5ff9005 26-Jan-2024 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Create two new rules for creating repo

This adds two new rules named create-packages-kernel-repo and
create-packages-world-repo.
The goal of those rules is to create the {kernel,world} packages and
after that the repository.
It helps a lot for developing with pkgbase by adding the dev machine
repository created by those rules on top of the official pkgbase one.

Differential Revision: https://reviews.freebsd.org/D43623
Reviewed by: bapt, emaste
Sponsored by: Beckhoff Automation GmbH & Co. KG


# 3d939d96 02-May-2023 Warner Losh <imp@FreeBSD.org>

build: Use ls -i | cut rather than stat -f %i to extract inode

ls -i dates back to 5th edition Unix and is more portable than the stat
command, though %% is a newer shellism, it works on any shell that
FreeBSD builds with.

Sponsored by: Netflix


# 3091cdb1 12-Jan-2024 Cy Schubert <cy@FreeBSD.org>

Revert "kerberos: Fix numerous segfaults when using weak crypto"

This revision breaks Linux and MacOS cross builds because
TARGET_ENDIANNESS is not define during bootstrapping on these
platforms.

I think the correct approach would be to separate the new
fbsd_ossl_provider_load() and unload functions into their own
library (instead of libroken). This avoids the less desirable
option of including bsd.cpu.mk in secure/lib/Makefile.common,
which does build but could complicate future work.

Reported by: jrtc27

This reverts commit cb350ba7bf7ca7c4cb97ed2c20ab45af60382cfb.


# cb350ba7 06-Dec-2023 Cy Schubert <cy@FreeBSD.org>

kerberos: Fix numerous segfaults when using weak crypto

Weak crypto is provided by the openssl legacy provider which is
not load by default. Load the legacy providers as needed.

When the legacy provider is loaded into the default context the default
provider will no longer be automatically loaded. Without the default
provider the various kerberos applicaions and functions will abort().

PR: 272835
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D43009
Tested by: netchild, Joerg Pulz <Joerg.Pulz@frm2.tum.de>


# 93f27766 03-Jan-2024 Domagoj Stolfa <domagoj.stolfa@gmail.com>

dtrace: Add the 'oformat' libdtrace option

This option can be used to specify a format to use in DTrace output.
The following formats are supported:
- json
- xml
- html
- none (default DTrace output)

This is implemented using libxo and integrated into libdtrace. Client
code only works with the following API:

- dtrace_oformat_setup(dtrace_hdl_t *) -- to be called when output is starting.
- dtrace_oformat_teardown(dtrace_hdl_t *) -- to be called when output is finished
- dtrace_oformat(dtrace_hdl_t *) -- check if oformat is enabled.
- dtrace_set_outfp(FILE *) -- sets the output file for oformat.
- Ensure that oformat is correctly checked in the drop handler and record
processing callbacks.

This commit also adds tests which check if the generated output is
valid (JSON, XML) and extends the dtrace(1) describing the structured output.

Reviewed by: markj
Discussed with: phil
MFC after: 2 months
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D41745


# 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


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

Makefile.inc1: Forward on METALOG and DISTBASE for kernel targets

Currently IMAKE_INSTALL, which includes -M METALOG, is enough for the
sub-makes to work, but using kldxref for -DNO_ROOT builds will require
manually adding linker.hints to the METALOG, and thus both METALOG
itself and DISTBASE need to be exposed directly to the sub-makes, so do
so.

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


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

Makefile.inc1: Reinstate building sbin/md5 for BOOTSTRAP_ALL_TOOLS

The sha256 and sha512 binaries are used when building release images.
Bootstrapping them used to be gated on MK_BOOT, which wasn't quite right
but in practice worked, at least in our use cases downstream. Add back
bootstrapping sbin/md5 and its aliases for this purpose to fix building
release images on Linux and macOS.

Fixes: f213da893ca8 ("Makefile.inc1: Remove beri straggler")


# 3b1904d9 08-Dec-2023 Ed Maste <emaste@FreeBSD.org>

pkgbase: pass --recurse-submodules to `git ls-files`

When generating source packages. Although submodules are not used by
FreeBSD itself they may be used by downstream projects. By default
for submodules `git ls-files` just emits the submodule directory name,
which resulted in:

pkg: pkg_checksum_hash_sha256_file(read failed): Is a directory

Passing --recurse-submodules lists all of the files in each submodule
(which is desired when submodules are in use), and has no effect when
submodules are not present.

Reviewed by: bapt, manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42983


# 7b085f14 07-Dec-2023 Warner Losh <imp@FreeBSD.org>

build: use bare (and portable) echo instead of echo -n

There's no need to use echo -n here. A single echo will do nicely.
This fixes the post-buildworld output on a macos build, where echo -n
is implemented like System V instead of BSD (so you get two lines
first one starting with -n).

Sponsored by: Netflix
Reviewed by: jrtc27, emaste
Differential Revision: https://reviews.freebsd.org/D42869


# 5faaa602 04-Dec-2023 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: propagate SRCRELDATE to the packages correctly

MFC After: 3 days
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D42892


# 99b8c0c3 17-Nov-2023 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: create source package

FreeBSD-src for all the sources but the kernel
FreeBSD-src-sys just for the kernel

MFC After: 3 days
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D42651


# f213da89 20-Nov-2023 Warner Losh <imp@FreeBSD.org>

Makefile.inc1: Remove beri straggler

Beri's boot loader needed md5 to build. It was the only thing that
needed that, so remove it (confirmed with univers and grep).

Sponsored by: Netflix


# 051d69d6 14-Nov-2023 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: create package with SRCRELDATE not OSRELDATE as OSVERSION

In 188fe88ec50eac7c10e1d8350bf1180f8c16e463 OSVERSION has been set
to OSRELDATE which is the RELDATE of the building OS while we wanted
to use SRCRELDATE which is the RELDATE of the target system


# 21e9018a 13-Nov-2023 Doug Rabson <dfr@FreeBSD.org>

pkgbase: use <major>.<minor> format for alpha, beta and release package versions

This is consistent with version numbers used in releng/13.2.

PR: 275051
Reviewed by: bapt
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42562


# 188fe88e 03-Nov-2023 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: force OSVERSION

This is used to the package annotation helping pkg to know about
backward compatibility is set to the version of the packages not
the version of the host building the packages


# df6e7e11 02-Nov-2023 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: set a default set of kernel for when PACKAGE_BUILDING=1

PACKAGE_BUILDING is already known in the ports tree as a variable
use to defined when the packages is being actually built in an
automation process, reuse that variable to define the default set
of kernel we plan to build for the default pkgbase.

Reviewed by: manu, jrtc27
Accepted by: manu
MFC After: 1 week
Differential Revision: https://reviews.freebsd.org/D42444


# 5c783a0b 03-Nov-2023 SHENG-YI HONG <aokblast@FreeBSD.org>

ASan: Add asan_static to build

This is a partial fix for building with -DWITH_ASAN.

Reviewed by: Fangrui Song, dim, emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42388


# f38bad0a 16-Oct-2023 Ed Maste <emaste@FreeBSD.org>

Remove MOVED_LIBS handling from list-old-libs

In 922337e8d398 I added MOVED_LIBS into list-old-files, so that
delete-old-files would remove the old /usr/lib/libc++.so.1 as soon as
possible (after the library moved to /lib).

I left it in list-old-libs in case a user updated their src tree between
delete-old-files and delete-old-libs. Now that some time has passed,
tremove the redundant MOVED_LIBS entry.

PR: 272642
Sponsored by: The FreeBSD Foundation


# 820fbcf2 26-Oct-2023 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: compress packages with zstandard

MFC After: 3 days
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D42375


# 0e0c4f58 16-Oct-2023 Brooks Davis <brooks@FreeBSD.org>

certctl: invoke with LOCALBASE set

When invoking certctl as part of installworld, set LOCALBASE in the
environment to match the build environment. That ensures that LOCABASE
is non-empty on systems without the user.localbase sysctl and avoids
allowing a system configuration detail to leak into the build. Users
who wish to build targeting a non-standard LOCALBASE should ensure it is
set in src.conf or similar.

Reviewed by: Mina Galić <freebsd@igalic.co>
Differential Revision: https://reviews.freebsd.org/D40530


# 2ee28902 16-Oct-2023 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove ncurses/form from _prebuild_libs

As of d287d3282f43 libbsddialog has a built-in form implementation and
does not need a formw dependency.

This reverts commit 483a226238ed8949c6d280ae0757a0683962a74b.

Reported by: asiciliano
Sponsored by: The FreeBSD Foundation


# 922337e8 13-Oct-2023 Ed Maste <emaste@FreeBSD.org>

Handle MOVED_LIBS in list-old-files

MOVED_LIBS is used when a library moves from one directory to another,
e.g. /usr/lib/libc++.so.1 to /lib/libc++.so.1.

delete-old-files and delete-old-libs are two separate steps, so that
old libraries can be retained until third party software packages are
rebuilt or reinstalled.

Having two copies of the same shared library with the same so version
(as can happen when delete-old-libs hasn't been run) causes trouble.
The PR below gives one example.

Libraries listed in MOVED_LIBS are logically equivalent to updating a
library without changing the so version, and should be removed as soon
as possible. Handle them in list-old-files and thus delete-old-files.

Leave them also in *-old-libs for now, in case the user updates their
tree between running delete-old-files and delete-old-libs.

PR: 272642
Reviewed by: dim
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Co-authored-by: Dimitry Andric <dim@FreeBSD.org>
Differential Revision: https://reviews.freebsd.org/D42197


# 1a18383a 15-Sep-2023 Pierre Pronchery <pierre@freebsdfoundation.org>

libcrypto: link engines and the legacy provider to libcrypto

OpenSSL's legacy provider module and engines need to link to
libcrypto.so, as it provides some of the actual implementations of
legacy routines.

This is a little tricky due to build order issues. Introduce a small
hack (LIBCRYPTO_WITHOUT_SUBDIRS) that builds libcrypto.so in its usual
early phase without any OpenSSL provider modules or engines. This is
intended to restore the test suite; a future change should remove the
hack and replace it with a better approach.

PR: 254853, 273528
Discussed with: Folks at EuroBSDCon in Coimbra
Sponsored by: The FreeBSD Foundation


# bd016ad2 01-Sep-2023 Brooks Davis <brooks@FreeBSD.org>

Teach make showconfig about group options

Output OPT_ variables in addition to MK_ variables.

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


# 315ee00f 26-Aug-2023 Martin Matuska <mm@FreeBSD.org>

zfs: merge openzfs/zfs@804414aad

Notable upstream pull request merges:
#15024 Add missed DMU_PROJECTUSED_OBJECT prefetch
#15029 Do not request data L1 buffers on scan prefetch
#15036 FreeBSD: catch up to __FreeBSD_version 1400093
#15039 Fix raw receive with different indirect block size
#15047 FreeBSD: Fix build on stable/13 after 1302506
#15049 Fix the ZFS checksum error histograms with larger record sizes
#15052 Reduce bloat in ereport.fs.zfs.checksum events
#15056 Avoid extra snprintf() in dsl_deadlist_merge()
#15061 Ignore pool ashift property during vdev attachment
#15063 Don't panic if setting vdev properties is unsupported for this vdev type
#15067 spa_min_alloc should be GCD, not min
#15071 Add explicit prefetches to bpobj_iterate()
#15072 Adjust prefetch parameters
#15076 Refactor dmu_prefetch()
#15079 set autotrim default to 'off' everywhere
#15080 ZIL: Fix config lock deadlock
#15088 metaslab: tuneable to better control force ganging
#15096 Avoid waiting in dmu_sync_late_arrival()
#15097 BRT should return EOPNOTSUPP
#15103 Remove zl_issuer_lock from zil_suspend()
#15107 Remove fastwrite mechanism
#15113 libzfs: sendrecv: send_progress_thread: handle SIGINFO/SIGUSR1
#15122 ZIL: Second attempt to reduce scope of zl_issuer_lock
#15129 zpool_vdev_remove() should handle EALREADY error return
#15132 ZIL: Replay blocks without next block pointer
#15148 zfs_clone_range should return descriptive error codes
#15153 ZIL: Avoid dbuf_read() before dmu_sync()
#15172 copy_file_range: fix fallback when source create on same txg
#15180 Update outdated assertion from zio_write_compress

Obtained from: OpenZFS
OpenZFS commit: 804414aad224b432590afe3f9ec114ffb49e0f13


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

# 2726978b 05-Jul-2022 Warner Losh <imp@FreeBSD.org>

Makefile.inc1: Remove redundant test for armv[67]

If MACHINE is arm, then MACHINE_ARCH is going to be either armv6* or
armv7*.

Sponsored by: Netflix

# 1c024976 01-Aug-2023 John Baldwin <jhb@FreeBSD.org>

Makefile.inc1: Enable requesting the universe toolchain.

make universe builds a cross toolchain under HOST_OBJTMP/tmp via the
universe-toolchain target. However, doing a plain 'make buildworld'
after a universe/tinderbox run (e.g. to reproduce a failure and test
the fix for it), will try to build a new cross toolchain under
OBJTMP/tmp which can be tedious. This commit adds a make variable
(UNIVERSE_TOOLCHAIN) which can be used similar to CROSS_TOOLCHAIN to
request an external toolchain. If this variable is set (value doesn't
matter), the the universe toolchain is used as an external toolchain.

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

# 9f811192 27-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Fix list-old-libs by deleting stray pipe

Reported by: Yuri <yuri@aetern.org>
Fixes: 264594efbe69 ("Makefile.inc1: Automatically generate _LIBCOMPATS and list-old-* libcompats")

# 2a4d73f3 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Reinstate kbdcontrol bootstrap for BUILD_WITH_STRICT_TMPPATH

During BUILD_WITH_STRICT_TMPPATH builds we need to symlink the host's
kbdcontrol into WORLDTMP/legacy/bin so that it can be used. For
completeness, also check if the host has it, since technically the host
could have been built with WITHOUT_LEGACY_CONSOLE (though given nobody's
screamed since this code was removed that's likely not something that
gets hit in practice), and handle BOOTSTRAP_ALL_TOOLS (especially since
that case will cover cross-building if and when kbdcontrol can be built
on non-FreeBSD).

This allows a BUILD_WITH_STRICT_TMPPATH tinderbox to pass.

This partially reverts commit 33550b47391330362ea58984aa3fd691f6219ee0.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41202

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

Makefile.inc1: Add new buildetc and installetc targets

These implement the steps that etcupdate (and mergemaster) need in order
to build their pristine trees, avoiding the need to use internal targets
and variables. Additionally, buildetc includes the steps needed to build
with BUILD_WITH_STRICT_TMPPATH enabled, since we need some host tools to
be available during the various build and install steps.

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

# 8fc3059b 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Split _cleanworldtmp out from _worldtmp

This mirrors _cleanobj vs _obj, and will be used by etcupdate to ensure
its build tree has host tools available when BUILD_WITH_STRICT_TMPPATH
is enabled by default (whether in the source tree, like CheriBSD, or in
a system config file).

Note that due to line length the .MAKE .PHONY dependency line is split
into two, one for the filtered WMAKE_TGTS and one for the filtered
.ALLTARGETS.

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

# 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

# 81805ec3 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

depend-cleanup.sh: Generalise lib32 code and avoid duplication

By passing through _ALL_libcompats we can avoid hard-coding the list of
libcompats in depend-cleanup.sh. This cleanup also makes clean_dep
shorter by using a loop instead of handling each case explicitly (at the
expense of slightly tweaked logging).

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

# 264594ef 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Automatically generate _LIBCOMPATS and list-old-* libcompats

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

# 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

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

Makefile.inc1: add LIBCOMPAT_INCLUDE_DIRS to reduce arch ifdefs

In preparation for adding support for building lib32 on arm64,
add a list of architecture-specific include directories,
LIBCOMPAT_INCLUDE_DIRS, then replace the architecture-specific
ifdefs throughout the file with simple loops. Another commit
will add a definition of LIBCOMPAT_INCLUDE_DIRS for aarch64.

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

# c70dd03a 10-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Make sure MACHINE(_ARCH) are exported for depend-cleanup.sh

We run depend-cleanup.sh twice during the build. The second time is the
normal run, where we run it under WMAKEENV and thus have CROSSENV's
MACHINE(_ARCH)=${TARGET(_ARCH)} in the environment. However, the first
time is for bootstrap-tools, where it's run under BMAKEENV and we don't
have any assignments to MACHINE(_ARCH) in the environment, meaning the
script sees them as unset. In practice this doesn't matter since the
only use doesn't apply to bootstrap-tools, but it could be a future
issue. Thus, explicitly export them for depend-cleanup.sh and have the
script verify they're set.

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

# 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

# bd9049ee 21-Jun-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix prebuild race between libpam and libtacplus.

Fixes: 21850106fdda
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D40702

# 2e0d99a9 08-Jun-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Fix distributeworld mtree mangling for dist root dir

The trailing slash means that ./base itself doesn't get mangled and
remains as-is in the output, leading to a stray /base in base.txz for
NO_ROOT builds and thus in the installed system. Since this action is
running on a line whose file matches one listed by find (and we're
printing all of these as part of that distribution), we don't need to
care about the possibility of a path like ./basefoo/bar where the path
prefix isn't ./base, and can thus just drop the slash rather than
needing something more complicated like "slash or whitespace or EOL" as
one might first think.

# 469727c9 08-Jun-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Use INSTALL_DDIR for distributeworld's distrib-dirs

INSTALL_DDIR is the canonicalised version of DESTDIR/DISTDIR. Whilst
most of what distrib-dirs does doesn't need the canonicalised form, it
is responsible for installing the POSIX and en_US.US_ASCII NLS symlinks
to C, and therefore needs the canonicalised version for those two uses
of install for NO_ROOT builds, since our install does a naive text-based
prefix strip when creating the METALOG entry rather than a smarter path
semantics-aware one (which itself is really a bug, and has bitten us
many times). As a result, using plain DESTDIR/DISTDIR instead can result
in the METALOG having ./path/to/destdir/base/usr/share/nls/$LOCALE
rather than ./base/usr/share/nls/$LOCALE and then being filtered out
when creating base.meta (or, if you're unlucky and the absolute path
begins with base or tests, weird things will probably happen).

Given this footgun an audit of DESTDIR uses is probably in order,
especially those using DESTDIR/DISTDIR, but this is sufficient for now.

# f7057652 10-Apr-2022 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: use make builtin :ts instead of sed

Commit 3eb1b4da3cf7 replaced "xargs -n1" with a sed expression to
convert from space to newline as a list separator for *-old-* targets.
Dan Nelson followed up with a suggestion to use make's built-in :ts
instead, which should be slightly more efficient.

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

# a1bf1a1a 23-Apr-2023 Simon J. Gerraty <sjg@FreeBSD.org>

showconfig - ignore options that do not start with A-Z

When building on various hosts it can be handy to create pseudo
options like MK_host_egacy - building on a host that needs libegacy.

Such options should be ignored by showconfig

Reviewed by: emaste

# 10172ce3 12-Apr-2023 John Baldwin <jhb@FreeBSD.org>

Stop stripping 'sf' suffixes from architecture names.

riscv64sf was the only architecture with an 'sf' suffix.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D39497

# 1ca12bd9 12-Apr-2023 John Baldwin <jhb@FreeBSD.org>

Remove the riscv64sf architecture.

Reviewed by: jrtc27, arichardson, br, kp, imp, emaste
Differential Revision: https://reviews.freebsd.org/D39496

# 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

# 9e914c7a 14-Mar-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Add new DISK_IMAGE_TOOLS_BOOTSTRAP option

This will build etdump, makefs and mkimg as bootstrap tools to allow
easily creating disk images. Note that etdump is bootstrapped due to its
use in the release scripts for building ISO images.

Reviewed by: emaste, arichardson
Differential Revision: https://reviews.freebsd.org/D39072

# d7a491dd 06-Mar-2023 Ed Maste <emaste@FreeBSD.org>

make showconfig: set MACHINE and MACHINE_ARCH

Previously these were not set for the showconfig target, so took the
host's value rather than the target. As a result some machine-dependent
kernel options were not reported with correct defaults in the src.conf
manpage.

PR: 269994
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38926

# dda4d972 02-Mar-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Support building with macOS Ventura's AMFI Launch Constraints

As of macOS Ventura, Apple-signed binaries cannot be run if copied away from
their system location. This security feature doesn't really make sense for
boring things like sh(1), more so for applications with special entitlements,
but it's universally present, and results in the following error:

>>> Install check world
bmake[2]: "/Users/Jess/cheri/freebsd/Makefile.inc1" line 572: warning: "MAKEFLAGS= CPUTYPE=dummy /Users/Jess/cheri/build/freebsd-riscv64-build/bmake-install/bin/bmake -f /dev/null -m /Users/Jess/cheri/freebsd/share/mk MK_AUTO_OBJ=no -V CPUTYPE" exited on a signal
bmake[2]: "/Users/Jess/cheri/freebsd/Makefile.inc1" line 575: CPUTYPE global should be set with ?=.

As with host-symlinks, we don't actually need to copy the files on macOS, since
we're not updating the current machine, so copy its approach and just symlink
them instead.

MFC after: 1 week

# 3dfd18a7 13-Feb-2023 John Baldwin <jhb@FreeBSD.org>

Remove support for the base/* toolchain ports.

These ports have been removed so these knobs are no longer meaningful.

This reverts commit 608289394f655d0635c71233248b734010fb4d2f.
This reverts commit 39eb07f172921a581ee9b33ca2765905f4235202.

Reviewed by: imp, bapt, emaste
Differential Revision: https://reviews.freebsd.org/D38562

# b4f7a31f 08-Feb-2023 Kyle Evans <kevans@FreeBSD.org>

buildworld: drop config(8) dependencies from bootstrap

We may still need them for other parts, so just remove the dependency
relationship for now and simplify config's place in bootstrap-tools.

Reviewed by: imp
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D38277

# 0dfaefa9 08-Feb-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

depend-cleanup.sh: Simplify the logic, and clean bootstrap tools.

* There's no need to check if the file exists before grepping it; if it does not exist, grep will fail, which is what we want. Just redirect the error message to /dev/null.
* There's no need to split the .o and .pico cases; the bodies are identical, so combine the conditions. Use a glob to avoid a false negative if one exists but not the other.
* Also run depend-cleanup.sh on the bootstrap build tree. This unbreaks the build after 29c5f8bf9a01.

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D38447

# 81ad6265 04-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks


# a1e3fb8f 10-Mar-2022 Eugene M. Kim <astralblue@gmail.com>

Fix _REVISION to be always major.minor

Introduced in commit 613fe53, _REVISION was redefined to be just the
major version (14) instead of major.minor (14.0) iff:

- PKG_VERSION was not overridden (default), and
- Branch was -CURRENT, -STABLE, or -PRERELEASE.

This introduced side effects in other parts of the code which expected
_REVISION to be major.minor:

- make-pkg-package.sh target triple became amd64-portbld-freebsd14
(should be amd64-portbld-freebsd14.0);
- Versioned cross dev symlink name became amd64-freebsd14-<tool>
(should be amd64-freebsd14.0-<tool>)

Also, compounded with commit ea9a92d (which was introduced afterward
and removed minor version from _REVISION incorrectly using :S with a
regex) this also caused pkgbase repo to use a wrong PKG_ABI with a minor
version (FreeBSD:14.0:amd64) when a custom PKG_VERSION was specified.
(Note, without a custom PKG_VERSION the bug was not triggered because in
that case _REVISION was already major-only.)

This commit fixes both problems by introducing and using MAJOR_REVISION
instead of redefining _REVISION. Existing uses of _REVISION now see
major.minor again, except PKG_ABI (ex: FreeBSD:14:amd64, as described
above) and PKG_VERSION (ex: 14.snap20220311121531) need only the major
version and now use MAJOR_REVISION instead.

PR: 262600, 262601
Reviewed by: imp, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/592

# d4fdfd3f 29-Jan-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Restore adding tzsetup to _basic_bootstrap_tools

ITOOLS is only the list of programs to make a copy of during install, it
doesn't cause anything to be bootstrapped. Thus, by removing tzsetup
from _basic_bootstrap_tools, we end up without it on non-FreeBSD, and so
we error out trying to copy it to INSTALLTMP.

Note that _basic_bootstrap_tools is only used for BOOTSTRAP_ALL_TOOLS
(which is why zic was moved away from it). Should tzsetup evolve such
that the host version is insufficient on older FreeBSD it can be moved
to be more like zic, but that seems unnecessary for what is likely to
remain a simple tool.

This partially reverts commit 7a4a520064cb7fbff79560113682d6fe1a1ae9ee.

Fixes: 7a4a520064cb ("Fix cross-build from STABLE or older CURRENT.")

# 4ebd18cf 29-Jan-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Print the right PATH for missing install tool error

We override PATH for which but then go and print the non-overridden
PATH, which leads to rather confusing messages.

Fixes: 5bb9250e0af4 ("Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD")

# 95016839 27-Jan-2023 John Baldwin <jhb@FreeBSD.org>

Revert "Don't omit bsd.compiler.mk for the nested delete-old in buildworld."

The original motivation (src.opts.mk needing bsd.comppiler.mk to
determine if CXX is supported) is no longer relevant now that CXX is
non-optional.

This reverts commit b9cb80883bce6dc992cf05ae2e59089a60d311ec.

# ac4c695a 16-Nov-2022 Ed Maste <emaste@FreeBSD.org>

Retire WITHOUT_CXX option

Several important base system components are written in C++, and the
WITHOUT_CXX option produced a system that was not fully functional.
Just accept this, and remove the option to build without C++ support.

This reverts commit adc3c128c6603054586a993d117e5dd808deac17.

Reviewed by: brooks, kevans, jhb (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33108

# 7a4a5200 25-Jan-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix cross-build from STABLE or older CURRENT.

Previously, zic and tzsetup were both listed as install tools and basic
bootstrap tools. Actually, tzsetup is an install tool while zic is a
non-basic bootstrap tool.

Fixes: 783c318fd118
Sponsored by: Klara, Inc.
Reviewed by: jrtc27, emaste
Differential Revision: https://reviews.freebsd.org/D38195

# 34ac629b 20-Jan-2023 Alex Richardson <arichardson@FreeBSD.org>

Shell-escape assignments to PATH in the top-level makefiles

Since 16fbf0191243e7c9dff6615b1424b5d39186b36c PATH is no longer set
to a hardcoded value on non-FreeBSD build hosts, so we can end up with
spaces in $PATH. Instead of only escaping PATH I updated all `env PATH=`
uses in the toplevel makefile. While many of these currently can't
contain any special characters (since the build would have failed
already), in theory this gets us closer to allowing build/source
directory to contain e.g. spaces.

# 20a66ab4 29-Sep-2022 Ed Maste <emaste@FreeBSD.org>

Retire CLANG_IS_CC option

A small reduction in build infrastructure complexity; when we had both
Clang and GCC in the tree it was useful to have both built, and choose
one or the other to install as /usr/bin/cc. Now only Clang is in the
tree, and there is no point in building and installing base Clang but
not providing it as cc (and c++, cpp).

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37075

# b9cb8088 18-Nov-2022 John Baldwin <jhb@FreeBSD.org>

Don't omit bsd.compiler.mk for the nested delete-old in buildworld.

src.opts.mk will need bsd.compiler.mk to determine if CXX is
supported. Without this, src.opts.mk always marks CXX as broken and
attempts to delete all dependencies of MK_CXX from WORLDTMP.

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

# 470fb726 24-Oct-2022 Ed Maste <emaste@FreeBSD.org>

build: Use `rm -fv` for BATCH_DELETE_OLD_FILES

It's possible to have files with odd permissions in the tmproot (or
sysroot), causing rm to prompt for each one during e.g. buildworld.
Add -f to forcibly delete these.

Reviewed by: brooks
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37111

# 77becb93 05-Oct-2022 Brooks Davis <brooks@FreeBSD.org>

Rename MACHINE_ABI and TARGET_ABI

The MACHINE_ABI and TARGET_ABI variables are used to set the middle of
the target triple (e.g., "-unknown-" or "-gnueabihf-"). They are not set
by any tool in the base system and I've only found the latter mentioned
in one review online. As such, rename them to to MACHINE_TRIPLE_ABI and
TARGET_TRIPLE_ABI to clear the way to use MACHINE_ABI as a supplement to
MACHINE_CPU, etc.

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

# 0aa27001 01-Oct-2022 Dag-Erling Smørgrav <des@FreeBSD.org>

Put OPIE to rest.

Differential Revision: https://reviews.freebsd.org/D36592

# fcf12081 15-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1 release bsd.own.mk: Introduce and use TAR_CMD

Our uses of tar rely on BSDisms, and so do not work in environments
where GNU tar is the default tar. Providing a TAR_CMD variable like
some other commands allows it to be overridden to use bsdtar in such
cases.

Reviewed by: brooks, delphij, gjb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35813

# 5e0a749c 15-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Set LC_COLLATE in distributeworld for glibc compatibility

distributeworld relies on "foo" sorting directly before "foo type=...",
but with glibc both en_US and en_GB have "fooa" sort between "foo" and
"foo z", resulting in some files (in particular, id due to "ident"
sorting before "id type=" but after "id") not being included in the meta
files and thus not included in the dist tarballs. Forcing use of the C
locale ensures this does not occur.

Reviewed by: brooks
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35812

# 445421ab 15-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Honour DB_FROM_SRC for NO_ROOT distributeworld

Currently the host's database files are used, but on non-FreeBSD these
are not necessarily sufficient; in particular, Linux does not have a
wheel group. Instead, use -N to use the in-tree database files when
creating the METALOG entries, as is done for the recursive makes via
IMAKE_MTREE.

Reviewed by: brooks
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35810

# 93f5ab12 14-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Bootstrap crunchgen after removing -dc from linker invocation

In ec81497cc726 crunchgen was updated to remove -dc from the linker
invocations in its generated makefile output, as this flag is no longer
necessary, and is going to be an error with lld 15.

Update the BOOTSTRAPPING conditions for copying the crunchgen binary
from the host, or actually bootstrapping it when necessary. Since
ec81497cc726 did not bump __FreeBSD_version, I have chosen the nearest
values.

Fixes: ec81497cc726
MFC after: 3 days

# 7e45839a 13-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Fix -DNO_ROOT distributeworld certctl usage

Currently for distributeworld we pass DESTDIR to certctl.sh as an
environment variable, which sets the default value in the script.
However, for -DNO_ROOT builds, CERTCTLFLAGS has METALOG_INSTALLFLAGS
which includes -D ${DESTDIR}, overriding the custom DESTDIR pointing at
the base dist directory.

Moreover, in order to ensure that the METALOG includes the base/ prefix
for all the files, we need to have certctl call install with -D set to
DESTDIR/DISTDIR without the /base suffix but also ensure the files get
installed to DESTDIR/DISTDIR/base.

Fix these by passing the custom DESTDIR to certctl via -D rather than in
the environment and to pass the /base suffix in the distributeworld case
via the newly-added -d option.

We also need to run certctl rehash before we generate the .meta files
from the METALOG, not after, otherwise they won't include the METALOG
additions, so move the certctl rehash call.

Finally, add a missing semicolon that results in no message being
printed in the missing openssl case. By not including the semicolon,
else echo "..." is treated as extra arguments to certctl, which is lax
in its argument parsing and ignores additional arguments, and the
semicolon and fi after the intended echo terminate the if statement as
normal so there's no syntax error at the shell level. This is harmless
as we weren't trying to do anything other than echo anyway, all that
happens is the echo doesn't actually get run.

Reported by: markj (missing semicolon)
Reviewed by: brooks, kevans
Obtained from: CheriBSD
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35809

# b1807136 13-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Add a missing ${dist} to distributeworld for usr/include/i386

Not including ${dist} results in the following non-fatal error printed
once per extra distribution:

mkdir //usr/obj/usr/src/amd64.amd64/release/dist/usr/include/i386
mkdir: //usr/obj/usr/src/amd64.amd64/release/dist/usr/include: No such file or directory
*** Error code 1 (ignored)

Also fix a whitespace nit on this line whilst here.

Reviewed by: brooks
Fixes: a09ea2bbc305 ("amd64: add an i386 include directory")

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

installworld: improve portability of ldd use

b3b462229f97 added a case statement to ignore lines containing strings
in square brackets such as "[vdso]" and "[preloaded]". On MacOS
Monterey where /bin/sh may be zsh, this fails with:

/bin/sh: -c: line 0: syntax error near unexpected token `;;'

Invoke grep in the pipeline to remove such lines instead.

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

# a09ea2bb 13-Jun-2022 Brooks Davis <brooks@FreeBSD.org>

amd64: add an i386 include directory

This directory will hold i386-specific headers that are needed for
-m32 support on amd64 and where the amd64 and i386 cases have too
little in common for combining them to make sense. Files to be
installed will come in later commits.

With the currently required set of files, this could be done with
another INCGROUP in include/Makefile, but at least one file that
might want -m32 support (ieeefp.h) conflicts with a files installed
in /usr/include.

Reviewed by: jhb, imp

# 1838bd0f 05-Feb-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project release/14.x llvmorg-14-init-18315-g190be5457c90

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18315-g190be5457c90.

PR: 261742
MFC after: 2 weeks


# 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

# 47bcbde9 17-Apr-2022 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

bintrans: move files to a new directory

And reflect the change in various places.

# 4cd4841a 05-Apr-2022 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

Modularize uuencode and uudecode by wrapping them in bintrans.c

The program will be installed as bintrans, uuencode, uudecode,
b64encode, and b64decode and will be responsible for running the coders
according to their historical behavior.

Additionally, bintrans will be able to take a parameter designating
the coder and accept all its options in this form:
bintrans <coder> [options]
and the behavior should be the same as if
<coder> [options]
was invoked.
This has the advantage that adding coders won't require installing them
as binaries.

Move uudecode files to uuencode since the latter is the one that
provides the manual page.

Reviewed by: delphij (previous version)
Differential Revision: https://reviews.freebsd.org/D32943

# a8267ecc 01-Apr-2022 Ed Maste <emaste@FreeBSD.org>

Speed up *-old-* make targets by using sed instead of xargs

Targets like 'list-old-files' used "xargs -n1" to produce a list with
one file per line. Using xargs resulted in one fork+exec for each
Argument, resulting in rather long runtime. Instead, use sed to split
the list. On one machine `make list-old-files` took 30s wall clock time
with xargs and less than 1s with sed.

Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34741

# b3b46222 01-Apr-2022 Ed Maste <emaste@FreeBSD.org>

installworld: handle ldd including preloaded objects

The installworld target makes a temporary copy of binaries to be used
during the install. Libraries that they depend on are also included,
found by using `ldd`.

After commit 0913953c9ed0 ldd started listing preloaded objects,
including [vdso], under a [preloaded] header. Skip ldd output that is
enclosed in square brackets.

Reviewed by: cy, kib [earlier version]
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34734

# 3b17e19f 01-Mar-2022 Warner Losh <imp@FreeBSD.org>

bootstrap: bump minimum supported version

Bump the minimum supported version to build -current from to 11.3R in
preparation of removing support for older systems. 11.4R was selected
as the most recent version to go out of support.

Sponsored by: Netflix
Reviewed by: delphij, emaste
Differential Revision: https://reviews.freebsd.org/D32444

# 33550b47 01-Mar-2022 Warner Losh <imp@FreeBSD.org>

bootstrap: No need for kbdcontrol bootstrap anymore

We only need kbdcontrol when bootstrapping from FreeBSD 10 or
pre-FreeBSD 11.0 current. Since we can no longer build from these
versions of FreeBSD, remove the support for bootstrapping them.

Sponsored by: Netflix

# 3e65b7d9 11-Feb-2022 Warner Losh <imp@FreeBSD.org>

cleankernel: A target to delete the kernel compile file

With the meta-build, it's always a NO_CLEAN build. Provide a way to
remove so one can rebuild from scratch. 'cleankernel' will delete the
kernel and modules object directories. Document this in build(7).

Sponsored by: Netflix
Reviewed by: debdrup, markj
Differential Revision: https://reviews.freebsd.org/D32978

# ea9a92d2 10-Feb-2022 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: synthesize PKG_ABI from newvers.sh variables

Previously we inspected ${WSTAGEDIR}/usr/bin/uname to determine PKG_ABI,
but the file will not exist in some cases - for example, if building
only kernel packages. We can instead synthesize the PKG_ABI from
information already provided by newvers.sh.

Reviewed by: kevans, manu (both earlier rev)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34249

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

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

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D34175

# 0a902e42 25-Jan-2022 John Baldwin <jhb@FreeBSD.org>

Stop trimming 'hf' suffixes from MACHINE_ARCH.

This was only used for MIPS hard-float architectures.

Reviewed by: imp
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D34018

# 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

# 77da558c 20-Jan-2022 John Baldwin <jhb@FreeBSD.org>

check/delete-old: Auto-generate lib32 entries for libraries.

- Add usr/lib32/libfoo.so.N for lib/libfoo.so.N.

- Add usr/lib32/foo for usr/lib/foo.

- Treat casper libraries special since they are installed to
/usr/lib32 instead of /usr/lib32/casper and thus map
usr/lib/casper/foo to usr/lib32/foo.

Note that OLD_DIRS and MOVED_LIBS entries are not duplicated, only
OLD_FILES and OLD_LIBS.

Reviewed by: imp, emaste
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33324

# 57ba3f00 20-Jan-2022 John Baldwin <jhb@FreeBSD.org>

Use MOVED_LIBS for libraries moved between /usr/lib and /lib.

Add a MOVED_LIBS variable similar to OLD_LIBS except that MOVED_LIBS
is used for the cases that a library's name doesn't change, but it
just moves between /usr/lib and /lib. This will be used by a future
change to auto-generate lib32 old files entries for which these cases
need to be ignored (a moved library remains in /usr/lib32).

Suggested by: emaste
Reviewed by: emaste
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33848

# 21baf42c 11-Jan-2022 John Baldwin <jhb@FreeBSD.org>

Add list-old-{dirs,files,libs} targets.

These targets generate a raw list of the candidate old files roughly
corresponding to the values of OLD_DIRS, OLD_FILES, and OLD_LIBS.
Currently list-old-files also includes uncompressed manpages in
addition to compressed manpages.

Use these targets in the implementation of check-old-* and
delete-old-* to replace duplicated logic.

Reviewed by: imp, emaste
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33327

# adc88b9c 07-Jan-2022 Ed Maste <emaste@FreeBSD.org>

Build libclang also if LLDB is enabled

LLDB depends on libclang as it uses Clang as the expression parser.
Previously setting WITHOUT_CLANG but leaving LLDB enabled (as default)
resulted in a build failure.

Users who set WITHOUT_CLANG in order to reduce build time or size
might want to set WITHOUT_LLDB in addition to WITHOUT_CLANG, or use
WITHOUT_TOOLCHAIN instead.

PR: 260993
Reported by: eugen
Reviewed by: dim
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

# 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

# 7a171e30 15-Dec-2021 Warner Losh <imp@FreeBSD.org>

test-includes: Build a library instead of a binary

We need to build the .o's, but don't need to link. Build a static
library instead of a binary to accmoplish this. This removes the need to
have all the libc and crt stuff built, which is required for a
binary. In addition, trying to build a non-standard binary runs into
trouble with undefined symbols on arm related to EABI, even when using a
simplified startup with -nostdlib -e start.

Turn back on testing includes, now that it works.

Sponsored by: Netflix
Reviewed by: brooks, markj (prior version)
Differential Revision: https://reviews.freebsd.org/D33452

# 6a2b72bf 14-Dec-2021 Warner Losh <imp@FreeBSD.org>

Remove test-includes build

This is making the CI red. I believe this is because we do a clean build
w/o metamode in the tinderbox, so none of the artifacts needed to build
a binary are present. However, I've not recreated the problem locally
yet to confirm. Remove this while I investigate. This partially reverts
dd55767b86bc. The rest of the commit causes no harm w/o the explicit
test here.

Sponsored by: Netflix

# dd55767b 14-Dec-2021 Warner Losh <imp@FreeBSD.org>

Test various header files to ensure they can be included by themselves.

A number of header files in sys/* have, going back to 7th Edition Unix
in 1979, reqiured other files (like sys/types.h) to compile. Likewise
the 4BSD networking code has had prerequisites. However, going back to
around the turn of the 21st century, other systems have made them be
independently include-able (wide-spread header include protection
post-dates 7th edition Unix by maybe 3 or so years judging from USENET
source postings). Start down the path of making them all independently
include-able by creating this test that fails buildworld when they are
not.

The file 'badfiles.inc' contains a list of the currently broken files
that cannot be included w/o any prerequisites. As files are fixed, 'make
badfiles.inc' should be re-run to remove them from the list. Note: All
files that start with an underscore are considered internal and not
tested.

Please note: once a file is removed from badfiles.inc, it must pass on
all architectures. Buildworld through at least the _includes target is
needed to ensure its working (though a buildkernel should also be done
on all architectures as well).

Sponsored by: Netflix
Reviewed by: brooks, markj
Differential Revision: https://reviews.freebsd.org/D32498

# b8cacb38 09-Dec-2021 Warner Losh <imp@FreeBSD.org>

mips: Remove mips as a recognized build target.

Remove mips as a recognized build target in advance of its removal from
the tree.

Sponsored by: Netflix

# 59f4abfa 07-Dec-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Allow to specify PKG_ABI on the command line

This is useful for creating kernel package without having to buildworld
before as we use uname from the world stage dir to get the ABI.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D33323
Sponsored by: Beckhoff Automation GmbH & Co. KG

# 8f7eb330 06-Dec-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Bootstrap libcrypt on non-FreeBSD for libroken

After f0a6ab51e6da, we need libroken's dependencies to be present; in
particular, libcrypt is not present on macOS, and so needs to be
bootstrapped. We include this on Linux too for consistency and to avoid
future compatibility issues, even if strictly unnecessary currently.

Fixes: f0a6ab51e6da ("src.libnames.mk: Include dependencies when bootstrapping from non-FreeBSD"
MFC after: 1 week

# 8d5d3295 06-Dec-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Bootstrap libz when cross-building from non-FreeBSD

This is needed now libdwarf depends on libz.

Fixes: dbf05458e3bd ("libdwarf: Support consumption of compressed ELF sections")
MFC after: 1 week

# 9b135747 30-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

kern.pre.mk: allow to use and customize elfdump during kernel build

Reviewed by: emaste
Discussed with: jrtc27
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32960

# aaa4cd7f 28-Nov-2021 Juraj Lutter <otis@FreeBSD.org>

Makefile.inc1: Silence an error in make packages

Silence an error in "packages" target, like:

eval: /usr/src: Permission denied

on systems without subversion present.

Reviewed by: emaste
Approved by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33153

# 7b3642da 26-Nov-2021 Mark Johnston <markj@FreeBSD.org>

Hoist cddl prebuild lib dependency definitions out of a MK_ZFS block

The compilation of several libraries under cddl/lib is not conditional
on MK_ZFS = "yes", so their dependency on libspl is not conditional
either. Unbreak buildworld when WITHOUT_ZFS is set.

Reported by: bz
Fixes: 9e9c651caceb ("cddl: fix missing ZFS library dependencies")
MFC after: 1 week

# 483a2262 24-Nov-2021 Ed Maste <emaste@FreeBSD.org>

Add ncurses/form to _prebuild_libs to fix build

Reported by: bz

# 8502220d 19-Nov-2021 Warner Losh <imp@FreeBSD.org>

Revert "Bootstrap: Prune building from pre-FreeBSD 11 support"

This reverts commit a420a672bc53bd3928626aa5d0ec5b41c0471356.

kevans pointed out some potential problems here, so reverting until
I can fix them.

# a420a672 10-Oct-2021 Warner Losh <imp@FreeBSD.org>

Bootstrap: Prune building from pre-FreeBSD 11 support

We don't need to bootstrap lex or md4 anymore.
Cat doesn't need to be bootstrapped (but is needed for buildkernel)
cruncgen doesn't need to be bootstrapped at all.
kbdcontrol isn't needed

Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/554

# 27a04f59 18-Nov-2021 Warner Losh <imp@FreeBSD.org>

Add warning that MIPS is being removed in FreeBSD 14.0

MFC After: 3 days
Sponsored by: Netflix
Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D32853

# 9e9c651c 16-Oct-2021 Greg V <greg@unrelenting.technology>

cddl: fix missing ZFS library dependencies

In 9fae47666 zfsd got a libspl dependency to avoid undefined references.
However that workaround did not help external consumers of libzfs_core.

Fix all missing dependencies lld 13 and the rtld complain about.

Reviewed by: freqlabs, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D32521

# e5adb145 10-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

Remove arm/linux from sysent toplevel target

Sponsored by: The FreeBSD Foundation
Fixes: 65e485014b0dcf53e0

# eab5358b 24-Oct-2021 Mateusz Piotrowski <0mp@FreeBSD.org>

Makefile.inc1: Remove mentions of removed target "update"

This is follow-up to commits e290182bcf38 and 1f7d11e636ab.

# 1a724aa9 18-Oct-2021 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove lorder from build/cross tools

As lorder is not used by the base system build there is no need to
include it in bootstrap-tools or NXBDIRS.

Fixes: 0e1e341b486c ("Stop using lorder and ranlib when...")
Sponsored by: The FreeBSD Foundation

# e2e2c622 13-Oct-2021 Kyle Evans <kevans@FreeBSD.org>

native-xtools: avoid libllvm while populating the sysroot

Prior to 021385aba562, MK_CLANG=no was sufficient to avoid descending
into lib/clang, but the referenced change added a couple of other
enabling knobs. Turn those off, too, to continue avoiding libllvm.

With this change, we no longer end up with a libllvm using the wrong
default target triple; `poudriere jail -cx` works once again.

Reported by: bhughes, imp, probably others
Fixes: 021385aba562 ("Add WITH_LLVM_BINUTILS to install LLVM ...")

# c05b382e 11-Oct-2021 Warner Losh <imp@FreeBSD.org>

Revert "bootstrap: No need to disable shared libraries for bootstrap tools"

This reverts commit e8f26e5dc859a8fbc663e108421f657325ca3054.

Although the change worked locally, it's breaking something in the CI
build for the riscv64 build (which makes no sense it would only break
that since we're building host tools to bootstrap at that point).

Sponsored by: Netflix

# e8f26e5d 11-Oct-2021 Warner Losh <imp@FreeBSD.org>

bootstrap: No need to disable shared libraries for bootstrap tools

There's no need to disable shared libraries when building the bootstrap
tools. This was added on 2000 (commit ad879ce9552c) when the perl
bootstrap was added (libperl and miniperl) and saved a fair amount of
time (perl took a long time to build on 2000-era hardware).

For many years now, however, we rarely build any libraries when
bootstrapping. Even when we do, the optimization saves at most a few
seconds when upgrading since the libraries built have been small. Shared
libraries are more robust accross versions that static libraries due to
creaping dependencies (we aren't crossing versions of share libraries,
though, just using what's on the host). In addition, linux and macos
have been building like this for some time because static binaries on
those systems are difficult to impossible.

Sponsored by: Netflix
Reviewed by: arichardson, bapt
Differential Revision: https://reviews.freebsd.org/D32443

# 4d7876aa 06-Oct-2021 Kyle Evans <kevans@FreeBSD.org>

build: slap a libtinfo dependency on libncurses

This mirrors the SUBDIR_DEPEND in lib/ncurses/Makefile.

Reported by: jenkins (e.g., riscv64 build #23984)
Fixes: 396851c20aeb ("ncurses: split libtinfo from libncurses")

# cbc83e37 22-Sep-2021 Baptiste Daroussin <bapt@FreeBSD.org>

ncurses: chase dependency changes in the source tree

Differential Revision: https://reviews.freebsd.org/D32098

# cf0ee873 12-Sep-2021 Konstantin Belousov <kib@FreeBSD.org>

Drop cloudabi

According to https://github.com/NuxiNL/cloudlibc:
CloudABI is no longer being maintained. It was an awesome experiment,
but it never got enough traction to be sustainable.

There is no reason to keep it in FreeBSD.

Approved by: ed (private mail)
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D31923

# 895545d0 11-Sep-2021 Doug Rabson <dfr@FreeBSD.org>

Fix spelling of BUILDENV_SHELL

# 021385ab 06-Sep-2021 Alex Richardson <arichardson@FreeBSD.org>

Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain

When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as
ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones.
Having the LLVM binutils instead of the elftoolchain ones allows us to use
features such as LTO that depend on binutils that understand LLVM IR.
Another benefit will be an improved user-experience when compiling with
AddressSanitizer, since ASAN does not symbolize backtraces correctly if
addr2line is elftoolchain addr2line instead of llvm-symbolizer.
See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html
for more details.

This is currently off by default but will be turned on by default at some
point in the near future.

Reviewed By: emaste

Differential Revision: https://reviews.freebsd.org/D31060

# 1e4c8029 24-Aug-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Fix bootstrapping to actually build lldb-tblgen for later use

Because MK_LLDB=no is in BSARGS, the bootstrap-tools recursive make does
not add lldb-tblgen to _clang_tblgen, causing it to not be built. This
means that the build currently always uses the host's lldb-tblgen
(which, whilst currently it appears to work, could in future break if
TableGen backends are added or altered) and, if it doesn't exist (either
because the current FreeBSD system was built with it disabled, or you're
building on macOS/Linux), fails. Linux and macOS cross-builds used to
work simply because LLDB was previously in BROKEN_OPTIONS when building
on non-FreeBSD.

Instead, move MK_LLDB=no from BSARGS to XMAKE. This ensures that the
lib/clang build in cross-tools continues to not build LLDB parts for the
bootstrap toolchain (both to save time/space on FreeBSD, and because our
vendored LLDB does not include the macOS and Linux host files so those
would fail to build).

The DIRDEPS target is updated to move MK_LLDB=no from the BSARGS block
that mirrors Makefile.inc1 to the line that disables additional
toolchain components. The DIRDEPS build likely suffers from the same
issue currently, but having never used it and not being familiar with
how it works I am leaving that as-is. If it does suffer from the same
issue it should be easily reproducible by renaming /usr/bin/lldb-tblgen
or moving it to a directory not in PATH.

Fixes: 31ba4ce8898f ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after: 1 week
Reviewed by: dim, emaste, imp
Differential Revision: https://reviews.freebsd.org/D31531

# ab3a1809 24-Aug-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Make sure sub-makes see MK_CLANG_BOOTSTRAP=no when XCC is a path

Currently we override MK_CLANG_BOOTSTRAP to no so we don't build a
bootstrap compiler, but subdirectories don't see that and so the hack in
bsd.sys.mk to prefer our includes over Clang's resource dir for external
toolchains is not enabled unless you use -DWITHOUT_CLANG_BOOTSTRAP
explicitly on top of XCC (which tools/build/make.py does not do),
causing duplicate definition errors when building rtld-elf due to the
use of -ffreestanding (Clang's stdint.h will use the system one when
hosted, but its own when freestanding, and only has glibc's preprocessor
guards, not FreeBSD's).

This broke when dropping CLANG_BOOTSTRAP from BROKEN_OPTIONS.

Fixes: 31ba4ce8898f ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after: 1 week
Reviewed by: imp, arichardson
Differential Revision: https://reviews.freebsd.org/D31529

# 298ee47e 18-Aug-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

localedef: unbreak WITHOUT_LOCALES

After 0fa5403d493b ("pkgbase: move locales into their own package") we
need usr.bin/localedef as a bootstrap tool independent on where
WITHOUT_LOCALE was specified as we ALWAYS process C.UTF-8.

At the same time LOCALES= in the local Makefile is empty but
C.UTF-8 with WITHOUT_LOCALES. C.UTF-8 is excluded from FILES, and thus
after the replacement FILES= is set to only .LC_CTYPE which results in
a build failure not knowing how to build that. Tweak the substitution to
replace only non-empty words so that FILES remains harmlessly empty.

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

# 4b7bf842 17-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

bootstrap-tools: Don't copy host tools with make -n

# a3ddd7c9 17-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

_worldtmp: Fix some sub-makes not working with make -n

# cc134505 16-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Add missing lex/yacc dependency for mkesdb/mkcsmapper bootstrap

This causes build failures on macOS where the build can end up invoking
an incompatible m4 binary.

Fxies: 2de949cf85d0 ("Remove mkcsmapper_static and mkesdb_static from build-tools")

# 54247ce1 07-Aug-2021 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: Avoid hanging if pkg is not installed

For `pkg --version`, Redirect stdin from /dev/null to avoid waiting on
/usr/sbin/pkg's bootstrap prompt if the pkg package is not installed.
Also redirect stderr to /dev/null to discard the warning message in
this case.

Reported by: mjg
Fixes: 4e224e4be7c3 ("pkgbase: accommodate pkg < 1.17")
Sponsored by: The FreeBSD Foundation

# 61ed578e 04-Aug-2021 Mitchell Horne <mhorne@FreeBSD.org>

Prefer MK_SSP=no to SSP_CFLAGS=

It is more idiomatic. CFLAGS is only augmented with $SSP_CFLAGS when
$MK_SSP != "no".

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31401

# bcd2f41f 04-Aug-2021 Mitchell Horne <mhorne@FreeBSD.org>

mk: format some option lists

Alphabetize and give each option its own line, ahead of making another
change to these lists. This makes future diffs easier to read.

Reviewed by: imp, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31399

# b60770fc 03-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native-xtools build

Fixes https://github.com/freebsd/poudriere/issues/894
Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line")
X-MFC-With: d0c737e18

# 2482ea42 03-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

Revert "Fix native-xtools build"

This reverts commit 36269b82318280ef184c953b90674f5905e0f53f.

This had an unintended change included.

# 36269b82 03-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native-xtools build

Fixes https://github.com/freebsd/poudriere/issues/894
Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line")
X-MFC-With: d0c737e18

# 2de949cf 02-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Remove mkcsmapper_static and mkesdb_static from build-tools

Build them as part of the bootstrap-tools phase instead.

Reviewed by: emaste (no objections)
Differential Revision: https://reviews.freebsd.org/D28181

# 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

# bbd16236 01-Aug-2021 Wolfram Schneider <wosch@FreeBSD.org>

add the time(1) command to the list of install tools

Reported by: dhw
Approved by: dhw
Differential Revision: https://reviews.freebsd.org/D31373

# 99feb137 01-Aug-2021 Wolfram Schneider <wosch@FreeBSD.org>

`make buildworld' with time logging for each stage

PR: 257141
Reviewed by: sjg,emaste
Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D31154

# 4dbac528 28-Jul-2021 Ed Maste <emaste@FreeBSD.org>

pkgbase: improve pkg --version parsing

In some cases `pkg --version` might produce unexpected or additional
output. Use a regex /^[0-9.]+$/ to match only the line containing the
version number.

Reported by: Michael Butler on freebsd-current@
Fixes: 4e224e4be7c3 ("pkgbase: accommodate pkg < 1.17")
Sponsored by: The FreeBSD Foundation

# 4e224e4b 26-Jul-2021 Ed Maste <emaste@FreeBSD.org>

pkgbase: accommodate pkg < 1.17

6cafdee71d2b adapted the pkgbase build for 1.17, but broke Cirrus-CI's
use of PKG_FORMAT=tar (the quarterly package set still has pkg 1.16).
Because of this I disabled the pkgbase build and test in 2bfba2a04b05.

Now, check `pkg --version` and use the old logic for < 1.17.

To be reverted once we no longer encounter pkg 1.16 in Cirrus-CI (i.e.,
via GCP cloud images) to avoid keeping this extra complexity around.

PR: 257422
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31324

# 6cafdee7 04-May-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Track pkg 1.17

With pkg 1.17 the extention is always .pkg, packing_format is also now deprecated.

# c5d1d88a 05-Jul-2021 Alex Richardson <arichardson@FreeBSD.org>

Don't build lldb-tablegen if MK_LLDB=no

Split out from D31060.

Reviewed by: emaste

# 0333fad1 11-Jun-2021 John Baldwin <jhb@FreeBSD.org>

Remove svnlite.

Reviewed by: bcr, imp, emaste
Differential Revision: https://reviews.freebsd.org/D30737

# e290182b 11-Jun-2021 John Baldwin <jhb@FreeBSD.org>

Remove 'make update'.

In the CVS days this used be a wrapper around either CVS or CVSup and
used to support updating src, doc, and ports checkouts. With the move
to subversion this only supported updating src and was itself a
wrapper around 'svn update'. With Git, users are probably better off
using appropriate Git commands directly to update without needing an
explicit make target as a wrapper.

Reviewed by: bcr, imp, emaste
Differential Revision: https://reviews.freebsd.org/D30736

# 689c7e79 31-May-2021 Mitchell Horne <mhorne@FreeBSD.org>

libpmc: always generate libpmc_events.c

The jevents build tool will create an empty table if it doesn't find any
events, so we can remove the extra $MACHINE_CPUARCH checks.

Reviewed by: gnn, ray, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30531

# c6081dea 21-May-2021 Marcin Wojtas <mw@FreeBSD.org>

Add elfctl to toolchain.

Add elfctl program to toolchain to allow modifying ELF feature flags
during system build.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D29552

# 50179c5ec 23-Mar-2021 Glen Barber <gjb@FreeBSD.org>

Makefile.inc1: unbreak bootstrap when kbdcontrol does not exist

Reviewed by: arichardson
MFC after: 12 hours
MFC target: stable/13, releng/13.0
Differential Review: https://reviews.freebsd.org/D29200
Sponsored by: Rubicon Communications, LLC ("Netgate")

# 4a847a6c 18-Mar-2021 Baptiste Daroussin <bapt@FreeBSD.org>

Revert "bootstrap: add tic to the bootstrap tools"
Since we don't build and install the terminfo db anymore this is not
needed

This reverts commit b6a51d39e3a2e2f75d5b42a8c17a531063258a15.
This reverts commit e5e4845959ac60110677df302a68c220dff75abe.
This reverts commit 0af562d7e1850bbef230d30805c101b26588a3ed.

# e5e48459 01-Mar-2021 Alex Richardson <arichardson@FreeBSD.org>

Makefile.inc1 "Avoid duplicate script for target" warning

This happens if -DBOOTSTRAP_ALL_TOOLS or when building on non-FreeBSD.

# b6a51d39 25-Feb-2021 Baptiste Daroussin <bapt@FreeBSD.org>

bootstrap: fix a last edit typo

Reported by: cy

# 0af562d7 22-Feb-2021 Baptiste Daroussin <bapt@FreeBSD.org>

bootstrap: add tic to the bootstrap tools

tic is necessary early in the build to be able to build the terminfo
database later on.

Tested by: manu, jbeich

# 5cf6f1c4 30-Jan-2021 Alex Richardson <arichardson@FreeBSD.org>

Remove the MK_LIBCPLUSPLUS option

This option has been equivalent to any form of C++ support since libstdc++
was removed. Therefore, replace all MK_LIBCPLUSPLUS uses with MK_CXX.

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

# 123ae304 20-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

build: remove LIBPTHREAD/LIBTHR build options

WITHOUT_LIBTHR has been broken for a little over five years now, since the
xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building
a useful system without threading support is becoming increasingly more
difficult.

Additionally, in the five plus years that it's been broken more reverse
dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among
others) that make it more and more difficult to reconcile the effort needed
to fix these options.

Remove the broken options.

PR: 252760
Reviewed by: brooks, emaste, kib
Differential Revision: https://reviews.freebsd.org/D28263

# 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")

# 26490d9b 18-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: allow update-packages for first-run of packaging

If ${REPODIR}/${PKG_ABI} does not exist when we begin real-update-packages,
skip the comparison with the non-existent previous repository and just
finish the repo off. This allows external scripts to just assume they can
run `update-packages` rather than figuring out if they'd previously run
`packages` for this Version/Arch combo.

PKG_VERSION_FROM_DIR was added so that we could perhaps detect the three
distinct cases:

1.) If the repo has not yet been created, PKG_VERSION_FROM_DIR will be
empty.
2.) If the repo is in some intermediate state between created and fully
initialized, PKG_VERSION_FROM_DIR may point to the ABI directory.
3.) If the repo is fully initialized, then PKG_VERSION_FROM_DIR points to
the latest build to compare to.

Option #2 is explicitly unhandled at the moment, but this is no different
than it was before.

Reviewed-by: manu
Differential-Revision: https://reviews.freebsd.org/D28229

# 613fe532 14-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases

The current postfix conversions are:

CURRENT / STABLE / PRERELEASE, 12.x-CURRENT becomes 12.snapYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1.YYYYMMDDhhmmss
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2.YYYYMMDDhhmmss
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3.YYYYMMDDhhmmss
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1
RELEASE-pX -> pX, so 12.1-RELEASE-p1 becomes 12.1p1

Note that for development branches we will start to drop the minor version
component entirely, which more closely matches how these branches are
physically named (stable/NN).

snap is a new prefix that was added to pkg in [0], which is simply a more
verbose version of the current ".s" used.

As noted, build timestamps are also added to ALPHA/BETA/RC versions. This
is largely irrelevant for re@ snapshots because they will only produce one
set of snapshots for each alpha/beta/rc, but external folks may produce
multiple in that timeframe -- at least for alpha. For them, it is
imperative that the builds have a differentiating characteristic like this
rather than multiple builds across multiple revisions being versioned
identically.

[0] https://github.com/freebsd/pkg/pull/1929

Reviewed by: gjb, manu
Submitted by: rene (original, original version)
Differential Revision: https://reviews.freebsd.org/D28167

# 95ae95d4 18-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: limit PKG_VERSION_FROM calculation to real-update-packages

PKG_ABI is defined in some other targets that do not need to shell out and
calculate PKG_VERSION_FROM. Moreover, it produces extra errors when
bootstrapping an initial pkgbase repo, as the /latest link doesn't exist
yet.

# da8cc827 13-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: collapse -PRERELEASE into STABLE/CURRENT case for version suffix

-PRERELEASE exists as a given stable/X branch while the next minor version
release is in progress. From a functional standpoint, it should be treated
as -STABLE since it'll typically be a superset of what's included in the
concurrent releng branch.

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D28166

# 9af9e7c5 15-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: default to installing all specified kernels

These only get staged off to the side, not installed into the system. Let's
change the default for packages/update-packages to be less surprising.

MFC after: 1 week
Reviewed by: manu, meena <me igalic co>
Differential Revision: https://reviews.freebsd.org/D28190

# 03cab14e 14-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

Revert "pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases"

This reverts commit aef769614f921660cb0262412426034cf5395ae5.

While the package names are a bit prettier this confuse pkg about upgrading :
$ pkg version -t 13.0.s2021011313063 13.0.a1
>
$ pkg version -t 13.0.s2021011313063 13.0_ALPHA1
<

Note that the current scheme isn't good when bumping from ALPHA to BETA or
even BETA to RC:
$ pkg version -t 13.0_ALPHA1 13.0_BETA1
=
$ pkg version -t 13.0_BETA1 13.0_RC1
=

But more thoughts have to be put into this renaming.

# aef76961 14-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases

The current postfix conversions are:

CURRENT / STABLE -> .sYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3
PRERELEASE -> .p, so 11.3-PRERELEASE becomes 11.3.p
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1

Submitted by: rene (original version)
Differential Revision: https://reviews.freebsd.org/D20734

# 44b8b2a0 16-Dec-2020 Bryan Drewery <bdrewery@FreeBSD.org>

Makefile.inc1: Avoid using release/Makefile for VERSION.

release/Makefile.inc1 has git executions that were being ran for each of
these lookups. The results were not needed so just lookup what we want
directly instead.

Reviewed by: gjb, rlibby, emaste (maybe)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27643

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

Rename NO_WERROR -> MK_WERROR=no

As suggested in D27598. This also supports MK_WERROR.clang=no and
MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses.

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

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

Stop passing MK_WARNS=no for bootstrap tools

I got annoyed by the number of warnings that the CheriBSD build was
emitting. It turns out that we are emitting lots of warnings during
bootstrap because bootstrap tools are built with the default compiler
flags and ignore the warnings flags that are set in bsd.sys.mk.

Looking at git blame, it appears that MK_WARNS=no has been passed since
rS112869, replacing the -DNO_WERROR option that was added in rS87775.

This commit changes MK_WARNS=no back to -DNO_WERROR. We need to pass
-DNO_WERROR, since the system compiler might have new warnings that we
don't know about yet, and we shouldn't fail the build in that case.

Reviewed By: imp, brooks
Differential Revision: https://reviews.freebsd.org/D27598

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

Add mkimg to the list of bootstrap tools

Having this as part of the bootstrap tools is useful to build disk images
to boot in QEMU (especially when building on a Linux/macOS host where
mkimg is not available). We have been bootstrapping mkimg in CheriBSD for
a long time (using LOCAL_XTOOL_DIRS) but I believe this is also useful
upstream.

Reviewed By: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D27602

# f1829643 06-Jan-2021 Toomas Soome <tsoome@FreeBSD.org>

vtfontcvt is part of bootstrap toolset and should always be built

Reported by: Peter Jeremy

# 821aa63a 04-Jan-2021 Baptiste Daroussin <bapt@FreeBSD.org>

ncurses: only keep the version with widechar support

Only keep the widechar version of ncurses as libncursesw.so.9

Keep the old name to avoid breaking the ABI compatibility (the non
widechar version libncurses.so.9 is not binary compatible with
libncursesw.so.9) since all ports and base are already only linking
against the widechar version we can simply remove libncurses.so.9

Since the .9 version only lived in the dev branch and never ended in a
release, it is simply removed and not added to any binary compat
package.

Add symlinks to keep build time compatibility for anyone linking against
-lncurses

# 4401fa9b 04-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: rename PKGSIGNKEY to PKG_REPO_SIGNING_KEY

this way, it'll be automatically picked up by poudriere
That's quite handy when building pkgbase!

Submitted by: Mina Galić <me@igalic.co>
Reviewed By: bapt, bcr (manpages)
Differential Revision: https://reviews.freebsd.org/D27690

# fe7dff17 15-Dec-2020 Ed Maste <emaste@FreeBSD.org>

Remove additional GDB leftovers missed in r368667

# f7ff7baa 04-Dec-2020 Alex Richardson <arichardson@FreeBSD.org>

crunchgen: fix NULL-deref bug introduced in r364647

While porting over the local changes from CheriBSD for upstreaming, I
accidentally committed a broken version of find_entry_point(): we have to
return NULL if the value is not found instead of a value with
ep->name == NULL, since the checks in main were changed to check ep instead
of ep->name for NULL.

This only matters if the crunched tool cannot be found using normal lookup
and one of the fallback paths is used, so it's unlikely to be triggered
in rescue. However, I noticed that one of our CheriBSD test scripts was
failing to run commands under `su` on minimal disk images where all
binaries are hardlinks to a `cheribsdbox` tool generated with crunchgen.

This also updates the bootstrapping check in Makefile.inc1 to bootstrap
crunchgen up to the next version bump.

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D27474

# 80cedb80 20-Nov-2020 Bryan Drewery <bdrewery@FreeBSD.org>

Add lists for customizing legacy and bootstrap-tools.

Reviewed by: arichardson
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27200

# 4ae78e70 20-Nov-2020 Alfredo Dal'Ava Junior <alfredo@FreeBSD.org>

[POWERPC64LE,POWEPCSPE] set default kernel config for powerpc64le and powerpcspe variants

Default KERNCONF for powerpc64le should be GENERIC64, and powerpcspe should
select MPC85XXSPE

Reviewed by: bdragon,emaste
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D27257

# 0e55bb7b 13-Nov-2020 Alex Richardson <arichardson@FreeBSD.org>

Makefile.inc1: remove no-longer required variable

This variable is unsed since r364760 but I forgot to delete it in that commit.

Reported By: bdrewery

# 8da6fc4d 04-Nov-2020 John-Mark Gurney <jmg@FreeBSD.org>

fix the docs, this was always wrong... In some cases, DISTDIR is set
automatically by tools via /etc/make.conf, so remind people (me) where
to find where it's set..

It would be nice for someone to document what DISTDIR is better than:
where the file for a distribution gets installed

# 0ac8aa55 02-Nov-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add incremental packages

This adds a new target update-packages which will create the new packages
compared to the last run.

This is how to use it:
At this point we cut a release
$ make buildworld ...
$ make buildkernel
$ make packages

There is now a PKG_VERSION directory with latest link pointing to it
Distribute the packages to server

$ something something that update the source tree
$ make buildworld ...
$ make buildkernel
$ make update-packages
You know have a PKG_VERSION directory in the REPODIR and latest link pointing to it.
In PKG_VERSION dir only the packages which differs from the latest run are
named PKG_VERSION, otherwise the old packages are there.

The process is :
Build the new packages in the PKG_VERSION directory
Compare the internal data with the PKG_VERSION_FROM version. The comparison is done
by checking the internal hash of the packages.
By default PKG_VERSION_FROM is set to what the latest link points to.
If the old and new version matches, we rm the new package and cp the old one.

Differential Revision: https://reviews.freebsd.org/D25984

# 73577bf0 24-Oct-2020 Ryan Moeller <freqlabs@FreeBSD.org>

flua: Add a libjail module

libjail is pretty small, so it makes for a good proof of concept demonstrating
how a system library can be wrapped to create a loadable Lua module for flua.

* Introduce 3lua section for man pages
* Add libjail module

Reviewed by: kevans, manpages
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D26080

# 3ac62888 18-Oct-2020 Alex Richardson <arichardson@FreeBSD.org>

Significantly speed up mkimg_test

It turns out that the majority of the test time for the mkimg tests isn't
mkimg itself but rather the use of jot and hexdump which can be quite slow
on emulated platforms such as QEMU.

On QEMU-RISC-V this reduces the time for `kyua test mkimg_test` from 655
seconds to 200. And for CheriBSD on QEMU-CHERI this saves 4-5 hours (25%
of the time for the entire testsuite!) since jot ends up triggering slow
functions inside the QEMU emulation a lot.

Reviewed By: lwhsu
Differential Revision: https://reviews.freebsd.org/D26796

# e5ccad50 12-Oct-2020 Alex Richardson <arichardson@FreeBSD.org>

Fix build with -DBOOTSTRAP_ALL_TOOLS

sbin/sysctl can no longer be bootstrapped on FreeBSD 12 after r366465,
so create a symlink to the host tool instead of trying to build it.

# 55be47b8 29-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

Makefile.inc1: sysent: allow subordinate sysent targets to run in parallel

makesyscalls.lua (and indeed makesyscalls.sh) are both safe to be run in
parallel, so let's do it.

This is a trivial difference because runtime per-target is pretty small, but
I like seeing it run in parallel when my muscle memory types `make -sj4`.

Reviewed by: brooks, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26594

# b75abea4 22-Sep-2020 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC64LE] Set up powerpc.powerpc64le architecture

This is the initial set up for PowerPC64LE.

The current plan is for this arch to remain experimental for FreeBSD 13.

This started as a weekend learning project for me and kinda snowballed from
there.

(More to follow momentarily.)

Reviewed by: imp (earlier version), emaste
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D26399

# 6129f33e 21-Sep-2020 Alex Richardson <arichardson@FreeBSD.org>

Prefer bootstrapped tools when running certctl.sh

Otherwise we get lots of warnings when building on Linux/macOS during
installworld:
Scanning /local/scratch/alr48/cheri/output/freebsd-x86/usr/share/certs/blacklisted for certificates...
install: invalid option -- 'U'
Try 'install --help' for more information.
install: invalid option -- 'U'
....

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D26481

# e307eb94 21-Sep-2020 Toomas Soome <tsoome@FreeBSD.org>

loader: zfs should support bootonce an nextboot

bootonce feature is temporary, one time boot, activated by
"bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.

By default, the bootonce setting is reset on attempt to boot and the next
boot will use previously active BE.

By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will
be set permanently active.

bootonce dataset name is recorded in boot pool labels, bootenv area.

in case of nextboot, the nextboot_enable boolean variable is recorded in
freebsd:nvstore nvlist, also stored in boot pool label bootenv area.
On boot, the loader will process /boot/nextboot.conf if nextboot_enable
is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf
processing on next boot.

bootonce and nextboot features are usable in both UEFI and BIOS boot.

To use bootonce/nextboot features, the boot loader needs to be updated on disk;
if loader.efi is stored on ESP, then ESP needs to be updated and
for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated
(gpart or other tools).

At this time, only lua loader is updated.

Sponsored by: Netflix, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25512

# fe815331 18-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

build: provide a default WARNS for all in-tree builds

The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by: emaste, brooks, ngie (all earlier version)
Reviewed by: emaste, arichardson (depend-cleanup.sh change)
Differential Revision: https://reviews.freebsd.org/D26455

# ca4b73c3 17-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

Promote the installworld `certctl rehash` to distributeworld

Contrary to my belief, installworld is not sufficient for getting certs
installed into VM images. Promote the rehash to both installworld and
distributeworld (notably: not stageworld) and rehash the base distdir so we
end up with /etc/ssl/certs populated in the base dist archive. A future
commit will remove the rehash from bsdinstall, which doesn't really need to
happen if they're installed into base.txz.

While here, fix a minor typo: s/CERTCLTFLAGS/CERTCTLFLAGS/

MFC after: 1 week

# 185e8af0 16-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

installworld: run `certctl rehash` after installation completes

This was originally introduced back in r360833, and subsequently reverted
because it was broken for -DNO_ROOT builds and it may not have been the
correct place for it.

While debatably this may still not be 'the correct place,' it's much cleaner
than scattering rehashes all throughout the tree. brooks has fixed the issue
with -DNO_ROOT by properly writing to the METALOG in r361397.

Do note that this is different than what was originally committed; brooks
had revisions in D24932 that made it actually use the revised unprivileged
mode and write to METALOG, along with being a little more friendly to
foreign crossbuilds and just using the certctl in-tree.

With this change, I believe we should now have a populated /etc/ssl/certs in
the VM images.

MFC after: 1 week

# 073e4094 13-Sep-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove more old stale depend hacks

Current stale dependency hacks are in tools/build/depend-cleanup.sh.
These ones were almost a year old; remove them from Makefile.inc1.

# b7b5bdba 10-Sep-2020 Alex Richardson <arichardson@FreeBSD.org>

Ensure that the makewhatis symlink is added in the bootstrap-tools stage

We currently set MK_MAN=no in $BSARGS so MK_MAN_UTILS will also be false
which means that the makewhatis symlink will not be created.
This change fixes the build when using both -DBUILD_WITH_STRICT_TMPPATH and
-DBOOTSTRAP_ALL_TOOLS.

Tested by: andrew
Differential Revision: https://reviews.freebsd.org/D16761

# 75766799 07-Sep-2020 Ed Maste <emaste@FreeBSD.org>

Add WITH_/WITHOUT_CLEAN option to replace NO_CLEAN

This allows use of the standard src.conf configuration for controlling
whether the tree is cleaned before build or not. The default is still
to clean.

Setting either NOCLEAN or NO_CLEAN will mention the new src.conf option.
NOCLEAN remains a .warning, while for now NO_CLEAN is .info.

Reviewed by: bdrewery (earlier version)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22762

# 30d46e45 31-Aug-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: comment .endif to ease finding matching .if

# e2515283 27-Aug-2020 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)


# cd568e2b 27-Aug-2020 Ryan Moeller <freqlabs@FreeBSD.org>

libzfs: Also add the crypto dependency to Makefile.inc1

Reported by: kevans
Discussed with: kevans
Sponsored by: iXsystems, Inc.

# 3ce13dbc 25-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Use bootstrapped install(1) install of tools/install.sh in world stage

This should be noticeably faster due to fewer processes being forked and
also handles other flags such as -S or writing to METALOG.

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

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

Fix running the builddtb target on a noexec file system

Obtained from: CheriBSD

# 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

# 9e5787d2 24-Aug-2020 Matt Macy <mmacy@FreeBSD.org>

Merge OpenZFS support in to HEAD.

The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.

I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.

Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.

Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.

Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.

Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872

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

# ebae797c 24-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Also print number of available CPUs on Linux

Without this change the buildworld/buildkernel epilogue looks like this:
>>> World built in 249 seconds, sysctl: cannot stat /proc/sys/hw/ncpu: No such file or directory
ncpu: , make -j72.

Reviewed By: emaste, bdrewery
Differential Revision: https://reviews.freebsd.org/D26056

# 0f31fdf2 24-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Pass the installworld install(1) flags to make buildenv

This ensure that running make install inside buildenv correctly includes
the METALOG flags when building with -DNO_ROOT.

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

# 530134d2 21-Aug-2020 Bjoern A. Zeeb <bz@FreeBSD.org>

After the clang/llvm version 11 import LLD_VERSION is no longer used
upstream so Version.inc now only defines LLD_VERSION_STRING.

This breaks the WANT_LINKER_VERSION magic and might lead to us building
more than needed (e.g., for croos-tools).

Change the awk script to parse LLD_VERSION_STRING instead of LLD_VERSION,
which not only unbreaks the current situation but should also be backwards
compatible as dim points out.

PR: 248818
Reviewed by: emaste, dim (seems right and the way to go)
MFC after: 4 weeks
X-MFC before: 364284

# 440cec3f 12-Aug-2020 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)


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

Fix -DBUILD_WITH_STRICT_TMPPATH dtrace builds

Some of the scripts used for libdtrace invoke nawk instead of awk
(for example cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh).
When bootstrapping all tools, we get the nawk -> awk link while building
usr.bin/awk, but when linking/copying the dependencies from the host we
were only adding awk but not nawk.

This was silently generating invalid files when building libdtrace with
BUILD_WITH_STRICT_TMPPATH=1 since those scripts invoke nawk instead of
awk. In addition to adding the missing link this commit also adds
set -e to those scripts to catch errors like this in the future.

Reviewed By: markj, emaste
Differential Revision: https://reviews.freebsd.org/D26025

# 1a18ab42 11-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Allow overriding the tool used for stripping binaries

Since the make variable STRIP is already used for other purposes, this
uses STRIPBIN (which is also used for the same purpose by install(1).
This allows using LLVM objcopy to strip binaries instead of the in-tree
elftoolchain objcopy. We make use of this in CheriBSD since passing
binaries generated by our toolchain to elftoolchain strip sometimes results
in assertion failures.

This allows working around https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248516
by specifying STRIPBIN=/path/to/llvm-strip

Obtained from: CheriBSD
Reviewed By: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D25988

# a90022d4 11-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Replace / with | for PKG_WWW

PKG_WWW contain / char, replace the delimiter by a '|'.

Reported by: 0mp

# 82087d4b 11-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add PKG_NAME_PREFIX, PKG_MAINTAINER and PKG_WWW

This is useful for downstream users to customize the packages.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D26019

# 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

# 0d834e0f 07-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Fix duplicate assignment of _localedef in Makefile.inc1

The same .if exists a few lines below.

# 70fc0cc3 06-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add the possibility to choose the output dir

The output dir is set to ${REPODIR}/${PKG_ABI}/${PKG_VERSION} now.
Add the possibility to specify the last componant and set it by default
to ${PKG_VERSION} as before.
This is useful for tests and also for building packages with the same
PKG_VERSION provided to check differences.

# d0327929 06-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add a new variable PKG_TIMESTAMP

libarchive uses the SOURCE_DATE_EPOCH env variable to set the date of file
in an archive, this is useful for reproducibility.
Add a variable name PKG_TIMESTAMP that take a epoch time and set SOURCE_DATE_EPOCH
to this. By default it is the current time so no changes here.

# eb578fec 03-Aug-2020 Kyle Evans <kevans@FreeBSD.org>

Ensure libregex is built in time for googletest

In lib/Makefile, we document the dependency with SUBDIR_DEPEND

For buildworld orchestration, just prebuild libregex if GOOGLETEST is
enabled. googletest will get built in a later pass.

# 40056899 16-Jul-2020 Glen Barber <gjb@FreeBSD.org>

Move GIT_CMD a few lines down, so it is not in between SVN_*
lines.

Sponsored by: Rubicon Communications, LLC (netgate.com)

# ff1031c1 16-Jul-2020 Glen Barber <gjb@FreeBSD.org>

Add GIT_CMD, similar to SVN_CMD.

Sponsored by: Rubicon Communications, LLC (netgate.com)

# 0a9ab9f5 24-Jun-2020 Conrad Meyer <cem@FreeBSD.org>

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT. Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

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

# a19aa4f7 21-Jun-2020 Kyle Evans <kevans@FreeBSD.org>

Squash liblzma build race

As of r362452, liblzma depends on libmd but the buildworld build order
hadn't been amended to document the new dependency.

Reported by: jenkins via freqlabs
X-MFC-With: r362452

# 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

# 74e8d41e 06-Jun-2020 Ed Maste <emaste@FreeBSD.org>

Retire BINUTILS and BINUTILS_BOOTSTRAP options

As of r361857 all BINUTILS options are disabled by default - ports
have been changed to depend on binutils if they require GNU as, and
all base system assembly files have been switched to use Clang's
integrated assembler.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation

# 5843b6e7 05-Jun-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove stale dependency cleanup from 2018

# 694034e2 30-May-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove BINUTILS_BOOTSTRAP linker support

As of r359347 BINUTILS_BOOTSTRAP does not include the bfd linker.

# 697b271d 20-May-2020 Ed Maste <emaste@FreeBSD.org>

pkgbase: use -dev,-dbg instead of -development,-debug

-development is long and awkward, and is also inconsistent with prior art
from the Linux world, which uses -dev (Debian) or -devel (Red Hat). Follow
the Debian convention, and similarly for debug info packages.

Also remove redundant pkgbase development tag from includes. We already tag
include files with package=runtime,dev; there is no need to separately tag
them as dev.

Discussed with: bapt
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24139

# 20076f97 17-May-2020 Kyle Evans <kevans@FreeBSD.org>

Revert r360833, r360882: certctl rehash in installworld

This was solving the correct-ish problem in the wrong place. Noted by
brooks; while he didn't request a prompt revert, doing so now will
facilitate proper testing for the revised version of this.

# a93817e0 10-May-2020 Kyle Evans <kevans@FreeBSD.org>

buildworld: add back in missing semicolon

if foo; then blah else blah; fi has a drastically different meaning than
if foo; then blah; else blah; fi. Fix it.

Reported by: 0mp
X-MFC-With: r360833

# 70868d48 08-May-2020 Kyle Evans <kevans@FreeBSD.org>

installworld: attempt a certctl rehash at the tail end

This can be run as root or normal user with no problem; if they hadn't
twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to
rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL +
WITH_CAROOT with a populated /etc/ssl that they can then use with an
appropriate *ssl from somewhere else.

Cross-builds are fine because this will always use the host certctl, or just
nag if it's missing and it wasn't a WITHOUT_CAROOT build.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24641

# 61fbd61b 25-Apr-2020 Dimitry Andric <dim@FreeBSD.org>

Fix race between prebuilding libsbuf and libgeom

The latter needs the former, but with a multi-job build on a fast
machine, the race is sometimes lost. This leads to "ld: error: unable to
find library -lsbuf", when linking libgeom.so.

Submitted by: kevans
MFC after: 3 days

# 6fe257c7 13-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

Move shm_open dependency cleanup into a new home

r359461 introduced this nifty script to centralize these things, so add
shm_open.c there to remove a total of one (1) bad example from
Makefile.inc1.

Looked over by: emaste

# a8b8edb2 06-Apr-2020 Maxim Sobolev <sobomax@FreeBSD.org>

Normalize deployment tools usage and definitions by putting into one place
instead of sprinkling them out over many disjoint files. This is a follow-up
to achieve the same goal in an incomplete rev.348521.

Approved by: imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20520

# f382bac4 06-Apr-2020 Brooks Davis <brooks@FreeBSD.org>

Fix compilation with upstream clang builtin headers.

By using -nobuiltininc and adding the clang builtin headers resource dir
to the end of the compiler header search path, we can still find headers
such as immintrin.h but find the FreeBSD version of stddef.h/stdarg.h/..
first.

This is a workaround until we are able to settle on and complete a plan
to harmonize guard macros with LLVM. We've mostly worked out this on
FreeBSD systems by removing select headers from the installed set of
devel/llvm*, but that isn't a good solution for cross build.

Submitted by: arichardson
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17002

# e40fa28f 03-Apr-2020 Brooks Davis <brooks@FreeBSD.org>

Pass the real value of MK_TESTS_SUPPORT to distribution.

This allows kyua's config file to actually be installed.

Reported by: arichardson
Reviewed by: arichardson
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24268

# 4dad87a4 30-Mar-2020 Ed Maste <emaste@FreeBSD.org>

add shell script for stale dependency hack

It's rather awkward to debug issues with the dependency cleanup hacks
when implemented via make. Add a cleanup shell script and move the
libomp hack there as an initial example.

Reviewed by: brooks
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24228

# c42a6767 30-Mar-2020 Brooks Davis <brooks@FreeBSD.org>

Relax existence check of ${LOCALBASE}/bin/kyua

After the base kyua import the testsuite can utilize the in-base kyua
just fine.

Submitted by: Dries Michiels
Differential Revision: https://reviews.freebsd.org/D24230

# be2af8fb 27-Mar-2020 Brooks Davis <brooks@FreeBSD.org>

Use the real value of MK_TESTS_SUPPORT in _libraries.

We need to build kyua libraries for kyua. Because we set MK_TESTS=no,
we can't not set MK_TESTS_SUPPORT=${MK_TESTS_SUPPORT} because the latter
defaults MK_TESTS_SUPPORT to no.

This fixes WITHOUT_TESTS + WITH_TESTS_SUPPORT builds.

Reported by: Ruslan Garipov
Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24206

# eb61f7bd 26-Mar-2020 Emmanuel Vadot <manu@FreeBSD.org>

Stop building libl and liby

Those libs aren't needed anymore so stop building them for the bootstrap tools
or the compat libs.

Reviewed by: bapt, emaste
X-Differential Revision: D24171

# 52de22ca 24-Mar-2020 Mitchell Horne <mhorne@FreeBSD.org>

Makefile.inc1: override MACHINE for native-xtools

For the final step of the native-xtools target, "everything" is built
with TARGET and TARGET_ARCH set to the architecture we wish to
cross-build for. However, CROSSENV overwrites the values of MACHINE and
MACHINE_ARCH, setting them to be identical to TARGET and TARGET_ARCH.
For native-xtools this is undesirable since we are building binaries to
run on the host architecture, that can cross compile for the target
architecture.

When building native-xtools for RISC-V, this issue manifests as an invalid
argument for "-march". The compiler is invoked with the target triple of the
host architecture, but the CFLAGS inherited from bsd.cpu.mk are that of the
target architecture.

Reviewed by: imp, bdrewery
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23838

# f1af40b5 24-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove old (2018) stale dependency hacks

We handle a number of stale dependency issues on an ad-hoc basis, in
order to support ongoing NO_CLEAN builds. These hacks do not need to
be maintained indefinitely; now remove those for issues that are more
than a year old.

Sponsored by: The FreeBSD Foundation

# c260dbfb 21-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: set DB_FROM_SRC also for stageworld

stageworld, invoked from e.g. `make packages`, shouldn't rely on the
build host's users/groups.

Sponsored by: The FreeBSD Foundation

# dadc342d 18-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Revert r359083, fixed properly by r359088

r359083 introduced a workaround for stale libomp dependencies during a
regular (no -DNO_CLEAN) buildworld. r359088 addressed the reason the
clean step missed libomp, so revert the workaround.

Sponsored by: The FreeBSD Foundation

# 0d02682c 18-Mar-2020 Ed Maste <emaste@FreeBSD.org>

invoke _cleanobj_fast_depend_hack unconditionally

Apparently make ${CLEANDIR} is leaving stale entries in .depend files;
for now invoke the hacky cleanup in both the -DNO_CLEAN and normal
(no -DNO_CLEAN) cases.

In collaboration with: dim
Sponsored by: The FreeBSD Foundation

# 564b9ff2 17-Mar-2020 Brooks Davis <brooks@FreeBSD.org>

Add an internal liblua and use it in flua.

The new liblua will be used in a forthcoming import of kyua.

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

# dfcef1de 17-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: add a note when deleting stale dependencies

We have ad-hoc stale dependency handling in Makefile.inc1 to handle the
cases where file extensions change, but it appears that some cases are
not functional. Add a note when about to clean stale deps to help
when investigating failure reports.

Sponsored by: The FreeBSD Foundation

# 450cc341 12-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: move dependency hack comment to the block it applies to

# 3b1781b4 12-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Extend r358907 to explicitly remove stale lib32 dependency

After r325072 stale lib32 dependencies were not remooved. A more
holistic approach is needed to address this but for the immediate issue
(-DNO_CLEAN builds across r358851) just readd the explicit lib32 path.

Reported by: dim
Sponsored by: The FreeBSD Foundation

# 0efe25f9 12-Mar-2020 Dimitry Andric <dim@FreeBSD.org>

Allow -DNO_CLEAN build across r358851.

The openmp 10.0.0 import renamed one .c file to .cpp, and this is
something our dependency system does not handle correctly. Add another
ad-hoc cleanup to get rid of the stale dependency.

PR: 244251
MFC after: 6 weeks
X-MFC-With: 358851

# 13f7dbe8 09-Mar-2020 Ed Maste <emaste@FreeBSD.org>

retire amd(8)

autofs was introduced with FreeBSD 10.1 and is the supported method for
automounting filesystems. As of r296194 the amd man page claimed that it
is deprecated. Remove it from base now; the sysutils/am-utils port is
still available if necessary.

Discussed with: cy
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

# 134b3783 29-Feb-2020 Ed Maste <emaste@FreeBSD.org>

retire in-tree GPL dtc devicetree compiler

Now that we no longer have GCC 4.2.1 in the tree and can assume FreeBSD
is being built with a C++11 compiler available, we can use BSDL dtc
unconditionally and retire the GPL dtc.

GPL dtc now has FreeBSD CI support via Cirrus-CI to help ensure it
continues to build/work on FreeBSD and is available in the ports tree
if needed.

The copy of (copyfree licensed) libfdt that we actually use is in
sys/contrib/libfdt so the extra copy under contrib/dtc/libfdt can be
removed along with the rest of the GPL dtc.

Reviewed by: kevans, ian, imp, manu, theraven
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23192

# c4501804 28-Feb-2020 Ed Maste <emaste@FreeBSD.org>

retire the LLVM_LIBUNWIND option

LLVM's libunwind is used on all FreeBSD-supported CPU architectures and
is a required component.

Reviewed by: brooks (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23123

# 57f80467 28-Feb-2020 Ed Maste <emaste@FreeBSD.org>

remove GCC 4.2.1 build infrastructure

As described in Warner's email message[1] to the FreeBSD-arch mailing
list we have reached GCC 4.2.1's retirement date. At this time all
supported architectures either use in-tree Clang, or rely on external
toolchain (i.e., a contemporary GCC version from ports).

GCC 4.2.1 was released July 18, 2007 and was imported into FreeBSD later
that year, in r171825. GCC has served us well, but version 4.2.1 is
obsolete and not used by default on any architecture in FreeBSD. It
does not support modern C and does not support arm64 or RISC-V.

Thanks to everyone responsible for maintaining, updating, and testing
GCC in the FreeBSD base system over the years.

So long, and thanks for all the fish.

[1] https://lists.freebsd.org/pipermail/freebsd-arch/2020-January/019823.html

PR: 228919
Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23124

# eb834d9f 19-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Take LINKER_FREEBSD_VERSION from numerical field after dash

Summary:
With COMPILER_FREEBSD_VERSION, we use a numeric value that we bump each
time we make a change that requires re-bootstrapping, but with the
linker variant, we instead take the entire part after "FreeBSD", as in
this example version output:

LLD 9.0.1 (FreeBSD c1a0a213378a458fbea1a5c77b315c7dce08fd05-1300006) (compatible with GNU linkers)

E.g., LINKER_FREEBSD_VERSION is currently being set to
"c1a0a213378a458fbea1a5c77b315c7dce08fd05-1300006". This means that
*any* new upstream lld version will cause re-bootstrapping.

We should only look at the numerical field we append after a dash
instead. This review attempts to make it so.

The only thing I am not happy about is the post-processing of awk output
in Makefile.inc1. I notice that our awk does not have gensub(), so it
can't substitute a numbered sub-regex with \1, \2, etc. Suggestions
welcome. :)

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23691

# 75ababf8 06-Feb-2020 Warner Losh <imp@FreeBSD.org>

Restore missing comment

I was overly agressive about removing the entire comment. It was still
valid, except the part about being only for some architectures.

Reviewed by: emaste
Differenial Revision: https://reviews.freebsd.org/D23523

# 5672c764 02-Feb-2020 Warner Losh <imp@FreeBSD.org>

Per the firm plan, start to remove sparc64

The sparc64 architecture is being removed from FreeBSD 13, starting
now. This removes it from the top level only. It is the only
architecture that didn't see substantial work after the call to get
things working with the external toolchain.

# 43e84039 31-Jan-2020 Ed Maste <emaste@FreeBSD.org>

retire BSD_CRTBEGIN option

BSD crt is currently used on all architectures (other than sparc64).
Remove the option and use BSD crt everywhere as part of the GCC 4.2.1
retirement plan.

https://lists.freebsd.org/pipermail/freebsd-arch/2020-January/019823.html

PR: 239851
Reviewed by: andrew, brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23122

# 7ec5e1c4 22-Jan-2020 John Baldwin <jhb@FreeBSD.org>

Remove support for auto-selecting an external binutils.

All of the in-tree architectures not supported by in-tree binutils are
supported by lld, so the condition is now always false. It also
didn't fully work since the external binutils are installed into a
directory that uses the host's OS version, not the target OS version.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D23294

# 9ccace3f 19-Jan-2020 Ed Maste <emaste@FreeBSD.org>

pkgbase: allow the pkg format to be overridden

Compressing .txz packages can be rather slow, and speed is likely more
important than disk space during development. Allow package format to
be set via PKG_FORMAT make variable.

Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23257

# c530c791 18-Jan-2020 Ed Maste <emaste@FreeBSD.org>

pkgbase: cache pkg ABI for all world/kernel packages

Rather than invoking `pkg config ABI` repeatedly.

Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23255

# 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

# 7c883770 08-Jan-2020 Ed Maste <emaste@FreeBSD.org>

Remove prereq lib support for GNU unwinder

LLVM's libunwind is used for all archs, as of r356514. As GCC 4.2.1
will soon be removed, and with it the GNU unwinder, start simplifying
the prereq/startup lib logic in Makefile.inc1. From here if there are
any unwinder bugs (on any arch) the path foward is to fix LLVM's
libunwind.

# cd0d51ba 04-Jan-2020 Kyle Evans <kevans@FreeBSD.org>

Provide libssp based on libc

For libssp.so, rebuild stack_protector.c with FORTIFY_SOURCE stubs that just
abort built into it.

For libssp_nonshared.a, steal stack_protector_compat.c from
^/lib/libc/secure and massage it to maintain that __stack_chk_fail_local
is a hidden symbol.

libssp is now built unconditionally regardless of {WITH,WITHOUT}_SSP in the
build environment, and the gcclibs version has been disconnected from the
build in favor of this one.

PR: 242950 (exp-run)
Reviewed by: kib, emaste, pfg, Oliver Pinter (earlier version)
Also discussed with: kan
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22943

# 36afd1d2 03-Jan-2020 Kyle Evans <kevans@FreeBSD.org>

Makefile.inc1: remove libcompiler_rt from _startup_libs

libcompiler_rt is already present in _prereq_libs, which will get built just
before _startup_libs and in advance of shared libc. Dedupe.

# 39eb07f1 02-Jan-2020 John Baldwin <jhb@FreeBSD.org>

Look for cross toolchain makefiles in /usr/share/toolchains.

The freebsd-binutils and freebsd-gcc* packages install toolchain
makefiles to /usr/share/toolchains rather than LOCALBASE.

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

# eb4977bd 01-Jan-2020 Warner Losh <imp@FreeBSD.org>

Remove arm/arm as a valid target.

TARGET=arm now defaults to TARGET_ARCH=armv7
TARGET_ARCH=arm is no longer valid.

Bump __FreeBSD_version to 1300073

Tested with make universe. Any stale LINT-V5 config files remaining in the tree
will fail the universe build. However, LINT-V5 was removed in r355119.

This retirement has been planned since last summer. The armv5 port is fragile:
it works OK for some peeople, and fails badly for others. There's a number of
subtle bugs in busdma, pmap and other MD parts of thee system that present
themselves under load or in unusual circumstances (like fsck after a
crash). stable/8, branched 10 years ago, was the last reliable release. Since
the support burden is larger then the benefit, the consensus view is armv5
should be removed from the tree.

Discussed with: arm@ mailing list and arm developer community.

# f6e159c6 13-Dec-2019 Ed Maste <emaste@FreeBSD.org>

revert r355609

# c039e959 11-Dec-2019 Ed Maste <emaste@FreeBSD.org>

libpmc: build json event support also on arm64

# 0ecf09af 11-Dec-2019 Ed Maste <emaste@FreeBSD.org>

connect arm linuxulator to top-level make sysent

Reported by: kevans

# c590fd27 11-Dec-2019 Ed Maste <emaste@FreeBSD.org>

Make NOCLEAN an error instead of a warning

The warning was added in r289728 (over four years ago) and at that time
NO_CLEAN was already the correct spelling for over a decade.

Make NOCLEAN an error as the next step to removing these backward
compatibility shims.

# 3e105562 26-Nov-2019 Ed Maste <emaste@FreeBSD.org>

Update Makefile.inc1 dtc comment

We use the BSDL dtc by default now (as long as we're using a C++11
compiler).

# 97900b44 19-Nov-2019 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_LINKER: Fix rebuilding lld every time.

This is due to LLD_REVISION_STRING being renamed to LLD_REVISION in
r351442 and the value being moved to another location in r351965.

`make test-system-linker` can be used to see the values being used here.

Reported by: ler

# 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

# 9d919726 13-Nov-2019 John Baldwin <jhb@FreeBSD.org>

Refine r354661 to unbreak the GCC_BOOTSTRAP case.

MK_CLANG_IS_CC controls installing links for GCC, not just clang. Set
MK_CLANG_IS_CC to the value of MK_CLANG_BOOTSTRAP. This will leave it
as "no" if no bootstrap compiler is being built or GCC 4.2.1 is being
used as the bootstrap compiler, and "yes" if clang is being used as
the bootstrap compiler.

Submitted by: bdrewery (kind of, he suggested this on IRC while I was
testing the original patch)
Reviewed by: kevans, imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D22350

# a99d99e5 12-Nov-2019 John Baldwin <jhb@FreeBSD.org>

Force MK_CLANG_IS_CC on in XMAKE.

This ensures that a bootstrap clang compiler is always installed as cc
in WORLDTMP. If it is only installed as 'clang' then /usr/bin/cc is
used during the build instead of the bootstrap compiler.

Reviewed by: imp
MFC after: 1 month
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D22332

# c723af11 08-Nov-2019 Ed Maste <emaste@FreeBSD.org>

suggest xtoolchain package if binutils and GCC bootstraps are both broken

Previously we checked for only BINUTILS_BOOTSTRAP as a broken option
and suggested installing the binutils package. This was originally done
for arm64 where we used the in-tree Clang with external binutils package.

Add a case to the warning to suggest instead the full xtoolchain package
if we have no in-tree compiler either.

Differential Revision: https://reviews.freebsd.org/D21851

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

Revert r354518 and commit the intented fix rather than the diagnostic
check.

This fixes the definition of MK_LIB32 in Makefile.inc1.

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

Fix the ARCH check for LIB32 from Makefile.inc1.

# 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

# 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

# 4196949c 23-Oct-2019 John Baldwin <jhb@FreeBSD.org>

Strip "sf" suffix when generating a target triple.

This fixes the target triple used when compiling riscv64sf with clang.

Discussed with: mhorne
MFC after: 2 weeks
Sponsored by: DARPA

# dfe76e95 21-Oct-2019 Ed Maste <emaste@FreeBSD.org>

Additional fix for -DNO_CLEAN build across r353340 and r353381

opensolaris_atomic.S is now only used on i386 with opensolaris_atomic.c
used on other platforms. After r353381 it doesn't exist on those
platforms so the stale dependency would result in a build error.

r353408 addressed this issue for cddl/lib/libzpool, but it persisted
with the opensolaris and zfs modules.

# 01a69565 19-Oct-2019 Andriy Gapon <avg@FreeBSD.org>

buildkernel: always add standard kernel configuration include path

This should change nothing for kernel configurations at the standard
locations in the source tree. However, if KERNCONFDIR is used to
specify a custom location for a kernel configuration file (e.g., out of
tree), then both the custom location and the standard location, in this
order, will be used as include paths for config(8). This will allow the
kernel configuration to include files from both locations.

Reviewed by: bdrewery
MFC after: 16 days
Differential Revision: https://reviews.freebsd.org/D22057

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

Build compat libraries before "everything".

This is required for us to link programs against compat versions of
libraries.

Reviewed by: bdrewery, jhb
Sponsored by: DARPA, AFRL

# 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

# a1ff92a5 10-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Fix -DNO_CLEAN build across r353340 and r353381

opensolaris_atomic.S is now only used on i386 with opensolaris_atomic.c
used on other platforms. After r353381 it doesn't exist on those
platforms so the stale dependency would result in a build error.

# 9122aeea 09-Oct-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r353316 through r353350.


# 0ed89481 08-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN build across r352689.

Split the LIBCOMPAT case because the usual egrep only matches in
LIBCOMPAT on amd64.

# 8b3bc70a 08-Oct-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r352764 through r353315.


# c1d45320 01-Oct-2019 Kyle Evans <kevans@FreeBSD.org>

Add a top-level makeman target

Abstracting away the details of how src.conf(5) is generated is arguably a
good thing; do so with a top-level makeman target.

# f9fd94f5 30-Sep-2019 Brooks Davis <brooks@FreeBSD.org>

Update cloudabi(32|64) sysents with "make sysent".

MFC after: 1 week

# c6b00391 28-Sep-2019 John Baldwin <jhb@FreeBSD.org>

Disable build of LOCAL_MODULES for cross-builds by default.

WITHOUT_LOCAL_MODULES can be set to disable LOCAL_MODULES for native
builds. WITH_LOCAL_MODULES can be set to leave it enabled for cross
builds.

This does not use a knob in kern.opts.mk because the options framework
does not currently support options whose default varies on the build
type. I discussed a few options there with Warner (e.g. maybe having
a tri-state where the default value is "auto" and having Makefile.inc1
apply logic when MK_LOCAL_MODULES is set to "auto"), but Warner ok'd
this approach for now until a better solution is implemented.

Requested by: many
Reviewed by: imp (in person at EuroBSDCon)
Differential Revision: https://reviews.freebsd.org/D21608

# 668ee101 26-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r352587 through r352763.


# 9ccd2fde 25-Sep-2019 Kyle Evans <kevans@FreeBSD.org>

Adjust Makefile.inc1 syscall sub commit

# 3e25d1fb 25-Sep-2019 Kyle Evans <kevans@FreeBSD.org>

Add linux-compatible memfd_create

memfd_create is effectively a SHM_ANON shm_open(2) mapping with optional
CLOEXEC and file sealing support. This is used by some mesa parts, some
linux libs, and qemu can also take advantage of it and uses the sealing to
prevent resizing the region.

This reimplements shm_open in terms of shm_open2(2) at the same time.

shm_open(2) will be moved to COMPAT12 shortly.

Reviewed by: markj, kib
Differential Revision: https://reviews.freebsd.org/D21393

# f05b9584 21-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r352537 through r352586.


# af3ccc07 20-Sep-2019 Baptiste Daroussin <bapt@FreeBSD.org>

Ensure libthr is always built before libprivatezstd when building the
startup libs

Reported by: "Galazka, Krzysztof" <krzysztof.galazka@intel.com>

# 0f80acb9 19-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r352436 through r352536.


# d567f909 18-Sep-2019 Baptiste Daroussin <bapt@FreeBSD.org>

Add native support for zstd to libarchive

Note that old pkg will failed to build after this. A recent ports tree (one
providing pkg 1.12+) is required to build. Older already built pkg, should
continue working as expected

PR: 238797
Exp run by: antoine
Reviewed by: cem
Approved by: cem
Differential Revision: https://reviews.freebsd.org/D20752

# 84ee6de9 02-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Always build lldb-tblgen, for now, and add a note.

# a32f82c2 26-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang plus lldb (enabled via MK_LLDB).

# 13212983 20-Jun-2019 Antoine Brodin <antoine@FreeBSD.org>

Add head(1) to native-xtools so that it can be used in qemu-user jails

# 0026fec5 16-Jun-2019 Rene Ladan <rene@FreeBSD.org>

Differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases.

Currently APLHA packages are treated as CURRENT or STABLE versions,
resulting in e.g. 13.0.s20190615125609. This version number is indeed
different from the next version number but ALPHA2 would be nicer IMO.

For the BETA, PRERELEASE and RC phases the packages are versioned the
same as for releases, so 11.3-BETA1 is 11.3 and so is 11.3-RC1, meaning
that pkg cannot easiliy upgrade from the former the next. This happened
on my Raspberry Pi which runs pkgbase.

Submitted by: rene
Approved by: manu
Event: Berlin hackathon 2019
Differential Revision: https://reviews.freebsd.org/D20651

# cbc493c6 03-Jun-2019 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: clean up stale dependency hacks

Carrying on from r339607, remove ad-hoc dependency cleanup for changes
prior to June 2018.

Sponsored by: The FreeBSD Foundation

# e1216db5 03-Jun-2019 Maxim Sobolev <sobomax@FreeBSD.org>

Rollback the rest of the botched r348521. Re-work would be posted to
reviews. Sorry.

Reported by: Enji Cooper

# 5d280640 03-Jun-2019 Maxim Sobolev <sobomax@FreeBSD.org>

Leave mtree hardcoded for now. Reverting partially 348521 and also
the followup stopgap change, because I don't think it's a correct. I still
need to figure out where to stick it in. In cannot be in Makefile.inc1
and it cannot be in etc/Makefile from the looks of it to avoid
chicken-and-egg problem.

# a88c8ae7 03-Jun-2019 Warner Losh <imp@FreeBSD.org>

Stopgap fix to breakage from r348521.

MTREE is defined, while MTREE_CMD isn't, use it instead.
This may not be 'right' but it fixes the CI and other issues.

Submitted by: Andreas Nilsson

# 5ec57af4 02-Jun-2019 Maxim Sobolev <sobomax@FreeBSD.org>

Fix several places where tool name has been hardcoded:

install -> ${INSTALL}
mtree -> ${MTREE_CMD}
services_mkdb -> ${SERVICES_MKDB_CMD}
cap_mkdb -> ${CAP_MKDB_CMD}
pwd_mkdb -> ${PWD_MKDB_CMD}
kldxref -> ${KLDXREF_CMD}

If you do custom FreeBSD builds you may want to override those
in some cases.

Sponsored by: Sippy Software, Inc.

# 78473c58 28-May-2019 Justin Hibbits <jhibbits@FreeBSD.org>

Update __FreeBSD_version and Makefile check for r348347

libdwarf needs forcibly rebuilt after r348347.

# 7fc5693f 23-May-2019 Baptiste Daroussin <bapt@FreeBSD.org>

Change package the MTREEFLAGS and INSTALLFLAGS missed in r348185

Reported by: lwhsu

# 871b6b10 15-May-2019 Brad Davis <brd@FreeBSD.org>

Move master.passwd and group to lib/libc/gen/

libc was picked as the destination location for these because of the syscalls
that use these files as the lowest level place they are referenced.

Approved by: will (mentor), rgrimes, manu
Differential Revision: https://reviews.freebsd.org/D16728

# 9c8f66cb 08-May-2019 Antoine Brodin <antoine@FreeBSD.org>

Add wc(1) to native-xtools so that it can be used in qemu-user jails

# 8ae9b1fe 27-Mar-2019 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Use uname as ABI_FILE

Add some more missed in r345159

MFC after: 1 week

# 656898ab 19-Mar-2019 Wolfram Schneider <wosch@FreeBSD.org>

Improve english grammar for kernel built time

PR: 224433
Approved by: jhb
Differential Revision: https://reviews.freebsd.org/D19636

# 1d3a067e 16-Mar-2019 Wolfram Schneider <wosch@FreeBSD.org>

`make buildkernel' should display the build time in seconds

PR: 224433
Approved by: cem
Differential Revision: https://reviews.freebsd.org/D13910

# 08df8f82 14-Mar-2019 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Use uname as ABI_FILE

uname is always rebuild on FreeBSD so use this as ABI_FILE for pkg when
building pkg for pkgbase.
pkg uses uname too as default ABI_FILE as of commit d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599
https://github.com/freebsd/pkg/commit/d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599

Discussed with: bapt
MFC after: 1 week

# 328dcc68 12-Mar-2019 Wolfram Schneider <wosch@FreeBSD.org>

`make buildworld' should display the build time in seconds

PR: 224433
Reviewed by: emaste, @bdrewery
Approved by: cem
Differential Revision: https://reviews.freebsd.org/D13911

# 92dec625 19-Dec-2018 Mateusz Guzik <mjg@FreeBSD.org>

Remove iBCS2: plug a wart missed in r342242

Sponsored by: The FreeBSD Foundation

# 466ed83b 12-Dec-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: update stale wpa dependency removal statement

Only stale .depend files are removed; do not mention object files.

# 457e6311 10-Dec-2018 Ed Maste <emaste@FreeBSD.org>

Clean stale wpa dependencies and objects after r341759

The wpa update added some source files with the same name as a file in
another directory (found via .PATH in the previous version). Having a
stale entry in a .depend file means the new file won't be built, so test
for this case and if found remove all of wpa's dependency files.

MFC with: r341759
Sponsored by: The FreeBSD Foundation

# c10d927c 05-Dec-2018 Alex Richardson <arichardson@FreeBSD.org>

Fix newvers.sh with BUILD_WITH_STRICT_TMPPATH=1

newvers.sh runs mkfifo which did not exist before this change.
However, I didn't notice before because it is run from a function
where a missing command does cause a noticeable failure.

Reviewed By: emaste, markj
Differential Revision: https://reviews.freebsd.org/D18377

# 7dc61ac1 04-Dec-2018 Andrew Turner <andrew@FreeBSD.org>

Only gnu/lib/csu when MK_BSD_CRTBEGIN is off.

We were still building it from Makefile.inc1. Disable it there so we don't
try to build the GNU crtbegin/crtend when the BSD version was asked for.

PR: 233733
Reported by: lwhsu
Reviewed by: emaste
MFC with: r339738
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18428

# 6edf2846 18-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Fix -DNO_CLEAN amd64 build after r340463

Without this change I got the following error:
clang-7: error: no such file or directory: '..../lib/libc/amd64/string/bzero.S'

Reviewed By: mjg
Differential Revision: https://reviews.freebsd.org/D18031

# 8643808a 13-Nov-2018 Glen Barber <gjb@FreeBSD.org>

In followup to r340406, remove doc from the EXTRA_DISTRIBUTIONS
list and remaining references from the script used to create the
MANIFEST file used by bsdinstall(8).

No MFC is planned at this time.

Sponsored by: The FreeBSD Foundation

# 0a9fcf32 07-Nov-2018 Brooks Davis <brooks@FreeBSD.org>

Add a top-level make target to rebuild all sysent files.

The sysent target is useful when changing makesyscalls.sh, when
making paired changes to syscalls.master files, or in a future where
freebsd32 sysent entries are built from the default syscalls.master.

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

# cd6b0f0e 06-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Turn off BUILD_WITH_STRICT_TMPPATH by default

Building with a strict $PATH (without inheriting from the parent
environment) still causes build failures in some workflows/environemnts
that I have not yet tested.
I will try to bring this back once these issues have all been resolved
since it is actually extremely useful in tracking broken dependencies
and wrong assumptions about the build environemt.

Discussed With: brooks

# 4805dd68 06-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Remove btxld from symlinked host tools

It is only present on amd64/i386 systems which breaks buildworld on
other hosts. In fact there is no need to add it to the bootstrap tools
list since it is already included in the cross-tools phase.
However, for cross-tools it was only built if the host and target
architecture didn't match. After this change it is also built when we
are builtin with a strict $PATH.

Reported By: mmel

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

Keep inheriting $PATH when using system linker/compiler

I missed this case when testing r340157. For now just keep
$PATH when we aren't bootstrapping a compiler so that the build
can find cc/c++/ld without an absolute path.

Reported by: yuripv

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

Build the elftoolchain libraries as part of bootstrap-tools

It is not necessary to build libelf and libdwarf this early. Furthermore,
when building on Linux/MacOS, m4 will only be built during the bootstrap
tools phase and not be available in $PATH before.

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

# 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

# 9117dffc 31-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Avoid binutils test in cleandir/obj stages

Further to r339946 skip the .error case for lack of in-tree binutils
support when we haven't set the toolchain feature variables.

Discussed with: arichardson
Sponsored by: The FreeBSD Foundation

# d6be9fdd 31-Oct-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't run cc --version during cleandir/obj stages

This will no work when there is no cc in $PATH (which is the case before the
cross-tools stage once we no longer inherit $PATH in $WMAKE).
The variables set by bsd.compiler.mk/bsd.linker.mk are not needed in these
stages so this avoids a little bit of makefile parsing.

Reviewed By: emaste
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16814

# f4cbc81d 25-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Update elftoolchain bootstrapping test after r339083

Sponsored by: The FreeBSD Foundation

# 5acedb55 23-Oct-2018 Ed Maste <emaste@FreeBSD.org>

sort {delete,check}-old* output

It is more convenient to review old libraries, files, and directories
in order.

Sort check-* after checking for existence of files for efficiency, and
because /usr/lib/debug entries are added while iterating over the list.

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

# 74f65486 23-Oct-2018 Alex Richardson <arichardson@FreeBSD.org>

Only compute the X_COMPILER_*/X_LINKER_* variables when needed

When building CheriBSD we have to set XLD/XCC/XCFLAGS on the command line.
This triggers the $XCC != $CC case in bsd.compiler.mk (and the same for LD
in bsd.linker.mk) which causes it to call ${XCC} --version and
${XLD} --version (plus various awk+sed+echo calls) in every subdirectory.
For incremental builds and stages that only walk the source tree this is
often the majority of the time spent in that directory.

By only computing the value of the X_COMPILER_*/X_LINKER_* variables if
_WANT_TOOLCHAIN_CROSS_VARS is set we can reduce the number of cc/ld calls
to once per build stage instead of once per recursive make.

With this change (and no changes to the sources) the `make includes` stage
now takes 28 seconds at -j1 instead of 86 seconds.

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

# 730a7ce9 22-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: clean up stale dependency hacks

Our dependency tracking cannot directly cope with certain source tree
changes, particularly with respect to removing or moving source files or
replacing generated files. We have a collection of ad-hoc workarounds
to handle these cases. As there is a (small) build-time cost inherent
in these workarounds, we do not want to keep them indefinitely. Thus,
remove workarounds from 2017.

Sponsored by: The FreeBSD Foundation

# fc191b11 20-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Introduce src.conf knob to build userland with retpoline

WITH_RETPOLINE enables -mretpoline vulnerability mitigation in userland
for CVE-2017-5715.

Reported by: Peter Malcom
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17421

# b9583179 18-Oct-2018 Glen Barber <gjb@FreeBSD.org>

- Update head to 13.0-CURRENT.
- Bump MACHINE_TRIPLE, TARGET_TRIPLE, FBSD_MAJOR, FBSD_CC_VER,
FREEBSD_CC_VERSION, OS_VERSION.
- Update comment in UPDATING regarding debugging options.
- Remove debug.witness.trace=0 from installation media.
- Bump __FreeBSD_version.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# bfe5c1dc 13-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: clean up dependencies after r339348

r339348 switched bcopy from .s to .c. Add ad-hoc dependency cleanup
as done for similar cases.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

# e4a41be5 12-Oct-2018 Dag-Erling Smørgrav <des@FreeBSD.org>

Replace libldns's bootstrap dependency on libcrypto with one on libssl
(which in turn has a bootstrap dependency on libcrypto).

Submitted by: jkim
Approved by: re (gjb)

# d97bf519 11-Oct-2018 Dag-Erling Smørgrav <des@FreeBSD.org>

Move libssl up in the bootstrap order.

Submitted by: jkim
Approved by: re (gjb)

# 539a27e1 09-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Switch ntp's embedded libevent to 2.1.18

For OpenSSL 1.1.1 compatibility.

In Makefile.inc1 add (to the existing similar cases) a hack to handle
dependencies across the migration.

Reviewed by: jhb
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation.
Differential Revision: https://reviews.freebsd.org/D17481

# 0c0c965a 06-Sep-2018 John Baldwin <jhb@FreeBSD.org>

Re-enable kernel modules for the MALTA64EL kernel configuration.

Update the BOOTSTRAPPING check for libelf to require the fix for
mips64el object files committed in r338478 and re-enable kernel
modules in the MALTA64EL config file.

Reviewed by: emaste
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17054

# 26ffc1ab 28-Aug-2018 Li-Wen Hsu <lwhsu@FreeBSD.org>

Fix 'install: symlink usr/src/sys -> /sys: File exists' in distributeworld

Follow r334617, specify ${DISTDIR} (by ${INSTALL_DDIR}), '/base' and add
${INSTALLFLAGS} while installing the '/sys' symbolic link.

Reviewed by: bapt (earlier version), markj
Approved by: re (gjb), markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16877

# c97e5167 23-Aug-2018 Alex Richardson <arichardson@FreeBSD.org>

Only bootstrap localedef if ${MK_LOCALES} != "no"

During the build it is only used by share/ctypedef and share/colldef
which will not be built if ${MK_LOCALE} == "no". This saves a tiny bit
of time when building without locales.

Approved By: jhb (mentor)

# 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

# 7920ad94 17-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

libbe(3): Move build goop back out of cddl/

Some background: in the GSoC project, libbe/Makefile lived in lib/libbe. I
created projects/bectl branch, maintained the above for all of five
minutes before I misread Makefile.inc1 and decided that it couldn't possibly
build outside of cddl/, so I kicked the Makefile out into the cddl/ build
and all was good. The misreading was of the bit where .WAIT is added to
SUBDIR after lib, libexec but prior to building bin and cddl *only during
the install targets*, which is the critical part.

Fast forward- buildworld was still broken in my branch unbeknownst to me
because I didn't nuke my OBJDIR. Combing through Makefile.inc1 eventually
revealed the necessary magic to make sure that libbe's dependencies are
specified well enough, and it becomes clear what needs done to make a
non-cddl/ build work. This is an interesting prospect, because the build
split is kind of annoying to work with.

IGNORE_PRAGMA is added to avoid dropping WARNS by one more. This was
previously pulled in via cddl/Makefile.inc.

# 49f1692a 17-Aug-2018 Bjoern A. Zeeb <bz@FreeBSD.org>

METALOG, unless manually overwritten, is defined as ${DESTDIR}/${DISTDIR}/METALOG

In the create-world-packages target we manually piece this together (unless
it is undefined), without the DISTDIR. Normally DISTDIR is empty (unset) and
no one notices. Now DISTDIR is a well known long-standing PORTS environment
variable and if that is set in the local environment the path to METALOG
is wrong as it no longer is ${DESTDIR}/METALOG.

Long-term we should start to avoid "publicly well known" names for global
variables, for now just piece ${DISTDIR} in as well. This allows
create-world-packages to continue if DISTDIR is set in the env.

# 2502c66b 17-Aug-2018 Roger Pau Monné <royger@FreeBSD.org>

build: skip the database check when generating install media

There are several scripts and targets solely used to generate install
media, make sure DB_FROM_SRC is used in that case in order to prevent
checking the host database, which is irrelevant when generating
install binaries.

Sponsored by: Citrix Systems R&D
PR: 230459
Reviewed by: gjb
Differential revision: https://reviews.freebsd.org/D16638

# 35d2028f 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

libbe(3)/bectl(8): More SYSROOT/GCC build fixes

- Missing include path
- Fully specify libzfs's dependencies (except for deps pulled in by other
deps) in Makefile.inc1
- Drop WARNS back down to 2 for libbe(3). I do this with much hesitation,
but the libzfs headers are apparently a hot warning-filled mess as far as
GCC 4.2 is concerned.

# f335e41b 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

Add libzfs to prebuild_libs, libbe dependency on libzfs

# 2b720021a 09-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

Makefile.inc1: Add libl to -legacy as well

libl is needed for config(8), which is a bootstrap-tool. It is possible to
build a system WITHOUT_TOOLCHAIN to exclude lex and thus, libl. We still
need to support building from this kind of host, though.

While here, group the config(8) dependencies together and add a small
explanation. These can likely both be scoped more clearly, but this will
need some further investigation.

Reported by: rgrimes (not WITHOUT_TOOLCHAIN, but provoked investigation)
MFC after: immediately

# d0f408fa 08-Aug-2018 Roger Pau Monné <royger@FreeBSD.org>

build: skip the database check for the distributeworld target

distributeworld is used to generate install media, so it makes no
sense to check the host database since the install media can be
generated from any box, regardless of the version of FreeBSD it's
running.

Sponsored by: Citrix Systems R&D
Reviewed by: ian, gjb
Differential revision: https://reviews.freebsd.org/D16507

# 9898e6df 22-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Alpha-sort the list of user/group IDs to check at install time.

# fd46d8a8 22-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Remove the .if ${MK_FOO} wrappers around the user/group ID checks. These
names are referenced in mtree files without any conditional logic, so the
users/groups must exist even if the corresponding tool(s) are disabled.

# 07b95333 19-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Add ntpd to the list of users/groups to check before installing.

# 8b6b96c9 17-Jul-2018 Warner Losh <imp@FreeBSD.org>

As discussed several times on freebsd-arch, start to decommission armeb.

Remove armeb/arm from KNOWN_ARCHS.
Remove armeb from arm universe targets.

Differential Revision: https://reviews.freebsd.org/D16257

# 44a83ae3 16-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

Unconditionally build libnv in legacy

Rather than using a config(8) built from new tree linking libnv built on
host.

# 0d26206d 10-Jul-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix parsing of create-kernel-packages

MFC after: 3 days
Reported by: rene

# 88171893 05-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

config(8): De-dupe hint/env vars within a single file

r335653 flipped the order in which hints/env files are concatenated to match
the order in which vars are processed by the kernel. This is the other
hammer to drop.

Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the
latest value specified for a key. This leaves some duplicates if a variable
is specified in multiple hint/env files or via `envvar` in a kernel config,
but the reversed order of concatenation (from r335653) makes this a
non-issue as the latest-specified version will be seen first.

This change also silently rewrote hint bits to use the same sanitization
process that ian@ wrote for r335642. To the kernel, hints and env vars are
basically the same thing through early boot, then get merged into the
dynamic environment once kmem becomes available and the dynamic environment
is created. They should be subjected to the same restrictions.

libnv has been added to -legacy for the time being to support the build of
config(8) with the new cnvlist API.

Tested with: universe (11 host & 12 host)
MFC after: 1 month

# 417d105f 05-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

Revert r336011,r336012 until I can competently test

# f1e0a986 05-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

Fix build after r336011

Add libnv to bootstrap-tools, use ${SRCTOP}/sys headers.

# d0338de5 01-Jul-2018 Wolfram Schneider <wosch@FreeBSD.org>

`make installworld' should display "completed" message if done

PR: 225159
Reviewed by: bdrewery
Approved by: cem (mentor)
Differential Revision: https://reviews.freebsd.org/D14057

# 2e90942f 30-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Fix clang-tblgen flip-flop building after r335707.

The build of this would have MK_LLVM_TARGET_ALL=yes for bootstrap-tools
but MK_LLVM_TARGET_ALL=no for cross-tools and thus would rebuild between
the two.

MFC after: 2 weeks
X-MFC-with: r335707
Sponsored by: Dell EMC

# 55a5b46a 29-Jun-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't change directory owner to root when building with -DNO_ROOT

Currently the mtree calls in Makefile.inc1 all change the directory owner
to match the spec file. However, we should not be doing this during
distributeworld if -DNO_ROOT is passed. Additionally, when creating the
WORLDTMP directory hierachy there is no need to change the owner to root so
we now always pass the -W flag when populating WORLDTMP.

This is also required for building FreeBSD on Linux/Mac since the required
groups/users will not exist there which is how I discovered this issue.

Reviewed By: emaste, bdrewery, imp
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D14185

# 8706983f 28-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix unknown target check after r335450.

X-MFC-with: r335450
Pointyhat to: bdrewery
Sponsored by: Dell EMC

# 151578dc 28-Jun-2018 John Baldwin <jhb@FreeBSD.org>

Remove the various build flag hacks for GCC cross-compile.

The xtoolchain GCC packages have not required these flags since ports
commits r465416 and r466701. The in-tree GCC 4.2.1 has also been patched
in r335716 and r335717 to correctly honor --sysroot when looking for
includes and libraries.

Reviewed by: bdrewery
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D16055

# 52b7824b 28-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER/LINKER: Fix cross-build support after r335706.

X-MFC-With: r335706
MFC after: 2 weeks
Sponsored by: Dell EMC

# f59e5352 28-Jun-2018 Brad Davis <brd@FreeBSD.org>

Simplify using bsd.endian.mk and have it provide CAP_MKDB_ENDIAN, since it is
the most common usage.

Approved by: bapt (mentor)

# 7c3f17c5 27-Jun-2018 Brad Davis <brd@FreeBSD.org>

Chase the pwd_mkdb endian changes.

Approved by: bapt (mentor)

# 01f124b4 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

tinderbox: Only build clang/lld once if needed.

Need to handle LLD_BOOTSTRAP separately (for archs like i386).
This would be much better off with an off-by-default option like
SHARED_TOOLCHAIN that universe force-enabled. Then a normal buildworld
would store the toolchain there if enabled and otherwise in WORLDTMP
with only the 1 arch selected.

MFC after: 3 weeks
Sponsored by: Dell EMC

# eed6d55d 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Clang: Only build needed target for bootstrap compiler.

This will disable the new LLVM_TARGET_ALL option which will only
enable the required target.

This only impacts the bootstrap compiler in WORLDTMP, not the target compiler
that will be installed.

MFC after: 2 weeks
Reviewed by: sbruno, dim (earlier version)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16021

# 631e709f 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Add LLVM_TARGET_ALL option.

LLVM_TARGET_* will auto be set based on LLVM_TARGET_ALL and MK_CLANG.

If LLVM_TARGET_ALL is disabled, during a cross-build, then SYSTEM_COMPILER
and SYSTEM_LINKER are auto disabled.

This option should be used by users rather than the per-arch LLVM_TARGET
options as it is simpler to maintain for them should the supported
target list change.

MFC after: 2 weeks
Reviewed by: sbruno, dim
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16020

# e4b0a90e 25-Jun-2018 Brooks Davis <brooks@FreeBSD.org>

Normalize the g(eom,cache,part,...) build.

Rather then combining hardlink creation for the geom(8) binary with
shared library build, move libraries to src/lib/geom so they are
built and installed normally. Create a common Makefile.classes
which is included by both lib/geom/Makefile and sbin/geom/Makefile
so the symlink and libraries stay in sync.

The relocation of libraries allows libraries to be build for 32-bit
compat. This also reduces the number of non-standard builds in
the system.

This commit is not sufficent to run a 32-bit /sbin/geom on a 64-bit
system out of the box as it will look in the wrong place for libraries
unless GEOM_LIBRARY_PATH is set appropriatly in the environment.

Reviewed by: bdrewery
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15360

# 9b844631 21-Jun-2018 Ed Maste <emaste@FreeBSD.org>

Rename usr.bin/elfcopy to usr.bin/objcopy

We always install ELF Tool Chain's elfcopy as objcopy, so to avoid
confusion rename the src directory containing our reach-over Makefile
to match.

Requested by: jhb
Sponsored by: The FreeBSD Foundation

# cb623f63 20-Jun-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: rename build metadata file to toolchain-metadata.mk

The metadata file contains more than just compiler metadata.

Discussed with: bdrewery

# 6e6be2bb 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Reduce exec and fstat overhead for non-build targets.

This is mostly targetting 'make showconfig' and 'make test-system-*' for
the benefit of makeman and universe-one-clang work.

Sponsored by: Dell EMC

# a7d84af8 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Add WITH_SYSTEM_LINKER, on by default, that avoids building lld when possible.

This works similar to WITH_SYSTEM_COMPILER added in r300354. It only
supports lld via WITH_LLD_BOOTSTRAP.

When both SYSTEM_COMPILER and SYSTEM_LINKER logic passes then libclang
will not build in cross-tools. If either check fails though then
libclang is built.

The .info is reworked to notify when libclang will be built since if
either clang or lld needs to be rebuilt, but not the other, the
notification can lead to confusion on why "clang is building".

-fuse-ld= is not used with this method so some combinations of compiler
and linker are expected to fail.

A new 'make test-system-linker' target is added to see the logic results.

Makefile.inc1:
CROSS_BINUTILS_PREFIX support had to be moved higher up so that XLD
could be set and MK_LLD_BOOTSTRAP disabled before checking SYSTEM_LINKER
logic as done with SYSTEM_COMPILER. This also required moving where
bsd.linker.mk was read since XLD needs to be set before parsing it. This
creates a situation where src.opts.mk can not test LINKER_FEATURES or
add LLD_BOOTSTAP to BROKEN_OPTIONS.

Reviewed by: emaste (earlier version)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15894

# 78187278 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Rework WITHOUT_LLD/TOOLCHAIN fix from r327892 for cross-tools.

MK_LLD is for the installed lld while MK_LLD_BOOTSTRAP is for the build
tool. For WITH_SYSTEM_LINKER it is necesarry to separate the logic of
these two. When building libllvm TOOLS_PREFIX will be defined and
MK_LLD_BOOTSTRAP should be checked instead.

Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15837

# d74021d6 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Rework how the ld link is handled in WORLDTMP from r322811.

LLD_BOOTSTRAP (build) is independent of LLD_IS_LD (installed) so they
should not be based on each other.

This is related to upcoming WITH_SYSTEM_LINKER work.

Reviewed by: emaste
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15836

# 2d2aba18 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

TARGET_TRIPLE is needed much earlier now for CROSS_BINUTILS_PREFIX check.

This was missed in r335394 since the check became exists(/usr/local) in
my testing.

X-MFC-With: r335394
MFC after: 2 weeks
Sponsored by: Dell EMC

# d18e2bca 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix detection for binutils bootstrap package.

The path was changed recently in the port to be the full target triple.

MFC after: 2 weeks
Sponsored by: Dell EMC

# 4d64cb78 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Let CROSS_BINUTILS_PREFIX work without a trailing slash.

Reported by: jhb
MFC after: 2 weeks
Sponsored by: Dell EMC

# 8a854b36 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER: Should use X_ vars for comparing wanted version.

It is XCC used during the build of target binaries that replaces the
bootstrap compiler.

Also slightly tweak style.

MFC after: 2 weeks
Sponsored by: Dell EMC

# aafc3339 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix X_COMPILER_* and X_LINKER_* not being passed to installworld environment.

This could lead to 'sh: head: not found' warnings which were a symptom
of running 'ld --version' during installworld. This was only happening
with XCC or XLD set. It is intended that cc and ld do not run during
installworld. The metadata for these are already stored in
compiler-metadata.mk added in r316794.

This also removes redundant CROSSENV additions that were for
WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, and WITHOUT_TOOLCHAIN
which all don't have a cc or ld in their PATH during install.

Reported by: Mark Millard
MFC after: 2 weeks
Sponsored by: Dell EMC

# cf43faaa 18-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Don't bootstrap lld if an external linker is used.

Sponsored by: Dell EMC

# 2a821fd9 17-Jun-2018 Ian Lepore <ian@FreeBSD.org>

Build LOCAL_LIB_DIRS along with system lib dirs, rather than building them
in parallel with LOCAL_DIRS and all the other system post-libs stuff.

# f39bffc6 16-Jun-2018 Konstantin Belousov <kib@FreeBSD.org>

Rework ofed build.

Aligns the build with the FreeBSD traditional approach to not build in
contrib/, and to track inter-dependencies between libraries.

With help from: bdrewery
Reviewed by: bdrewery, hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D15648

# 4e3db1e0 15-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Assert that a build is done before an install.

This should also catch cases where the wrong MAKEOBJDIRPREFIX is used for
install.

MFC after: 2 weeks
Sponsored by: Dell EMC

# 6f1f2b19 15-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Only build jevents if MK_PMC is yes and only for amd64 in libcompat.

Sponsored by: Dell EMC

# 8590505f 09-Jun-2018 Mark Johnston <markj@FreeBSD.org>

Bump __FreeBSD_version after r334881 and force libdwarf to be rebuilt.

Reported by: O. Hartmann <ohartmann@walstatt.org>
Reviewed by: bdrewery

# 521ef556 05-Jun-2018 Ed Maste <emaste@FreeBSD.org>

Handle -DNO_CLEAN builds across brk/sbrk rewrite in r334626

Sponsored by: The FreeBSD Foundation

# 8dc84f09 04-Jun-2018 Brad Davis <brd@FreeBSD.org>

Move /sys symlink creating out of etc/Makefile.

This is prep for etc/Makefile going away.

Approved by: bapt (mentor)

# 7d1c2b74 31-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmc/pmu: enable for i386 as well

# 41e258c4 30-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmc/jevents: fix cross-compile _to_ amd64

Reported by: emaste

# 959826ca 26-May-2018 Matt Macy <mmacy@FreeBSD.org>

pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
vendor provided pmu-events tables and sundry cleanups.

The vendor pmu-events tables provide counter descriptions, default
sample rates, event, umask, and flag values for all the counter
configuration permutations. Using this gives us:

- much simpler kernel code for the MD component
- helpful long and short event descriptions
- simpler user code
- sample rates that won't overload the system

Update man page with newer sample types and remove unused sample type.

# 5506ceb8 26-May-2018 Matt Macy <mmacy@FreeBSD.org>

Revert r334242 "pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the"
because of squash commit messages

# 49281356 26-May-2018 Matt Macy <mmacy@FreeBSD.org>

pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
vendor provided pmu-events tables and sundry cleanups.

The vendor pmu-events tables provide counter descriptions, default
sample rates, event, umask, and flag values for all the counter
configuration permutations. Using this gives us:

- much simpler kernel code for the MD component
- helpful long and short event descriptions
- simpler user code
- sample rates that won't overload the system

Update man page with newer sample types and remove unused sample type.

Squashed commit of the following:

commit 4459d43eff815bec08ccc5533dbe5de846f03128
Author: Matt Macy <mmacy@mattmacy.io>
Date: Sat May 26 00:06:31 2018 -0700

libpmc: fix pmu function signatures for non amd64

commit a2cb8bbc586c65d41f9b291430a2261ec67b59fe
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:38:11 2018 -0700

pmcstat: fix indentation of usage

commit f686954b15ff56a833ac80404898977cb80a265b
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:19:49 2018 -0700

pmclog(3): add callchain and pmcallocatedyn, remove pcsample

commit 73e13a0d2e9498c81c150d14d022050cee7511bb
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:19:00 2018 -0700

pmclog.h: GC pcsample field

commit 3e93ffd65da641fa657539dad3c48e281f8b5798
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:05:57 2018 -0700

hwpmc: make Intel core CPUs use external event tables

commit 634f5fae1e1644ac324003136c66cd9c619d1c93
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:00:06 2018 -0700

pmclog: update log record types, bump PMC_MAJOR
- explicitly make log record types a multiple of 8 bytes
- hook in pmu event types for pmc_allocate records
- remove references to no longer PCSAMPLE record

commit 83d84fcd2d65bdf6ddcb2e155a22f0cfa2a9c225
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 21:52:10 2018 -0700

libpmc: add support for having vendor table driven pmc_allocate

commit 9e6ad63c40c2fce8404847ace5078ca6cb33a736
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 19:11:33 2018 -0700

hwpmc_core: add accessors for EVSEL & UMASK, make IAP_UMASK useful to user

commit 859dceb93daa6419a48c794db99b6758e5b041c9
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 19:09:45 2018 -0700

pmcstat: update usage and man page as well as make -L consistent with pmccontrol

commit 79c7d8597e28c2eb13f5f9113e65ec2792ca57b1
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 18:07:03 2018 -0700

pmu_util: add support for all current intel event keywords

commit d8089c7f6a6c8527f38324252b1ffb47004694c6
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 17:45:00 2018 -0700

add description for new arguments

commit 058336740bab53c62ec88a3a026ea848cf3878c6
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 17:38:15 2018 -0700

libpmc: move pmu_events table and pmu_utils out of libpmcstat so that they can be used by pmc_allocate

commit 049b66b382e2f833c3f47bc8df9e750cb265709f
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 16:12:41 2018 -0700

pmcstat: hook pmu_events counter description utility routines in

commit f5e01e7b37a691dc045e1aa16b3ebdd162515de8
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 16:11:59 2018 -0700

pmu_events: add utility routines for listing counters and their descriptions

commit cba4d4f8907f772279f86f18f915e0d74d33ac56
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 16:09:50 2018 -0700

pmu-events: expand out skylake regex to simplify string matches

# c2decc35 25-May-2018 Brooks Davis <brooks@FreeBSD.org>

Support -DNO_CLEAN builds across r334223+r334224.

# 77301553 24-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmcstat: Don't build pmu tables on !amd64 until the corresponding
util routines have been written and tested. Currently building them
breaks the build on power64

Reported by: emaste

# 810c4dcd 24-May-2018 Brooks Davis <brooks@FreeBSD.org>

exect() was removed in 2018, not 2017.

# e98bbcf9 23-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmcstat: compile in events based on json description

# 754a9d6c 27-Apr-2018 Ed Maste <emaste@FreeBSD.org>

Bump min supported release for building HEAD to 10.3

r307825 and r333017 disallow building FreeBSD-HEAD from 9.x or 10.x
versions that have some clang issues. The minimum supported Subversion
revisions and osreldates containing the fix are:

Version Min Rev osreldate
9.x r286035 903509
10.x r286033 1002501

9.3 is the final 9.x release and does not contain the r286035 fix.
10.3 is the first 10.x release with the fix. Thus, in practice 10.3 is
the oldest release that can build HEAD.

Although it may still be possible to build HEAD from an up-to-date
stable/9 it's not worth maintaining the special case when the branch
itself is unsupported and there are no usable releases from that branch.

Old UPDATING entries can be removed and the Clang warning in UPDATING
may be updated, in a future commit.

Approved by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15209

# 27d86a1c 26-Apr-2018 Ed Maste <emaste@FreeBSD.org>

Correct r307825 BOOTSTRAPPING test for unsupported upgrade

__FreeBSD_version has five digits after the major number, but the min
versions in the test had an extra 0 (so the test was always false).

# d3292755 12-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN builds across r332443.

# d9b41671 06-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Support -DNO_CLEAN builds across r332119.

# e4e7a46b 05-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN buildworld after r332080.

# 523bfea2 04-Apr-2018 Ed Maste <emaste@FreeBSD.org>

remove special handling for stale ptrace dependencies

r318957 added special handling for stale ptrace dependency files to
support a -DNO_CLEAN build in a tree last built before r305012. That
revision is now over a year and a half old, so retire the special case.

Sponsored by: The FreeBSD Foundation

# 62d6bc39 04-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN builds over r332048.

# af94761a 20-Mar-2018 Ed Maste <emaste@FreeBSD.org>

Correct comment date in r331255

Reported by: jhb

# aa9ceac4 20-Mar-2018 Ed Maste <emaste@FreeBSD.org>

Remove stale generated assym.s files after r331254

So that -DNO_CLEAN builds work.

This should be reverted after a sufficient transition period (perhaps 3
or 6 months).

Sponsored by: The FreeBSD Foundation

# fb6d3be5 14-Mar-2018 Kyle Evans <kevans@FreeBSD.org>

pkgbase: Fix post-install script for kernel packages

kernel.ucl uses a hardcoded boot/kernel for kldxref, which is the incorrect
directory when we're installing extra kernels that aren't the "default"
kernel (placed at boot/kernel).

Fix this by instead using a new %KERNELDIR% that we now replace in
Makefile.inc1 with "kernel" for the default kernel and "kernel.${_kernel}"
for these extra kernels so that, e.g. /boot/kernel.SHIVA, will get properly
kldxref'd upon update and avoid outdated linker.hints.

Reviewed by: gjb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14689

# 2f513483 26-Feb-2018 Brooks Davis <brooks@FreeBSD.org>

Improve wording of error message when CROSS_TOOLCHAIN is not found.

Reported by: emaste, jhb

# 0df651d7 25-Feb-2018 Brooks Davis <brooks@FreeBSD.org>

Allow CROSS_TOOLCHAIN to be a path to a file.

This allows working with custom cross toolchains without the need to
create files in /usr/local/share/toolchains.

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

# 55927f28 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Properly lookup values if they were empty.

Spotted by: rpokala
X-MFC-With: r329676
MFC after: 2 weeks
Sponsored by: Dell EMC

# 0f8995a9 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Only lookup SVN once and rename to SVN_CMD.

MFC after: 2 weeks
Sponsored by: Dell EMC

# c0d9f07d 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Avoid looking up VCS_REVISION for every sub-make call to Makefile.inc1.

MFC after: 2 weeks
Sponsored by: Dell EMC

# 49a1108a 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Move SVNVERSION_CMD into the one place that uses it.

This code, which is basically `svnversion || svnliteversion`, generates
2 fstatat(2) for every directory in PATH for every Makefile parsed that
includes bsd.own.mk. This can add up for things like generating a Ports
index (Poudriere) or building a dependency graph for base.

Sponsored by: Dell EMC
MFC after: 2 weeks

# c1c35c10 09-Feb-2018 Warner Losh <imp@FreeBSD.org>

sort needs to be in ITOOLS since find -s was changed to find | sort.

# 207efdb3 07-Feb-2018 Warner Losh <imp@FreeBSD.org>

Add a note about why we have the conditional before including
bsd.compiler.mk. It's so fmake from older 9.x systems still
works (still a supported build config, and having the note here
will let us know when we can cull it more easily).

Also pull in a related change from include to sinclude from
arichardson@'s cross building work, as well as it's companion in
Makefile.inc1 with a note about why we do the odd thing there.

Submitted by: archardson
Differential Revision: https://reviews.freebsd.org/D14241

# 48164080 07-Feb-2018 Ed Maste <emaste@FreeBSD.org>

add retpoline compiler and linker feature flags

These features indicate that the compiler and linker support the
retpoline speculative execution vulnerability (CVE-2017-5715)
mitigation.

Reviewed by: dim, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14228

# fb1df203 06-Feb-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't hardcode /usr/bin as the path for mktemp in build tools

It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is in
/bin there.

Reviewed By: bdrewery
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D13937

# a564880c 25-Jan-2018 Wolfram Schneider <wosch@FreeBSD.org>

`make installkernel' should display a completed message if done

PR: 225159
Reviewed by: bdrewery
Approved by: cem (mentor)
Differential Revision: https://reviews.freebsd.org/D13940

# 553b3bb8 24-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

test-system-compiler: Display X_ variants for compiler/linker.

Sponsored by: Dell EMC

# 1c0cac23 24-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

X_COMPILER_* may not be defined.

Sponsored by: Dell EMC

# ebe45c64 16-Jan-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't build share/syscons in build-tools stage if MK_SYSCONS == "no"

Reviewed By: emaste, jhb
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12926

# fe8be588 12-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Ensure MK_LDD for bootstrap-tools matches MK_LLD_BOOTSTRAP.

This fixes building libllvmminimal with MK_LLD support when WITHOUT_LLD
or WITHOUT_TOOLCHAIN are set, which are install flags not build tools
flags.

Reported by: sbruno
Tested by: sbruno
Sponsored by: Dell EMC

# d52c29e7 11-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Cache LINKER_FEATURES to fix the wrong ones being used.

Submitted by: Dan McGregor <dan.mcgregor@usask.ca>

# e93e5bb0 31-Dec-2017 Ian Lepore <ian@FreeBSD.org>

Allow use of .WAIT in the LOCAL_DIRS and LOCAL_LIB_DIRS lists.

A comment in Makefile.inc1 has long stated that LOCAL_DIRS are built last,
after the base system. Incremental improvements in parallel building over
the years have led to LOCAL_DIRS being built in parallel with base system
directories. This change allows the .WAIT directive to appear in LOCAL_DIRS
and LOCAL_LIB_DIRS lists to give the user some control over parallel
building of local additions.

Differential Revision: https://reviews.freebsd.org/D13622

# 3670d4c7 05-Dec-2017 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: map mips MACHINE_/TARGET_ARCH to triples

This helps Clang MIPS builds.

Reviewed by: bdrewery, jhb (earlier version)
Differential Revision: https://reviews.freebsd.org/D12171

# 9b43e3da 05-Dec-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Ensure GCC files are cleaned up.

Because we force enable MK_GCC when building we need to also force
enable it for the cleaning phase. Otherwise the NXB_TARGET files
are found in the next build's kernel-toolchain phase and cause
an error.

Reported by: sbruno
X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC

# 4a51c708 04-Dec-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Fix build without META_MODE for GCC archs.

The initial kernel-toolchain is built with TARGET=MACHINE but
we want GCC to have files generated for TARGET=NXB_TARGET
instead later on. Just clean the files between building of
the toolchain and nxb binaries which will let it rebuild
when needed.

Reported by: sbruno
X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC

# 388290b8 24-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix for multi-threaded lib32 compat build on amd64.

Sponsored by: Mellanox Technologies

# e8333057 24-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Simplify the build dependencies when building the OFED libraries.

Suggested by: bdrewery@
Sponsored by: Mellanox Technologies

# 937d37fc 18-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r325842 through r325998.


# 3faecc70 18-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make -n' for {reinstall,distribute}kernel.

PR: 201779
Sponsored by: Dell

# 7a310b06 16-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Update list of hardcoded OFED build order dependencies for
the buildworld target.

Sponsored by: Mellanox Technologies

# 92b800cc 15-Nov-2017 Ed Maste <emaste@FreeBSD.org>

Sort pkgbase mtree metadata, for reproducible builds

Packaged base packages are created by running the stageworld and
stagekernel targets with -DNO_ROOT, and converting the resulting mtree
file into a set of pkg plists. If stage* is run with multiple processes
the order of entries in the mtree file may be nondeterministic, and the
resulting package tbz also had nondeterministic file ordering.

The mtree file generated by -DNO_ROOT builds consists of one line per
file, with the filename starting in the first column, so is easily
sorted. There's one exception: the first line of the mtree file is a
comment, but the # character sorts before the filenames anyhow and needs
no special treatment.

PR: 223673
Reviewed by: bapt, gjb
Sponsored by: The Linux Foundation, Core Infrastructure Initiative
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13103

# ca987d46 14-Nov-2017 Warner Losh <imp@FreeBSD.org>

Move sys/boot to stand. Fix all references to new location

Sponsored by: Netflix

# 7202739f 13-Nov-2017 Alex Richardson <arichardson@FreeBSD.org>

Only build the libmagic build-tools if MK_FILE != no

Before this patch libmagic was always built in the build-tools phase
even if -DWITHOUT_FILE was specified.

Reviewed by: emaste, jhb
Approved by: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12925

# f649ab27 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

cleanworld only needs a tree walk if the expected .OBJDIR is .CURDIR.

Sponsored by: Dell EMC Isilon

# 9cde684d 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Fix for GCC archs.

- This also adds in a _cleanobj step as needed.
- This redirects TARGET/TARGET_ARCH to NXB_TARGET/NXB_TARGET_ARCH in
Makefile.inc1 as the main build needs to be for MACHINE rather
than TARGET.

First build the toolchain and then use that as an external toolchain
to build the needed directories and NXB_TARGET-toolchain, all as
MACHINE files though via TARGET_TRIPLE=MACHINE_TRIPLE.

The NXBDIRS is evaluated in the 'everything' submake as it needs to be
based on TARGET's src.opts.mk values, such as MK_GCC=yes when building
on a MK_CLANG=yes MACHINE. This can likely be changed to a specific
_native-xtools-everything target later and the funky late evaluation
of SUBDIR_OVERRIDE removed.

X-MFC-With: r325001
Pointyhat to: bdrewery
MFC after: 2 months
Sponsored by: Dell EMC Isilon

# ae9f7248 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

rescue ipf: Remove hacks and link in libipf directly.

Sponsored by: Dell EMC Isilon

# fa65e3a5 09-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Handle some .OBJDIR == .CURDIR cases.

- If OBJROOT is SRCTOP then don't add on TARGET.TARGET_ARCH. This
only happens at the top-level, and for sub-directories when the
user is clever with MAKEOBJDIRPREFIX=/.
- Don't bother checking 'test -w' on .CURDIR.
- Properly set OBJTOP/OBJROOT to SRCTOP in various needed cases.
- Check if the OBJDIR is writable even for *clean* targets since it
determines which .OBJDIR the user gets; If they cannot write to an
existing eligible .OBJDIR then it needs to clean in .CURDIR instead.
- Add guard to cleanworld/cleanuniverse from removing SRCTOP.
- Ensure OBJTOP is proper for .OBJDIR=.CURDIR which fixes finding
libraries since src.libnames.mk is based on OBJTOP.
- Avoid some chdir(2) for modifying .OBJDIR

Sponsored by: Dell EMC Isilon

# 3fa561a4 07-Nov-2017 Warner Losh <imp@FreeBSD.org>

Note interactive shell errors for make buildenv and add a warning for
people tempted to add back the || true to get rid of them.

Sponsored by: Netflix

# 996e4759 04-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix nested MAKEOBJDIRPREFIX breaking various release/buildworld/toolchain targets.

This problem was caused by r325329 and r325350.

For the release(7) targets, some will run mm-mtree.sh which itself runs make
with a MAKEOBJDIRPREFIX. The execution of that script leaks OBJROOT,
MAKEOBJDIR, and MAKELEVEL=1 in the environment. This causes the mm-mtree makes
to not do some basic setup of OBJROOT and only use this special
MAKEOBJDIRPREFIX case which fails to empty out MAKEOBJDIRPREFIX for further
nested makes, such as a tree walk. If that tree walk sets OBJROOT/OBJTOP such
as r325329 is doing, then the wrong OBJDIRs end up being used due to the
unemptied MAKEOBJDIRPREFIX being preferred over the proper MAKEOBJDIR.

Pointyhat to: bdrewery
Sponsored by: Dell EMC Isilon

# 2abeba9d 03-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r318105: Don't use NO_OBJ at top-level, use NO_OBJWALK.

NO_OBJ has a very specific meaning in sub-directories in that no object
directory will be made. If a user wanted to skip the 'make obj' phase then
passing -DNO_OBJ would break all sub-directories from building properly. Using
NO_OBJ internally also causes issue with NO_OBJ handling being added in
share/mk/bsd.init.mk soon.

Sponsored by: Dell EMC Isilon

# 2c36cefe 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r325329: Store all WORLDTMP objects back in the same directory.

This still keeps the reduced MAKEOBJDIRPREFIX (SRCTOP) redundancy
removed in the OBJDIR, but now keeps all early phase objects
in the same directory rather than split per phase.

The problem of splitting per phase is that later phases want to link in
libraries from earlier phases and base their location on ${OBJTOP}.

Pointyhat to: bdrewery
Reported by: mjoras, Mark Millard
Sponsored by: Dell EMC Isilon

# fe480405 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r325342: Always ensure WORLDTMP exists.

Reported by: Herbert J. Skuhra
Sponsored by: Dell EMC Isilon

# 89bd07e9 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

DIRDEPS_BUILD: Cleanup leftover WORLDTMP files.

This will force any existing objects to rebuild if their .meta
files reference files from WORLDTMP. This is a problem after
the UNIFIED_OBJDIR effort caused buildworld and DIRDEPS_BUILD
to share an OBJDIR. Without cleaning these files the
Makefile.depend files end up with odd tmp/legacy/... entries
since some bootstrap-tools linger from there and otherwise
don't rebuild. Removing the files causes anything having
used WORLDTMP to rebuild.

Sponsored by: Dell EMC Isilon

# 4dc89c4d 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Reduce MAKEOBJDIRPREFIX path spam by specifying a direct objdir to use.

Sponsored by: Dell EMC Isilon

# 3d165b2f 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools/xdev: Store these in a location including both MACHINE/TARGET.

Given MACHINE/MACHINE_ARCH=amd64, TARGET=arm64 and TARGET_ARCH=aarch64,
this change will build them in a location such as:
/usr/obj/usr/src/amd64.amd64/nxb/arm64.aarch64/
and
/usr/obj/usr/src/amd64.amd64/xdev/aarch64-freebsd/

Sponsored by: Dell EMC Isilon

# c10062b9 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add a 'make cleanuniverse'.

This will remove all build files for the source directory
when MK_UNIFIED_OBJDIR is enabled.

Sponsored by: Dell EMC Isilon

# dfa09989 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.

This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for
native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to
a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>. This
new format is used regardless of cross or native build. It allows
easier management of multiple source tree object directories.

The UNIFIED_OBJDIR option will be removed and its feature made permanent
for the 12.0 release.

Relnotes: yes (don't note UNIFIED_OBJDIR option since it will be removed)
Prior work: D3711 D874
Reviewed by: gjb, sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Discussed with: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12840

# f0696740 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Follow-up r325087: Need to build lib/clang before lld.

LLD needs headers generated by the full libllvm.

X-MFC-With: r325087
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 651c6845 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

kernel-toolchain: Fix improper build order after r325244.

Due to removing some targets that the previous .ORDER: ${WMAKE_TGTS}
set, it was no longer being respected; _build_tools was coming
immediately.

Pointyhat to: bdrewery
X-MFC-with: r325244
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 5a4121a8 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

kernel-toolchain: Skip world _obj and _cleanobj phases.

There's no good reason to treewalk the entire tree removing old OBJDIRS
and creating new ones when 'includes', 'libraries', and 'everything' are
all skipped. The only shared directory in the existing toolchain target
and world is build-tools. So handle cleaning in it directly if needed
only for the directories it wants to build.

The extra _obj/_cleanobj walks came in the initial kernel-toolchain
addition in r128189.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 7cd84b56 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

build-tools: De-special-case the gcc tools build.

It merely wanted to use 'all' rather than 'build-tools' so just
add a build-tools target to the Makefile.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 555c6e60 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r297998: Remove redundant TOOLS_PREFIX in XMAKE.

Sponsored by: Dell EMC Isilon

# 337698b7 30-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Allow SYSTEM_COMPILER to be used after r325001.

Now that a proper sysroot is used and a separate target list, it should
be safe to skip building the initial cross-compiler.

X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC Isilon

# 601594ed 30-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

cleanworld: No need to cleandir if MK_AUTO_OBJ is enabled.

Sponsored by: Dell EMC Isilon

# 0255bc13 29-Oct-2017 Warner Losh <imp@FreeBSD.org>

Return proper status from buildenv.

make buildenv BUILDENV_SHELL=<some command> more useful. Remove '||
true' from the command line so that errors are properly
returned. There appears to be no reason for it, and it dates back to
the original commit by ru@.

Sponsored by: Netflix

# be1ef37b 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Consolidate duplicate cross-tools build/install list into XDEVDIRS.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 86c4ac99 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Remove excess '/' since XDTP is asserted to be an absolute path.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# c16a698b 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Fix build for platforms needing LLD.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 57820ca8 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Add missing 'make obj' treewalk for 'make includes'.

It is possible that building headers requires an OBJDIR.
The other phases of xdev have their own 'make obj' calls
where needed, such as inside 'make libraries' itself.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 5bd47cc5 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Change native-xtools to not install by default; add a native-xtools-install.

Without this the user has to mess with 'make -f Makefile.inc1 ...' to figure
out where the files are installed in the OBJDIR and then they need to copy them
to where they really wanted them. Using DESTDIR may be problematic after
r325001 as well.

The files will be installed to DESTDIR/NXTP where NXTP defaults to /nxb-bin.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 24830684 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix xdev TARGET/TARGET_ARCH assertion and expand to native-xtools.

The top of Makefile.inc1 requires TARGET/TARGET_ARCH be defined. Just
building 'make xdev' would already set them, so this error was never
triggered. Moving it to Makefile fixes the problem.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# bb3f65ea 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Disable AUTO_OBJ as a make argument to ensure it really is disabled.

If the user sets this to yes as a make argument too we still want
to ensure these do not get enabled.

Sponsored by: Dell EMC Isilon

# 0a3c9523 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Remove comment: debug files can be useful for build tools.

Sponsored by: Dell EMC Isilon

# 67d2f51a 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move some LIBCOMPAT tmpdir logic setup to its own build target.

Its own build target was already handling mtree extractions
just as _worldtmp did, so the other cleaning of the
tmpdir makes sense here as well.

Sponsored by: Dell EMC Isilon

# a3d90ddf 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

MK_TESTS is disabled in early phases, no need for TESTBASE extraction here.

Sponsored by: Dell EMC Isilon

# 53f3deb1 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

FAST_DEPEND clean hack: Remove lib32/soft files properly.

Only remove them if the option is enabled and also handle libsoft
by using the proper LIBCOMPAT_OBJTREE. LIBCOMPAT:D will expand
the text after it as a proper glob to the command line if LIBCOMPAT
is defined.

Sponsored by: Dell EMC Isilon

# fb3d959c 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move FAST_DEPEND cleanup hack into its own target and call from _cleanobj.

The _worldtmp target is for setting up WORLDTMP. Nothing between _worldtmp
and _cleanobj will read these files. Move to its own target since it is
so large.

Sponsored by: Dell EMC Isilon

# 354ffd53 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

We don't need LIB32 directories extracted in early phase legacy/WORLDTMP dirs.

This reverts some changes from r289662

Sponsored by: Dell EMC Isilon

# 64ec6792 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Disallow using a colon ':' in source checkout paths.

This leaks into the PATH handling for WORLDTMP and breaks
finding cross-tools. The PATH handling could be fixed to
properly quote but is not worth the effort.

Also allow this sanity check to always run even with 'make -n'.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 5e3b9061 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move sendmail special check into a _sanity_check target.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# a13a8505 25-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Cleanup pieces missed in r315057 which made mandoc mandatory

Sponsored by: Dell EMC Isilon

# ca95e9dd 25-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native-xtools build to use a proper sysroot.

This takes longer but should reliably produce working binaries.
The old version linked against system libraries and headers
which would be a problem if building a native-xtools against
a newer source than the host system. With a proper sysroot made
first this is not a problem.

This also allows:
- NXBDIRS to be built in parallel
- NXBDIRS to be installed to NXBDESTDIR in parallel
- SYSTEM_COMPILER logic to work again. Note that because this change
is adding a sysroot phase the compiler may be built up to twice now.
The first is the "cross-compiler" even though it is for the native
architecture, but it is still built to ensure the latest compiler
is used to generate the binaries, unless SYSTEM_COMPILER allows
/usr/bin/cc to be used. Then the target compiler is built
which is actually a cross-compiler since it runs on native host
but generates TARGET.TARGET_ARCH binaries.

Note this also changes the path used for the OBJDIR. It used to use
/usr/obj/target.target_arch/nxb/<srcdir> for objects and
/usr/obj/target.target_arch/nxb-bin for installed files, but now uses
/usr/obj/nxb/target.target_arch/<srcdir> for objects and
/usr/obj/nxb/target.target_arch/<srcdir>/nxb-bin for installed files.
- NXBDESTDIR can be specified for where to install or queried with
`make -f Makefile.inc1 TARGET=... TARGET_ARCH=... -V NXBDESTDIR`

This could potentially be improved to reuse an existing sysroot. The
problem is with building the SUBDIR_OVERRIDE list it needs to use a
different OBJDIR since it is building all statically. We don't want to
pollute the existing 'buildworld' OBJDIR and cause confusion on the next
build. Using a separate OBJDIR for the 'everything' phase mostly works
except for some things like linking in INTERNALLIBS that exist in the
other OBJDIR.

MFC after: 1 month
Sponsored by: Dell EMC Isilon

# b1237142 25-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Follow-up r319593: Don't use host headers in a fresh new build.

Sponsored by: Dell EMC Isilon

# 71a6afa2 10-Oct-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Do not print error when running make check-old on system
without catpages directories

Reported by: dim

# 0b972ac9 05-Oct-2017 Warner Losh <imp@FreeBSD.org>

Support armv7 builds for userland

Make armv7 as a new MACHINE_ARCH.

Copy all the places we do armv6 and add armv7 as basically an
alias. clang appears to generate code for armv7 by default. armv7 hard
float isn't supported by the the in-tree gcc, so it hasn't been
updated to have a new default.

Support armv7 as a new valid MACHINE_ARCH (and by extension
TARGET_ARCH).

Add armv7 to the universe build.

Differential Revision: https://reviews.freebsd.org/D12010

# 0c059da3 03-Oct-2017 Cy Schubert <cy@FreeBSD.org>

When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

This is the correct patch.

Reviewed by: ngie (previous version, r302865)
MFC after: 2 months
Differential Revision: D7167

# 84f54c4f 03-Oct-2017 Cy Schubert <cy@FreeBSD.org>

Revert r324246. This is not exactly what was intended.

# 74e0e295 03-Oct-2017 Cy Schubert <cy@FreeBSD.org>

When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

Reviewed by: ngie (previous version, r302865)
MFC after: 2 months
Differential Revision: D7167

# b505dd63 25-Sep-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Do not print error when running make delete-old on system
without catpages directories

# 6d0ab078 05-Sep-2017 Ryan Libby <rlibby@FreeBSD.org>

Makefile.inc1: bump elf tool chain version check after PR 215350 fix

This causes builds to use the in-tree libdwarf with the bug fix instead
of the host library.

Reviewed by: bdrewery, emaste, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12239

# e133ecbb 27-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Respect MK_TCSH with build-tools and native-xtools

This helps reduce the WORLDTMP footprint slightly.

Based on a patch I submitted 5 years ago to GNATS.

PR: 174051
MFC after: 2 weeks
Relnotes: yes (anyone who cross-builds with MK_TCSH=yes will run into
build failures if the host doesn't have tcsh(1))
Reminded by: Fabian Keil <fk@fabiankeil.de>

# 6323f724 22-Aug-2017 Ed Maste <emaste@FreeBSD.org>

Set MK_LLD_IS_LD to MK_LLD_BOOTSTRAP for cross-tools

LLD_BOOTSTRAP is intended to control the linker used to link world and
kernel, while LLD_IS_LD is intended to control the linker installed in
that world.

Force LLD_IS_LD equal to LLD_BOOTSTRAP for the cross-tools build and
install phase, so that lld will be installed as the ld to run on the
host, when LLD_BOOTSTRAP is set.

PR: 221543
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12072

# 53d1eddd 15-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Revert r322327, r322352, r322358:

Disconnect the dependency on the kernel package from the runtime
package. There are a number of problems here:

1) The runtime package installed into a chroot or a jail would
include the kernel package, changing the behavior of how jails
work now [1];

2) As result of (1), it is possible a binary may incorrectly
resolve kernel symbols [2]; in addition, it is possible there
will be unexpected fallout with 32-bit jails on a 64-bit host
kernel [2].

Noticed by: brd [1]
Discussed with: kib [2]
MFC after: 3 days
MFC note: record-only to wipe from the merge tracker
Sponsored by: The FreeBSD Foundation

# ebd2eeb3 11-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Add SVNVERSION_CMD to bsd.own.mk, adding the capability to include
svnversion metadata to the runtime and kernel packages.

Instead of traversing src/sys, as is done by newvers.sh for uname(1),
a full tree walk is done to prevent userland and/or modifications
from not being reflected in a modified tree (M).

MFC after: 5 days
Sponsored by: The FreeBSD Foundation

# 1866d42e 11-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Fix indentation from r322401.

MFC after: 3 days
MFC with: r322401
Sponsored by: The FreeBSD Foundation

# 33f8570d 11-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Avoid creating kernel-dbg.txz distribution sets and kernel-debug
packages when MK_DEBUG_FILES is 'no'.

MFC after: 5 days
Sponsored by: The FreeBSD Foundation

# 15373377 10-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Indent nested conditionals for readability.

Sponsored by: The FreeBSD Foundation

# 16398a11 09-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Add a dependency on the kernel package for the runtime package.

The idea here is that, provided upstream pkg(8) maintainers accept
the proposed change, the kernel.ucl will contain a post-install
script causing pkg(8) to emit a message informing to reboot the
system after the kernel is upgraded using 'pkg upgrade', so the
new userland is installed on the running new kernel. At present,
this functionality does not exist in pkg(8), but will help ensure
the upgrade path follows that from UPDATING. To work around this
for now, evaluate ASSUME_ALWAYS_YES, and prompt the user if they
wish to proceed if not set to true.

Since there is a kernel dependency, and a non-GENERIC kernel may
be in use, update Makefile.inc1 to replace '%KERNCONF%' in the
runtime.ucl with the first-built kernel set either via command line
or in make.conf(5).

MFC after: 5 days
Sponsored by: The FreeBSD Foundation

# 8422e09e 07-Aug-2017 Dimitry Andric <dim@FreeBSD.org>

Follow-up to r321684 (Don't use libc++ when cross-building for gcc
arches), and handle two more cases where libc++ includes could be
incorrectly enabled, in case the host compiler is clang 5.0.0, and the
target (cross) compiler is gcc 4.2.1.

Noted by: bdrewery
MFC after: 3 days
X-MFC-With: 321684

# 91234af7 01-Aug-2017 Bryan Drewery <bdrewery@FreeBSD.org>

CCACHE_BUILD: Follow-up r321880: Fix some PATH issues with buildworld.

- bsd.compiler.mk: Must ensure that the CCACHE_WRAPPER_PATH comes first
in PATH.
- Makefile.inc1: Must prepend the CCACHE_WRAPPER_PATH into BPATH as it
overrides the PATH set in bsd.compiler.mk in sub-makes. The PATH
set in bsd.compiler.mk is not exported and doing so would cause it to
then override the BPATH set from environment. The only sane solution
is to prepend into BPATH as needed.
CCACHE_PATH could possibly be used for some of this as well.

Sponsored by: Dell EMC Isilon

# 5aa73fa2 01-Aug-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_CLEAN: No need to run delete-old if the directories don't exist.

X-MFC-With: r321443
MFC after: 1 month
Sponsored by: Dell EMC Isilon

# dca576be 01-Aug-2017 Ian Lepore <ian@FreeBSD.org>

In xdev-links, when installing symlinks to the cross-compiler pieces that
includes the OS version (armv6-freebsd12.0-cc, etc), use the OS version of
the compiler/world source code, not the version of the build host machine.

# 1681d1de 28-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Don't use libc++ when cross-building for gcc arches

Since we imported clang 5.0.0, the version check in Makefile.inc1 which
checks whether to use libc++ fires even when the compiler for the target
architecture is gcc 4.2.1. This is because only X_COMPILER_VERSION is
checked. Also check X_COMPILER_TYPE, so it will only use libc++ when an
external gcc toolchain is used.

Reviewed by: emaste, rpokala
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11776

# 18388aa4 25-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_CLEAN: Hide delete-old output.

It is full of distracting noise about UPDATING and may confuse
the user about what is actually being deleted. It is also
possible to have directories removed on every run with
use of WITHOUT_ knobs that the mtree files do not
account for and for which the directories are incorrectly
in OLD_DIRS currently.

X-MFC-With: r321443
MFC after: 1 month
Sponsored by: Dell EMC Isilon

# b7c6a063 25-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Only build libzfs_core in 'make libraries' if needed.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 63c534e7 25-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Remove unneeded dependency for libzfs.

This dependency does nothing since cddl/lib/libzfs is never
added into the 'make libraries' dependency chain
directly.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 1ae1311d 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP.

This prevents situations with -DNO_CLEAN from finding stale headers or
libraries in places that no longer exist or have moved. It avoids
the need to remove all of WORLDTMP by reusing what we already know
is obsolete.

MFC after: 1 month
Sponsored by: Dell EMC Isilon

# dc75d44e 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

The .depend.obj cleanup hacks are only needed with -DNO_CLEAN.

Sponsored by: Dell EMC Isilon

# cd283100 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move llvm Options.inc hack from r321433 for NO_CLEAN to lib/clang/libllvm.

The files are only ever generated to .OBJDIR, not to WORLDTMP (as a
sysroot) and are only ever included from a compilation. So using
a beforebuild target here removes the file before the compilation
tries to include it.

MFC after: 2 months
X-MFC-With: r321369

# edcc769f 24-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Cleanup stale Options.inc files from the previous libllvm build for
clang 4.0.0. Otherwise, these can get included before the two newly
generated ones (which are different) for clang 5.0.0.

Reported by: Mark Millard
MFC after: 2 months
X-MFC-With: r321369

# 0f827d7a 08-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

makeman: Don't show META_MODE ABI rebuild warnings.

Reported by: dim
Sponsored by: Dell EMC Isilon

# 9bb3819b 08-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER: Ensure there is not a stale compiler in WORLDTMP.

In a scenario of cross-building it is possible that an OBJDIR's WORLDTMP
contains an older compiler in WORLDTMP/usr/bin/cc that is not rebuilt
if SYSTEM_COMPILER logic is triggered. This compiler was still
incorrectly used. Address this by removing WORLDTMP/usr/bin/cc and all
of the hardlinked files associated with it. Also do this for c++ for
GCC builds.

Sponsored by: Dell EMC Isilon
MFC after: 1 week

# f45c7805 05-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix create-kernel-packages with multiple BUILDKERNELS after r320284

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: ngie

# a28412b0 24-Jun-2017 Ed Maste <emaste@FreeBSD.org>

Clean up stale dependencies after r320278

Our current approach to dependency tracking cannot cope with switching
generated asm syscall stubs into C wrappers. Perpetuate the hack in
Makefile.inc1 to paper over the problem until we can take a holistic
approach to fixing dependency problems.

Differential Revision: https://reviews.freebsd.org/D11344

# 0369270f 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_ROOT: Remove excessive // when DESTDIR/DISTDIR are empty.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 2d5cc538 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

compiler-metadata: Properly handle cross-build OBJDIR.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

# 275219cf 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Expose only the create-packages-* targets since they set needed DEST/DIRDIR.

The other targets just fail confusingly otherwise.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 10c93529 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Parallelize individual kernel packaging.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# f77b03aa 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow actually building individual world packages in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 48c22674 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow creating kernel/world packages in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 00c44825 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow staging world/kernel in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# dd7b4c15 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow stageworld/stagekernel to run with make jobs.

The -B was originally added in projects/release-pkg r289381 as a copy
of what 'make world' did at the time. The -B was removed from
the 'installworld' call in 'world' in r303844 though. The staging
of files is safe to run in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# d20bd9e4 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Set compiler metadata for stageworld/distributeworld.

This fixes LD errors during 'make packages' but also for the unlikely case of
'buildworld' on 1 system and 'packages' on another [1].

PR: 212877 [1]
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 81b4423f 22-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Pass along LINKER_* vars during installworld and show in test-system-compiler.

Sponsored by: Dell EMC Isilon

# 817366f1 20-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

buildworld: Pass which world phase the build is in down to submakes.

This is useful for having directories behave differently depending
on the phase - such as enabling SUBDIR_PARALLEL or disabling
redundant building of library directories already done by
earlier 'make _libraries'.

Sponsored by: Dell EMC Isilon

# 35fb812a 19-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

buildworld: Define SYSROOT to WORLDTMP.

This is to allow downstream Makefiles to know for sure they are building
against a sysroot rather than only depending on ${DESTDIR} or other
assumptions.

This also exports it into buildenv.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# ff6c17c9 12-Jun-2017 Ed Maste <emaste@FreeBSD.org>

remove stale dependencies for utimens* wrappers removed in r319663

Use a similar approach to r318957 (which was for ptrace dependencies):
grep the .depend file for the old source file and delete the stale
dependency if found.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11091

# 69db9346 07-Jun-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Fix src.conf.5 generation

When makeman is generating src.conf(5) it tries to test all variation of options
including WITH_DIRDEPS_BUILD. it results in an error when filemon(4) is not
loaded.

Export variables that are needed to prevent this behaviour.

Helped by: sjg

# c8fab231 04-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Force a host tool rebuild for ino64 in r318736.

Sponsored by: Dell EMC Isilon

# 1a9cc831 04-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Add framework to force rebuilding for major ABI changes.

Normally META_MODE ignores host files for "meta mode" decisions on whether a
file should be rebuilt or not. This is because a simple installworld can
update timestamps and cause the next build to rebuild all host tools, when the
previous ones may not have any changes in the source tree. These tools are
normally still ABI compatible. They are only rebuilt if NO_META_IGNORE_HOST is
set from the workaround/hack in r301467.

One of the major problems with this is when a host tool has objects spread
across many revisions that have mixed-ABI. For example, if struct stat were to
change on the host, some objects for a tool may have different ideas of that
struct's definition. If just 1 source file were modified and rebuilt and
linked into the tool, then that toll will have mixed-ABI objects and crash.
This exact thing happened with the ino64 commit in r301467 followed by a
trivial update to libbfd in r318750. The resulting binary would crash in
buildworld.

Sponsored by: Dell EMC Isilon

# 86f2d54f 03-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Connect makewhatis.

This speeds up some port staging, namely perl.

# 9f685734 01-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Connect lld.

This will ensure that aarch64 gets a working native /usr/bin/ld rather
than requiring the aarch64-binutils hack in Poudriere, or emulating
the aarch64 lld.

PR: 217189
Reported by: swills, jbeich

# bd1c3bad 30-May-2017 Ed Maste <emaste@FreeBSD.org>

add a rescue/sh sanity check before installworld on the running system

FreeBSD does not guarantee kernel forward compatibility (that is,
running a newer userland on an older kernel). The documented upgrade
procedure specifies that installkernel should be performed, followed by
a reboot and then installworld. As a sanity check when installing onto
the running system (DESTDIR is / or unset), attempt to run "sh echo OK"
using rescue from the objdir. If rescue fails (e.g., because the system
has not been rebooted and the "old" kernel lacks a system call required
by the to-be-installed world), abort the installation.

This should avoid ino64 foot-shooting when the proper upgrade procedure
is not followed.

Reviewed by: allanjude, gjb, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10987

# 55b87d46 26-May-2017 Ed Maste <emaste@FreeBSD.org>

rm stale ptrace dependencies after r305012

This is similar to r318912, except that ptrace.[sS] was previously a
file in the source tree, not a generated assembly wrapper.

Check for the existence of ptrace.[sS] in the .depend file to determine
if we have to clean it up. This is a bit hackish and will not be left
in place indefinitely, but provides a useful example case when
investigating a better solution in bmake.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10930

# 90d4415d 25-May-2017 Ed Maste <emaste@FreeBSD.org>

libc: rm stale generated files which are no longer syscalls

This is an attempt to help -DNO_CLEAN builds after r302092 (which
removed the pipe libc syscall wrapper) and r318736 (which removed
getdents, lstat, mknod, and stat).

Dependencies cannot cope with certain source tree changes,
particularly with respect to removing source files and replacing
generated files. Handle these cases from _worldtmp in an ad-hoc
fashion.

Reviewed by: bdrewery, cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10876

# ac4ef3f9 25-May-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Now that roff documentation has been disconnected from the build, it is no
longer necessary to have groff(1) as a bootstrap tool

# c596c287 09-May-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add a -DNO_LIBS to skip building the libraries phase as well.

This is useful for cases where -DWORLDFAST is useful.

Sponsored by: Dell EMC Isilon

# 16892c77 09-May-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Support -DWORLDFAST to skip all build steps up to 'libraries' and 'everything'.

This allows for building the world against the already-created
host/sysroot environment. It is not overly useful outside of cases of
large-impact changes such as a testing a new compiler. It will
allow quickly getting back to an error in the target-phases of the
build where a new compiler is being used.

Sponsored by: Dell EMC Isilon

# 6d75a7a8 09-May-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Support skipping 'make obj' tree-walk.

This is part of a larger effort for WITH_AUTO_OBJ and a WORLDFAST
option.

Sponsored by: Dell EMC Isilon

# d5392a41 08-May-2017 John Baldwin <jhb@FreeBSD.org>

Honor WITHOUT_LIB32 on mips64.

The closing paren for the list of architectures that should enable LIB32
by default was in the wrong place resulting in LIB32 always be enabled on
mips64 regardless of WITH_LIB32/WITHOUT_LIB32.

Submitted by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Obtained from: CheriBSD
Sponsored by: DARPA / AFRL

# a17665bc 20-Apr-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Replace again GNU diff with BSD diff

After a firts failed attempt, BSD diff is now good enough to replace
GNU diff.

Relnotes: yes

# 5e50a318 18-Apr-2017 Glen Barber <gjb@FreeBSD.org>

Use relative symlink for 'latest' to allow repo to work after being
moved.

Submitted by: woodsb02
MFC after: 3 days
PR: 217197
Sponsored by: The FreeBSD Foundation

# 848d5e92 13-Apr-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Cache compiler metadata and reuse it at installworld time.

Right after cross-tools, a compiler-metadata.mk file is created that
stores all of the bsd.compiler.mk metadata. It is then read in
with a fail-safe during installworld time.

The file is explicitly removed when invoking cross-tools to ensure that
a stale file is not left around from odd manual 'make _cross-tools' ->
'make installworld' invocations.

This fixes several issues:
- With WITH_SYSTEM_COMPILER (default yes on head and no on releng/11.0):
If you build on a system where the bootstrap compiler does not
build due to the host compiler matching the in-tree one, but then
installworld on another system where that logic fails (a
bootstrap compiler is needed), the installworld immediately fails
with:
sh: cc: not found
Note that fixing this logic may then hit a case where a rebuild is
attempted in installworld. Normally cc would be ran with
'CFLAGS+=ERROR-tried-to-rebuild-during-make-install' to cause an
error such as:
cc: error: no such file or directory: 'ERROR-tried-to-rebuild-during-make-install'
However, now it will just fail with the 'cc: not found' error.
Inspection of the compile line will show
'ERROR-tried-to-rebuild-during-make-install'; It's not useful to
set CC to anything other than 'cc' during install as it is more
helpful to see the attempted compile rather than some other bogus
error.
- This now avoids running bsd.compiler.mk (cc executions) even more
during installworld. There are compiler-dependent SUBDIR in the
tree which required having a compiler during install.

There is at least 1 case where CC is still executed in the install,
such as from a LOOKUP!= in secure/lib/libcrypto/Makefile.inc checking
for 'vzeroall' support. This is not significant for installworld
as the lookup has a fallback (and hides its error) and only modifies CFLAGS,
thus it's not worth fixing.

PR: 212877
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# d5b29b60 13-Apr-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Pass COMPILER_FEATURES down to submakes for installworld.

This is for WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, external
compiler, etc.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# ffe63c8b 08-Apr-2017 Ed Maste <emaste@FreeBSD.org>

Introduce LLD_BOOTSTRAP to control lld as bootstrap linker

Add WITH_LLD_BOOTSTRAP and WITHOUT_LLD_BOOTSTRAP knobs, similar to the
Clang bootstrap knobs.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10249

# 1bf5e133 07-Apr-2017 Ed Maste <emaste@FreeBSD.org>

do not require binutils port when using lld as ld

r279908 added logic to Makefile.inc1 to automatically set
CROSS_BINUTILS_PREFIX for architectures not supported by the in-tree
binutils: arm64 when first introduced, and later riscv64 as well.

LLVM's LLD linker is now included in the base system, and is enabled by
default for arm64 and capable of linking world and kernel. Thus, avoid
automatically setting CROSS_BINUTILS_PREFIX and requiring the binutils
port if WITH_LLD_IS_LD is true.

Reviewed by: kan
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10310

# dbbb03c2 06-Apr-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Fix build-tools still sometimes rebuilding during target build.

In a cross-build, the build-tools are native host binaries. We do not
want to rebuild them when building for the target. Bmake previously
did not support checking .NOMETA on an existing target, so .NOMETA_CMP
was used here. However, .NOMETA_CMP still triggers meta mode conditions
if the number of commands or the command changes. In r312467 the paths
to build ncurses files were modified and thus triggered meta mode to
rebuild the build tools (make_keys, make_hash) in ncurses during the
target build. Bmake 20160604 committed in r301462 changed .NOMETA to
also skip meta mode logic for an existing .meta file as well, thus it
is now the proper fix here.

I explored moving the build-tools output to WORLDTMP/tools with
relatively good success, but have concerns that doing so would be
problematic for downstream vendors who use LOCAL_TOOL_DIRS and
expect the tools to be in current OBJDIR for the target. It also
adds more complexity into finding the tools during target build
and handling of where they are for rescue/rescue and
mkcsmapper_static/mkesdb_static which should really not be connected in
build-tools anyway.

MFC after: 2 weeks
Reported by: many
Sponsored by: Dell EMC Isilon

# 35070067 21-Mar-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Rename _cc to _gcc to be more clear.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

# 2c5ddcf8 19-Mar-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Temporary readd GNU diff

etcupdate requires --change-group-format it is not easy to implement
in bsd diff so for now readd GNU diff

# 5714b701 11-Mar-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Fix native-xtools after replacement of GNU diff

# 97ab006d 10-Mar-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Remove the WITHOUT_MANDOCDB option

mandoc database is activated since FreeBSD 11.0, let's remove the previous
database format for FreeBSD 12.0

# 0e4e8f1b 06-Mar-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Added comments for why nmtree/libmd are bootstrapped.

# 51c6e78d 05-Mar-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix bootstrapping mtree after r313404 for older systems.

r313404 made libnetbsd require sha384.h from libmd. Libmd added it in
r292782. Update BOOTSTRAPPING to account for this.

Reported by: bde
Reviewed by: ngie

# 6ae9acde 23-Feb-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r313896 through r314128.


# 6fc94bc4 21-Feb-2017 Warner Losh <imp@FreeBSD.org>

Document why cat is a bootstrap tool.

# 74464d3c 18-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Include ${LOCALBASE}/bin in $PATH when running "make checkworld"

Some of the tests in devel/atf // devel/kyua rely on the tools being in $PATH,
which means that the tests fail when run via "make checkworld" because $PATH
is restricted to exclude directory elements like "${LOCALBASE}/bin".

MFC after: 1 week
Sponsored by: Dell EMC Isilon

# 66df1425 18-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Quote path to doxygen/kyua in test(1) -x check

This is a basic stopgap against ${LOCALBASE} containing spaces in it

MFC after: 1 week
Sponsored by: Dell EMC Isilon

# 68a558ec 17-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Fix after libc++ update in r300873.

The xdev build needed the same fixes as libcompat and external toolchain
support needed for handling of --sysroot, -L, -B, etc.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# e36b831f 17-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Build yacc which is needed for recent libpcap updates.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 9e580940 17-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE+xdev: Don't rebuild build-tools during normal build.

See r297997 for more information.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

# f9edb084 05-Feb-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r313055 through r313300.


# e2972270 03-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Remove LOCAL_LIB_DIRS warning added in r275839.

The case for which this was added, r274807, causes this warning to
always show. LOCAL_DIRS=foo LOCAL_LIB_DIRS=foo/lib. The only case in
which r274807 is a problem is if foo/Makefile does not contain
SUBDIR+=lib, which is a normal convention. LOCAL_LIB_DIRS is a special
hack only to get a library into the _generic_libs list for the
'make libraries' bootstrapping phase. The old behavior changed in
r274807 was only in head during the 10.0 cycle, so the warning was
only ever needed until release anyhow.

Reported by: ngie
MFC after: 1 week
Sponsored by: Dell EMC Isilon

# c6dc1332 03-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Fix typo in variable name (_REDUNDENT_LIB_DIRS -> _REDUNDANT_LIB_DIRS)

MFC after: 3 days
Sponsored by: Dell EMC Isilon

# 27f134b6 03-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Add missing readelf.

The switch to elftoolchain's readelf in r280859 caused native-xtools
to no longer build readelf. This fixes poudriere builds not using
a native readelf when expected.

Reported by: strejda on freenode
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 65575c14 29-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r312894 through r312967.


# 2b375b4e 27-Jan-2017 Yoshihiro Takahashi <nyan@FreeBSD.org>

Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes: yes

# d63b10f0 27-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Update clang400 branch for LD_AS_LLD -> LD_IS_LLD

# 14f850f3 27-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r312720 through r312893.


# f52e4bdf 26-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Rename LLD_AS_LD to LLD_IS_LD, for consistency with CLANG_IS_CC

Reported by: Dan McGregor <dan.mcgregor usask.ca>

# 737872e9 25-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Also apply WITH_LLD_AS_LD to build tools

Previously WITH_LLD_AS_LD installed LLD as /usr/bin/ld in the target
system, but still used the GNU BFD ld to link the binaries in that
target. LLD 4.0.0 can link the FreeBSD/amd64 world and kernel so use
LLD as the build-time linker as well when the knob is set.

Reviewed by: dim
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9226

# 7666f500 21-Jan-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Import mandoc cvs snapshot 20170121 (pre 1.14)

Note that mandoc does not use anymore sqlite3 but a home made database format
An important improvement has been made as well in makewhatis performance:
Tests on my laptop shows makewhatis on the entire system goes from 26s to 12s


# 69b4d461 06-Jan-2017 John Baldwin <jhb@FreeBSD.org>

Enable /usr/lib32 for o32 binaries on mips64.

Build and install an o32 set of libraries on mips64 suitable for
running o32 binaries via COMPAT_FREEBSD32. Enable COMPAT_FREEBSD32 in
MALTA64.

Reviewed by: jmallett, imp
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D9032

# 94ef145e 02-Jan-2017 Enji Cooper <ngie@FreeBSD.org>

Only bake krb5_config.h support in to ssh(3), etc if both MK_GSSAPI and
MK_KERBEROS_SUPPORT != no

This fixes the odd case where someone specified MK_GSSAPI=no and
MK_KERBEROS_SUPPORT=yes (which admittedly, probably doesn't make sense,
but the build system doesn't prevent this case today, and it didn't when
I filed the bug back in 2011 either).

MFC after: 2 weeks
PR: 159745

# 715652a4 02-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Make native-xtools build correctly after clang/llvm 3.9.0 import

During the clang/llvm 3.9.0 import, the build structure for it was
completely revamped. This broke the native-xtools target.

It first attempts to build libllvmminimal, then the llvm-tblgen and
clang-tblgen executables, but these fail to link because they are linked
to the 'full' libllvm by default, as they normally are during the
'world' stage.

To make these link against libllvmminimal instead, define TOOLS_PREFIX,
similarly as during the bootstrap-tools phase. The value itself is
empty, as we don't really want to use a prefix.

Reviewed by: imp
PR: 215684
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9026

# aeb76c0b 16-Dec-2016 Matthew Seaman <matthew@FreeBSD.org>

Revert r309339, thus re-instating r309314

The original problem with conflicting definitions of ${PKG_CMD} was
solved by r427523 in ports (see https://reviews.freebsd.org/D8677), so
this should be safe now.

Reviewed by: gjb
Approved by: gjb
Differential Revision: https://reviews.freebsd.org/D8120

# 629582ca 10-Dec-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Now that external gcc directly natively links to libc++ we can remove
the dirty hack made to fake libstdc++

# 158c18ff 02-Dec-2016 Warner Losh <imp@FreeBSD.org>

dd is currently a bootstrap tool. It really doesn't have any business
being a bootstrap tool. However, for reproducible build output,
FreeBSD added dd status=none because it was otherwise difficult to
suppress the status information, but retain any errors that might
happen. There's no real reason that dd has to be a build tool, other
than we use status=none unconditional. Remove dd from a bootstrap tool
entirely by only using status=none when available. This may also help
efforts to build the system on non-FreeBSD hosts as well.

Differential Revision: https://reviews.freebsd.org/D8605

# ebc7f2b8 30-Nov-2016 Glen Barber <gjb@FreeBSD.org>

Revert r309314, which breaks installing ports.

Requested by: antoine
Differential Revision: https://reviews.freebsd.org/D8120 (related)
Sponsored by: The FreeBSD Foundation

# 26e28783 30-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Cleanup old debug dirs in delete-old-dirs target

Any .debug or .symbols files under /usr/lib/debug which correspond to
OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up
by the delete-old target. Make this also apply to any OLD_DIRS entries.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D8683

# 91c915fa 30-Nov-2016 Matthew Seaman <matthew@FreeBSD.org>

Allow a user-overridable setting 'PKG_CMD' to control the command used
to create a repo during 'make packages'

This would have been useful for a situation I found myself in where
pkg(8) had been upgraded to a version that wanted the FBSD_1.5 ABI
version but libc.so.7 had not been upgraded, and only provided
FBSD_1.4. I found I needed to update libc in order to run pkg, and I
also needed to use pkg to update libc... Which is why pkg-static
exists, but there's currently no way to tell the build system to use
pkg-static instead of pkg.

This creates a variable PKG_CMD, default value 'pkg', that can be
overridden from the command line.

Reviewed by: gjb
Approved by: gjb
Differential Revision: https://reviews.freebsd.org/D8120

# 0aa5466e 25-Nov-2016 Ed Maste <emaste@FreeBSD.org>

Add WITH_LLD_AS_LD build knob

If set it installs LLD as /usr/bin/ld. LLD (as of version 3.9) is not
capable of linking the world and kernel, but can self-host and link many
substantial applications. GNU ld continues to be used for the world and
kernel build, regardless of how this knob is set.

It is on by default for arm64, and off for all other CPU architectures.

Sponsored by: The FreeBSD Foundation

# 67bc8c8b 19-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r308491 through r308841.


# 7804dd52 16-Nov-2016 Ruslan Bukin <br@FreeBSD.org>

Add full softfloat and hardfloat support for RISC-V.

Hardfloat is now default (use riscv64sf as TARGET_ARCH
for softfloat).

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8529

# 7c6d0bb1 12-Nov-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move libsysdecode-specific hack out of buildworld.

This should fix the lib32 build since it was not removing the generated
ioctl.c. This file is generated by a find(1) call, so cannot use normal
dependency tracking methods.

Reported by: jhb
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 2828dafc 10-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r308227 through r308490.


# 111bf579 10-Nov-2016 Antoine Brodin <antoine@FreeBSD.org>

Add limits(1) to native-xtools so that it can be used in qemu user-mode jails

# c7fbd772 04-Nov-2016 Ed Maste <emaste@FreeBSD.org>

Connect new LLVM-based libgcc_eh & libgcc_s to the build

Compiler-rt and LLVM's libunwind provide a suitable replacement for
libgcc.a, libgcc_eh.a, and libgcc_s.so.

Remove the now-unused LLVM_LIBUNWIND block from gnu/lib/libgcc.

PR: 213480 [exp-run]
Reviewed by: brooks, ed
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8189

# a2b802ce 02-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r303250 through r308226.


# e4195e2e 01-Nov-2016 Jonathan Anderson <jonathan@FreeBSD.org>

Add rules to build LLVM IR binaries and libraries.

Running `make libfoo.ll` or `make libfoo.bc` within a library directory
will now give us an LLVM IR version of the library, and `make foo.full.ll`
or `make foo.full.bc` will give us an IR version of a binary.

As part of this change, we add an LLVM_LINK variable to sys.mk that can be
specified/overridden using an external toolchain.

Reviewed by: bdrewery, brooks
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8388

# 02ebdc78 31-Oct-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r307736 through r308146.


# 5bca2215 31-Oct-2016 Ruslan Bukin <br@FreeBSD.org>

Add full softfloat and hardfloat support for MIPS.

This adds new target architectures for hardfloat:
mipselhf mipshf mips64elhf mips64hf.

Tested in QEMU only.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D8376

# 90136961 23-Oct-2016 Warner Losh <imp@FreeBSD.org>

Tweak the UPDATING message a bit about the upgrade path.
Add some automation into Makefile.inc1 to to enforce known good
upgrade from source paths.

# dc9b124d 21-Oct-2016 Justin Hibbits <jhibbits@FreeBSD.org>

Create a new MACHINE_ARCH for Freescale PowerPC e500v2

Summary:
The Freescale e500v2 PowerPC core does not use a standard FPU.
Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor
unit, which doubles as a FPU. The PowerPC SPE ABI is incompatible with the
stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this.
Additionaly, the SPE opcodes overlap with Altivec, so these are mutually
exclusive. Taking advantage of this fact, a new file, powerpc/booke/spe.c, was
created with the same function set as in powerpc/powerpc/altivec.c, so it
becomes effectively a drop-in replacement. setjmp/longjmp were modified to save
the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by
the SPE).

Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not
support double-precision floating point.

Also, without a new MACHINE_ARCH it would be impossible to provide binary
packages which utilize the SPE.

Additionally, no work has been done to support ports, work is needed for this.
This also means no newer gcc can yet be used. However, gcc's powerpc support
has been refactored which would make adding a powerpcspe-freebsd target very
easy.

Test Plan:
This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222
(P1022-based) board, compiled against the new ABI. Base system utilities
(/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot
multiuser.

Reviewed By: bdrewery, imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D5683

# 5763f796 21-Oct-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r307383 through r307735.


# c615275c 20-Oct-2016 Ed Maste <emaste@FreeBSD.org>

Don't build libssp as a prereq lib if WITHOUT_SSP is set

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

# 801b3919 19-Oct-2016 Ed Maste <emaste@FreeBSD.org>

Fix MK_SHAREDOCS test from r306864

Groff is needed only if MK_GROFF and MK_SHAREDOCS are both true.

# 242b2482 09-Oct-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r306412 through r306905.


# 24ff5a32 08-Oct-2016 Baptiste Daroussin <bapt@FreeBSD.org>

groff is not needed in the bootstrap tools if the system is built
WITHOUT_SHAREDOCS

MFC after: 2 weeks

# 335bcabe 28-Sep-2016 Ed Maste <emaste@FreeBSD.org>

Merge ^/head r306303 through 306411.


# f987297f 27-Sep-2016 Ed Maste <emaste@FreeBSD.org>

Add a WITHOUT_DIALOG src.conf(5) knob

It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup).

Reviewed by: dteske
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7969

# 2aeb0380 02-Sep-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r305220 through r305300.


# fcc803df 01-Sep-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Bump __FreeBSD_version for crunchgen META_MODE fix in r305254.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 4d611b2b 23-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix in-tree GCC builds after r304681.

There were a few issues.
- In-tree GCC won't have X_COMPILER_TYPE defined but will have
WANT_COMPILER_TYPE==gcc set from the SYSTEM_COMPILER logic that can
be used. Make the clang check specific to clang as well to ensure
-target doesn't leak into a GCC build.
- When using a cross-compiler GCC (with a default sysroot or arch) and also
passing --sysroot, it basically forgets all internal paths for
libraries. We've already worked around this quite a bit for
the external toolchains. Now for the in-tree bootstrap cross-compiler
GCC, also pass in the needed -B${WORLDTMP}/usr/lib to find the crt
object files, but also -isystem and -L to fix the paths. This creates
quite a spammy build log, but it is clear and still achieves the goals
and stays consistent between internal and external build flags.
Reducing the spam by using the '=' prefix feature will help and be
done later.

MFC after: 3 days
X-MFC-With: r304681
Reported by: bz
Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

# bb0cd1b5 23-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Always pass in -target and --sysroot flags for the build.

The internal bootstrap compiler has a default sysroot set by TOOLS_PREFIX
and target set by TARGET/TARGET_ARCH. However, there are several needs to
always pass an explicit --sysroot and -target.
- External compiler needs sysroot and target flags.
- External ld needs sysroot.
- To be clear about the use of a sysroot when using the internal compiler.
- Easier debugging.
- Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to
the flip-flopping build command when sometimes using external and
sometimes using internal.
- Allow using no lld which has support for default paths.

The default sysroot in the bootstrap compiler is not changed. The
buildenv compiler will still work with its default and will also
include -target/--sysroot from CC in the environment.

MFC after: 3 days
Discussed with: emaste, brooks (BSDCam)
Reviewed by: emaste
Sponsored by: EMC / Isilon Storage Division

# 0295d98c 15-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Trim unneeded bootstrap after r301470 made 9.1 the minimum supported release.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

# c8de0c57 12-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Avoid showing the bootstrap make command for check-old, etc.

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

# 14009f5e 10-Aug-2016 Li-Wen Hsu <lwhsu@FreeBSD.org>

Only remove empty directories before packaging.

This preserves files are intentionally empty, most of them are in tests.txz

Reviewed by: bdrewery
MFC after: 3 days

# 87ae8210 29-Jul-2016 Mark Johnston <markj@FreeBSD.org>

Add libprocstat prebuild library dependencies.

X-MFC-With: r303531

# a7e13d50 29-Jul-2016 Mark Johnston <markj@FreeBSD.org>

librtld_db: Use the auxv to figure out where to look up loader symbols.

Previously, librtld_db just hardcoded /libexec/ld-elf.so, which isn't
correct for processes that aren't using the native ABI. With this change,
librtld_db can be used to inspect non-native processes; in particular,
dtrace -c now works for 32-bit executables on amd64.

MFC after: 1 month

# fd406aa3 27-Jul-2016 Ed Maste <emaste@FreeBSD.org>

Remove ${OBJDUMP} as it is not used by the base system

It was added to sys.mk relatively recently (r274503) for EFI builds
but is no longer used by the base system. The in-tree binutils are
outdated, will not be updated, and will be removed in the future.
Remove it from the toolchain build now to slightly simplify the build
and make sure we don't grow an accidental dependency.

Note that this affects only the toolchain build, and does not affect
/usr/bin/objdump in the built world.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6460

# 73371266 24-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't disable binutils/elftoolchain bootstrapping with external compiler.

This was a regression from r300349.

Setting MK_CROSS_COMPILER=no forces the compiler bootstraping *and* the
binutils/elftoolchain bootstrapping to be disabled in share/mk/src.opts.mk.
The only intent with using an external compiler is to disable bootstrapping of
the compiler. The binutils/elftoolchain bootstrapping must still occur unless
XAS is set. This did not affect WITH_SYSTEM_COMPILER.

Now that setting an external compiler sets both MK_CLANG_BOOTSTRAP and
MK_GCC_BOOTSTRAP to no, and MK_CROSS_COMPILER does the same via
share/mk/src/opts.mk, remove redundant logic that checks for
MK_CROSS_COMPILER. It will not always be true now that MK_CROSS_COMPILER==no
when an external compiler is used and --sysroot/-target is needed.

Reported by: sbruno
Pointyhat to: bdrewery
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

# a9254587 24-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix empty WANT_COMPILER_TYPE when neither compiler is bootstrapped.

Bug in r303272.

MFC after: 3 days
X-MFC-With: r303272
Sponsored by: EMC / Isilon Storage Division

# b17f5b22 24-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER: Rework the logic to allow a 'make test-system-compiler'.

1. Always calculate what the expected values are.
2. Add 'make test-system-compiler' to show all of the computed values
vs the wanted values.
3. Extend the .info line to buildkernel/kernel-toolchain/toolchain/_cross-tools.
4. Consolidate all of the logic to one condition.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

# 4143850b 21-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add LOCAL_XTOOL_DIRS to add into cross-tools.

Sponsored by: EMC / Isilon Storage Division

# fe50ba05 19-Jul-2016 Ed Maste <emaste@FreeBSD.org>

Include makewhatis in ITOOLS when MK_MAN_UTILS is true

Previously it was conditional on MK_MAN. It's possible to build
FreeBSD with man pages but without man page tools. MK_MAN_UTILS
is the conditional used in share/man/Makefile for determining whether
makewhatis is executed at install time, so it is the proper one for
ITOOLS as well.

PR: 210142
MFC after: 1 week

# bcc238ea 15-Jul-2016 Cy Schubert <cy@FreeBSD.org>

Revert r302865 and it's sister r302866 as r302865 causes some breakage.

Reported by: Guy Yur <guyyur@gmail.com>

# 507cef93 14-Jul-2016 Cy Schubert <cy@FreeBSD.org>

When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

Reviewed by: ngie@
MFC after: 1 week
Differential Revision: D7167

# b987685f 12-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r302670 and r302671 for now.

MACHINE_CPUARCH smells like MACHINE except for arm64/aarch64 which
has it backwards.

# 79156eb7 12-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Create a TARGET_CPUARCH thing to go with MACHINE_CPUARCH.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7160

# 6cdb0cba 11-Jul-2016 Glen Barber <gjb@FreeBSD.org>

Fix TARGET_TRIPLE for 12.0-CURRENT.

Submitted by: rene
Sponsored by: The FreeBSD Foundation

# a356b784 07-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_COMPILER: Don't enable for xdev or native-xtools.

Otherwise they get no compiler.

Reported by: swills
Tested by: swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

# 48413367 28-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_COMPILER: Avoid using GCC4.8+ logic on native GCC4.2 platforms.

As the XXX notes, these should really be checking MK_GNUCXX since there is
already a version check in share/mk/src.opts.mk to disable it. Fixing that
here is more complex though. This could also be using X_COMPILER_FEATURES
but uses X_COMPILER_VERSION to keep in sync with the src.opts.mk logic.

Tested by: andreast
Sponsored by: EMC / Isilon Storage Division
Approved by: re (gjb)

# 07394091 15-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native powerpc64 build of lib32 with in-tree GCC.

- This was broken by r300350 and r300885.
- Add some comments around the external GCC logic since it is spread out
and in need of some cleanup.
- The problem was that X_COMPILER_TYPE is always defined from CC->XCC's
default, so if /usr/bin/cc is GCC (as it is on native powerpc64) then
X_COMPILER_TYPE was getting GCC and triggering the external logic in
Makefile.libcompat. It was intended to always provide -isystem with
GCC since --sysroot is used into the lib32 sysroot which won't modify
the header path without the -isystem. The use of the libc++/std=c++11
override was only intended to be used for external compilers though
(more accurately GCC 4.8+ but that's a separate assumption to
cleanup). Apply the same logic from Makefile.inc1 to Makefile.libcompat
to only add the libc++ override when needed for external compilers.

Pointyhat to: bdrewery
Tested with: native ppc64 (swills), universe, ppc64 xtoolchain,
amd64 xtoolchain, sparc64 cross-build of ppc64 (host GCC 4.2)
Reported by: andreast, swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

# 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

# aa06dfc9 05-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

legacy: Avoid building/installing headers twice.

Sponsored by: EMC / Isilon Storage Division

# 4d40df1b 05-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add a MINIMUM_SUPPORTED_OSREL and bump it to 900044.

This is actually a revision in the stable/9 branch released as 9.1. The
localedef build requires xlocale from this period.

Sponsored by: EMC / Isilon Storage Division

# 95348a57 04-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix incorrect logic in r301394.

Reported by: Mark Millard

# b4dd4229 04-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r301287: Pass external compiler metadata when used.

This fixes WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, external compiler, to
pass the external compiler metadata rather than the ${CC} metadata. On
a build host that has clang as CC it was passing the clang metadata rather than
GCC metadata during the build.

# bbfcc681 03-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITHOUT_CROSS_COMPILER: Fix installworld.

Since no WORLDTMP/usr/bin/cc is created, cc cannot be found
during installworld time since /usr/bin is not in the PATH.
Pass along the known compiler metadata to allow installworld
to work. The same fix was used for WITH_SYSTEM_COMPILER.

A better route would be to store a cookie in buildworld
containing this compiler metadata and then using that
at install time, rather than rerunning cc.

Reported by: Mark Millard
Sponsored by: EMC / Isilon Storage Division

# c371433e 03-Jun-2016 Dimitry Andric <dim@FreeBSD.org>

For clang, move the definition of FREEBSD_CC_VERSION into its own header
file, lib/clang/freebsd_cc_version.h, instead of reusing Version.inc.
The header is only included from one .cpp file in the clang tree.

This minimizes the number of .cpp files that need to be rebuilt if the
version is bumped.

Discussed with: bdrewery

# f661dbee 29-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

GCC External: Revert r300886, r300904, r300917, r300918

The fix in r300873 is mostly enough. A fix for lib32 will be
committed.separately.

# ce00342b 27-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move external GCC compiler hacks to bsd.sys.mk.

This allows respecting -nostdinc, -nostdinc++ and -nostdlib before
making the decision to add in -isystem, etc. The -isystem flags
are problematic for building lib/libc++ and lib/libcxxrt which wants
to only use its own headers.

More information the need of these flags can be found at
https://gcc.gnu.org/ml/gcc/2016-03/msg00219.html

This also reverts r300873.

Sponsored by: EMC / Isilon Storage Division

# 5929ee29 27-May-2016 Glen Barber <gjb@FreeBSD.org>

Make PKG_VERSION aware of '-ALPHA*'.

Submitted by: Ben Woods
Sponsored by: The FreeBSD Foundation

# eb9b07bb 26-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_AUTO_OBJ: Fix crunchgen builds.

Passing MAKEOBJDIRPREFIX to the main prog build (rescue) would confuse
WITH_AUTO_OBJ and cause it to create a recursed object directory that
then broke the actual prog build. This is normally not a problem since
we do not call 'make -f prog.mk obj' before building anything in it.

Crunchgen(1) also assumes that if -o is not passed then if an object
directory does not already exist then it should build in the source
directories. The normal buildworld process will have already ran 'make
obj' in each of the component directories so this is not a problem.
With WITH_AUTO_OBJ though this is not the case. So we must tell
crunchgen(1) that MK_AUTO_OBJ=yes will create the directory and to not
require it be present before generating its Makefile.

Sponsored by: EMC / Isilon Storage Division

# 016448a5 26-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Move the kernel support to kern.pre.mk.

This allows using META_MODE directly from the kernel build directory.
This also allows removing a hack from the DIRDEPS_BUILD kernel target.

Sponsored by: EMC / Isilon Storage Division

# 2d86a958 26-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove leftover _crunchide from r283108

# 9729cf09 26-May-2016 Dimitry Andric <dim@FreeBSD.org>

Update libc++ to 3.8.0. Excerpted list of fixes (with upstream revision
numbers):

r242679 Implement the plugin-based version of std::search. There are no
searchers yet; those are coming soon.
r242682 Implement the default searcher for std::experimental::search.
r243728 Add <experimental/any> v2.
r245330 implement more of N4258 - Cleaning up noexcept in the standard
library. Specifically add new noexcept stuff to vector and
string's move-assignment operations
r245334 Fix PR22606 - Leak pthread_key with static storage duration to
ensure all of thread-local destructors are called.
r245335 Fix PR23589: std::function doesn't recognize null pointer to
varargs function.
r247036 Implementation of Boyer-Moore and Boyer-Moore-Horspool
searchers for the LFTS.
r249325 Implement LWG#2063, and update the issues links to point to the
github generated pages
r249738 Split <ctype.h> out of <cctype>.
r249739 Split <errno.h> out of <cerrno>.
r249740 Split <float.h> out of <cfloat>.
r249741 Split <inttypes.h> out of <cinttypes>.
r249742 Split <math.h> out of <cmath>.
r249743 Split <setjmp.h> out of <csetjmp>.
r249761 Split <stddef.h> out of <cstddef>.
r249798 Split <stdio.h> out of <cstdio>.
r249800 Split <stdlib.h> out of <cstdlib>.
r249889 Split <wchar.h> out of <cwchar>.
r249890 Split <wctype.h> out of <cwctype>.
r249929 Split <string.h> out of <cstring>.
r250254 ABI versioning macros for libc++.
r251246 Fix LWG#2244: basic_istream::seekg
r251247 Fix LWG#2127: Move-construction with raw_storage_iterator.
r251253 Fix LWG#2476: scoped_allocator_adaptor is not assignable
r251257 Fix LWG#2489: mem_fn() should be noexcept
r251618 Implement P0004R1 'Remove Deprecated iostreams aliases'
r251766 Implement the first part of P0006R0: Adopt Type Traits Variable
Templates for C++17.
r252195 Implement P0092R1 for C++1z
r252350 Allow deque to handle incomplete types.
r252406 More of P0006R0: type traits variable aliases for C++17.
r252407 Implement LWG#2353: std::next is over-constrained
r252905 Implement P0074: Making owner_less more flexible
r253215 Implement P0013R1: Logical Operator Type Traits.
r253274 Implement P0007: Constant View: A proposal for a std::as_const
helper function template.
r254119 Add static_assert to set/multiset/map/multimap/forward_list/deque
that the allocator's value_type match the container's value_type.
r254283 Implement more of P0006; Type Traits Variable Templates.
r255941 LWG2485: get() should be overloaded for const tuple&&.
r256325 Fix LWG Issue #2367 - Fixing std::tuple and std::pair's default
constructors.
r256652 Fix for ALL undefined behavior in <list>.
r256859 First half of LWG#2354: 'Unnecessary copying when inserting
into maps with braced-init syntax'

Exp-run: antoine
Relnotes: yes


# 7e1b3c5e 23-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move binutils handling after src.opts.mk.

This fixes the arm64 build after r300348.

Sponsored by: EMC / Isilon Storage Division

# 6120aabd 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Opportunistically skip building a cross-compiler with SYSTEM_COMPILER set.

This will still build the compiler for the target but will not build the
bootstrap cross-compiler in the cross-tools phase. Other toolchain
bootstrapping, such as elftoolchan and binutils, currently still occurs.

This will utilize the default CC (cc, /usr/bin/cc) as an external compiler.

This is planned to be on-by-default eventually.

This will utilize the __FreeBSD_cc_version compiler macro defined in the
source tree and compare it to CC's version. If they match then the
cross-compiler is skipped. If [X]CC is an external compiler (absolute
path) or WITHOUT_CROSS_COMPILER is already set, then this logic is skipped.
If the expected bootstrap compiler type no longer matches the found CC
compiler type (clang vs gcc), then the logic is skipped. As an extra
safety check the version number is also compared from the compiler to
the tree version.

Clang:
The macro FREEBSD_CC_VERSION is defined in:
lib/clang/include/clang/Basic/Version.inc
For clang -target will be used if TARGET_ARCH != MACHINE_ARCH. This
is from the current external toolchain logic. There is currently an
assumption that the host compiler can build the TARGET_ARCH. This
will usually be the case since we don't conditionalize target arch
support in clang, but it will break when introducing new
architectures. This problem is mitigated by incrementing the version
when adding new architectures.

GCC:
The macro FBSD_CC_VER is defined in:
gnu/usr.bin/cc/cc_tools/freebsd-native.h
For GCC there is no simple -target support when TARGET_ARCH !=
MACHINE_ARCH. In this case the opportunistic skip is not done. If we
add proper support for this case in external toolchain logic then it
will be fine to enable.

This relies on the macros being incremented whenever any change occurs
to these compilers that warrant rebuilding files. It also should never
repeat earlier values.

Reviewed by: brooks, bapt, imp
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6357

# 76286f4b 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Enable external compiler logic if both bootstrap compilers are disabled.

Reviewed by: brooks
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6358

# c1b9d002 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Enable and utilize WITHOUT_CROSS_COMPILER logic for external CC.

This is a NOP.

Reviewed by: brooks, bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6354

# 34fb4407 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move external toolchain support earlier.

This is to consolidate external toolchain and WITHOUT_CROSS_COMPILER support.

Reviewed by: brooks, bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6353

# bf0c0f96 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Use META_MODE rather than .MAKE.MODE for buildkernel.

This is mostly a style change so that other code does not duplicate
it. The problem is when META_MODE needs to be disabled but it has
been overridden by .MAKE.MODE.

Sponsored by: EMC / Isilon Storage Division

# e873d4db 18-May-2016 Warner Losh <imp@FreeBSD.org>

Turns out, mipsn32el worked at one point, so add it back in.

Pointed out by: jmallet@

# 14e5b32d 18-May-2016 Warner Losh <imp@FreeBSD.org>

Fix negative logic error. We want gnueabihf ABI when we're NOT
requesting soft float ABI.

Noticed by: bdrewery

# 631dbc3b 18-May-2016 Warner Losh <imp@FreeBSD.org>

mipsn32el is not a thing, remove it from the list of valid
architectures. There's no definition for it, nobody uses it
and it is unlikely to ever work. We can put it back when someone
demonstrates it running...

The new default for armv6 is hard float, so extend that default
to the external toolchain support.

# ecb92e2d 18-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Combine restage/reinstall in a safe way.

Sponsored by: EMC / Isilon Storage Division

# 2c0e9e2a 18-May-2016 Warner Losh <imp@FreeBSD.org>

Make armv6 hard float abi by default. Kill armv6hf.
Allow CPUTYPE=soft to build the current soft-float abi libraries.
Add UPDATING entry to announce this.

Approved by: re@ (gjb)

# 396f5ab6 13-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Support libsoft for restage.

This is essentially fixing a merge conflict.

# d4ca5483 09-May-2016 Glen Barber <gjb@FreeBSD.org>

Revert r299292, which was not a mismerge. It has an additional horrible
side effect of replacing /etc/{master.,}passwd and /etc/group.

Submitted by: O. Hartmann
Pointyhat to: gjb (myself)
Sponsored by: The FreeBSD Foundation

# 381fcf10 09-May-2016 Glen Barber <gjb@FreeBSD.org>

Combine the 'reinstall' and 'restage' targets, which appears to have
been a mismerge.

Sponsored by: The FreeBSD Foundation

# 79ccc589 04-May-2016 Enji Cooper <ngie@FreeBSD.org>

Default NO_INSTALLEXTRAKERNELS to yes, not no

The old (^/stable/9) default was yes, not no ("no" was the new default
introduced recently that broke POLA). Restore it to keep POLA like
glebius intended in r299077

MFC after: 3 days
X-MFC with: r299086
Pointyhat to: ngie (research before assuming and committing next time)
Sponsored by: EMC / Isilon Storage Division

# c0fd4255 04-May-2016 Enji Cooper <ngie@FreeBSD.org>

Default NO_INSTALLEXTRAKERNELS to "no" to unbreak the build

MFC after: soon (was insta-MFCed -_-..)
Pointyhat to: glebius
Sponsored by: EMC / Isilon Storage Division

# f4ae78bd 04-May-2016 Gleb Smirnoff <glebius@FreeBSD.org>

Make it possible to override NO_INSTALLEXTRAKERNELS.

Reviewed by: gjb

# a1ff7af0 03-May-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

Misc. build: minor spelling fixes.

No functional change.

# 561e173f 26-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Allow buildkernel to create .meta files with curdir==objdir.

Without this the incremental build was broken since .depend.* are not
generated with .MAKE.MODE=meta and .meta files were not created to
track dependencies. Typically meta mode does not create .meta files
when building with curdir==objdir but the kernel build is special.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by: EMC / Isilon Storage Division

# 75a6cb4f 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix unset variables from r298417.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

# 40cf3344 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add more missing .PHONY

Sponsored by: EMC / Isilon Storage Division

# 59e2f057 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove redundant logic from the pkg-base merge.

These will be set from the logic right above it.

Reviewed by: gjb
Sponsored by: EMC / Isilon Storage Division

# ae001499 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make -n' for new packaging targets.

Sponsored by: EMC / Isilon Storage Division

# c943a53e 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add more missing .PHONY.

This also protects them from trying to create .meta files
with WITH_META_MODE.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by: EMC / Isilon Storage Division

# 97c316c6 21-Apr-2016 Ed Maste <emaste@FreeBSD.org>

Adjust BOOTSTRAPPING test after MFC of kbdcontrol's -P option

# fcede88b 18-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Add MK_AUTO_OBJ=no to ${MAKE} invocation if PKG_VERSION needs to be
created to avoid creating ${.OBJDIR}.

The duplicate REVISION/BRANCH/VERSION evaluation will be addressed
separately.

Sponsored by: The FreeBSD Foundation

# 0edd2576 15-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 473fda75 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE+filemon: Default -DNO_CLEAN enabled.

When using meta mode with filemon, the build is reliably incremental
safe. Bmake will use the meta files, along with filemon information,
to rebuild targets when their dependencies change, commands change,
or files they generate are missing.

Sponsored by: EMC / Isilon Storage Division

# fdff4951 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Pass along the default sysroot in bootstrap-tools to avoid rebuilds later.

Some of the clang libraries build in this phase and the cross-tools
phase. Later in the cross-tools phase when they build with a default
TOOLS_PREFIX, they see a changed build command in meta mode due to
the changed DEFAULT_SYSROOT. This is avoided by passing along
TOOLS_PREFIX earlier.

Sponsored by: EMC / Isilon Storage Division

# d1dd034d 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Don't rebuild build-tools targets during normal build.

This avoids 'build command changed' due to CFLAGS/CC changes during the
normal build. Without this the build-tools targets end up rebuilding
for the *target* rather than keeping the native versions built in
build-tools.

Sponsored by: EMC / Isilon Storage Division

# a561b106 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Mark some more .PHONY targets.

Sponsored by: EMC / Isilon Storage Division

# 7cbd0a29 13-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Simplify building libpam and fix libpam.a not containing the modules since r284345.

The change in r284345 moved the creation of openpam_static_modules.o to
lib/libpam/static_modules but never managed to get them into libpam.a.

Move this logic to lib/libpam/static_libpam and have it create a static
library for libpam.a The main lib/libpam/libpam will only create a
shared library. No redundancy in compilation or installation exists
in this solution.

This avoids requiring a pass with -D_NO_LIBPAM_SO_YET.

Sponsored by: EMC / Isilon Storage Division

# 9c831bbd 12-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# d13c4614 12-Apr-2016 Steve Wills <swills@FreeBSD.org>

Try harder to find svn

While here, elliminate last references to CVS_UPDATE and SUP_UPDATE

Reviewed by: gjb
Approved by: gjb

# 14cda706 11-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Set explicit ordering to prevent packaging failures with parallel
(-jN) make(1) jobs.

Sponsored by: The FreeBSD Foundation

# 7a888f32 07-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Avoid using DESTDIR in packaged-base targets, which can
cause bizarre packaging failures with non-default OBJDIR
and/or MAKEOBJDIRPREFIX and REPODIR set to a location not
within OBJDIR.

Reported by: many
Tested by: sef
Sponsored by: The FreeBSD Foundation

# 2263fb58 05-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 31f3abb1 05-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Fix errors packaging the base system when using non-default DESTDIR
and MAKEOBJDIRPREFIX.

Sponsored by: The FreeBSD Foundation

# 91da7698 05-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove leftover _LDSCRIPTROOT missed in r297270.

Sponsored by: EMC / Isilon Storage Division

# d6084013 04-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# d043a786 30-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix the external GCC build after r297271 by setting -L <sysroot>/usr/lib.

GCC does add <sysroot>/usr/lib to the library search path but it comes after
/usr/local/lib which can find ports libraries such as libedit.so. The
bad path comes in as /usr/local/lib/gcc/x86_64-portbld-freebsd11.0/5.3.0/../../../
which corresponds to <prefix>/lib.

This partially reverts r297271.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

# 497e8091 30-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove the old depend (mkdep) code and make FAST_DEPEND the one true way.

Reviewed by: emaste, hselasky (partial), brooks (brief)
Discussed on: arch@
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5742

# 915d57ae 28-Mar-2016 Ed Maste <emaste@FreeBSD.org>

simplify compile-time default keyboard map generation

In r296926 the -P <path> option was added to kbdcontrol, which enables
this change for a simplified compile-time default keymap build process.

PR: 193865
Reviewed by: Oliver Pinter
Tested by: Oliver Pinter
MFC After: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5708

# ac978f5a 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITHOUT_TOOLCHAIN: Fix includes not being staged in WORLDTMP.

This has been the case since r264930 and r274662.

Sponsored by: EMC / Isilon Storage Division

# 4e3252c4 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

CROSS_BINUTILS_PREFIX: Reduce redundant logic.

Sponsored by: EMC / Isilon Storage Division

# 5df2c3cc 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

External compiler: Remove redundant flags from CXXFLAGS.

The use of XCXXFLAGS is to assign it to CXX in CROSSENV.
XCFLAGS is also assigned here so there is no need to have
--syroot and -B flags again.

Sponsored by: EMC / Isilon Storage Division

# d63cb012 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITHOUT_CROSS_COMPILER: Fix this to use external compiler logic.

Without this the default toolchain in /usr/bin/ would not use
WORLDTMP via --sysroot, and would lack --target if cross-building.

PR: 196193
Related: D3970
Sponsored by: EMC / Isilon Storage Division

# 1b89301d 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Update flags for external GCC.

- The -L WORLDTMP/usr/lib is not needed as GCC is already adding in
-L =/usr/lib internally with --sysroot. It does not do this for
header include paths though, thus passing -isystem =/usr/include is
still needed.

For the forced libc++ usage:
- Use -isystem rather than -I for libc++ headers.
- Use -std=c++11 rather than gnu++11.
- Use -nostdinc++ to ensure GCC's headers don't leak in.

Sponsored by: EMC / Isilon Storage Division

# 1b337a34 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Build libcompat (lib32) with a --sysroot pointing into its stage directory.

This overrides the cross-compiler's default sysroot to use the WORLD32's
sysroot for building the lib32 libraries. Previously the cross-compiler
would default the sysroot to the 64bit WORLDTMP and -B/-L/-isystem flags
were used to build using the lib32 files. This leads to multiple issues
discussed later. Some extra headers are now needed to be staged since the
64bit WORLDTMP is not referenced at all for headers. The 64bit WORLDTMP
is still used via PATH for build tools. Overriding the default
target/arch is retained in the CC/CXX overrides.

This allows reverting the LDSCRIPT rewriting in installworld from r296921 and
r235122, thus allowing read-only objdirs to work for installing again.

This removes the need for _LDSCRIPTROOT.

This allows progressing the change to always use --sysroot for the build
rather than only relying on the cross-compiler's default sysroot. The
work for that is in D3970 and needed to resolve WITHOUT_CROSS_COMPILER
not using a --sysroot [1].

PR: 196193 [1]
Sponsored by: EMC / Isilon Storage Division

# b0b64494 22-Mar-2016 Glen Barber <gjb@FreeBSD.org>

Make WSTAGEDIR, KSTAGEDIR, and REPODIR configurable.

This should fix the 'packages' target when MAKEOBJDIRPREFIX or
DESTDIR is set in the make(1) environment or via command line.

Reported by: kmoore, sef, Marko Turk
Sponsored by: The FreeBSD Foundation

# 53835448 14-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# bb52d711 12-Mar-2016 Warner Losh <imp@FreeBSD.org>

Use the newly minted Makefile.libcompat to implement libsoft libraries
for the armv6 ABI switch. This also make WITH_LIBSOFT functional on
the arm platform. As a transition thing, this seems to work even
without switching the ABI (we basically build the same libraries
twice when MK_LIBSOFT=yes until the ABI cut over next
month). MK_LIBSOFT remains default no.

# cb1469fd 12-Mar-2016 Ed Maste <emaste@FreeBSD.org>

Bump BOOTSTRAPPING test for libelf after cross-endian fix in r296685

# dba75e9f 11-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move Makefile.lib32 to Makefile.libcompat and generalize it.

This is in preparation for LIBSOFT.

This file only supports *1* LIBCOMPAT value currently and must be capitalized.
In Makefile.libcompat given LIBCOMPAT=FOO there can be values set for
LIBFOOCFLAGS, LIBFOOCPUFLAGS, LIBFOOWMAKEENV, LIBFOOWMAKEFLAGS, LIBFOOCPUFLAGS,
and LIBFOODTRACE. These will have the standard cross-build values appended
onto them.

This could be extended to support multiple libcompat libraries in the future
once there is a need.

Reviewed by: imp
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5612

# 52023717 10-Mar-2016 Warner Losh <imp@FreeBSD.org>

Factor out lib32 generation to its own file. This is prep for a
similar Makefile.libsoft which will do the same for armv6 soft fp API
libraries in prep for pulling the trigger on moving to armv6 hard
float. Once there's two files, I'll work with bdrewery@ to merge the
two files as they are mostly the same. The high rate of churn for
Makefile* makes it quite difficult to make progress out of tree.

Differential Review: https://reviews.freebsd.org/D5566

# 7d536dc8 10-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 0481f785 08-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't ever create object directories here with MK_AUTO_OBJ.

Sponsored by: EMC / Isilon Storage Division

# b0bdd783 08-Mar-2016 Glen Barber <gjb@FreeBSD.org>

Avoid adding the '-release' suffix to non-debug kernel packages.

Sponsored by: The FreeBSD Foundation

# b655ec97 05-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# a36b180a 05-Mar-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r296369 through r296409.


# 34f4acc8 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Conditionalize building makewhatis(1) for upgrades that need it.

Remove building of the legacy makewhatis(1) since it was only needed for
6.0 upgrades.

On my 2.2 GHz system libsqlite3 takes 60-100 seconds to build, which due to
its serialized nature can hold up the build waiting on it to finish in
bootstrap-tools.

makewhatis(1) was only required to be a build tool to support upgrades
from 6.0 which was properly removed in r208324 but later reverted due to
installworld using it. The installworld issue was fixed in r275622
when it was added to ITOOLS. A BOOTSTRAPPING check was missed when
makewhatis(1) was replaced with mandoc in r283777.

Sponsored by: EMC / Isilon Storage Division

# 2bece0ce 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't add duplicates from LOCAL_LIB_DIRS.

This causes parallel failures.

Sponsored by: EMC / Isilon Storage Division

# 400b94bb 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix over/under-linking in contrib/ofed.

Sponsored by: EMC / Isilon Storage Division

# bd6daf52 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

NO_ROOT: Create the METALOG directory on installworld/distributeworld.

When not using NO_ROOT the DESTDIR is implicitly created by the
distrib-dirs call. However with NO_ROOT it is trying to write
to the METALOG right away before running distrib-dirs which
may fail.

Sponsored by: EMC / Isilon Storage Division

# 6cb64f84 04-Mar-2016 Ed Maste <emaste@FreeBSD.org>

Add dd as a bootstrap tool, for status= support

In r295757 I added status=none to buildworld's use of dd, but FreeBSD
versions before April 2014 lack support.

# 82aa34e6 03-Mar-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r296007 through r296368.


# 28c9d1af 02-Mar-2016 Glen Barber <gjb@FreeBSD.org>

Set ALLOW_BASE_SHLIBS when creating base packages to enable
shared library tracking.

Note, this requires a patched pkg(8) to do anything, but pkg(8)
does not complain when an option is specified that it does not
recognize.

Sponsored by: The FreeBSD Foundation

# 52259a98 02-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# c501d73c 25-Feb-2016 Mariusz Zaborski <oshogbo@FreeBSD.org>

Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.

Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by: drysdale@google.com, bdrewery
Approved by: pjd (mentor)
Differential Revision: https://reviews.freebsd.org/D4277

# 14e9c916 24-Feb-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r295902 through r296006.


# f4d0f67f 24-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

FAST_DEPEND: Skip 'make depend' for buildworld and kernel since it is auto-ran now.

Sponsored by: EMC / Isilon Storage Division

# 3a3f435f 23-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Include a 'package-pkg' target, intended for use for
architectures we do not provide upstream pkg(8) packages.

This is not tied to anything as-is, and likely will break
your system if used (based on experience with testing with
powerpc).

There is an overwhelming amount of evil happening here,
so until the issues are fixed, it will not be tied into the
'packages' target.

Sponsored by: The FreeBSD Foundation

# 90963403 23-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Set PORTSDIR if not already set.

Sponsored by: The FreeBSD Foundation

# debac084 23-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Further subdir-ize WSTAGEDIR and KSTAGEDIR base on the
TARGET/TARGET_ARCH value, since there are valid use cases
for having multiple on any given system.

Sponsored by: The FreeBSD Foundation

# 9893f787 21-Feb-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r295601 through r295844.


# 72c3aa02 17-Feb-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 4821f9ed 16-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Always include the kernel name in the resulting package.
While functionally expected to be a no-op on big-iron hardware,
embedded hardware (arm, mips) do not have a GENERIC kernel, so
the KERNCONF value must be included in the package to avoid
conflicting packages for the default kernel (RPI-B versus RPI2,
for example).

While here, correct the kernel name in the metadata.

Sponsored by: The FreeBSD Foundation

# 619a5d7b 15-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't descend into test directories for distribution->installconfig.

Sponsored by: EMC / Isilon Storage Division

# 0fe0fe11 15-Feb-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 90a47263 13-Feb-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r295544 through r295600.


# c1da2974 12-Feb-2016 Ed Maste <emaste@FreeBSD.org>

Add libpe for elfcopy(1) PE/COFF support

Sponsored by: The FreeBSD Foundation

# 4156ce4f 11-Feb-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r295351 through r295543.


# acf5bd83 09-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Remove unnecessary env(1) invocations.

Sponsored by: The FreeBSD Foundation

# a5395435 09-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Add logic to rotate the package repository, keyed on PKG_VERSION,
and create a 'latest' symlink to the PKG_VERSION repository path.

Suggested by: des
Sponsored by: The FreeBSD Foundation

# ea85204f 08-Feb-2016 Dag-Erling Smørgrav <des@FreeBSD.org>

Rename the signpackages target to sign-packages, and include it in the
packages meta-target so 'make packages' now does everything.

# ee1627c4 08-Feb-2016 Dag-Erling Smørgrav <des@FreeBSD.org>

Split the packages target into stage-packages and create-packages to make
it possible to roll new packages from an existing build without having to
restage them.

# bbb51924 07-Feb-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 71b7fa12 07-Feb-2016 Enji Cooper <ngie@FreeBSD.org>

Simplify running the FreeBSD test suite

Replace `make regress` (legacy test make target) and `make test` (incomplete
test make target added with the FreeBSD test suite) with make check as it's
consistent with other open source projects.

`make check` defaults to running tests from `.OBJDIR`, but can be overridden
with the `CHECKDIR` variable.

Add `make checkworld` target to simplify running the FreeBSD test suite from
`TESTSBASE` (i.e. the top-level tests directory), similar to buildworld.

Document `make check` and `make checkworld` in build(7).

Other minor changes:

- Rename intermediate file (`Kyuafile.auto`) to `Kyuafile` to simplify
`make check`.
- Remove terse warnings attached to `beforetest`/`aftertest`.
- Add kyua binary check to check target in suite.test.mk; error out if it's
not found

The MFC is [partly] contingent on other build related changes being MFCed.

Differential Revision: https://reviews.freebsd.org/D4406
MFC after: 2 months
X-MFC to: stable/10
Relnotes: yes
Reviewed by: bdrewery, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division

# a49d8b6e 06-Feb-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r294961 through r295350.


# 848f2374 04-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Silence a few command lines.

Sponsored by: The FreeBSD Foundation

# 5c52b2f5 04-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Rework the way <packagename>.ucl files are generated.
One of the major pain points with how this was implemented
is the requirement of in-tree, hard-coded <name>.ucl, as
well as <name>-<suffix>.ucl where <suffix> can be lib32,
profile, development, debug, or any combination of the four.

This created significant overhead when adding new packages
and any of the files in any of the combinations were missing.

Instead of test(1)-ing if the <packagename>.ucl file exists,
hand off to a script to figure out what the final ucl file
name should be before invoking pkg(8).

The default behavior is 'template.ucl' is used as a fallback.

This affects only the userland packages, as the kernel code
is already smart enough to handle these variations.

Sponsored by: The FreeBSD Foundation

# db9ba9ee 03-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Deduplicate distrib-dirs logic from r289086 in distribution.

This does it correctly this time, rather than the incorrect version in
r295167.

Sponsored by: EMC / Isilon Storage Division

# 3bea1c13 02-Feb-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 4be4b11f 02-Feb-2016 Conrad Meyer <cem@FreeBSD.org>

Revert r295167 at bdrewery's request

$ svn merge -c -295167 .

JHB reports Navdeep reports that it breaks distribution and etcupdate.

Approved by: bdrewery

# 221b3499 02-Feb-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# fb872bbc 02-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Deduplicate distrib-dirs logic from r289086 in distribution.

Sponsored by: EMC / Isilon Storage Division

# 7cd7d126 02-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Adjust install .WAITs for lib/ and etc/ to allow parallelization more.

Only 'installworld' needs to be protected and only when not using
-DNO_ROOT, which implies not installing to / and not needing the
lib dependency protections.

Sponsored by: EMC / Isilon Storage Division

# 1793d339 29-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Wrap long lines after recent commits.

Sponsored by: The FreeBSD Foundation

# 35854cea 29-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Make sure 'pkg config ABI' uses ABI_FILE for the target.

Sponsored by: The FreeBSD Foundation

# d9b0aafd 29-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Reorder execution in the 'packages' target so both userland
and kernel are staged before invoking the 'create-<foo>-packages'
targets.

Include PKG_VERSION value in the 'create-{world,kernel}-packages'
targets so the value is not redefined when packaging the kernel,
which otherwise results in inconsistent and confusing package
version results.

Sponsored by: The FreeBSD Foundation

# d7a8d386 28-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Avoid excessively invoking 'pkg bootstrap' if already done.

Sponsored by: The FreeBSD Foundation

# f61b1691 27-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Fix naming for multiple kernels when building/packaging more than one.

Sponsored by: The FreeBSD Foundation

# 3d98f473 27-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Add 'stagekernel' target, which invokes 'distributekernel'
with -DNO_ROOT to create the METALOG mtree(8) file.

Separate the default STAGEDIR for world (WSTAGEDIR) and kernel
(KSTAGEDIR).

Fix the 'create-kernel-packages' target to work properly.

Evaluate if 'kernel' is set when invoking mtree-to-plist.awk,
which splits the kernel and kernel.debug into separate plist
files.

Fix METALOG creation when building/packaging multiple kernels.

Sponsored by: The FreeBSD Foundation

# d46f0432 25-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Add a 'signpackages' target, which creates the pkg repository
metadata files and uses the path of PKGSIGNKEY for signing,
if set.

Sponsored by: The FreeBSD Foundation

# f9371dca 22-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Create a _pkgbootstrap target, and remove the env(1) prefix
to pkg(8) commands.

Move the resulting packages outside STAGEDIR to minimize
pollution.

When invoking 'pkg create', include the ABI in the REPODIR
path so the correct hierarchy is created for cross-builds.

Move the STAGEDIR and REPODIR declarations above the targets
that use them to keep things cleaner, and move the packages
target.

Include '-o ABIFILE=DESTDIR/bin/sh' in pkg(8) invocations in
the create-kernel-packages target.

Sponsored by: The FreeBSD Foundation

# bc3f9191 21-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Ensure pkg(8) is bootstrapped, and avoid prompting for confirmation
to install, in case the 'packages' target is run non-interactively.

Sponsored by: The FreeBSD Foundation

# ea2c42d8 13-Jan-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r293686 through r293849.


# e6068002 11-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 57ce33ac 11-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Correct a comment.

Submitted by: jhb

# 89d3f0ea 11-Jan-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r293430 through r293685.


# 1f17dba4 08-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Chase r292622: Update path to ioctl.c for incremental build hack.

Sponsored by: EMC / Isilon Storage Division

# 8dc7b23a 08-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix upgrading from OSVERSION 1000002-1000032 after r288829.

r288829 states that lex requires the latest m4, but was not always building it.
Move lex to the same logic as m4 since they are closely tied now.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
Reported by: Slawa Olhovchenkov <slw@zxy.spb.ru>

# b229c1a0 08-Jan-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r293280 through r293429.


# 0c9da521 07-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# b46e9175 06-Jan-2016 Gleb Smirnoff <glebius@FreeBSD.org>

Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF
won't be installed, only the first one would.

# 5dc6cc42 06-Jan-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r293175 through r293279.


# 1a5c9277 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 88343186 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Merge ^/projects/release-install-debug:

- Rework MANIFEST generation and parsing via bsdinstall(8).
- Allow selecting debugging distribution sets during install.
- Rework bsdinstall(8) to fetch remote debug distribution sets
when they are not available on the local install medium.
- Allow selecting additional non-GENERIC kernels during install.
At present, GENERIC is still required, and installed by default.

Tested with: head@r293203
Sponsored by: The FreeBSD Foundation

# c60009cc 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

In 'create-kernel-packages', do not exit with an error if NO_ROOT is
not set. The 'stageworld' target is invoked with -DNO_ROOT, so the
metalog file(s) will be created regardless.

This matches the behavior of 'create-world-packages'.

Sponsored by: The FreeBSD Foundation

# 51daa9fe 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Do not implicitly invoke 'buildworld' as part of the 'packages' target.

This retains the original behavior of release-related targets, which
assume 'buildworld' and 'buildkernel' have already happened.

Sponsored by: The FreeBSD Foundation

# b626f5a7 04-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH r289384-r293170

Sponsored by: The FreeBSD Foundation


# 34cdd776 31-Dec-2015 Dimitry Andric <dim@FreeBSD.org>

First part of updating llvm/clang build glue: getting llvm-tblgen,
clang-tblgen and clang itself built.

# 7144d5cb 23-Dec-2015 Sean Bruno <sbruno@FreeBSD.org>

Fixup native-xtools target for poudriere cross build jails after svn
r291955 by excluding all debug files.

Reported by: swills

Reviewed by: emaste

# 4a2a740e 19-Dec-2015 Enji Cooper <ngie@FreeBSD.org>

Always expose LOCALBASE, not just when CROSS_TOOLCHAIN is defined

Instead of using which(1) to look for doxygen, look for it in <LOCALBASE>/bin .
$PATH gets mangled by make buildenv, etc so it's better to just be explicit
about the path if someone uses that for instance.

Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division

# 37ded2a7 14-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r290423: Don't use CSH for buildenv shell.

It does not properly import PATH; the PATH is reset by included profile
files on startup which breaks the biggest feature of buildenv (using
sysrooted cc from WORLDTMP)

Spotted by: smh, kib
Sponsored by: EMC / Isilon Storage Division

# c492eb76 14-Dec-2015 Andrew Turner <andrew@FreeBSD.org>

Split KNOWN_ARCHES so we have one per line to simplify merging future
architectures.

# 1fdcc5e5 11-Dec-2015 Ruslan Bukin <br@FreeBSD.org>

Start support for the RISC-V 64-bit architecture developed by UC Berkeley.

RISC-V is a new ISA designed to support computer research and education, and
is now become a standard open architecture for industry implementations.

This is a minimal set of changes required to run 'make kernel-toolchain'
using external (GNU) toolchain.

The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv.

Reviewed by: andrew, bdrewery, emaste, imp
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D4445

# 9229b179 08-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix some makeman issues.

- Don't bother looking up REVISION/BRANCH/etc from release/, or the
CPUTYPE check, as these are not used for makeman and wastes time. The also
invokes auto.obj.mk after I reverted auto.obj.mk ignoring -V in r291312.
- Don't modify CC or PATH when WITH_CCACHE_BUILD or WITH_META_MODE is enabled
as it leads to bsd.compiler.mk errors.

Sponsored by: EMC / Isilon Storage Division

# 1c2a618b 07-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix spelling of internal hack.

Reported by: ngie

# 03173d2f 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

bsd.subdir.mk: Only recurse on called targets, rather than dependencies.

This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.

This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.

This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.

This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids
various issues such as the one fixed in r289462. As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.

Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438. This is so users do not get a probably broken build if they
run 'make all' from the top-level. Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion. Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.

This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331. This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk
for now.

I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack. If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.

Discussed on: arch@
MFC after: never
Sponsored by: EMC / Isilon Storage Division

# 6fa97020 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add NO_INSTALLKERNEL to undo the assumption that the first KERNCONF will be
installed as "kernel". This is relevant for packaging of the kernel when
not wanting a default "kernel.txz".

Submitted by: Russell Cattelan <cattelan@thebarn.com>
MFC after: 2 weeks
Obtained from: OneFS
Sponsored by: EMC / Isilon Storage Division

# 0a63717c 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Allow storing package(world|kernel) tarballs into a different location at PACKAGEDIR.

Submitted by: Russell Cattelan <cattelan@thebarn.com>
Discussed with: gjb
MFC after: 2 weeks
Obtained from: OneFS
Sponsored by: EMC / Isilon Storage Division

# b67490a3 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix errors being ignored in many phases of the build since the bmake integration.

Say it with me, "I will not chain commands with && in Makefiles"

This was originally fixed and explained quite well by bde@ in r36074. The
initial bmake integration caused 'set -e' to stop being used which lead to
r252419. Later 'set -e' expectations were fixed with bmake in r254980.

Because of the && here, errors would be ignored when building in parallel and
a dependency failed. Such as bootstrap-tools since it builds everything in
parallel. If any tool failed in obj/depend/all, it would just ignore the error
and continue to build. This later would result in cascaded errors that only
confused the real issue. This could also cause commands after the failed
command to still execute, leading to more confusion.

This should be fine if the command is in a sub-shell such as: (cmd1 && cmd2)

This reverts r252419.

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

# 7f911abe 27-Nov-2015 John Baldwin <jhb@FreeBSD.org>

Add support to libkvm for reading vmcores from other architectures.
- Add a kvaddr_type to represent kernel virtual addresses instead of
unsigned long.
- Add a struct kvm_nlist which is a stripped down version of struct nlist
that uses kvaddr_t for n_value.
- Add a kvm_native() routine that returns true if an open kvm descriptor
is for a native kernel and memory image.
- Add a kvm_open2() function similar to kvm_openfiles(). It drops the
unused 'swapfile' argument and adds a new function pointer argument for
a symbol resolving function. Native kernels still use _fdnlist() from
libc to resolve symbols if a resolver function is not supplied, but cross
kernels require a resolver.
- Add a kvm_nlist2() function similar to kvm_nlist() except that it uses
struct kvm_nlist instead of struct nlist.
- Add a kvm_read2() function similar to kvm_read() except that it uses
kvaddr_t instead of unsigned long for the kernel virtual address.
- Add a new kvm_arch switch of routines needed by a vmcore backend.
Each backend is responsible for implementing kvm_read2() for a given
vmcore format.
- Use libelf to read headers from ELF kernels and cores (except for
powerpc cores).
- Add internal helper routines for the common page offset hash table used
by the minidump backends.
- Port all of the existing kvm backends to implement a kvm_arch switch and
to be cross-friendly by using private constants instead of ones that
vary by platform (e.g. PAGE_SIZE). Static assertions are present when
a given backend is compiled natively to ensure the private constants
match the real ones.
- Enable all of the existing vmcore backends on all platforms. This means
that libkvm on any platform should be able to perform KVA translation
and read data from a vmcore of any platform.

Tested on: amd64, i386, sparc64 (marius)
Differential Revision: https://reviews.freebsd.org/D3341

# 20f68058 18-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove unneeded libmd from bootstrap-tools (reverting r246784).

The bootstrap-tools are supposed to be host tools, which in most cases, use
host headers and libraries. As such, directly including the src tree's headers
for libmd here causes the need to link libmd in since it will be built with
the new symbols (which /usr/lib/libmd.so) won't have unless it is new enough.
During the target build in buildworld the target headers are staged into
WORLDTMP and used via --sysroot, allowing the target xinstall to be built with
the new/target libmd.

The .PATH here was also not doing anything since xinstall does not use libmd
source files.

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks

# 2cc77b79 17-Nov-2015 Brad Davis <brd@FreeBSD.org>

Don't match on "version" when found as a value.

Approved by: bapt

# f2307a2a 13-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Avoid setting schg in the objtree for lib32 build.

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

# ddd945c7 09-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make cleanworld' to respect TARGET/TARGET_ARCH for cross-build objtrees.

This simplifies the logic to always try removing the objdir if it exists
and to fallback on a 'cleandir' if no objdir exists. The reasoning for
this is to avoid rm -rf src/* (r126024)

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks

# 2753ba1a 09-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Move 'make cleandir' from Makefile to Makefile.inc1.

This leads the way for fixing cross-build cleanup, and eventually replacing
'cleandir' with it during the build.

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks

# 9160419c 07-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add built-in ccache build support via WITH_CCACHE_BUILD option.

ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not
used to achieve a safe pseudo-incremental build. This is explained in
more detail upstream [1] [2]. It incurs about a 20%-28% hit to populate the
cache, but with a full cache saves 30-50% in build times. When combined with
the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the
resulting dependency file, which it does not do when using mkdep(1)/'CC
-E'. Stats are provided at the end of this message.

This removes the need to modify /etc/make.conf with the CC:= and CXX:=
lines which conflicted with external compiler support [3] (causing the
bootstrap compiler to not be built which lead to obscure failures [4]),
incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid
Clang errors with parenthesis, and did not work with META_MODE.

The option name was picked to match the existing option in ports. This
feature is available for both in-src and out-of-src builds that use
/usr/share/mk.

Linking, assembly compiles, and pre-processing avoid using ccache since it is
only overhead. ccache does nothing special in these modes, although there is
no harm in calling it for them.

CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap
compiler to hash the content of the compiler binary to determine if it
should be a cache miss. For external compilers the 'mtime' option is used
as it is more efficient and likely to be correct. Future work may optimize the
'content' check using the same checks as whether a bootstrap compiler is needed
to be built.

The CCACHE_CPP2 pessimization is currently default in our devel/ccache
port due to Clang requiring it. Clang's -Wparentheses-equality,
-Wtautological-compare, and -Wself-assign warnings do not mix well with
compiling already-pre-processed code that may have expanded macros that
trigger the warnings. GCC has so far not had this issue so it is allowed to
disable the CCACHE_CPP2 default in our port.

Sharing a cache between multiple checkouts, or systems, is explained in
the ccache manual. Sharing a cache over NFS would likely not be worth
it, but syncing cache directories between systems may be useful for an
organization. There is also a memcached backend available [5]. Due to using
an object directory outside of the source directory though you will need to
ensure that both are in the same prefix and all users use the same layout. A
possible working layout is as follows:
Source: /some/prefix/src1
Source: /some/prefix/src2
Source: /some/prefix/src3
Objdir: /some/prefix/obj
Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj'
This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace
all absolute paths to be relative. Using something like this is required due
to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache
adds into its hash for the object without CCACHE_BASEDIR.

distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc.
I have not personally tested this and assume it will not mix well with
using the bootstrap compiler.

The cache from buildworld can be reused in a subdir by first running
'make buildenv' (from r290424).

Note that the cache is currently different depending on whether -j is
used or not due to ccache enabling -fdiagnostics-color automatically if
stderr is a TTY, which bmake only does if not using -j.

The system I used for testing was:
WITNESS
Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes
DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
The arc was fully populated with src tree files and ccache objects.
RAM: 76GiB
CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16

The WITH_FAST_DEPEND feature was used for comparison here as well to show
the dramatic time savings with a full cache.

buildworld:
x buildworld-before
+ buildworld-ccache-empty
* buildworld-ccache-full
% buildworld-ccache-full-fastdep
# buildworld-fastdep
+-------------------------------------------------------------------------------+
|% * # +|
|% * # +|
|% * # xxx +|
| |A |
| A|
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 3744.13 3794.31 3752.25 3763.5633 26.935139
+ 3 4519 4525.04 4520.73 4521.59 3.1104823
Difference at 95.0% confidence
758.027 +/- 43.4565
20.1412% +/- 1.15466%
(Student's t, pooled s = 19.1726)
* 3 1823.08 1827.2 1825.62 1825.3 2.0785572
Difference at 95.0% confidence
-1938.26 +/- 43.298
-51.5007% +/- 1.15045%
(Student's t, pooled s = 19.1026)
% 3 1266.96 1279.37 1270.47 1272.2667 6.3971113
Difference at 95.0% confidence
-2491.3 +/- 44.3704
-66.1952% +/- 1.17895%
(Student's t, pooled s = 19.5758)
# 3 3153.34 3155.16 3154.2 3154.2333 0.91045776
Difference at 95.0% confidence
-609.33 +/- 43.1943
-16.1902% +/- 1.1477%
(Student's t, pooled s = 19.0569)

buildkernel:
x buildkernel-before
+ buildkernel-ccache-empty
* buildkernel-ccache-empty-fastdep
% buildkernel-ccache-full
# buildkernel-ccache-full-fastdep
@ buildkernel-fastdep
+-------------------------------------------------------------------------------+
|# @ % * |
|# @ % * x + |
|# @ % * xx ++|
| MA |
| MA|
| A |
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 571.57 573.94 571.79 572.43333 1.3094401
+ 3 727.97 731.91 728.06 729.31333 2.2492295
Difference at 95.0% confidence
156.88 +/- 4.17129
27.4058% +/- 0.728695%
(Student's t, pooled s = 1.84034)
* 3 527.1 528.29 528.08 527.82333 0.63516402
Difference at 95.0% confidence
-44.61 +/- 2.33254
-7.79305% +/- 0.407478%
(Student's t, pooled s = 1.02909)
% 3 400.4 401.05 400.62 400.69 0.3306055
Difference at 95.0% confidence
-171.743 +/- 2.16453
-30.0023% +/- 0.378128%
(Student's t, pooled s = 0.954969)
# 3 201.94 203.34 202.28 202.52 0.73020545
Difference at 95.0% confidence
-369.913 +/- 2.40293
-64.6212% +/- 0.419774%
(Student's t, pooled s = 1.06015)
@ 3 369.12 370.57 369.3 369.66333 0.79033748
Difference at 95.0% confidence
-202.77 +/- 2.45131
-35.4225% +/- 0.428227%
(Student's t, pooled s = 1.0815)

[1] https://ccache.samba.org/performance.html
[2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html
[3] https://reviews.freebsd.org/D3484
[5] https://github.com/jrosdahl/ccache/pull/30

PR: 182944 [4]
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Relnotes: yes

# a55d4ddd 07-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add a hack to workaround ZSH as BUILDENV_SHELL breaking CPUTYPE.

ZSH considers CPUTYPE a magic variable that will be the output of 'uname -m'
even if already set in environment when starting up.

The CPUTYPE?= check in Makefile.inc1 and supporting overriding CPUTYPE
manually in the buildenv shell make automatic workarounds too tricky
here. ZSH should really respect variables set in the environment before
trashing them.

X-MFC-With: r290423
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 3e4f384e 07-Nov-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head r290483


# 208f1083 05-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Allow 'make buildenv' to work anywhere in the src tree.

Sponsored by: EMC / Isilon Storage Division

# e4fa4faf 05-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Allow 'make buildenv' to default to the caller's shell by using SHELL.

Also pass BUILDENV=1 into the sub-shell to allow modifying PS1 in .profile such
as:
if [ -n "${BUILDENV}" ]; then
PS1="(buildenv) ${PS1}"
fi

SHELL defaults to 'sh' in share/mk/sys.mk, but is typically passed down by
the shell invoking make as well. Rather than forcing all 'buildenv' users
to use plain /bin/sh, let them use their favorite shell.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Discussed with: imp

# e5ff3aad 05-Nov-2015 Warner Losh <imp@FreeBSD.org>

Fix CC being wrong during install* targets.

Move CROSS_TOOLS stuff to top of file (before bsd.compiler.mk) so that
decisions made by bsd.compiler.mk can properly affect the defaults in
src.opts.mk. Move that to after bsd.compiler.mk. Add a comment about
why we include bsd.compiler.mk here despite the fact that src.opts.mk
currently does too. Also remove bsd.arch.inc.mk that's been OBE.

Differential Revision: https://reviews.freebsd.org/D4087

# a36eca08 04-Nov-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Rename libohash to libopenbsd.

libopenbsd is an internal library which
to bring in compatibility stuff from OpenBSD.
This will allow us to bring in more
OpenBSD utilities into the FreeBSD base system.

We similarly use libnetbsd for bringing in stuff from NetBSD.

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

# 3c3feed4 01-Nov-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 6aa2fe89 26-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add a note about DEPFLAGS which is currently a hack around not properly passing
CXXFLAGS to sub-makes.

The bad passing also causes bsd.dep.mk's logic to selectively pull only some
flags from C[XX]FLAGS to not apply which can be seen with '-L' being passed to
mkdep when using an external compiler.

# c9ec6256 23-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Replace common path with NXBDESTDIR.

Also combine some mkdir calls.

Sponsored by: EMC / Isilon Storage Division

# 5eedd0c0 23-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Fix build with WITH_DEBUG_FILES.

Sponsored by: EMC / Isilon Storage Division

# 68847f14 21-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Parallelize build-tools.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

# 8f9403e9 21-Oct-2015 Ed Maste <emaste@FreeBSD.org>

Warn that NOCLEAN is deprecated - use NO_CLEAN instead

NO_CLEAN has been the correct spelling for over a decade.

# 7f1636b7 21-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.

Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)

Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.

SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.

With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.

- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.

- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.

- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.

- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.

The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.

This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.

- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.

- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.

- Document these changes in build.7

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks

# e0499c11 21-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix my change in r289435 causing 'etc' to be added to SUBDIR when using
SUBDIR_OVERRIDE.

MFC after: 2 weeks
X-MFC-With: r289435
Sponsored by: EMC / Isilon Storage Division

# d82fd861 20-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add some missing '+', .MAKE, and .PHONY modifiers.

Some of these targets were lacking both .MAKE and a '+'. Others were just
inconsistent.

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

# 74c52c65 20-Oct-2015 Julio Merino <jmmv@FreeBSD.org>

Handle lib32 files during delete-old* when MK_LIB32=no.

Extend OptionalObsoleteFiles.inc to delete all lib32 files when MK_LIB32 is
set to no on a system that previously had lib32 libraries installed.

Also, to prevent "make delete-old-dirs" from always deleting lib32 directories
after an installworld, move the lib32 subtree to its own mtree file that only
gets applied when MK_LIB32=yes.

Test: Ran "make delete-old" and "make delete-old-libs" on a system that never
had MK_LIB32 enabled, and on a system where MK_LIB32 was enabled and later
disabled. Did this both on amd64 and powerpc64.

Test: Ran "make tinderbox" without errors.

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

# 031c294c 19-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# b02f187c 17-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove unneeded MK_CTF=no when MK_CDDL=no.

This has been handled since r228158 made MK_CTF dependent on MK_CDDL
in share/mk/bsd.opts.mk.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 4c339735 17-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix wrong PATH being set for world 'includes' stage after r289438.

The 'includes' target is currently a pseudo target in bsd.subdir.mk that
does 'cd ${.CURDIR} && ${MAKE} buildincludes && ${MAKE} installincludes',
versus all over targets that just recurse.

In Makefile.inc1 the older duplicated bsd.subdir.mk logic for calling
'includes' was being executed in each subdir directly, meaning 'cd lib && make
includes' became 'cd lib && make buildincludes && make installincludes'. Now
that the bsd.subdir.mk logic is used it is calling 'make buildincludes && make
installincludes' from the top-level which pulls in the PATH=<default path>
from /Makefile.

The sub-make logic for 'includes' in bsd.subdir.mk was attempted to be removed
in r289282 but turned out to be wrong. I have a working version now but
it is not yet ready for commit. So for now in Makefile.inc1 split out
'includes' to 'buildincludes' and 'installincludes' which will avoid the
problem.

MFC after: 2 weeks
X-MFC-With: r289438
Sponsored by: EMC / Isilon Storage Division

# 53c0e6d5 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

For 'buildenvvars' show any .exported variables as well to cover recent
exporting of OSRELDATE and VERSION. These already do export to 'buildenv'
fine.

Sponsored by: EMC / Isilon Storage Division

# a378087d 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Always export VERSION to the environment to avoid looking it up again in
sub-makes.

Some of the world phases that used plain '${MAKE} -f Makefile.inc1' were not
passing this variable along which caused them to look it up again. By
using bmake's .export we can remove it from all of the other environment
lines.

Add a comment about the usage for VERSION for ctfmerge.

Sponsored by: EMC / Isilon Storage Division

# 470c2b3a 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Export OSRELDATE so sub-makes don't look it up again.

We pass BOOTSTRAPPING=${OSRELDATE} to some of the sub-makes. Rather than
chase every ${MAKE} invokation, just export it as bmake lets us.

Sponsored by: EMC / Isilon Storage Division

# fb84a99e 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Rework the world subdir build targets to use the standard SUBDIR_PARALLEL mechanism.

Back in r30113, the 'par-*' targets were added to parallelize portions of
the build in a very similar fashion as the SUBDIR_PARALLEL feature used in
r263778. Calling a target without 'par-' (for 'parallel') resulted in the
standard bsd.subdir.mk handling without parallelization. Given we have
SUBDIR_PARALLEL now there is no reason to duplicate the handling here.

In build logs this will result in the ${dir}.${target}__D targets now showing
as the normal ${target}_subdir_${dir} targets.

I audited all of the uses of Makefile.inc1 and Makefile's targets that use
bsd.subdir.mk and found that all but 'all' and 'install' were fine to use
as always parallel.
- For 'install' (from installworld -j) the ordering of lib/ and libexec/
before the rest of the system (described in r289433), and etc/ being last
(described in r289435), is all that matters. So now a .WAIT is added in
the proper places when invoking any 'install*' target. A parallel
installworld does work and took 46% of the time a non-parallel
install would take on my system with -j15 to ZFS.
- For 'all' I left the default handling for this to not run in parallel. A
'par-all' target is still used by the 'everything' stage of buildworld
to continue building in parallel as it already has been. This works
because most of the dependencies are handled by the early bootstrap
phases as well as 'libraries' and 'includes' phases. This lets
all of the SUBDIR build in parallel fine, such as bin/ and lib/. This
will not work if the user invokes 'all' though as we have dependencies
spread all over the system with no way to depend between them (except
for the dirdeps feature in the META_MODE build). Calling 'make all'
from the top-level is still useful at least when using SUBDIR_OVERRIDE.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 23ffbc10 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix adding manpages installed by LOCAL_DIRS to whatis file.

The ordering of 'etc' in the install has a long history dating back to the
first time it was realized it needed to be "last" in r4486. That commit
still left it before LOCAL_DIRS though. By having it before LOCAL_DIRS
any manpages they install were not being added to the whatis database in the
install image. They would likely show up in the file after a periodic
rebuild of the file though.

Currently the whatis file is built by an 'afterinstall' hook in etc/Makefile
that calls share/man's 'makedb' target.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# c38230eb 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove lockf as an ITOOL.

It was added in r152006 to handle serializing access of info/dir when
installing INFO files. We no longer support INFO files since r276551
though.

Sponsored by: EMC / Isilon Storage Division

# 7e81b832 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Correct a bitrotted comment about installworld order requirements.

The case of make(1) using a new /bin/sh issue was fixed in r173219 when ITOOLS
was introduced.

There are still issues with mid-install errors leaving a system unusable that
are currently non-trivial to solve. The safest ordering requires installing
rtld, libc and libthr (in that order) before anything else. We don't do that
now though. Much improvement is needed here still.

Discussed with: kip and kan (rtld/library ordering)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

# 35511448 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove .MAKE from targets that do more than just run sub-makes, such as
calling rm or mtree.

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

# 651e2703 15-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix delete-old and check-old-files not removing old debug symbols.

This was handled for libraries in r256842 but for some reason was missed
for files (bsd.prog.mk).

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

# 7b9c2f16 15-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix buildworld with clean objdir after r289351.

Sponsored by: EMC / Isilon Storage Division

# 86f58908 15-Oct-2015 Glen Barber <gjb@FreeBSD.org>

Pass .MAKEFLAGS in the 'packages' target to allow parallel
builds.

Pass '-B' when invoking the 'stageworld' target, similar to
what is done for 'installworld'.

Sponsored by: The FreeBSD Foundation

# 324fd1ce 15-Oct-2015 Glen Barber <gjb@FreeBSD.org>

MFH to r289370

Sponsored by: The FreeBSD Foundation


# ba831a2c 14-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Consider top-level targets to be .PHONY as bmake won't build them
otherwise if a file with the same name is found in the directory.

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

# 33388a16 14-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add temporary workaround for .MAKE being applied to _worldtmp, since r251750.

This was causing files to be removed from the objdir when -n was used.
_worldtmp makes no sub-make calls.

A more comprehensive solution is coming involving fine-grained '+' where
appropriate.

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

# 07670b30 14-Oct-2015 Ed Maste <emaste@FreeBSD.org>

Create /usr/tests *.debug file directory hierarchy

Reviewed by: bdrewery, ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3896

# becbad1f 13-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# c69900f1 10-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 5d8d6498 10-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix installing config files as non root

Reported by: adrian

# 9be27fdc 09-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# dd985c8f 09-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Change make distribution so that it now call installconfig in all dirs along
with the current behaviour of calling "distribution" in the etc target.

This allows mergemaster/etcupdate to still work when some configuration will be
moved to be handled in the same directories their source code lives in.

# 89ef7a96 05-Oct-2015 Ian Lepore <ian@FreeBSD.org>

The latest version of lex requires the latest m4 to build, add a dependency
when running the build-tools stage.

The requirement is due to the -P flag used when running m4 from usr.bin/lex
Makefile to generate skel.c. With the old m4 that fails and the failure is
ignored, resulting in an empty(-ish) skel.c, which leads to later build
failures when the misconfigured new lex tool is run.

This enables building -current (and 10-stable after MFC) on a stable-8
system again.

MFC after: 3 days

# 6875f8e7 03-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remerge as previous one was broken


# 6ae1554a 02-Oct-2015 Colin Percival <cperciva@FreeBSD.org>

Final step of eliminating the "games" distribution: Merge src/games
(or what's left of it, at least) into src/usr.bin.

This change will not be MFCed.

Discussed at: EuroBSDCon 2014
Committed from: EuroBSDCon 2015

# 5a2b666c 01-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 9875367b 27-Sep-2015 Andriy Gapon <avg@FreeBSD.org>

remove unused sgsmsg utility (originally imported from opensolaris)

MFC after: 25 days

# 3cad5c68 25-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Make it easier to keep the bootstrap-tools args in sync.

Sponsored by: EMC / Isilon Storage Division

# 2518edf6 24-Sep-2015 Ed Maste <emaste@FreeBSD.org>

Remove EOL whitespace from Makefile.inc1

# b5512f3b 21-Sep-2015 Ed Maste <emaste@FreeBSD.org>

Move DTrace tools to cross-tools stage

Bootstrap tools exist for backwards compatibility support. DTrace tools
tools are also needed for cross builds, so belong in cross-tools.

Reviewed by: imp (earlier), markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2144

# 26b7188d 16-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Let makeman run 'make showconfig' without hitting the aarch64 error.

# 1b87f1f3 15-Sep-2015 Brad Davis <brd@FreeBSD.org>

Fix grammer in an error message

PR: 202310
Submitted by: Chris Petrik <chris@bsdjunk.com>
Approved by: will

# 286bbc34 14-Sep-2015 Mark Johnston <markj@FreeBSD.org>

Unconditionally build CTF tools in the bootstrap-tools phase of the build.

Stale CTF tools are a frequent source of DTrace issues, and they compile
quickly enough that the increase in build time is negligible.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D3670

# f94594b3 11-Sep-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Finish merging from head, messed up in previous attempt


# b779ff2b 12-Sep-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Rename kernel-pkgs into create-kernel-packages to be consistent with world

# b5ff185e 12-Sep-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 05f05f8b 02-Sep-2015 Gleb Smirnoff <glebius@FreeBSD.org>

The ${BUILDKERNELS:[2..-1]} appears to produce a non zero result for
a one word variable, which is quite unexpected from documentation.
So, to avoid double installation of a single kernel, protect the extra
kernels loop with ${BUILDKERNELS:[#]} > 1 conditional.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

# f3c7b830 01-Sep-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Not only build with buildworld, but also install with installworld all
alternative kernels.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

# 6d04a5ad 01-Sep-2015 Gleb Smirnoff <glebius@FreeBSD.org>

When building multiple kernels use [2..-1] to extract !INSTALLKERNEL
from BUILDKERNELS list. This is more strict, since INSTALLKERNEL by
definition is the first word of BUILDKERNELS list. The previous
code failed if INSTALLKERNEL is a substring of additional kernel name.

Reviewed by: gjb
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

# 23a32822 25-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from HEAD


# 0f3c3059 24-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove now unused LIBPRIVATEDIR

Sponsored by: Gandi.net

# c404eb64 23-Aug-2015 Warner Losh <imp@FreeBSD.org>

Sparc64 is the odd-man out, so form the if that way rather than
listing everybody else.

# 08474898 17-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Separate ELFTOOLCHAIN_BOOTSTRAP from BINUTILS_BOOTSTRAP

For most cases they are equivalent, but BINUTILS_BOOTSTRAP is a
BROKEN_OPTION on arm64 as the in-tree GNU binutils do not support it,
so we need a separate internal flag for ELF Tool Chain.

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

# 39d3a844 13-Aug-2015 Warner Losh <imp@FreeBSD.org>

Spell binaries in the customary way.

Submitted by: jhb@

# 1bc28ffc 13-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Roll WITHOUT_ELFTOOLCHAIN_TOOLS into WITHOUT_TOOLCHAIN

The option was added only to ease the transition from GNU Binutils to
ELF Tool Chain tools, and that process is now complete (for the viable
replacements). Noting the removal in UPDATING is sufficient as we have
not shipped a release with the option.

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

# d7768ad4 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Fix the fixing of the build I broke. rescue/rescue has the right
target, but rescue doesn't.

Pointy hat: imp@

# 572ec1c5 12-Aug-2015 Xin LI <delphij@FreeBSD.org>

Fix build.

# 9aca5ced 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Document build-tools better. Add rescue back because it builds /bin/sh
which has a build-tools target (see commit for how build-tools and
cross-tools differ).

# 1ddcdb76 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Why on earth have we been building rescue as a build tool for the past
12 years? Nothing downstream in the build uses it. Eliminate it as a
build tool.

Reviewed by: emaste@ ("just delete it")

# ad38a9d9 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Crunchgen needs to be bootstrapped to pick up the STRIP->STRIPBIN
changes to prevent the 'rescue: not found' errors from happening.
Bump FreeBSD_version to 1100078 since there's been no version bumps
since this change was made. Only people that installed since r284356
really need to do this bootstrapping, but since crunchgen needs to
bootstrap for other reasons, bumping the number was the simplest.

# d9933780 11-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Fix comment describing legacy target and wrap to 80 columns

# 8551ff3f 11-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Build libelf and libdwarf in the legacy stage

They need to be built and installed (including headers) prior to the
DTrace CTF tools.

Reviewed by: imp (as part of a larger change)
Sponsored by: The FreeBSD Foundation

# f600d35f 09-Aug-2015 Warner Losh <imp@FreeBSD.org>

cmp and cp are used by the kerberos install, so need to be imclided in
ITOOLS. They are tiny enough that I'm not making conditional: the
minuscule savings in disk space isn't worth the obfuscation of
Makefile.inc1.

# 1fd99f14 08-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

libavl is not needed anymore for localedef(1)

# 57df665a 07-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add localedef(1) to bootstrap tools

# b78ee15e 01-Jul-2015 Ruslan Bukin <br@FreeBSD.org>

First cut of DTrace for AArch64.

Reviewed by: andrew, emaste
Sponsored by: ARM Limited
Differential Revision: https://reviews.freebsd.org/D2738

# af38028d 27-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Make all shared library a relative symlink

This makes sysroot usable for cross building, it also removes the need for
_SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have no time
to test it)

Differential Revision: https://reviews.freebsd.org/D2920
Submitted by: imp, adrian
Tested by: adrian

# 0f20a3cd 21-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Only build gperf as a bootstrap tool if gcc is going to be built

# ffe11f41 20-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove temporary changes that crept in r284417 when it should not have

Reported by: antoine, jbeich

# baec3dae 16-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head@274131


# 18b2ee82 15-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Revert r284417 it is not necessary anymore

# dad2fb7e 15-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 3e82c722 03-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Revert r283938 it is not needed anymore and broken

gzip(1) cannot be used as bootstrap tools as it depends on syscalls that only
exists on HEAD

# 0bbe6da5 03-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

mandoc's makewhatis requires gnuzip to be in the path when deadling with
with compressed manpages.

This should fix spam during installworld: "exec: No such file or directory"

Reported by: many

# 75e20d65 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove libmandoc from bootstrap tools

# f5e4216e 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Only push libohash once in bootstrap tools

# 8faa40d1 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Switch to mandoc's version of makewhatis(8), whatis(1), apropos(1) utilities.

This change among other things improve search capabilities over the manpages
allowing fine grain query.

A new build option WITHOUT_MANDOCDB has been added to keep the ancient version
of the database and the tools. The plan is to entirely remove this option before
11.0-RELEASE.

Differential Revision: https://reviews.freebsd.org/D2603

# 645acf41 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Do not make libsqlite3 dependency chain only defined for kerberos, soon more
options would need libsqlite3 as well thus depends on this definitions

# 37a48d40 28-May-2015 Glen Barber <gjb@FreeBSD.org>

MFH: r282615-r283655

Sponsored by: The FreeBSD Foundation


# 8e9b16e5 26-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix build WITHOUT_CDDL by unconditionnaly adding libproc and librtld_db
on supported arches to the prebuild libs

# 2b42dcf7 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

_Really_, _Really_ fix buildworld by moving the conditionals down, fixing some
typos, and fixing the dependency when MK_LIBCPLUSPLUS != no

- `:D` operator evaluation is immediate, i.e. like .if defined(..). So r283159
was in effect a no-op commit.
- Fix dependency in MK_LIBCPLUSPLUS case in two ways:
-- lib/libc++ was the wrong dependency. It should have been libcxxrt.
-- lib/libc++ was missing __L, so again it was depending on the directory, not
the relevant .PHONY target.

Tested with: make tinderbox (amd64, arm, sparc64) and JFLAG=-j16
In collaboration with: bdrewery, imp, peter
BIG pointyhat to: ngie (for trying to commit things at 6am while staying up all
night working on other tasks)

# f3dba867 20-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Make kerberos use the same sqlite libraries as other sqlite consumer.

This reduces the number of copy of sqlite we have to just one and easier
tracking version of sqlite

Differential Revision: https://reviews.freebsd.org/D2443
Reviewed by: imp, stas, bjk

# cf13852b 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

Fix breakage I didn't fully solve in r283151 by depending on the .PHONY
target, not the directory when building libctf for libproc

Reported by: many, Jenkins
Submitted by: rodrigc

# 3f480759 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

Unbreak the arm64/sparc64 tinderbox by only compiling lib/libproc and
lib/librtld_db on architectures where they're supported

Reported by: bz, Jenkins
Pointyhat to: bapt

# ebfd9f66 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

cddl/lib/libctf isn't always a requirement for lib/libproc; its use is dependent
on MK_CTF != "no". Use the other divined value instead of reinventing the wheel

# 5731a3ce 19-May-2015 Enji Cooper <ngie@FreeBSD.org>

Add _more_ missing dependencies for lib/libproc to further squash build races

Verified via `cd lib/libproc; make -VLIBADD`

Pointyhat to: ngie

# d0edea4a 19-May-2015 Enji Cooper <ngie@FreeBSD.org>

Articulate all dependencies for lib/libproc to squash build races after r283139
on !arm64 and !sparc64

Pointyhat to: bapt
Sponsored by: EMC / Isilon Storage Division

# b61e5e48 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

Only build sys/boot/usb/tools if MK_USB != no

Sponsored by: EMC / Isilon Storage Division

# f4547478 20-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix buildworld by adding libproc and librtld_db to the _prebuild_libs
Those are needed to build libdtrace

# 7f36f2d0 19-May-2015 Ed Maste <emaste@FreeBSD.org>

Update crunch bootstrapping test for recent fixes

- r277259 crunchide: Correct 64-bit section header offset
- r281674 crunchide: always include both 32- and 64-bit ELF support

With built-in cross-size support we also no longer need a special case
for cross-build crunchide.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2576

# 4d372549 12-May-2015 Ed Maste <emaste@FreeBSD.org>

Remove redundant csu subdir logic

The appropriate subdirectories are handled by lib/csu/Makefile. There's
no need to duplicate this logic in Makefile.inc1 and lib/Makefile.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2523

# 55b13095 10-May-2015 Thomas Quinot <thomas@FreeBSD.org>

Unbreak build following rev. 282726

(Makefile.inc1): add dependency of xinstall on libmd to
avoid failure of parallel bootstrap.

(lib/libmd/*.h): do not redefine symbols if already
defined as macros (libcrypt uses the same sources internally,
redefining symbols with a prefix of its own).

Fixes build failures caused by previous change to libmd.

Reported by: ian
Pointy hat to: thomas

# 7757a1b4 03-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 363da138 01-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Replace groff's soelim by soeliminate(1) renamed soelim(1)

# 0484aa59 29-Apr-2015 Sean Bruno <sbruno@FreeBSD.org>

Setting PATH to anything is useless as a bare command. Its only relevant
if its set in the environement of each command seperately.

Move the PATH setting to the NXBMAKE variable so its picked up to find
the one-off gperf build for the native-xtools target.

Pointed Out by: ngie

# bf3befad 29-Apr-2015 Sean Bruno <sbruno@FreeBSD.org>

Fix native-xtools breakage when building a gcc enabled target on a clang
enabled host. Build a one-off gperf and put it in the PATH for the rest
of the target so the ONE call to gperf by the gcc build picks it up and
DTRT.

Reviewed by: imp

# 9dc634de 21-Apr-2015 Enji Cooper <ngie@FreeBSD.org>

Serialize all of _kerberos5_bootstrap_tools to avoid build failures involving
make bootstrap-tools

On the plus side, this also greatly reduces complexity

MFC after: 1 week
Pointyhat to: ngie
Reported by: Willem Jan Withagen <wjw@digiware.nl>

# 2d8d8e3c 17-Apr-2015 Ed Maste <emaste@FreeBSD.org>

Bump crunch BOOTSTRAPPING for ELF header offset fix in r277557

# c5e8e000 17-Apr-2015 Warner Losh <imp@FreeBSD.org>

RELEASEDIR was removed in FreeBSD 9.x, at the same time /boot/loader
stopped using kgzip in the release process. We no longer need to build
kgzip as a cross tool, and tests for RELEASEDIR are obsolete, so
remove both.

Differential Revision: https://reviews.freebsd.org/D2313

# 6c4f9295 16-Apr-2015 Enji Cooper <ngie@FreeBSD.org>

Defeat race with MK_KERBEROS == yes introduced with bootstrap-tools
parallelization work done in r279197

- kerberos5/lib/libroken requires kerberos5/tools/make-roken to build
- kerberos5/tools/asn1_compile, kerberos5/tools/slc, and usr.bin/compile_et
require kerberos5/lib/libroken and kerberos5/lib/libvers

This race is incredibly evident when cross-building sparc64 on
ref10-amd64.freebsd.org

MFC after: 1 week
Pointyhat to: ngie

# 008bd7c6 16-Apr-2015 Warner Losh <imp@FreeBSD.org>

People are still getting burned by the byacc upgraded, switch to
always doing byacc until someone figures out the more nuanced version
to switch off of.

# 4bf53d0b 03-Apr-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from HEAD


# b40d31d0 02-Apr-2015 Andrew Turner <andrew@FreeBSD.org>

Only use the CROSS_BINUTILS_PREFIX tool if it exists.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

# 76e2c537 02-Apr-2015 Dimitry Andric <dim@FreeBSD.org>

Ensure the cross assembler, linker and objcopy are used for the build32
stage, just like for the regular world stage.

Reviewed by: rodrigc, imp, bapt, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D2187

# 5ab58881 26-Mar-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Add --sysroot to the compiler flags for clang or gcc external toolchains

Before this fix, --sysroot was only added to the compiler flags if a clang
external toolchain was used.

Reviewed by: imp

# 996d8a0d 25-Mar-2015 Warner Losh <imp@FreeBSD.org>

Add some more explanation to the different phases of the build.

# b9a9d9ca 25-Mar-2015 Ed Maste <emaste@FreeBSD.org>

Force MK_INCLUDES for the legacy stage

As legacy executes "make installincludes" we don't want it to be
disabled by a src.conf setting.

Reviewed by: imp
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2143

# 8daa8167 19-Mar-2015 Andrew Turner <andrew@FreeBSD.org>

Start to import support for the AArch64 architecture from ARM. This change
only adds support for kernel-toolchain, however it is expected further
changes to add kernel and userland support will be committed as they are
reviewed.

As our copy of binutils is too old the devel/aarch64-binutils port needs
to be installed to pull in a linker.

To build either TARGET needs to be set to arm64, or TARGET_ARCH set to
aarch64. The latter is set so uname -p will return aarch64 as existing
third party software expects this.

Differential Revision: https://reviews.freebsd.org/D2005
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

# 8cf263c8 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

run pw_mkdb and cap_mkdb at post-installation for cross installation the version
from the host would be run but the generated files will be on the target
respecing the endianness of the target

# 9269ba46 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Always cleanup remnant plist in destdir if any

# ee1376bc 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix printing the package name when creating

# d3cd95cf 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Now that pkg create can directly accept both a file and a plist in command line,
directly use it

# 9d732154 17-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Detect ABI based on what would be packaged

# a8bed44a 17-Mar-2015 Ed Maste <emaste@FreeBSD.org>

When cross-building with an external toolchain we still need a target strip

It is used by at least crunchide(1).

# 59fa1525 17-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 215d02b7 17-Mar-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add LIB_CXX so that C++ libraries will use CXX to link.

This fixes C++ libraries not implicitly linking in libc++. This is
generally not an issue because the final linking with the compiled binary
will involve CXX via PROG_CXX or other means. It is however
inconsistent with libraries implicitly linking in libc and problematic
for trying to build libraries with '-z defs' to ensure all direct
dependencies are linked in.

libatf-c++ is currently the only consumer of this new feature.

Differential Revision: https://reviews.freebsd.org/D2039
Reviewed by: imp
Discussed with: bapt
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 5d3fd44b 15-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Directly use bmake's ':gmtime'

# 42450b49 15-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Create a "packages" target takes care of all the magic

# 7426d572 15-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 4c4073fd 12-Mar-2015 Ed Maste <emaste@FreeBSD.org>

Provide automatic cross-binutils path if no BINUTILS_BOOTSTRAP

The in-tree binutils does not support arm64, so will not work for the
forthcoming FreeBSD arm64 port. BROKEN_OPTIONS will include
BINUTILS_BOOTSTRAP, so provide a default CROSS_BINUTILS_PREFIX for this
case.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

# e22b7515 12-Mar-2015 Warner Losh <imp@FreeBSD.org>

It appears that xlint isn't used in the build process, so it certainly
doesn't need to be a build tool.

# ca0abefb 04-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add new create-world-packages target to generated the packages out of world

Dynamically figure out the list of targets based on tags passed on the mtrees
First sanity check that all packages have existing manifests
Generate the packages

Please note that for now the mtree needs more work as it has duplicate entries,
everything is not yet tagged

The packages now have generic entries and needs to be customize

# fa1e92b6 04-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# fe692231 26-Feb-2015 Ed Maste <emaste@FreeBSD.org>

Support CROSS_BINUTILS_PREFIX with in-tree compiler

Reviewed by: bapt, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1974

# 3e3b7072 22-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Fill in missing dependencies for dtrace related tools so the bootstrap-tools
compiles properly on older hosts

Pointyhat to: me
X-MFC with: r279197
MFC after: 2 weeks

# aebc0e35 22-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Parallelize building bootstrap-tools

Differential Revision: https://reviews.freebsd.org/D1901
MFC after: 2 weeks
Reviewed by: ian
No serious objections from: imp

# 9c633deb 18-Feb-2015 Jung-uk Kim <jkim@FreeBSD.org>

Fix bootstrap on systems with old yacc with small MAXTABLE.

# 784b6cd5 18-Feb-2015 Peter Grehan <grehan@FreeBSD.org>

Restore the ability to use clang as an external compiler. This was
inadvertently removed when support for external GCC was added.

Deprecate XFLAGS in favour of the newer XCFLAGS/XCXXFLAGS.

Tested with: make universe, make CROSS_COMPILER_PREFIX=/usr/bin/ buildworld
Reviewed by: imp, bapt

# bd9cab6f 17-Feb-2015 Rui Paulo <rpaulo@FreeBSD.org>

release: use xz via pipe when compressing the tarballs.

libarchive(3) doesn't support the new liblzma API yet, but this change
allows us to enable multi-threaded xz compression.
``make release'' should now finish in half the time on a machine with
several cores and fast disks (our typical build server).

This behaviour only applies when building a release and it doesn't
affect buildworld/installworld. To disable threaded xz compression,
set XZ_THREADS=1.

Reviewed by: gjb
Tested by: gjb

# 3b66656a 16-Feb-2015 Rui Paulo <rpaulo@FreeBSD.org>

Fix a typo when invoking tar(1) to create the debug distributions.

# d8fee543 12-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from HEAD


# 11d9aa67 11-Feb-2015 Colin Percival <cperciva@FreeBSD.org>

Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.

The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive. Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.

The next steps will be:

2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.

3. Merging src/games into src/usr.bin.

This change will not be MFCed.

Reviewed by: jmg
Discussed at: EuroBSDCon
Approved by: gjb (release-affecting changes)

# b48e3e73 11-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove remnant from texinfo

# c69a9896 10-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add a new target make stageworld which basically does the same job as:
make installworld distribution but preparing the mtree the same way
distributeworld does and respecting -DNO_ROOT

# cf4b80d8 09-Feb-2015 Glen Barber <gjb@FreeBSD.org>

Exclude 'tests' from DEBUG_DISTRIBUTIONS.

Sponsored by: The FreeBSD Foundation

# 64e55c39 09-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove remnants from texinfo

# 3f98b1eb 09-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add a user message to explain what package is being created

# 53200025 08-Feb-2015 Rui Paulo <rpaulo@FreeBSD.org>

Merge xz 5.2.0.

This brings support for multi-threaded compression. This brings close
N times faster compression where N is the number of CPU cores.
Because of this, liblzma now depends on libthr.

Soon libarchive will be modified to use the new lzma API.

Thanks to antoine@ for the exp-run.

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


# 0b6a052e 08-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove the verbose flag from pkg invocation as it is not in pkg releases yet

# 183a8ead 08-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add a new kernel-pkgs target to create pkg(8) packages from the kernel

The version scheme used is the following:
For stable/current branches:
${REVISION}.sYYYYMMDDhhmmss

s standing for snapshot

For releases branches:
${REVISION}_${PATCHLEVEL}

When packaging the kernel 2 different package are created per kernel
release (only contains the regular kernel and modules)
debug (contains the .symbols files)

Note that package the kernel (packaging world will follow the same rule) can
only by passing -DNO_ROOT to the build (hence can be done as a regular user)

To package the kernel:
make buildkernel
make distributekernel DESTDIR=/somewhere -DNO_ROOT
make kernel-pkgs DESTDIR=/somewhere -DNO_ROOT

The packages will be created inside the DESTDIR

# 9312c006 08-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

if BUILD_PKGS is set add sha256 hash into the metalogs

# 31a741f4 03-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Conditionalize building radius support into libpam, ppp, etc via
MK_RADIUS_SUPPORT

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

# 27051ca1 23-Jan-2015 Ed Maste <emaste@FreeBSD.org>

Restore addr2line to cross tools

Addr2line is not required for the build, and a per-arch binary is no
longer required with the switch to the ELF Tool Chain. However, building
these tools during the cross tools stage can be useful for developers
who cross build HEAD from stable/10, and adds very little to the build
time.

Reviewed by: ian, imp
Differential Revision: https://reviews.freebsd.org/D1583

# 8b817932 21-Jan-2015 Ed Maste <emaste@FreeBSD.org>

Fix bootstrap on systems with old libdwarf and WITHOUT_CDDL

ELF Tool Chain tools need libelf and libdwarf.

Submitted by: jmallett (earlier version)
Reviewed by: jmallett
Sponsored by: The FreeBSD Foundation

# da010b56 21-Jan-2015 Ed Maste <emaste@FreeBSD.org>

Remove addr2line from cross elftoolchain tools list

It is not required, and there is no reason to install it just because it
came with the binutils cross tools.

Sponsored by: The FreeBSD Foundation

# 2d281361 02-Jan-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove GNU texinfo from base along with all info pages.

To be able to info pages consider installing texinfo from ports print/texinfo or
via pkg: pkg install texinfo

Differential Revision: https://reviews.freebsd.org/D1409
Reviewed by: emaste, imp (previous version)
Relnotes: yes

# 7d612a43 30-Dec-2014 Ed Maste <emaste@FreeBSD.org>

Use BINUTILS_BOOTSTRAP knob for binutils only

Previously it also disabled building elftoolchain bootstrap tools such as
strip(1).

Differential Revision: https://reviews.freebsd.org/D1398
Reviewed by: imp
Sponsored by: The FreeBSD Foundation

# 851cc4c0 21-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Update the text for building texinfo with build-tools to reflect the fact
that make install is being called as well

MFC after: 1 week
X-MFC with: r276052

# 492c2b1f 21-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Build selective portions of gnu/usr.bin/texinfo as part of build-tools to
ensure that building on a host without makeinfo (i.e. a host where
make delete-old -DWITHOUT_INFO was run), then building with MK_INFO == yes
doesn't manifest in build errors when building info pages

This manifested itself like the following when I was build testing an MFC
change on stable/10:

makeinfo --no-split -I /usr/src/gnu/lib/libregex/doc -I /usr/src/gnu/lib/libregex/doc regex.texi -o regex.info
makeinfo: not found
*** [regex.info] Error code 127

make[6]: stopped in /usr/src/gnu/lib/libregex/doc
1 error

Tested on a head VM without makeinfo installed and by building with MK_INFO=yes

MFC after: 1 week

# 9e7d291e 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Fix accidental MK_DEBUG_FILES=no addition to NXBMAKE in r275909

X-MFC with: r275909
Sponsored by: EMC / Isilon Storage Division

# c8ed1da7 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Don't build full clang toolchain or clang extras in stages 1-3 of buildworld

MFC after: 1 week
Reviewed by: dim (as part of a "larger" diff)
Phabric: D1336
Sponsored by: EMC / Isilon Storage Division

# f703589e 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Fix building/installing tests when TESTSBASE != /usr/tests

The work in r258233 hardcoded the assumption that tests was the last component
of the tests tree by pushing tests as an explicit prefix for the paths in
BSD.tests.dist and /usr was the prefix for all tests, per BSD.usr.dist and all
of the mtree calls used in Makefile.inc1. This assumption breaks if/when one
provides a custom TESTSBASE "prefix", e.g. TESTSBASE=/mytests .

One thing that r258233 did properly though was remove "/usr/tests" creation
from BSD.usr.dist -- that should have not been there in the first place. That
was an "oops" on my part for the work that was originally committed in r241823

MFC after: 2 weeks
Phabric: D1301
Reviewed by: imp
Sponsored by: EMC / Isilon Storage Division

# f9d93ea7 17-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Fix sporadic build failures due to race when running make installworld
when strip gets replaced at install time by adding it to ITOOLS for the
default usr.bin/xinstall STRIP_CMD

This will fix the failure noted in this Jenkins build step:
https://jenkins.freebsd.org/job/Build-UFS-image/688/

This will also fix the issue reported by alfred@ dealing with installing on
targets that differ from build hosts (e.g. installing on i386/i386 when built
on amd64/amd64)

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

# 5f25ee9c 16-Dec-2014 Brooks Davis <brooks@FreeBSD.org>

Add an UPDATING entry and warning about the change in r274807 to help users
transition to the new behavior.

Discussed with: jmallett
Sponsored by: DARPA, AFRL

# 46fe68cd 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Add makewhatis to ITOOLS if MK_MAN != no

This will fix installation with differing host targets in installworld, so
one can build i386/i386 on an amd64 host, then install to an i386/i386 target

Reported by: alfred
Phabric: D1280
MFC after: 1 week

# 317b32d4 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Build gperf with xdev as part of _xb-bootstrap-tools

This will unbreak the build when "env MK_CXX=no make delete-old" has been run
on the build host post-r272849

Tested with the following commands:

/bin/sh
export __MAKE_CONF=/dev/null SRCCONF=/dev/null
export MK_CLANG=no MK_CLANG_BOOTSTRAP=no MK_GCC=yes MK_GCC_BOOTSTRAP=yes
export MK_GNUCXX=yes TARGET=armv6 TARGET_ARCH=arm make xdev
make toolchain
make xdev-build
sudo -E make xdev-install
/usr/armv6-freebsd/usr/bin/cc -dumpmachine | grep arm

X-MFC with: r272849
Reported by: Dan Raymond <draymond@foxvalley.net>, gjb


# 2bc62d50 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Build gperf with xdev as part of _xb-bootstrap-tools to unbreak the build
if/when MK_CXX == no and make delete-old has been run on the build host,
post-r272849

Tested with the following command:

% sudo env MK_CLANG=no MK_CLANG_BOOTSTRAP=no MK_GCC=yes MK_GCC_BOOTSTRAP=yes \
MK_GNUCXX=yes make xdev

# 1955a4bf 07-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Push the build-tools logic down into Makefile.inc1 so it's localized all in
one spot, and the potential for installing to the wrong DESTDIR is lower

# da976f9d 05-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

MFhead @ r275496


# 31942939 01-Dec-2014 Ed Maste <emaste@FreeBSD.org>

Build infrastructure for elftoolchain tools

Set WITH_ELFTOOLCHAIN_TOOLS in src.conf to use the elftoolchain version
of the following tools:

* addr2line
* elfcopy (strip / mcs)
* nm
* size
* strings

Reviewed by: bapt (earlier version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1224

# 1d91a058 28-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

share/termcap requires ex from usr.bin/vi in order to compile, and since usr.bin
comes after share in SUBDIR in Makefile.inc1, the build will fail when vi is not
installed on the build host

Run build-tools for usr.bin/vi and install ex, etc to WORLDTMP to enable building
share/termcap on hosts that don't have nvi installed on them

# f541dd9b 26-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Implement MK_RADIUS_SUPPORT to make libradius and assorted support optional

# 7e57795a 25-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Don't try and build 32-bit versions of hyperv / bhyve

# 0e97688f 21-Nov-2014 Brooks Davis <brooks@FreeBSD.org>

Slightly alter the handling of LOCAL_LIB_DIRS to skip addition of
directories in LOCAL_LIB_DIRS if they are subdirectories of directories
listed in LOCAL_DIRS. This allows a hierarchy like:

foo
foo/lib
foo/usr.bin
foo/usr.sbin

to be supported with LOCAL_DIRS=foo LOCAL_DIRS=foo/lib.

MFC after: 1 week
Sponsored by: DARPA, AFRL

# e163efb6 21-Nov-2014 Brooks Davis <brooks@FreeBSD.org>

Add a guard against attempting to invoke the buildenv target with -j# as
that silently exits rather than doing something useful.

MFC after: 1 week
Sponsored by: DARPA, AFRL

# e93397e5 16-Nov-2014 Sean Bruno <sbruno@FreeBSD.org>

Add mv, echo and hostname to the native-xtools target. Missed these
when profiling.

MFC after: 2 weeks

# e98c3c3f 16-Nov-2014 Sean Bruno <sbruno@FreeBSD.org>

Flush out many more static binaries that can be used in a jail for building
pkgs via poudriere. This removes a significant amount of emulation speeding
up run times.

Phabric: D1172
Reviewed by: imp
MFC after: 2 weeks

# 2c8c40a7 13-Nov-2014 Sean Bruno <sbruno@FreeBSD.org>

Add more static binaries to the native-xtools target. These help speed
up the cross builds significantly.

adding:
bin/sh
bin/csh
sbin/md5
usr.bin/bzip2
usr.bin/fetch
usr.bin/gzip
usr.bin/tar
usr.bin/unzip
usr.bin/xz

Phabric: D1146
Reviewed by: imp bdrewery
MFC after: 2 weeks

# 6e48c752 07-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Fix build race in Makefile.inc1 after r274226 by adding lib/libm__L dependency
for gnu/lib/libdialog

Sponsored by: EMC / Isilon Storage Division

# b78618fb 06-Nov-2014 Devin Teske <dteske@FreeBSD.org>

For really fast machines, an edge-case may exist where dpv(3) may be
built before contrib dependency, dialog(3). Add dialog(3) to the list
of _prebuild_libs to ensure that this does not happen.

Tested on: 11.0-CURRENT amd64 @ r274205
Thanks to: kargl, Larry Rosenman <ler@lerctr.org>, ngie, markj
Recommended by: ngie
Reviewed by: ngie, markj
MFC after: 21 days
X-MFC-to: stable/10 stable/9
X-MFC-with: 274116 274120 274121 274123 274144 274146 274192 274203

# 2b293f6a 06-Nov-2014 Devin Teske <dteske@FreeBSD.org>

SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for me.
Add to using _prebuild_libs in (top-level) Makefile.inc1.
NB: Unbreak build yet again (we'll get this right eventually)

Reviewed by: markj, ngie
Thanks to: ian, markj, ngie, Nikolai Lifanov <lifanov@mail.lifanov.com>
MFC after: 21 days
X-MFC-to: stable/10 stable/9
X-MFC-with: 274116 274120 274121 274123 274144 274146 274192

# 75c3b117 27-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Rename XFLAGS to XCFLAGS and XXFLAGS to XCXXFLAGS

This is less confusing names and actually more reflexting what they are intended
to.

Discussed with: brooks

# b55e8e6e 21-Oct-2014 Warner Losh <imp@FreeBSD.org>

My previous commit exposed an issue as it fixed a different
issue. lib/atf isn't a prereq_lib, since it isn't required for other
libraries to build. Remove it. The old kludge of always building it
had effectively been retired. Since we don't want to build the
libraries with the tests when we're bootstrapping, invent
MK_TESTS_SUPPORT which normally defaults to the current MK_TESTS
value, except when explicitly defined. Make lib/atf depend on it being
yes. When building the libraries set MK_TESTS to no, and
MK_TESTS_SUPPORT to the current value of MK_TESTS so that later stages
of the build work correctly. This should fix (and does for me)
people's issues with parallel builds racing between lib/atf and
libexec/atf. Since lib/atf is built during the libraries phase, the
race disappears.

# 983678dd 21-Oct-2014 Warner Losh <imp@FreeBSD.org>

Generate both userland and kernel option settings for showconfig.

PR: 191920

# e8a66c33 21-Oct-2014 Warner Losh <imp@FreeBSD.org>

You aren't allowed to test WITH_xxx or WITHOUT_xxx here, so remove it.
Even if you were allowed to test for it, the test makes no sense as it
always results in adding -DWITH_ATF unless WITH_ATF was already
defined. But if MK_ATF != no, then we know it was defined. This, in
turn, caused tools/build/options/makemake always think WITH_ATF is the
default, which removed control of that from sys.conf.mk.

To get the intent of the deleted comment, another mechanism is
required, assuming that the intent of that comment is desirable.

# 1ff70c71 21-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Make the external toolchain support grows to the knowleged of XXFLAGS for C++ dedicated flags
and DEPFLAGS for mkdep flags
Pass the path to the libc++ headers in both, enforce the gnu++11 standard in the XXFLAGS
to satisfy libc++ requirements pass the libc++ objectdir as a location where to find
libraries so it can find libstdc++.so and libstdc++.A

Reviewed by: imp

# a5edb5fb 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Add size(1) to the cross build toolchain

# 8329338c 08-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Fix typo

# 481d7bbf 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Add OBJCOPY to the list of external tools

# 46d3ab75 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Fix build when XCC is defined and X_COMPILER_TYPE is not

# 3dce4cb5 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Add CROSS_TOOLCHAIN macro select pre seeded external toolchain configuration files
The goal is to provide pre seeded toolchain configurations withing the ports tree
to allow the use of an external toolchain in a simple way:

make CROSS_TOOLCHAIN=powerpc64-gcc TARGET=powerpc TARGET_ARCH=powerpc64 buildworld

This will look for the external toolchain definition in /usr/local/share/mk/powerpc64-gcc.mk
While here add the notion of X_COMPILER_TYPE to the external toolchain framework to allow
to deal with differences between gcc and clang in regards of cross building

# 06429175 05-Oct-2014 Mark Johnston <markj@FreeBSD.org>

Fix dependency errors when linking libproc.

Reported by: Oliver Hartmann
X-MFC-With: r272488

# c36047bd 03-Oct-2014 Xin LI <delphij@FreeBSD.org>

Add dependencies to various libraries to libzfs and libzpool.

Submitted by: sef

# 3dde11c4 30-Sep-2014 Andrew Turner <andrew@FreeBSD.org>

Fix the TARGET_ABI value clang uses. It shpuld be gnueabi on all ARM
soft-float architectures, and gnueabihf for hard-float.

# 6d4766c1 01-Oct-2014 Andrew Turner <andrew@FreeBSD.org>

Remove MK_ARM_EABI, the armeb issues have been fixed. The code to support
the oabi is still in the tree, but it is expected this will be removed
as developers work on surrounding code.

With this commit the ARM EABI is the only supported supported ABI by
FreeBSD on ARMa 32-bit processors.

X-MFC after: never
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D876

# be26ce21 23-Sep-2014 Enji Cooper <ngie@FreeBSD.org>

Have distrib-dirs, distribution, hier, hierarchy, redistribute, and reinstall
depend on the .MAKE special target

This will allow users to do something like the following to print out the
results of the running the simulated make target with bmake, like some of the
other top-level make targets in Makefile.inc1:

% make -f Makefile.inc1 -n distribution TARGET=i386 TARGET_ARCH=i386

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 217c8381 17-Sep-2014 Will Andrews <will@FreeBSD.org>

Root the lib32 object tree under the overall object tree.

This enables a common root directory for all object files for a given tree,
which eases sharing a common MAKEOBJDIRPREFIX, and cleaning up of object trees.

In particular, one can simply (from the source directory) rm -rf /usr/obj$(pwd)
to destroy all object files for it. Or to copy/sync files, etc.

Reviewed by: bdrewery
CR: https://reviews.freebsd.org/D796
MFC after: 1 month
Sponsored by: Spectra Logic

# 5608fd23 19-Aug-2014 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r267233 for now. PIE support needs to be reworked.

1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
where it never would work anyhow, such as csu or loader. This suggests
there may be better ways of adding support to the tree. Many of these
cases can be fixed such that -fPIE will work but there is really no
reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
really building libraries but have been using bsd.prog.mk because the code
is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by: kib

# 75872267 18-Aug-2014 Warner Losh <imp@FreeBSD.org>

Create the native-xtools target. This target creates only the cross
building toolchain for the host computer. This toolchain produces
TARGET_ARCH and assumes the rest of the system contains libraries for
the target. It is intended to be used in a "qemu-user jail" where all
the binaries would otherwise be the target architecture's to build
ports. However, emulation of the compilers is too slow, so we build
native binaries for that. Rather than use the xdev produced binaries,
with all their weird links and paths, these binaries use the native
paths. They will not work unless installed into the qemu-user jail.

Differential Revision: https://phabric.freebsd.org/D518
Reviewed by: sbruno@

# 51483c42 15-Aug-2014 Enji Cooper <ngie@FreeBSD.org>

Fix atmconfig compilation when MK_ATM == yes and MK_BSNMP == no

Makefile.inc1:
Always compile gensnmptree with bootstrap-tools when MK_BSNMP != no
instead of depending on a potentially stale tool installed on the build host

sbin/atm/atmconfig/Makefile:
- Always remove oid.h to avoid cluttering up the build/src tree.
- Consolidate all of the RESCUE/MK_BSNMP != no logic under one
conditional to improve readability
- Remove unnecessary ${.OBJDIR} prefixing for oid.h and use ${.TARGET} instead
of spelling out oid.h
- Add a missing DPADD for ${LIBCRYPTO} when compiled MK_BSNMP == yes and
MK_OPENSSL == yes and not compiling for /rescue/rescue

sbin/atm/atmconfig/main.c:
Change #ifndef RESCUE to #ifdef WITH_BSNMP in main.c to make it
clear that we're compiling bsnmp support into atmconfig

Approved by: jmmv (mentor)
Phabric: D579
PR: 143830
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 37fbf898 08-Aug-2014 Rui Paulo <rpaulo@FreeBSD.org>

Run dtrace in 32-bit mode when compiling 32-bit libraries.

MFC after: 3 days

# 51fa06dd 07-Aug-2014 Ian Lepore <ian@FreeBSD.org>

m4 now requires libohash, ensure it gets built when bootstrapping.

# 4504fbd3 07-Aug-2014 Ollivier Robert <roberto@FreeBSD.org>

10 has a new flex (2.5.37) and the config.h for unbound has been updated to
take this into account. Alas it breaks source upgrade from any version of
9 because flex is not built as a bootstrap-tools (it would be for older
versions).

That means "libunbound/configlexer.c" is built with the old flex but using
config.h for the new one. Build is thus broken going from 9.* to 10.

Make flex a bootstrap-tools entry if host is less than 1000033 to take into
account the flex update in 10.

Tested on both 9.2-RC3 and 9.3 by myself and dim@. Running buildworld in
head but as both 10 and 11 has the new flex, it will not matter.

Reviewed by: imp
Approved by: des, imp
MFC after: 1 week
Phabric: D554

# 92dbec66 04-Aug-2014 Brooks Davis <brooks@FreeBSD.org>

Merge from CheriBSD:

Make the sysinit tool a build tool rather than building in with
/usr/bin/cc and running it from OBJDIR. (It will be moved to usr.bin
once a manpage is written and a few style cleanups are done.)

Split the makefile bits for Hans' kernel shim layer into their own
includable kshim.mk.

Move USB support into a .mk file so loaders can include it.

# 22cbbf9d 23-Jul-2014 Sean Bruno <sbruno@FreeBSD.org>

Deprecate the use of XDEV and XDEV_ARCH and just use TARGET/TARGET_ARCH
for the xdev build target, which is awesome and totally works.

Reapply svn R268377 with correct name of libsupc++ here as this does
resolve one dependancy race when building the xdev target.

the xdev target builds for amd64, i386, mips, mips64 and armv6 with this commit,
must be built as root, must be built from /usr/src, must not have a /usr/obj and
places the xdev tools in /usr/$TARGET_ARCH-freebsd

the xdev target still leaves some assorted files strewn about your /usr/src when
this is done and needs to be investigated further.

Phabric: https://phabric.freebsd.org/D385
Submitted by: bsdimp

# 1782c649 21-Jul-2014 Dimitry Andric <dim@FreeBSD.org>

Run mtree for BSD.tests.dist during make xdev-install, if the tests are
enabled (which they are in the default configuration). Otherwise, it
will fail because ${XDDESTDIR}/usr/include/atf-c does not exist.

MFC after: 3 days

# 9e88096e 10-Jul-2014 Warner Losh <imp@FreeBSD.org>

Make MK_GNUCXX mean "build the libstdc++ and libsupc++ libraries" and
nothing more. Force it to be "no" when MK_CXX is "no" to simplify
usage. It no longer also means "build g++" since we no longer have a
platform where that's interesting now that pc98 no longer needs clang
and gcc, but not g++. pc98 now just uses clang after boot2 changes.

# 9e488366 10-Jul-2014 Warner Losh <imp@FreeBSD.org>

Separate out the links creation from the other targets. This was
supposed to have been done for the original commit, but somebody
forgot.

Pointy-hat-to: imp@

# 9016d25f 07-Jul-2014 Warner Losh <imp@FreeBSD.org>

Typo means that this couldn't have possibly fixed anything, so revert
r268377.

# 8bc01eb6 07-Jul-2014 Warner Losh <imp@FreeBSD.org>

xdev builds libsupc++ and libstdc++ in a slightly strange way. This
cause a race to be exposed between the two. Compensate for this race
by serializing the build/install of libstdc++ before libsupc++.

# 50f73640 02-Jul-2014 Marcel Moolenaar <marcel@FreeBSD.org>

Remove ia64 from the list of known architectures and add an entry to
UPDATING. This is the first step towards the removal of ia64 from
head. A buildworld for ia64 will now yield:

% make buildworld
make[1]: "/usr/src/Makefile.inc1" line 151: Unknown target ia64:ia64.

While here, trim the ia64-specific additions from ObsoleteFiles.inc

Discussed at: BSDcan

# ffc6fb79 01-Jul-2014 Glen Barber <gjb@FreeBSD.org>

Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:

r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.

Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.

r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)

Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.

r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution

This also follows other naming conventions seen in the
wild.

r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.

This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.

r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.

MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation

# 824a9093 29-Jun-2014 Ed Maste <emaste@FreeBSD.org>

Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT

The _SUPPORT knobs have a consistent meaning which differs from the
behaviour controlled by this knob. As the knob is opt-out and has not
appeared in a release the impact should be low.

Suggested by: imp, wblock
MFC after: 1 week

# a0e6a013 17-Jun-2014 Bryan Drewery <bdrewery@FreeBSD.org>

- Add a LOCAL_ITOOLS to allow adding additional tools required for the
installworld and distributeworld targets

PR: 179562
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
MFC after: 1 week

# cce0f182 12-Jun-2014 Ed Maste <emaste@FreeBSD.org>

Build vt(4) fonts during buildworld

vtfontcvt(8) is now built during buildworld, so can be used as a
bootstrap tool to create vt(4) fonts from source .hex or .bdf font
files, rather than having uuencoded binary fonts in the tree.

Sponsored by: The FreeBSD Foundation

# e8a34402 10-Jun-2014 Julio Merino <jmmv@FreeBSD.org>

Put the test suite in its own tests.txz distribution file.

Force all the contents of /usr/tests to go into a separate distribution
file so that users of binary releases can easily choose to not install it.

To make this possible, we need two fixes:
- bsd.subdir.mk needs to properly honor NO_SUBDIR in all cases so that we
do not recurse into 'tests' subdirectories when we needn't. Otherwise,
we end up with some Kyuafiles in base.txz.
- etc/Makefile needs to skip installing tests in its 'distribute' target
so that a Kyuafile doesn't leak into base.txz.

Approved by: gjb

# 864c53ea 08-Jun-2014 Bryan Drewery <bdrewery@FreeBSD.org>

In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.

This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by: Shawn Webb <lattera@gmail.com>
Discussed between: des@ and Shawn Webb [2]

# 403ec796 22-May-2014 Warner Losh <imp@FreeBSD.org>

When libelf and libdwarf were updated, we didn't bump the minimal
version needed for CTF tools, so sometimes we'd use the host's CTF
tools that didn't work. Be sure to bootstrap in that case.

# e00e69ab 21-May-2014 Xin LI <delphij@FreeBSD.org>

Fix build: Build libavl as prebuild-lib.

X-MFC-With: 266520

# 7273339d 10-May-2014 Warner Losh <imp@FreeBSD.org>

Eliminate EARLY_BUILD flag. It is redundant and means MK_CLANG_FULL=no
and MK_LLDB=no, so set those explicitly (now that we can do
that). Simplify tests for these variables as well, since we know they
will always be defined regardless of the phase of the build.

# ab72ce6b 10-May-2014 Warner Losh <imp@FreeBSD.org>

Migrate NO_WARN to MK_WARN. Support legacy NO_WARN usage. Remove a
check for EARLY_BUILD because it isn't necessary (MK_WARN=no will
always be defined for that).

# a46954e2 05-May-2014 Warner Losh <imp@FreeBSD.org>

Document src.opts.mk changes and the decoupling of /etc/src.conf from
anything but the source tree.

# c6063d0d 05-May-2014 Warner Losh <imp@FreeBSD.org>

Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.

# cf35c685 03-May-2014 Thomas Quinot <thomas@FreeBSD.org>

Add appropriate quoting to allow building with a KERNCONFDIR containing
spaces.

PR: kern/162736
MFC after: 1 week

# 56d78e82 30-Apr-2014 Warner Losh <imp@FreeBSD.org>

Turns out this .if evaluated not in the context of the makedtb target
sometimes due to Makefile expansion rules. Make the test for things
being NULL elsewhere...

# 0edb7351 30-Apr-2014 Warner Losh <imp@FreeBSD.org>

Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a
kernel config file. If you also want to have a static DTB compiled
into your kernel, however, it cannot be a list. We have no mechanism
in the kernel for picking one, so that doesn't make sense and will
result in a compile-time error.

# 52cb8b8f 28-Apr-2014 Warner Losh <imp@FreeBSD.org>

Add dependency for libm to libstdc++. This fixes high -j value builds
when not building with clang.

Submitted by: ian@

# 845b7c7b 26-Apr-2014 Warner Losh <imp@FreeBSD.org>

make_dtb.sh is designed to be used in a kernel build environment where
MACHINE is defined to the target's value, not the host's
value. However, in Makefile.inc1, it is still defined to be the host's
value. Make the makedtb target work by expanding TARGET in the
existance test, and passing MACHINE=$TARGET in the call to make_dtb.sh

# 347c9de0 25-Apr-2014 Warner Losh <imp@FreeBSD.org>

Eliminate NO_INCS. It is used one place, and MK_TOOLCHAIN=no will
handle the job just as well. Opt for simplicity rather than one more
option.

# 98407b8b 25-Apr-2014 Warner Losh <imp@FreeBSD.org>

Spell NO_PROFILE= as MK_PROFILE=no.

# 96267df3 25-Apr-2014 Warner Losh <imp@FreeBSD.org>

Remove NO_CTF, exccept as an undocumented compatibility
option. Convert all other uses to MK_CTF=no. Set MK_CTF=no rather than
the indirect WITHOUT_CDDL in filemon regression. It is expected that
NO_CTF will be removed in FreeBSD 12 entirely.

# 2bf36e7e 18-Apr-2014 Warner Losh <imp@FreeBSD.org>

Separate out enabling building clang and/or gcc for the system and
building clang and/or gcc as the bootstrap compiler. Normally, the
default compiler is used. WITH_CLANG_BOOTSTRAP and/or
WITH_GCC_BOOTSTRAP will enable building these compilers as part
bootstrap phase. WITH/WITHOUT_CLANG_IS_CC controls which compiler is
used by default for the bootstrap phase, as well as which compiler is
installed as cc. buildworld now successfully completes building the
cross compiler with WITHOUT_CLANG=t and WITHOUT_GCC=t and produces a
built system with neither of these included.

Similarlly, MK_BINUTILS_BOOTSTRAP controls whether binutils is built
during this phase.

WITHOUT_CROSS_COMPILER will now force MK_BINUTILS_BOOTSTRAP=no,
MK_CLANG_BOOTSTRAP=no and MK_GCC_BOOTSTRAP=no.

BOOTSTRAP_COMPILER was considered, but rejected, since pc98 needs both
clang and gcc to bootstrap still. It should be revisisted in the
future if this requirement goes away. Values should be gcc, clang or
none. It could also be a list.

The odd interaction with Xfoo cross/external tools needs work, but
is beyond the scope of this change as well.

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

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

Determine whether to build clang and its bootstrap tools the same
way. This allows a clang bootstrap to happen, even when WITHOUT_CLANG
is defined. This is a minimal version of a more extensive change which
can be MFC'd more easily. However, we have to also test to see if
we're building clang as not cc, since the bootstrap for that needs
these cross tools and it is easier to build them in just one place.

MFC after: 1 week

# 62c4a462 04-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Prevent XDTP from being a relative path
XDTP is used as the default SYSROOT for clang and thus should be an absolute path.

PR: arm/188249
Submitted by: Edgar Martinez <wink15987@gmail.com>
Reviewed by: imp

# e4dbff8a 03-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

XDDESTDIR should not be set by the user, instead the user might want to tweak
XDTP and let the standard DESTDIR decide where to install.

Discussed with: imp

# cf44c89b 03-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Some xdev fixes:

- if TARGET_ARCH is not defined and XDEV_ARCH is defined then early define
TARGET_ARCH to the valud of XDEV_ARCH: This allow the xdev-build target
to be able to correctly chose the compiler it needs to build
- Allow overwriting XDTP to allow a user to not chose where the xdev env will
live in
- Fix build for gcc only xdev (like ia64) by providing the proper -B to the
toolchain and not relying on gcc being installed already in base
- Fix TOOLS_PREFIX so the generated toolchain has the right default sysroot when
installed intead of getting the DESTDIR one
- Fix supporting DESTDIR
- Also overwrite CXX (needed for cross building c++ libraries with clang) and
CPP (needed to cross build some libraries when gcc is the target default
compiler but gcc is not installed on the building host)

Discussed with: imp

# c77d0c98 01-Apr-2014 Warner Losh <imp@FreeBSD.org>

It is possible that MK_GNUCXX is "yes" but MK_CXX is "no" so make sure
MK_CXX isn't "no" before building these libraries.

# ae85a489 01-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Ensure make xdev respect which compiler is CC
and which compilers should be built according to standard build options

# 63e4d6f7 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

There's no need to guess at the COMPILER_TYPE to pass it down. We
guess wrong for buildkernel when CC=gcc49, say. Eliminate all the
guessing. COMPILER_TYPE propigates properly on its own, if specified,
and we guess it correctly otherwise lower in the build. Also, fix
conditionals for armv6hf when using an external compiler chain. They
were broken before, but unused. Also, prefer checking the compiler
type over CLANG_IS_CC since the latter is only supposed to be used to
determine what symlinks to install (more fixes to follow).

# bfbada6e 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

Move stray targets out of the xdev section.

# 15eee895 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

Kill NO_TESTS and use MK_TESTS=no when we want to skip them.

# e091d985 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

Allow the build system to safely set MK_FOO to avoid the ambiguity
when both WITH_FOO and WITHOUT_FOO are set. Use this where
possible. Only disallow setting of MK_FOO on the command line. This
was preferable to inventing a new mechanism or fixing the undef bug
(bin/183762) which precludes users from turning off anything we turn
off for parts of the build with WITHOUT_FOO prior to this.

# 53eff78a 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

When building g++, we need to build libsupc earlier to avoid a race
with libproc. Not sure why people didn't see this before now, but I
get it often for higher (20-30) -j builds, but never for -j1 builds.

# bd633799 28-Mar-2014 Warner Losh <imp@FreeBSD.org>

Only set XDDESTDIR if it wasn't already set to allow people to
override it.

# 73279d41 22-Mar-2014 Andrew Turner <andrew@FreeBSD.org>

Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.

This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit.
This is an optional coprocessors may not be present in all devices, however
it appears to be in all current SoCs we support.

armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too
old to support this. Because of this there are a number of WITH/WITHOUT
options that are unsupported and must be left as the default value. The
options and their required value are:
* WITH_ARM_EABI
* WITHOUT_GCC
* WITHOUT_GNUCXX

In addition, without an external toolchain, the following need to be left
as their default:
* WITH_CLANG
* WITH_CLANG_IS_CC

As there is a different method of passing float and double values to
functions the ABI is incompatible with existing armv6 binaries. To use
this a full rebuild of world is required. Because no floating point values
are passed into the kernel an armv6 kernel with VFP enabled will work with
an armv6hf userland and vice versa.

# ae094461 20-Mar-2014 Alan Somers <asomers@FreeBSD.org>

Fix kern/187712: config(8) does not respect KERNCONFDIR.
The impact of this bug is that you cannot build a kernel if both of the
following are true:
1) The kernel config file is in a non-default location
2) The kernel config file uses the "include" statement from config(5).

usr.sbin/config/main.c
usr.sbin/config/config.8
usr.sbin/config/config.h
usr.sbin/config/lang.l
Added a "-I path" option to config(8). By analogy to cc(1), it adds
an extra path in which the "include" statement will search for
files.

Makefile.inc1
Pass "-I ${KERNCONFDIR}" to config(8).

PR: kern/187712
Reviewed by: will, imp (previous version)
MFC after: 3 weeks
Sponsored by: Spectra Logic Corporation

# 02701f04 14-Mar-2014 Warner Losh <imp@FreeBSD.org>

With the more generous footprints today, it makes little sense to use
UFS1 by default any more. Switch to UFS2.

# 2c284d93 13-Mar-2014 Gleb Smirnoff <glebius@FreeBSD.org>

Remove IPX support.

IPX was a network transport protocol in Novell's NetWare network operating
system from late 80s and then 90s. The NetWare itself switched to TCP/IP
as default transport in 1998. Later, in this century the Novell Open
Enterprise Server became successor of Novell NetWare. The last release
that claimed to still support IPX was OES 2 in 2007. Routing equipment
vendors (e.g. Cisco) discontinued support for IPX in 2011.

Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.

# 3b8f61cb 01-Mar-2014 Marcel Moolenaar <marcel@FreeBSD.org>

Use ${MAKE} so that we always use the same version/implementation
of make.

# eeb913c9 28-Feb-2014 Warner Losh <imp@FreeBSD.org>

Integrate device-tree upstream files into the build process:
(1) Invoke cpp to bring in files via #include (although the old
/include/ stuff is supported still).
(2) bring in files from either vendor tree or freebsd-custom files
when building.
(3) move all dts* files from sys/boot/fdt/dts to
sys/boot/fdt/dts/${MACHINE} as appropriate.
(4) encode all the magic to do the build in sys/tools/fdt/make_dtb.sh
so that the different places in the tree use the exact same logic.
(5) switch back to gpl dtc by default. the bsdl one in the tree has
significant issues not easily addressed by those unfamiliar with
the code.

# d2ed6da0 30-Jan-2014 Brooks Davis <brooks@FreeBSD.org>

Merge from CheriBSD:
commit 1b41f6de7ca09e04fdc6f66bc478ea6c981a41b9
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date: Mon Jan 27 22:59:02 2014 +0000

Now that mtree is always nmtree use it as mtree

Tested on: ref9-amd64
X-MFC after: never
Sponsored by: DARPA, AFRL

# 2b29a85c 24-Jan-2014 Alan Somers <asomers@FreeBSD.org>

Fix the build so -DNO_TESTS is passed in various phases that don't
require tests in order to build or install. Crucially, don't try to
install tests during the lib32 install phase. This commit supersedes
r261081, which fixed the lib32 install phase problem, but didn't fix
other phases.

Submitted by: Garrett Cooper
Reviewed by: sjg
MFC after: 13 days

# a8eb96d5 23-Jan-2014 Alan Somers <asomers@FreeBSD.org>

Replace the old unix_seqpacket and unix_seqpacket_exercise tests, which
were a little broken and not automatable, with unix_seqpacket_test.
It's coverage is a superset of the old tests and it uses ATF. It
includes test cases for bugs kern/185813 and kern/185812.

PR: kern/185812
PR: kern/185813
Sponsored by: Spectra Logic
MFC after: 2 weeks

# 385d6d47 22-Jan-2014 John Baldwin <jhb@FreeBSD.org>

Generate /var/db/services.db during 'make distribution' so that it is
present during new installs. Update etcupdate and mergemaster to
ignore the generated file.

Tested by: gjb (release build)
MFC after: 1 month

# 50b464aa 07-Jan-2014 Scott Long <scottl@FreeBSD.org>

Remove aicasm as a build dependency. It made sense when the ahc and ahd
drivers and their firmware were under active development, but those days
have passed. The firmware now exists in pre-compiled form, no longer
dependent on it's sources or on aicasm. If you wish to rebuild the
firmware from source, the glue still exists under the 'make firmware'
target in sys/modules/aic7xxx.

This also fixes the problem introduced with r257777 et al with building
kernels the old fashioned way in sys/$arch/compile/$CONFIG when the
ahc/ahd drivers were included.

# 42a85952 02-Dec-2013 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Please welcome casperd daemon. It (and its services) will be responsible for
giving access to functionality that is not available in capability mode
sandbox. The functionality can be precisely restricted.

Start with the following services:
- system.dns - provides API compatible to:
- gethostbyname(3),
- gethostbyname2(3),
- gethostbyaddr(3),
- getaddrinfo(3),
- getnameinfo(3),
- system.grp - provides getgrent(3)-compatible API,
- system.pwd - provides getpwent(3)-compatible API,
- system.random - allows to obtain entropy from /dev/random,
- system.sysctl - provides sysctlbyname(3-compatible API.

Sponsored by: The FreeBSD Foundation

# 2f02600a 01-Dec-2013 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Move my simple logging API to a separate library. It is now already used
by hastctl(8), hastd(8) and auditdistd(8) and will soon be also used
by casperd(8) and its services. There is no documentation and pjdlog.h
header file is not installed in /usr/include/ to keep it private.
Unfortunately we don't have /lib/private/ at this point, only
/usr/lib/private/, so the library is installed in /lib/.

Sponsored by: The FreeBSD Foundation

# 091b8336 17-Nov-2013 Peter Wemm <peter@FreeBSD.org>

Attempt to move the POSIX iconv* symbols out of runtime linker space.
FreeBSD systems usually implemented this as a third party module and
our implementation hasn't played as nicely with the old way as it could
have.

To that end:
* Rename the iconv* symbols in libc.so.7 to have a __bsd_ prefix.
* Provide .symver compatability with existing 10.x+ binaries that
referenced the iconv symbols. All existing binaries should work.
* Like on Linux/glibc systems, add a libc_nonshared.a to the ldscript
at /usr/lib/libc.so.
* Move the "iconv*" wrapper symbols to libc_nonshared.a

This should solve the runtime ambiguity about which symbols resolve
to where. If you compile against the iconv in libc, your runtime
dependencies will be unambiguous.

Old 9.x libraries and binaries will always resolve against their
libiconv.so.3 like they did on 9.x. They won't resolve against libc.

Old 10.x binaries will be satisified by the .symver helpers.

This should allow ports to selectively compile against the libiconv
port if needed and it should behave without ambiguity now.

Discussed with: kib

# 5efcd27a 16-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Move all atf directories to the tests mtree.

This is to ensure that test-related directories don't get needlessly
created (and later deleted) when MK_TESTS=no.

Problem found by jhb@.

Approved by: rpaulo (mentor)

# d8efce39 13-Nov-2013 Colin Percival <cperciva@FreeBSD.org>

Strip the -pN patch level from the VERSION string which gets encoded into
CTF data. Otherwise FreeBSD Update builds think every kernel file has
changed every time there's a security advisory, since the FreeBSD Update
build code isn't smart enough to look inside CTF data to ignore those
changes.

Pointy hat to: cperciva
MFC after: 1 day, or before the next BETA

# d3109d39 08-Nov-2013 Ian Lepore <ian@FreeBSD.org>

This change builds kernel tools based on the same assumption as building
the kernel itself: If building for the same architecture as the build host,
the kernel build assumes that the host toolchain is capable of building the
kernel. If it's not, "make kernel-toolchain" will bootstrap a new set of
tools that will work.

With this change the same assumptions are made for building kernel tools,
and the existing host toolchain is used to do the build (notably, the build
doesn't link the tools with the legacy libraries, which may not even exist).
If ever for some reason the host toolchain isn't capable of building the
kernel tools, then doing a "make kernel-toolchain" will bootstrap newer
tools to get the job done.

So when built as part of buildworld or kernel-toolchain, the kernel tools
are built using the XMAKE (via BMAKE) commands and environment. When built
as part of building just the kernel on a same-target host, the tools are
built using the new KTMAKE commands and environment. What doesn't jump
out at you in the diffs is that the difference between BMAKE and KTMAKE
is that BMAKE contains this magic line which changes how the build is done
because it changes what files get included for .include <bsd.prog.mk> and
other standard includes:

MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"

and KTMAKE doesn't, and contains this instead:

TOOLS_PREFIX=${WORLDTMP}

Hopefully this brings the "how to build aicasm with the right toolchain"
saga to a conclusion that works in all usage scenarios that have
historically been supported.

# e01d128a 08-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Subsume the functionality of MK_ATF into MK_TESTS.

There is no reason to keep the two knobs separate: if tests are
enabled, the ATF libraries are required; and if tests are disabled,
the ATF libraries are not necessary. Keeping the two just serves
to complicate the build.

Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)

# ee695f67 08-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Add libatf-c++ to the prebuild libs.

Some tests may require C++ so we must ensure this library exists as part
of the bootstrap process or else they will fail to build. Do this by
just depending on lib/atf as part of the bootstrap libraries instead of
using lib/atf/libatf-c.

Submitted by: Garrett Cooper <yaneurabeya at gmail dot com>
Approved by: rpaulo (mentor)

# 57028ca4 08-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Fix buildworld when WITH_TESTS is enabled.

The addition of the TESTS knob and its enabling of the build of tests in
lib/libcrypt/tests/ broke the build. The reason is that we cannot descend
into tests/ subdirectories until all prerequisites have been built, which
in the case of tests may be "a lot of things" (libatf-c in this case).

Ensure that we do not walk tests/ directories during the bootstrapping of
the libraries as part of buildworld.

Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)

# 6abd71b0 07-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Build kernel tools along with other tools during world build, as well as
during kernel build (if they didn't get done with world). This will make
-DMODULES_WITH_WORLD work, and it ensures the kernel tools are built
as part of 'make kernel-toolchain'.

# ed39dd91 07-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Instead of modeling the kernel-tools build after the bootstrap tools, build
kernel tools the way cross-tools get built. This seems to result in the
tool getting installed in the right place. It also seems more correct in
retrospect, because if a tool emitted code or binary data as part of
building the kernel, it should do so in target-specific ways (endianess,
architecture, whatever). That issue is moot for aicasm, our only current
tool, but it still seems to be more correct in principle.

# f382c38e 06-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Do not build aicasm with the cross-tools/kernel-toolchain, instead add a
proper kernel-tools step/target modeled after the world build-tools stuff.

This is a re-do of r257730 which was backed out in r257734, but this time
it's one byte smaller... a leftover trailing backslash resulted in a .for
loop with no rules, so no compiler stuff got built and later steps built
with the wrong toolset.

# 74832336 05-Nov-2013 Glen Barber <gjb@FreeBSD.org>

Revert r257730:
Make head/ buildable again, instead of spewing garbage like:
/src/gnu/lib/csu/../../../contrib/gcc/config/rs6000/crtsavres.asm:280:
Error: no such instruction: `lwz 28,-16(11)'

# 5da6cd47 05-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Do not build aicasm with the cross-tools/kernel-toolchain, instead add a
proper kernel-tools step/target modeled after the world build-tools stuff.

# f827d58e 04-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Rework the aicasm build machinery so that it gets built along with toolchain
components instead of with the kernel and/or modules. This ensures that it
gets built with the host compiler, not the compiler in obj/... used to build
the target components (which may be a cross-compiler outputting code for a
different architecture and using header files with types and options set up
for the wrong architecture).

Reviewed by: imp

# 8b78b15b 29-Oct-2013 Xin LI <delphij@FreeBSD.org>

In r257079, SRCDIR is pointed to ${.CURDIR} when not set. However,
Makefile.inc1 is being called in sub-make's where make(1) would,
by default, implicitly chdir(2) to ${.OBJDIR} before executing any
targets. This would make some targets, like delete-old, when trying
to derive various variables introduced by change r256921 using
``make -f Makefile.inc1'' that also rely on SRCDIR to fail.

This changeset adds an explicit cd ${.CURDIR} before these unwrapped
make calls, making them in line with the other ones that are already
being wrapped with the explicit chdir's.

Tested by: gjb
MFC after: 5 days

# 3d2fb95a 28-Oct-2013 Yoshihiro Takahashi <nyan@FreeBSD.org>

Fix build. Both clang and gcc are required on pc98.

X-MFC with: r256915

# e2197f80 24-Oct-2013 Rui Paulo <rpaulo@FreeBSD.org>

Set up the /usr/tests hierarchy.

Populate /usr/tests with the only test programs that currently live
in the tree (those in lib/libcrypt/tests/) and add all the build
machinery to accompany this change.

In particular:

- Add a WITHOUT_TESTS variable that users can define to request that
no tests be put in /usr/tests.
- Add a top-level Kyuafile for /usr/tests and a way to create similar
Kyuafiles in top-level subdirectories.
- Add a BSD.tests.dist file to define the directory layout of
/usr/tests.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

# 57bd24ce 24-Oct-2013 Glen Barber <gjb@FreeBSD.org>

Fix build host pollution by avoiding calling 'uname -srp' to
determine values for 'VERSION'.

Looked at by: cperciva

# 44c38c2c 24-Oct-2013 Glen Barber <gjb@FreeBSD.org>

Revert r256921 to prevent error output when in the wrong directory.
This should have been reverted with the stable/10/Makefile.inc1
revert, but apparently my commit did not go through.

Discussed with: cperciva (originally)

# a0c65623 22-Oct-2013 Colin Percival <cperciva@FreeBSD.org>

Thou shalt not leak build host state into the system being compiled.

The VERSION variable is encoded into the SUNW_ctf sections of the kernel
and every kernel module when dtrace is enabled; starting with 9.2-RELEASE
(when dtrace was turned on in GENERIC) this means that different host kernels
will result in very different kernel binaries being generated. This tripped
up freebsd-update builds after the build boxes were updated from 9.x to 10.x.

MFC after: 3 days (stable/9)
X-MFC after: 0 days (stable/10)
Security: Rendered two members of so@ temporarily insane

# f936a2e5 22-Oct-2013 Brooks Davis <brooks@FreeBSD.org>

Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC. This allows
bootstrapping a copy of clang without building clang for the base system
which is useful for nanobsd and similar setups. It's still probably
wrong to conflate what is installed as /usr/bin/cc with the selection
of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another
day.

MFC after: 1 week
Sponsored by: DARPA/AFRL

# e45e2255 21-Oct-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make delete-old-libs' and 'make check-libs' to delete .debug
files created by WITH_DEBUG_FILES. Also cleanup .symbols files from
the period between r244236 when .symbols were supported and r251512
when they were renamed to .debug.

Only propose to delete a .debug file if the corresponding library
itself was deleted already.

Reported by: des
Reviewed by: emaste (earlier version)
Approved by: bapt
MFC after: 3 days

# 923cfb89 16-Oct-2013 Ian Lepore <ian@FreeBSD.org>

Allow 'make xdev' to work when DESTDIR is set.

Submitted by: Patrick Kelsey <kelsey@ieee.org>

# c60c0372 10-Oct-2013 Dimitry Andric <dim@FreeBSD.org>

Bump OS versions in the toolchain triples to 11.0, and bump the
__FreeBSD_cc_version predefined macros in clang and gcc.

Approved by: re (gjb)

# 5bab7367 01-Oct-2013 Xin LI <delphij@FreeBSD.org>

Revert-and-redo r255955: the sort -r should be added to delete-old-dirs.

Approved by: re (gjb)

# 5cf4a427 30-Sep-2013 Xin LI <delphij@FreeBSD.org>

Reverse directories order when doing 'make delete-old-dir'. This
ensures subdirectories gets removed before their parents when doing
make delete-old.

Approved by: re (gjb)
MFC after: 2 weeks

# 56b72efe 30-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove BIND.

Approved by: re (gjb)

# 865f7779 24-Sep-2013 John Baldwin <jhb@FreeBSD.org>

Don't parse NO_ROOT metadata for extra kernels if NO_ROOT isn't defined.

Approved by: re (gjb)
MFC after: 1 week

# e8192c89 22-Sep-2013 Andrew Turner <andrew@FreeBSD.org>

Remove the armv6eb architecture as it is unused, and almost certainly
broken. None of our kernels can boot armv6eb. The little-endian kernels do
not have the required code to be able to switch endian when running a
big-endian executable.

Approved by: re (gjb)

# 31caf4c8 17-Sep-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make installcheck' to check for missing UID/GID as well, broken
since r249893, by adding a separate _installcheck_world and
_installcheck_kernel so the destination targets can be more explicit
on which they are needed for.

installcheck will call both, while installworld only calls
_installcheck_world and installkernel only calls _installcheck_kernel

While here, mark the internal targets as starting with _.

Reported by: des
Reviewed by: des
Pointyhat to: bdrewery
Approved by: re (delphij)

# 91270ec5 16-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Add unbound to the list of UIDs / GIDs to check fore before installing.

Approved by: re (blanket)

# 9cfa8b3f 10-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Clean up the OpenSSH build. It is now possible to build most components
as static binaries, if desired. The one exception is sshd, which runs
into trouble due to libpam.a's includion of pam_ssh.

Make OpenSSH use LDNS if available. This allows it to verify signed
SSHFP records.

Approved by: re (blanket)

# 2442cc58 08-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Create a private library directory (LIBPRIVATEDIR) for libraries which
we don't want to expose but which can't or shouldn't be static.

To mark a library as private, define PRIVATELIB in its Makefile. It
will be installed in LIBPRIVATEDIR, which is normally /usr/lib/private
(or /usr/lib32/private for 32-bit libraries on 64-bit platforms).

To indicate that a program or library depends on a private library,
define USEPRIVATELIB in its Makefile. The correct version of
LIBPRIVATEDIR will be added to its run-time library search path.

Approved by: re (blanket)

# 06362369 29-Aug-2013 Bryan Drewery <bdrewery@FreeBSD.org>

- Fix LOCAL_MTREE so it properly handles multiple files and quotes
its value into submakes

PR: conf/179466
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
Approved by: bapt
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# f0957cca 11-Aug-2013 Peter Wemm <peter@FreeBSD.org>

Update nvi-1.79 to 2.1.1-4334a8297f

This is the gsoc-2011 project to clean up and backport multibyte support
from other nvi forks in a form we can use.

USE_WIDECHAR is on unless building for the rescue crunchgen. This should
allow editing in the native locale encoding.

USE_ICONV depends on make.conf having 'WITH_ICONV=YES' for now. This
adds the ability to do things like edit a KOI8-R file while having $LANG
set to (say) en_US.UTF-8. iconv is used to transcode the characters for
display.

Other points:
* It uses gencat and catopen/etc instead of homegrown msg catalog stuff.
* A lot of stuff has been trimmed out, eg: the perl and tcl bindings which
we could never use in base anyway.
* It uses ncursesw when in widechar mode. This could be interesting.

GSoC info: http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/zy/1
Repo at: https://github.com/lichray/nvi2

Obtained from: Zhihao Yuan <lichray@gmail.com>


# 2d0bcb76 23-Jul-2013 Ed Maste <emaste@FreeBSD.org>

Generate debug data release dist sets

If WITH_DEBUG_FILES is set the standalone debug data will be excluded
from each ${dist}.txz and placed in a ${dist}.debug.txz.

Submitted by: gjb
Reviewed by: brooks

# bb6d7d0e 05-Jul-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Sprinkle some .MAKE magic

# 03630b54 30-Jun-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Use && rather than ; when success of previous job matters.

# c872793d 14-Jun-2013 Brooks Davis <brooks@FreeBSD.org>

Simplify the hierarchy target's logic. [0]

Run hierarchy with WORLDTMP in the path so it works when it is invoked
directly. Such use is nearly alwasy wrong but appears to be common.[1]

PR: conf/178209 [0], conf/178547 [1]
Submitted by: Garrett Cooper <yaneurabeya@gmail.com> [0]
MFC after: 5 days

# d3187057 14-Jun-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Flag recursive make targets with .MAKE
so that job token pipe is passed to them.
To avoid surprising anyone, only add .MAKE to ${TGTS} when -n
has not been specified (at least for Makefile).

Reviewed by: obrien

# aa5084e4 13-Jun-2013 Brooks Davis <brooks@FreeBSD.org>

Be more agressive about bootstrapping ctfmerge and ctfconvert so
builds from existing releases have a chance of working properly.

Sponsored by: DARPA, AFRL
MFC after: 3 days

# 42f8c5b5 07-Jun-2013 Ed Maste <emaste@FreeBSD.org>

Add a new knob WITH_DEBUG_FILES to control the building of standalone
debug files for userland programs and libraries. The "-g" debug flag
is automatically applied when WITH_DEBUG_FILES is set.

The debug files are now named ${prog}.debug and ${shlib}.debug for
consistency with other systems and documentation. In addition they are
installed under /usr/lib/debug, to simplify the process of installing
them if needed after a crash. Users of bsd.{prog,lib}.mk outside of the
base system place the standalone debug files in a .debug subdirectory.
GDB automatically searches both of these directories for standalone
debug files.

Thanks to everyone who contributed changes, review, and testing during
development.

# b9bcca07 05-Jun-2013 Jilles Tjoelker <jilles@FreeBSD.org>

release: Allow empty extra distributions.

For example, WITHOUT_SHAREDOCS= in src.conf creates an empty doc
distribution.

Submitted by: Kurt Lidl
Tested by: Kurt Lidl
Discussed with: gjb
MFC after: 1 week

# 80ba5ec8 30-May-2013 Brooks Davis <brooks@FreeBSD.org>

Restore (at least temporarily) SHARED=symlinks in the build includes
stage of buildworld. This was accidentally included in r251140.

Reported by: jhb

# 6c461479 30-May-2013 Brooks Davis <brooks@FreeBSD.org>

Always define INSTALL_DDIR and define it such that it contains no extra
/ characters rather than removing them later on. This should fix
release builds.

PR: conf/178963
Reviewed by: gjb, hrs

# 4e02fd95 28-May-2013 Glen Barber <gjb@FreeBSD.org>

r245757 introduced warning output if update method is set to CVS_UPDATE
or SUP_UPDATE.

CVS exporter for head/ is turned off for nearly one month now.

It is finally time to swing the ax at these update methods.

Reviewed by: eadler
MFC after: 1 month

# 527f7dc3 28-May-2013 Glen Barber <gjb@FreeBSD.org>

Update comments to reflect use of svn/svnup to keep the src/ tree up
to date.

MFC after: 3 days

# 25fbccdc 28-May-2013 Peter Wemm <peter@FreeBSD.org>

Temporarily revert r251058 - it breaks documented use of makeoptions
including the tinderbox.

http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-i386-i386.full
make: don't know how to make modules-all. Stop
make: stopped in /obj/i386.i386/src/sys/PAE
*** Error code 2

# 13b85cea 28-May-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

During buildkernel, print a banner before building modules.

# 6cf6aae2 26-May-2013 Eitan Adler <eadler@FreeBSD.org>

Remove backwards compat layer which was added in r71419 (in 2001).

This change is not intended for MFC.

Reviewed by: peter

# 936d0074 24-May-2013 Marcel Moolenaar <marcel@FreeBSD.org>

Fix building on slightly older -current and stable systems after
the switch to bmake. The rescue bits are built via crunchgen,
which didn't respect the MAKE environment variable until r237574
(i.e. ~11 months ago). This resulted in a failure due to bmake's
internal -J flag being passed around and not being understood by
the standard (i.e. host's) make.
Note that the failure is conditional upon having the jobServer
feature enabled within bmake.

# ab76bc97 21-May-2013 Jung-uk Kim <jkim@FreeBSD.org>

Connect flex 2.5.37 to the build and bump __FreeBSD_version.

# 96cd1f74 21-May-2013 Brooks Davis <brooks@FreeBSD.org>

Restore the ability to build on systems with 32-bit compat when
the system compiler is not clang. clang and gcc appear to differ
signficantly in their interpretation of -isystem and --sysroot. Further
work is likely required to support an external gcc.

Reported by: andreast, fidaj@ukr.net, sergey.dyatko@gmail.com

# 54cf6141 20-May-2013 Brooks Davis <brooks@FreeBSD.org>

Fix distributekernel in the non NO_ROOT case.

PR: conf/178775
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>

# 39da820b 16-May-2013 Brooks Davis <brooks@FreeBSD.org>

Implement NO_ROOT support for distributekernel and packagekernel.

# a09aff83 15-May-2013 Brooks Davis <brooks@FreeBSD.org>

Add support for an external cross compiler. The cross compiler is
specified by passing the XCC, XCXX, and XCPP variables (corresponding to
CC, CXX, and CPP) to buildworld/buildkernel. The compiler must be clang
or be configured to target the appropriate architecture.

To speed build times, if XCC is an absolute path or
WITHOUT_CROSS_COMPILER is defined then no cross compiler will be built
during the cross-tools stage.

Limited documentation of this feature can currently be found at:

https://wiki.freebsd.org/ExternalToolchain

This functionality should be considered experimental and is subject to
change without notice.

Sponsored by: DARPA, AFRL
Discussed with: imp, sjg

# 6b5b16be 11-May-2013 Antoine Brodin <antoine@FreeBSD.org>

Add compile_et to kerberos bootstrap tools.
This makes it possible to build a regular world on a host without kerberos.

PR: conf/178421
Submitted by: Garrett Cooper
MFC after: 1 month

# f26a777c 01-May-2013 Benno Rice <benno@FreeBSD.org>

Optimize SUBDIR_OVERRIDE such that SUBDIR isn't automatically defined if
SUBDIR_OVERRIDE is defined.

PR: conf/174071
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
Sponsored by: EMC / Isilon Storage Division

# ec6bcfa1 29-Apr-2013 Eitan Adler <eadler@FreeBSD.org>

A transition period of more than two years is more than enough:
Remove the compatibility code added in 2011-02-10.

This change is not intended for MFC

Reviewed by: imp

# 55d1493a 24-Apr-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix installworld with DB_FROM_SRC after r249807

Approved by: bapt
Reported by: Tom Everett

# 61f75c49 23-Apr-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix installkernel requiring users/groups defined in CHECK_UIDS
and CHECK_GIDS to exist since r152680. This is only needed for
installworld. The documented procedure of running mergemaster -p
to check for missing users is only needed for installworld, not
for installkernel. This fixes auditdistd incorrectly being
required for installkernel.

PR: misc/174405
Approved by: bapt

# b18ddb2a 20-Apr-2013 Mikolaj Golub <trociny@FreeBSD.org>

This should have been committed in r249666.

MFC after: 1 month

# 139f7f9b 12-Apr-2013 Dimitry Andric <dim@FreeBSD.org>

Upgrade our copy of llvm/clang to trunk r178860, in preparation of the
upcoming 3.3 release (branching and freezing expected in a few weeks).

Preliminary release notes can be found at the usual location:
<http://llvm.org/docs/ReleaseNotes.html>

An MFC is planned once the actual 3.3 release is finished.


# 862c0d36 31-Mar-2013 Andrew Turner <andrew@FreeBSD.org>

Fix xdev-install when installing to a location other than /

# 45fab5d8 31-Mar-2013 Andrew Turner <andrew@FreeBSD.org>

Fix xdev. Clang and libc were not building correctly on older worlds, for
example, on 9.1.
* To fix clang add an _xb-bootstrap-tools target that mirrors the existing
bootstrap-tools target in the full world.
* For libc have the compiler use the newly installed includes, and, while
here, tell the compiler about the xdev library path as some other
libraries will link against the installed libraries.

# 829e39ff 27-Mar-2013 Rene Ladan <rene@FreeBSD.org>

Fix a typo, 'xdev-build' should be spelled with a 'd' at the end.

Approved by: cognet

# ac66f4a9 05-Mar-2013 Xin LI <delphij@FreeBSD.org>

libzfs_core depends on libnvpair, explicitly say this in Makefile.inc1.

This fixes build with make -j.

# dce1a726 05-Mar-2013 Martin Matuska <mm@FreeBSD.org>

WiP merge of libzfs_core (MFV r238590, r238592)
not yet working, ioctl handling needs to be changed


# 776a9ddc 25-Feb-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

In all situations where we need to bootstrap yacc, we also need to
bootstrap liby. This was not readily apparent, because a normal 'make
buildworld' or 'make toolchain' builds liby before building anything
that uses yacc. However, 'make kernel-toolchain' does not build
headers or libraries, so it was not possible to build a kernel from
head on, say, stable/9 without first building the complete toolchain.

MFC after: 1 week

# 0af99eef 14-Feb-2013 Hiroki Sato <hrs@FreeBSD.org>

- Fix libmd dependency. It is needed in the bootstrap library list because
usr.bin/xinstall depends on it.
- Remove libutil from usr.bin/xinstall/Makefile. No symbol was actually used.

Reviewed by: brooks

# 3e381257 09-Feb-2013 Brooks Davis <brooks@FreeBSD.org>

Add nmtree to ITOOLS if it is installed on the host instead of keying off
the BOOTSTRAPPING variable. The previous test was wrong because
BOOTSTRAPPING is 0 in most cases.

Tested by: db

# 1dc56acd 04-Feb-2013 Andrew Turner <andrew@FreeBSD.org>

Fix xdev by using the install shell script as it knows about the -l
argument thile the local version install may not.

# de17cbcc 03-Feb-2013 Hiroki Sato <hrs@FreeBSD.org>

- Add CHECKSUM.* support in Makefile[1].
- Use ln -fs to create a symlink.
- Remove pkgadd for docports.
- Use WITHOUT_JADETEX=yes instead of WITH_JADETEX=no.
- Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.
- Use makefs(8) and gpart(8) for sparc64 ISO image[2].
- Add publisher option to makefs(8)[2].

Based on work by: gjb[1]
Discussed with: marius, nwhitehorn[2]

# 64dc091f 29-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Log the addition of login.conf.db, passwd, pwd.db, and spwd.db via cat -l.

Make cat a bootstrap tool to facilitate this.

# beb7ecad 29-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Fix installworld when nmtree is not on the host by only adding it to
ITOOLS when we will be using the host copy.

Fix installkernel when -DNO_ROOT is set.

# 1113cd31 29-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Fix installworld when the host does not need to bootstrap nmtree.

Reported by: lev, jmg

# 6784ea85 25-Jan-2013 Glen Barber <gjb@FreeBSD.org>

Fix update method (s/SUP/CVS) warning.

Submitted by: Ryan Stone
MFC after: 1 day

# 40f0cb19 24-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Strip any trailing slash off of the -D argument to install to support the
rather fragile destdir stripping in the metalog.

# 4a63ae11 22-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Introduce a new option -DNO_ROOT that allows install and distribution
targets to be run without root privilege.

Information about ownership, group, flags, and suid bits are stored in
the file specified by METALOG which defaults to ${DESTDIR}/METALOG.
This file can be used in conjunction with bsdtar or makefs to generate
archives or file system images with correct permissions.

The packageworld target has been altered to use this metadata allowing
non-root releases (subject to further changes in release/Makefile.)

Sponsored by: DARPA, AFRL
Reviewed by: ian, ray

# c3b739c7 22-Jan-2013 David Chisnall <theraven@FreeBSD.org>

Fix spurious leading / on dtc path in Makefile.inc1. Spotted by jhb.

# af0dd31f 22-Jan-2013 David Chisnall <theraven@FreeBSD.org>

Import new (BSDL) device tree compiler. Now built by default, so that it can't
be used on the host system (and not installed on the device, if required). The
GPL'd one is still available if there are any devices that need it (make
universe passes with it, including kernels that use fdt, but there may be some
out-of-tree ones). WITH_GPL_DTC can be used to select the old one, for now.

Probably won't be MFC'd, but we'll remove the GPL'd version in head after the
new one has had a lot more testing and ship it in 10.0.

# 6a473a7d 21-Jan-2013 Glen Barber <gjb@FreeBSD.org>

Chase r245756 of make.conf(5):

- If update method is SUP_UPDATE or CVS, warn that those
update methods are deprecated.

- While here, remove bogus NO_WWWUPDATE.

MFC after: 3 days
X-MFC-with: r245756

# 706b1b65 21-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Always bootstrap nmtree if it is not available on the host. It is fairly
small and it is quite annoying to get all the way through buildworld
only to discover that you forgot the DB_FROM_SRC (or soon NO_ROOT)
option.

# 00f793f8 18-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Remove a harmless (somewhat to my surprise) bogon that crept into r245440.

# 75534bda 17-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Rework the mtree portion of etc/Makefile's distrib-dirs target to run
mtree in a shell loop so there is only one mtree commandline. Move the
implementation of LOCAL_MTREE into etc/Makefile.

Sponsored by: DARPA, AFRL
Reviewed by: mtree :)

# c109162f 17-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Correct the distrib-dirs target in the -DDB_FROM_SRC case.

# afd9b463 17-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Add a new LIBRARIES_ONLY make variable to disable the build and install
of files other than the actual libraries.

Use LIBRARIES_ONLY to supress the inclusion of files in the lib32
distribution that are duplicates of files in base.

Sponsored by: DARPA, AFRL
Reviewed by: emaste

# 41a8e223 14-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Add an option DB_FROM_SRC to use src/etc's user/group databases when
installing. This allows things like running installworld for 10-CURRENT
on a 9.0-RELEASE system without adding extra users and groups to the
passwd and group files.

To prevent potentially risky uid/gid mismatches on systems with
non-standard local values, require that DESTDIR be set if DB_FROM_SRC is
set.

Sponsored by: DARPA, AFRL
Reviewed by: peter

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

Revert r245316. Systems with non-standard uids/gids are more prevalent
that I'd feared. Discussion is ongoing about the scope of a safer
solution.

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

Use the -N option to install and nmtree to eliminate the need for the
checks for missing users and groups.

Sponsored by: DARPA, AFRL

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

Use find -exec to install zoneinfo instead of requiring xargs to be an
install tool.

Suggested by: delphij

# 3da2132e 10-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Add xargs to the set of install tools when zoneinfo is not disabled.
This fixes installworld which I had broken in r245265.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>

# 248da532 02-Dec-2012 Peter Wemm <peter@FreeBSD.org>

Add auditdistd to the pre-install required uid check list.

# ddcc951f 30-Nov-2012 Simon J. Gerraty <sjg@FreeBSD.org>

The build-tools step during build32 also needs the -legacy magic.

Approved by: marcel (mentor)

# cff4243d 19-Nov-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Unbreak amd64 cross-build where amd64 is the target. While clang
may be installed as cc and we don't need to build gcc as a
cross-tools, we still build gcc and thus need cc_tools built
as a build tool. Not doing this results in building gengenrtl with
the target compiler while we need to run it on the build machine.

# 0c704c35 10-Nov-2012 Dimitry Andric <dim@FreeBSD.org>

Work around pc98 tinderbox failures in sys/boot/pc98, by making sure a
cross gcc gets built during the cross-tools stage.

MFC after: 1 week
X-MFC-With: 242706

# c175365c 21-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Add ATF to the build. This is may be a bit rought around the egdes,
but committing it helps to get everyone on the same page and makes
sure we make progress.

Tinderbox breakages that are the result of this commit are entirely
the committer's fault -- in other words: buildworld testing on amd64
only.

Credits follow:

Submitted by: Garrett Cooper <yanegomi@gmail.com>
Sponsored by: Isilon Systems
Based on work by: keramida@
Thanks to: gnn@, mdf@, mlaier@, sjg@
Special thanks to: keramida@

# 29f5a35c 17-Oct-2012 Brooks Davis <brooks@FreeBSD.org>

Allow LOCAL_(DIRS,LIBS) to install files in directories not found in the
system mtree files via a LOCAL_MTREE variable which contains a list of
mtree files to be applyed along with the base mtree files to the tmp root
and DESTDIR.

# aae8db90 07-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Fix the showconfig target. bmake sends debug output to stderr.

Submitted by: Simon Garrety <sjg@juniper.net>

# 8d6871f4 07-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Fix 32-bit library builds after the removal of adding -E to make for AS,
CC, CXX and LD. This fix implements the intended as it should have been
implemented all along: by passing AS, CC, CXX and LD on the commandline
of the sub-make instead of in the environment of the sub-make.

Breakage pointed-out by: dim@

# 0815243c 06-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Add support for bmake. This includes:
1. Don't do upgrade_checks when using bmake. As long as we have WITH_BMAKE,
there's a bootstrap complication in ths respect. Avoid it. Make the
necessary changes to have upgrade_checks work wth bmake anyway.
2. Remove the use of -E. It's not needed in our build because we use ?= for
the respective variables, which means that we'll take the environment
value (if any) anyway.
3. Properly declare phony targets as phony as bmake is a lot smarter (and
thus agressive) about build avoidance.
4. Make sure CLEANFILES is complete and use it on .NOPATH. bmake is a lot
smarter about build avoidance and should not find files we generate in
the source tree. We should not have files in the repository we want to
generate, but this is an easier way to cross this hurdle.
5. Have behavior under bmake the same as it is under make with respect to
halting when sub-commands fail. Add "set -e" to compound commands so
that bmake is informed when sub-commands fail.
6. Make sure crunchgen uses the same make as the rest of the build. This
is important when the make utility isn't called make (but bmake for
example).
7. While here, add support for using MAKEOBJDIR to set the object tree
location. It's the second alternative bmake looks for when determining
the actual object directory (= .OBJDIR).

Submitted by: Simon Gerraty <sjg@juniper.net>
Submitted by: John Van Horne <jvanhorne@juniper.net>

# 9215d178 13-Sep-2012 Brooks Davis <brooks@FreeBSD.org>

Introduce a new make variable COMPILER_TYPE that specifies what
type of compiler is being used (currently clang or gcc). COMPILER_TYPE
is set in the new bsd.compiler.mk file based on the value of the CC
variable or, should it prove informative, by running ${CC} --version
and examining the output.

To avoid negative performance impacts in the default case and correct
value for COMPILER_TYPE type is determined and passed in the environment
of submake instances while building world.

Replace adhoc attempts at determining the compiler type by examining
CC or MK_CLANG_IS_CC with checks of COMPILER_TYPE. This eliminates
bootstrapping complications when first setting WITH_CLANG_IS_CC.

Sponsored by: DARPA, AFRL
Reviewed by: Yamaya Takashi <yamayan@kbh.biglobe.ne.jp>, imp, linimon
(with some modifications post review)
MFC after: 2 weeks

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

Not all Pmake derivatives silently handle empty shell output, so ensure there
is something for make(1) to consume. Bmake gives output such as:
"warning: Couldn't read shell's output for "/bin/sh -c true"
Note we parted from traditional Pmake behavior in r18864 / r18255.

# 10d2255f 03-Sep-2012 Glen Barber <gjb@FreeBSD.org>

Fix 'distributeworld' target when WITHOUT_GAMES is set.

Reviewed by: des
Approved by: des
MFC after: 3 days
X-MFC-To: 9-only

# 4da573d9 14-Aug-2012 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Merging of projects/armv6, part 3

r238211:
Support TARGET_ARCH=armv6 and TARGET_ARCH=armv6eb

This adds a new TARGET_ARCH for building on ARM
processors that support the ARMv6K multiprocessor
extensions. In particular, these processors have
better support for TLS and mutex operations.

This mostly touches a lot of Makefiles to extend
existing patterns for inferring CPUARCH from ARCH.
It also configures:
* GCC to default to arm1176jz-s
* GCC to predefine __FreeBSD_ARCH_armv6__
* gas to default to ARM_ARCH_V6K
* uname -p to return 'armv6'
* make so that MACHINE_ARCH defaults to 'armv6'
It also changes a number of headers to use
the compiler __ARM_ARCH_XXX__ macros to configure
processor-specific support routines.

Submitted by: Tim Kientzle <kientzle@freebsd.org>

# e9832bb1 30-Jul-2012 Martin Matuska <mm@FreeBSD.org>

Partial MFV (illumos-gate 13753:2aba784c276b)
2762 zpool command should have better support for feature flags

References:
https://www.illumos.org/issues/2762

MFC after: 2 weeks


# e324b4bc 03-Jul-2012 David E. O'Brien <obrien@FreeBSD.org>

Add "hier" as an alternate spelling of "hierarchy" to match hier(9).

# 5814131a 15-Jun-2012 Brooks Davis <brooks@FreeBSD.org>

Minor wording change. The previous commit message should have included:

Sponsored by: DARPA, AFRL

# 6e4ee6dd 15-Jun-2012 Brooks Davis <brooks@FreeBSD.org>

MFP4: 212854, 212854

Add a LOCAL_LIB_DIRS variable to complement the existing LOCAL_DIRS
and LOCAL_TOOL_DIRS variables. Directories in LOCAL_LIB_DIRS are
built at the end of the _generic_libs target.

Reviewed by: imp (212854)

# 883e0f87 03-Jun-2012 Dimitry Andric <dim@FreeBSD.org>

During buildworld and buildkernel, define EARLY_BUILD in the earlier
stages (build-tools, cross-tools, etc) of the build, so we can detect in
bsd.*.mk whether to pass compiler-specific flags to ${CC}.

In particular, this commit will allow using WITH_CLANG_IS_CC when the
base compiler is still gcc, and when ${CC}, ${CXX} and ${CPP} are left
at their defaults. The early stages will then be built using gcc, and
no clang-specific flags will be passed to it. The later stages will be
built as usual.

The EARLY_BUILD define can also serve other uses, such as building the
world stage C++ executables with libc++ instead of libstdc++: during the
early build stages, we cannot assume libc++ is already available, so we
must still build with libstdc++ at that time.

MFC after: 1 week

# 5bfe3851 22-May-2012 Dag-Erling Smørgrav <des@FreeBSD.org>

Bump __FreeBSD_version for the byacc import, and update _bootstrap_tools.

# 727d8c81 18-May-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Fix bootstrapping from FreeBSD 7.x: we also need to build ar.

# 9e460a98 15-May-2012 Warner Losh <imp@FreeBSD.org>

By request, add back support from 7.0 and newer, since the changes for
that are so minimal.

# 0446f881 10-May-2012 Warner Losh <imp@FreeBSD.org>

Do a bit of house cleaning and remove the old, obsolete upgrade from
6.0 support and bump the minimum version to 8.0. These versions have
not been tested and are believed to be broken.

# 51a65f35 07-May-2012 Jeremie Le Hen <jlh@FreeBSD.org>

Introduce the ${SHLIB_LDSCRIPT} variable to have an ld(1) script
instead of a symlink for .so files.

Reviewed by: kib, kan (previous version), dim
Approved by: kib (mentor)
Silence from: -hackers@
MFC after: 1 week

# ae8662c7 26-Apr-2012 Warner Losh <imp@FreeBSD.org>

Fix ordering issue. 'make xdev' can fail with -jN because it tries to run the
xdev-install step while xdev-build is still running.

Submitted by: Ian Lepore

# f8e8c8fa 28-Mar-2012 Juli Mallett <jmallett@FreeBSD.org>

o) Fix mips/mips -> mips for Makefile.inc1.
o) Rebuild src.conf.5.

# 84db023e 28-Mar-2012 Juli Mallett <jmallett@FreeBSD.org>

Assume a big-endian default on MIPS and drop the "eb" suffix from MACHINE_ARCH.
This makes our naming scheme more closely match other systems and the
expectations of much third-party software. MIPS builds which are little-endian
should require and exhibit no changes. Big-endian TARGET_ARCHes must be
changed:
From: To:
mipseb mips
mipsn32eb mipsn32
mips64eb mips64

An entry has been added to UPDATING and some foot-shooting protection (complete
with warnings which should become errors in the near future) to the top-level
base system Makefile.

# 634f9253 23-Mar-2012 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Build CTF tools as a part of toolchain for cross-compilation case

# 0e46933c 22-Mar-2012 Stanislav Sedov <stas@FreeBSD.org>

- Do not build libcom_err and compile_et when kerberos is disabled. They
depends on several heimdal libraries and not used by anything but kerberos
tools.

# ae771770 22-Mar-2012 Stanislav Sedov <stas@FreeBSD.org>

- Update FreeBSD Heimdal distribution to version 1.5.1. This also brings
several new kerberos related libraries and applications to FreeBSD:
o kgetcred(1) allows one to manually get a ticket for a particular service.
o kf(1) securily forwards ticket to another host through an authenticated
and encrypted stream.
o kcc(1) is an umbrella program around klist(1), kswitch(1), kgetcred(1)
and other user kerberos operations. klist and kswitch are just symlinks
to kcc(1) now.
o kswitch(1) allows you to easily switch between kerberos credentials if
you're running KCM.
o hxtool(1) is a certificate management tool to use with PKINIT.
o string2key(1) maps a password into key.
o kdigest(8) is a userland tool to access the KDC's digest interface.
o kimpersonate(8) creates a "fake" ticket for a service.

We also now install manpages for some lirbaries that were not installed
before, libheimntlm and libhx509.

- The new HEIMDAL version no longer supports Kerberos 4. All users are
recommended to switch to Kerberos 5.

- Weak ciphers are now disabled by default. To enable DES support (used
by telnet(8)), use "allow_weak_crypto" option in krb5.conf.

- libtelnet, pam_ksu and pam_krb5 are now compiled with error on warnings
disabled due to the function they use (krb5_get_err_text(3)) being
deprecated. I plan to work on this next.

- Heimdal's KDC now require sqlite to operate. We use the bundled version
and install it as libheimsqlite. If some other FreeBSD components will
require it in the future we can rename it to libbsdsqlite and use for these
components as well.

- This is not a latest Heimdal version, the new one was released while I was
working on the update. I will update it to 1.5.2 soon, as it fixes some
important bugs and security issues.


# 15d321c5 17-Mar-2012 Peter Wemm <peter@FreeBSD.org>

Make sure libgcc_s is finished building in _startup_libs before
building libcxxrt with high -j levels. The workaround in
libc++/Makefile isn't necessary once that race is solved.

Reviewed by: theravin

# 5e07d031 04-Mar-2012 Dimitry Andric <dim@FreeBSD.org>

Fix a thinko in r232322, where gcc (and its tools) are not built during
the cross-tools stage, if CC=clang and WITH_CLANG_IS_CC is not set.

This causes no 'cc' to be installed in the temporary cross-tools tree,
making lint fall over later in the build, because it ignores ${CC} and
attempts to run 'cc' anyway.

To fix this, only skip building gcc during cross-tools, if WITHOUT_GCC
is set, or if WITH_CLANG_IS_CC is set.

Pointy hat to: dim
MFC after: 2 weeks

# dfbaea83 29-Feb-2012 Dimitry Andric <dim@FreeBSD.org>

Add a WITH_CLANG_IS_CC option for src.conf(5), disabled by default, that
installs clang as /usr/bin/cc, /usr/bin/c++ and /usr/bin/cpp.

Note this does *not* disable building and installing gcc, which will
still be available as /usr/bin/gcc, /usr/bin/g++ and /usr/bin/gcpp. If
you want to disable gcc completely, you must use WITHOUT_GCC.

MFC after: 2 weeks

# 5db254ad 30-Jan-2012 Warner Losh <imp@FreeBSD.org>

Allow specification of build shell for the buildenv target.

Submitted by: ian lepore

# 7fa955cd 27-Jan-2012 Dimitry Andric <dim@FreeBSD.org>

When the buildkernel stage 2.3 (build tools) runs, the PATH is still set
to the default from the top-level Makefile. Therefore, invocations of
lex and yacc (used during building of aicasm) will use the executables
in /usr/bin, not those optionally built during the previous buildworld
or kernel-toolchain. This makes kernel builds from older FreeBSD
releases more difficult than necessary.

Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the
bootstrap tools directories are searched before the regular ones.

Silence from: svn-src-{all,head}
MFC after: 1 week

# d6ba7d93 15-Jan-2012 Gleb Smirnoff <glebius@FreeBSD.org>

Restore functionality to pack several kernels into release. All
kernels specified by KERNCONF are built and packed into release.
The first one is packed into kernel.txz, all others to
kernel.CONFIG.txz.

The first one is installed on bootables in /boot.

# 0d9f40f2 05-Jan-2012 Adrian Chadd <adrian@FreeBSD.org>

Fix the broken non-cross compile build. Oops!

Another pointy hat to: adrian, for stirring up more trouble.

# 9b428cfa 05-Jan-2012 Adrian Chadd <adrian@FreeBSD.org>

Allow extra directories to be added to the build-tools target.

Things such as "sh" require local tools to be built before
cross-compiling. This allows for extra software (that's
built via LOCAL_DIRS) to also have a build-tools target where
required.

# 411246d3 22-Dec-2011 Dimitry Andric <dim@FreeBSD.org>

Remove -mfancy-math from LIB32CPUFLAGS for amd64. It has been default
for our gcc since more than three years (see r181534, which is also in
stable/9 and stable/8). This flag used to be for the benefit of the old
in-kernel math emulator, which was removed more than eight years ago.

Pointed out by: arundel
MFC after: 1 week

# 83cb5bae 30-Nov-2011 Max Khon <fjoe@FreeBSD.org>

- CTF knob is now implemented using common scheme: MK_CTF=yes/no is
defined based on WITH/WITHOUT_CTF settings, default is WITHOUT_CTF,
NO_CTF overrides WITH_CTF (used by Makefile.inc1)
- CTFCONVERT_CMD/NORMAL_CTFCONVERT are now defined to empty string
if make(1) can handle empty commands

# d0ed1ea4 29-Nov-2011 Max Khon <fjoe@FreeBSD.org>

Turn off profiled libs build by default.
Can be enabled back using WITH_PROFILE=yes in /etc/src.conf

# 49c8e5e7 25-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Fix breakage after r227983; lib/libcxxrt still got built, because it was
not disabled in the usual way (by adding it to __DEFAULT_NO_OPTIONS in
share/mk/bsd.own.mk), and because the test for MK_LIBCPLUSPLUS in
Makefile.inc1 was incorrect.

Pointy hat to: dim

# bb61ba08 25-Nov-2011 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Provide proper error message when trying to build xdev, xdev-build or
xdev-install targets without either XDEV or XDEV_ARCH defined.

# 7a984708 25-Nov-2011 David Chisnall <theraven@FreeBSD.org>

Import libc++ / libcxxrt into base. Not build by default yet (use
MK_LIBCPLUSPLUS=yes to enable). This is a work-in-progress. It works for
me, but is not guaranteed to work for anyone else and may eat your dog.

To build C++ using libc++, add -stdlib=libc++ to your CXX and LD flags.

Bug reports welcome, bug fixes even more welcome...

Approved by: dim (mentor)


# dcf83bf7 24-Nov-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Revert r227841 and part of r227798. We still build libpam in two passes,
but we use STATIC_CFLAGS instead of our own private .c.o rule.

MFC after: 3 weeks

# 8e2a5aa1 22-Nov-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove libpam from _prebuild_libs. This should unbreak the -jX build.

MFC after: 3 weeks

# e03e3b69 21-Nov-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Simplify the libpam build by removing the shared modules' dependency
on the shared library. The modules are loaded by the library, so we
know it'll be there when we need it.

MFC after: 3 weeks

# 6bac4c3e 19-Nov-2011 Andreas Tobler <andreast@FreeBSD.org>

Rename the linker emulation name for powerpc and powerc64. This is needed that
we can also use the upstream binutils linker where we have to have a unique
name for the FreeBSD emulation.

# 907eed1f 10-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Revert r227403 for now. Since the cross-tools stage purposefully
doesn't have ${WORLDTMP}/usr/bin in its PATH, if you build world with
CC=clang, tblgen tools from /usr/bin will be used instead of the ones
built under ${WORLDTMP}. This can lead to various errors, especially if
you upgrade from an older clang.

Note that building world with gcc would not experience these problems,
because it only uses the tblgen tools in the world stage, where PATH
does contain ${WORLDTMP}/usr/bin.

Pointy hat to: dim

# 338f97fe 09-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Move building of clang's tblgen tools (and required libraries) from the
bootstrap-tools stage to the cross-tools stage. These tools are only
needed for generating llvm/clang include files, and are not necessary
for bootstrapping the build itself.

This shaves off some build time, because the required libraries are now
just built twice (during the cross-tools and world stages), instead of
three times.

Also, if you build world using WITHOUT_CLANG= in src.conf(5), no llvm or
clang code will be compiled at all anymore.

MFC after: 1 week

# 8dcbd431 05-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Make it possible to set CC and CXX (and optionally, AS and LD) in
make.conf(5), while allowing the build32 stage on 64-bit architectures
to still override them, so that stage can successfully build 32-bit
compatibility libraries.

Explanation:
1) The build32 stage sets environment variables CC, CXX, AS and LD for
its sub-make, to add 32-bit specific flags (-m32 and such).
2) The sub-make reads sys.mk, encounters CC?= and CXX?= assignments, so
does not alter them.
3) After some other stuff, sys.mk reads /etc/make.conf. When you have
"CC=xxx" and "CXX=yyy" statements in there, they will *override* the
build32-supplied CC/CXX values, nullifying the 32-bit specific flags.
4) Thus all objects get built as 64-bit anyway, and since LD is usually
not set in make.conf, it still has the 32-bit flags!
5) Now, whenever something is linked, you will get a "ld: Relocatable
linking with relocations from format elf64-x86-64-freebsd (foo.o) to
format elf32-i386-freebsd (bar.o) is not supported" error.

Fix this by adding "-ECC -ECXX -EAS -ELD" to the build32 sub-make
invocation, which forces those environment variables to always override
any assignment in makefiles. Thus making it possible to simply set:

CC=my-cc
CXX=my-c++

in your make.conf, or specify a path, even:

CC=/usr/local/bin/other-cc
CXX=/usr/local/bin/other-c++

Note this was never a problem on i386, since it has no build32 stage.

Silence from: current@
MFC after: 1 week

# 653eeb7f 26-Oct-2011 Ed Schouten <ed@FreeBSD.org>

Attempt to fix build logic for gensnmptree.

There are two problems with the existing logic. It builds gensnmptree
on <700018, even if WITHOUT_BSNMP is set, but more importantly, we must
not forget to build gensnmptree on systems that have originally been
built without. This causes a buildworld on those systems to fail.

MFC after: 1 week

# 6122f3e6 22-Oct-2011 Dimitry Andric <dim@FreeBSD.org>

Upgrade our copy of llvm/clang to r142614, from upstream's release_30
branch. This brings us very close to the 3.0 release, which is expected
in a week or two.

MFC after: 1 week


# e59e2d8e 03-Oct-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Farewall, sysinstall! You served us well for many years, but 10.0 is one
digit beyond your time.

Various sysinstall dependencies (e.g. libftpio, libdisk, libodialog, etc.)
will be cleaned up in coming days. Some will take longer than others due to
a few other consumers (tzsetup and sade).

# 611ff617 27-Sep-2011 Stanislav Sedov <stas@FreeBSD.org>

- Add missing interdependencies to kerberos libraries. Some of the
kerberos libraries were not linked properly (missing dependencies),
which causes 3rd party applications linking to fail when --as-needed
ld flag is used. I also added the --no-undefined ld(1) flag to make
sure that there're no missing dependencies.

MFC after: 3 days

# aa0da2e4 11-Aug-2011 Ruslan Ermilov <ru@FreeBSD.org>

- Merged awk upstream that includes a fix for a bug exposed by kmod_syms.mk.
- Provide a build aid for those who already have a buggy awk(1) installed.

Approved by: re (kib)


# 69c488cd 15-Jun-2011 Ruslan Ermilov <ru@FreeBSD.org>

It's a bit odd, but "make update" in src/ can also update the ports/,
doc/, and now www/ trees, but only using the "cvsup" transport.

When "make update" is run using a tree's makefile, it can also use
"cvs" (except for www/) and "svn" (only src/).

Clean up documentation and code regarding "make update":

- Increase oddness by adding support for WWWSUPFILE and NO_WWWUPDATE to
Makefile.inc1 (analogous to PORTSSUPFILE/NO_PORTSUPDATE and
DOCSUPFILE/NO_DOCUPDATE; WWWSUPFILE already supported by www/Makefile).

- Document all trees that support CVS_UPDATE.

- Document all trees that support SUP_UPDATE.

- Document SVN_UPDATE.

- Document NO_WWWUPDATE.

- make.conf(5) mistakenly said that *SUPFILE* had defaults.

- Add an example entry for WWWSUPFILE.

# 0163af23 18-May-2011 Warner Losh <imp@FreeBSD.org>

Implement WITH{,OUT}_{GCC,BINUTILS} to provide finer-grained control
over building gcc and binutils. They default to true, unless
MK_TOOLCHAIN is no.

Reviewed by: ru@

# 4b7e6116 18-May-2011 Warner Losh <imp@FreeBSD.org>

Clean up a loose end from the conversion from gnu ar/ranlib to the BSD
one. Without this, we don't have ar or randlib in the tool path,
leading to much pain for some users. This pain is exposed by the
external toolchain enhancements that I'm working on.

Submitted by: John Hein (ages ago, and dropped on the floor by me: sorry)

# 2eb4b00c 17-May-2011 Florent Thoumie <flz@FreeBSD.org>

Backout libinstall.a -> libpkg commit.

Discussed with: erwin, brooks, bapt

# 4b547324 13-May-2011 Attilio Rao <attilio@FreeBSD.org>

Disconnect sun4v architecture from the three.

Some files keep the SUN4V tags as a code reference, for the future,
if any rewamped sun4v support wants to be added again.

Reviewed by: marius
Tested by: sbruno
Approved by: re

# c79f2d97 11-May-2011 David E. O'Brien <obrien@FreeBSD.org>

+ DTrace as a bootstrap tool is only needed on certain older systems.
+ Be more consistent between BMAKE and TMAKE.
+ Add NO_CTF to crosstools as is done for bootstrap and build tools.

Reviewed by: marcel

# cb10fc9d 04-May-2011 David E. O'Brien <obrien@FreeBSD.org>

Correct the kernel config name printed out during install.

PR: 156579
Submitted by: dhw

# 3afb5177 22-Apr-2011 David E. O'Brien <obrien@FreeBSD.org>

Note which of the built kernels is being installed.

PR: 156579
Submitted by: dhw

# 6d67f694 17-Apr-2011 Dimitry Andric <dim@FreeBSD.org>

Remove libobjc and other Objective-C related components, as these are
extremely outdated, and not used by anything in the base system.

Silence from: current@

# b3eb927f 06-Apr-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Complete WITHOUT_CXX support. It implies WITHOUT_GROFF and
WITHOUT_CLANG.

Don't build clang bootstrap/build-tools depending on this flag. We also
keep gperf, devd and libstdc++ around to prevent foot-shooting and to
make this a two-way street.

# 1b595919 05-Apr-2011 Warner Losh <imp@FreeBSD.org>

Make clang default on x86 and powerpc, but not on other architectures.
Make fdt default on arm and powerpc.

This now includes cross compiled targets, where before we tried to
make it host-based.

Also, move the lists of default yes and no options to a variable.

In general, only build tools should get this treatment in bsd.own.mk.
Also, the use of TARGET* in the bsd.*mk files is discouraged, but
necessary here due to the ordering of things in buildworld. We make
the native case work by testing MACHINE_ARCH after TARGET_ARCH.

# 86be7546 01-Apr-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Fix the delete-old/check-old targets to work with arbitrarily long
OLD_FILES/OLD_DIRS/OLD_LIBS lists.

If you specify enough WITHOUT_FOO flags, the argument list passed to the
shell will be too long. Using .for/.endfor make(1) "loop" will make the
parser of the Makefile explode. Hack around this with good old pipes.

No objections: netchild
Reported by: b.f.

# aa0a1e58 21-Mar-2011 Jeff Roberson <jeff@FreeBSD.org>

- Merge in OFED 1.5.3 from projects/ofed/head

# 99ad39c8 02-Mar-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Improve the distributeworld target in Makefile.inc1 and update the release
infrastructure to use it. make distributeworld can now be used without
preparing its environment first and installs games into its distribution
using the regular make distribute logic instead of post-processing with
a script.

Also add two new targets, packageworld and packagekernel, that tar up the
results of distributeworld and distributekernel (also new), respectively.

# 9c216a50 01-Mar-2011 John Baldwin <jhb@FreeBSD.org>

Use a suitable DIRPRFX for each invocation of make in the build32 and
install32 targets so that the full path to each program or library is
displayed in the make output.

MFC after: 1 week

# 6be04ba6 27-Feb-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Commit two more files missed in r219089.

MFC after: 1 month

# ad30f8e7 24-Feb-2011 Gabor Kovesdan <gabor@FreeBSD.org>

Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.

This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:

- Some utilities have been added. There is a conversion table generator,
which can compare conversion tables to reference data generated by
GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
and cleaned up, now it is easy to read and it is also easier to add
support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
GNU version, i.e. sources should build with base iconv.h and
GNU libiconv. It also includes a macro magic to deal with the
char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
encoding in use
- Various cleanups and style(9) fixes.

Approved by: delphij (mentor)
Obtained from: The NetBSD Project
Sponsored by: Google Summer of Code 2009

# 423102c6 22-Feb-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Flesh out WITHOUT_GROFF support to DTRT.

A full featured groff is required during buildworld, so build it always
and don't rely on it being present on the host system.

vgrind(1) is tightly coupled to a roff processor and will not be
built/installed when groff is disabled. Also much of the roff'ed
documentation under share/doc will not be built/installed when
WITHOUT_GROFF is defined.

Reviewed by: ru (partial)

# d51726b0 21-Feb-2011 Warner Losh <imp@FreeBSD.org>

Back out 218933 and 281934. The easy cases still worked, but some
hard cases broke in worse ways than the status quo. Back them out
until that can be resolved.

# acd26693 21-Feb-2011 Warner Losh <imp@FreeBSD.org>

Select building CLANG based on ${TARGET_ARCH} and existence of
WITH{,OUT}_CLANG. We default to yes on some archs, no on others,
unless WITHOUT_CLANG or WITH_CLANG is defined respectively.

# 2754fe60 20-Feb-2011 Dimitry Andric <dim@FreeBSD.org>

Upgrade our copy of llvm/clang to r126079, from upstream's trunk.

This contains many improvements, primarily better C++ support, an
integrated assembler for x86 and support for -pg.


# 9b3d9914 10-Feb-2011 Warner Losh <imp@FreeBSD.org>

Hmmm, specifying TARGET and TARGET_ARCH in the environment doesn't
seem to work when building xdev anymore (most likely my changes lately
moving the TARGET guessing stuff to Makefile from Makefile.inc1, but I
really don't grok why). Fix make xdev by putting them on the command
line. This will work either way while I try to figure it out.

# f263e792 10-Feb-2011 Warner Losh <imp@FreeBSD.org>

CPUTYPE is now a required define for calling Makefile.inc1 diretly, so
make sure we define it for the xdev stuff.

Move xdev stuff to be last again in this file.

# xdev-build works now, but xdev-install appears to be broken though.

# fbd0c280 10-Feb-2011 Warner Losh <imp@FreeBSD.org>

You are now *REQUIRED* to pass both TARGET and TARGET_ARCH to any
invocations of Makefile.inc1 (since that's supposed to be an internal
interface for world and related targets). Document this with a .error
message. For a transition period, support passing in just TARGET, but
give a .warning for that case: I plan on removing it in 9.0...

# fda074e4 31-Jan-2011 Warner Losh <imp@FreeBSD.org>

Move the architecture guessing from Makefile.inc1 to Makefile. We
need to do this because variables specified on the command line
override those specified in the Makefile. This is why we also moved
from TARGET to _TARGET in Makefile, and then set TARGET on the command
line when we fork a submake with Makefile.inc1.

This makes mips/mips work again, even without the workaround committed to
lib/libc/Makefile.

# cd2ae253 07-Jan-2011 Warner Losh <imp@FreeBSD.org>

Retire TARGET_ABI.

Implement MACHINE_ARCH=mips64e[lb] to build N64 images. This replaces
MACHINE_ARCH=mipse[lb] TARGET_ABI=n64.

MACHINE_ARCH=mipsn32e[lb] has been added, but currently requires
WITHOUT_CDDL due to atomic issues in libzfs. I've not investigated
this much, but implemented this to preserve as much of the TARGET_ABI
functionality that I could. Since its presence doesn't affect the
working cases, I've kept it in for now.

Added mips64e[lb] to make universe, so more kernels build.

And I think this (finally) closes the curtain on the tbemd tree.

# f0a0ad3b 18-Nov-2010 Mark Murray <markm@FreeBSD.org>

Do not lint code beyond necessity (with apologies to Wiliam of Ockham).

Don't lint externally maintained CDDL code, or relint the 32-bit libraries
in amd64 mode.

# 80595f8a 13-Nov-2010 Warner Losh <imp@FreeBSD.org>

add / to the translation of TARGET_ARCH to TARGET

# 6451dd5e 13-Nov-2010 Warner Losh <imp@FreeBSD.org>

The fixes for mips/mips arm/arm compat hacks broke if TARGET or
TARGET_ARCH wasn't defined. Fix it for that case.

Submitted by: Garrett Cooper

# f10ff4ab 13-Nov-2010 Warner Losh <imp@FreeBSD.org>

Add legacy names for mips:mips and arm with TARGET_BIG_ENDIAN, for the moment.

# 39cd938c 11-Nov-2010 Ed Schouten <ed@FreeBSD.org>

Replace libgcc.a by libcompiler_rt.a.

libcompiler_rt.a is a BSD licensed C language runtime, which implements
many routines which are linked into binaries on architectures where
certain functionality is missing (e.g. 64 bits mul/div on i386).

Unfortunately, libcompiler_rt cannot replace libgcc entirely. Certain
features, such as an unwinder for exception handling, are missing.
That's why only libgcc.a is replaced for now, because this one does seem
to be complete.

Tested by: rene (amd64), nwhitehorn (powerpc), droso (i386 exprun)
and many others. Thanks!
Obtained from: user/ed/compiler-rt

# bf4724fa 09-Nov-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd:
o TARGET=mips --> little endian 32-bit mips build
o mipsel and mipseb TARGET_ARCH are both mips TARGETs
o Add some more architecture combinations

# 87ff4bce 08-Sep-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Check TARGET_ARCH as well as TARGET to determine if we are doing a cross
build. This is necessary to be able to cross-build 32-bit PowerPC from
a 64-bit PowerPC host.

Reviewed by: imp

# b12277d1 28-Aug-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Repair some build breakage introduced in r211725 and garbage collect some
code made obsolete in the same commit.

# dda89c73 24-Aug-2010 Warner Losh <imp@FreeBSD.org>

The order was correct before. I'd talked to Nathan about this before,
so this must have been mismerged into tbemd before I merged it back to
head. This unbreaks this on powerpc64

Submitted by: nathanw@

# 25faff34 23-Aug-2010 Warner Losh <imp@FreeBSD.org>

MFtbemd:

Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.

# 767bb849 22-Aug-2010 Warner Losh <imp@FreeBSD.org>

Minor tweak from tbemd

# 029a7373 21-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

Don't link drti.o with libelf_pic.a. This means that all software with
userland SDT probes must be linked with libelf explicitly.

Requested by: kib
Sponsored by: The FreeBSD Foundation

# ad8a0e42 21-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

Add clang to the cross-tools build stage.

Submitted by: Dimitry Andric <dimitry at andric.com>

# 9510083e 21-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

Add libelf to the prebuild libs.

This is needed for the DTrace instrumentation object.

Sponsored by: The FreeBSD Foundation

# 50e2303d 18-Aug-2010 Dag-Erling Smørgrav <des@FreeBSD.org>

Revert r211436; it was a good idea, but not fully thought out.

# d350d2cd 17-Aug-2010 Dag-Erling Smørgrav <des@FreeBSD.org>

Split kernel stage 3.2 (build everything) into 3.2 (build the kernel)
and 3.3 (build the modules). IMHO, this makes it a little easier to
track the progress of a kernel build using whereintheworld et al.

MFC after: 3 weeks

# c606b778 15-Jul-2010 Rafal Jaworowski <raj@FreeBSD.org>

Relax FDT_DTS_FILE validation (and unbreak world build).

Pointed out by: kib

# 24c00a90 15-Jul-2010 Rafal Jaworowski <raj@FreeBSD.org>

Fix FDT_DTS_FILE parsing to properly retrieve its value. This unbreaks the
'builddtb' target.

Make the processing more robust against non-existent kernel config files
(pointed out by imp@).

# 8bb23971 13-Jul-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Connect powerpc64 to the build. It is not presently part of make universe,
which will be added soon.

Reviewed by: imp

# d5872601 24-Jun-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd:

use MACHINE_CPUARCH instead of MACHINE_CPU since the sources for the
CSU is based on MACHINE_CPUARCH

Reviewed by: arch@ (twice)

# 4a5faa67 24-Jun-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd:

change the name of the object tree from ${TARGET} to
${TARGET}.${TARGET_ARCH} so we can do both big and little endian
builds in the same tree.

Reviewed by: arch@ (twice)

# 9998d0c0 24-Jun-2010 Warner Losh <imp@FreeBSD.org>

Merge from TBEMD:

Rather than having arch specific code in Makefile.inc1, generalize so
that we can control the settings of different options on a per
architecutre basis.

Reviewed by: arch@ (twice)

# df06a575 16-Jun-2010 Rafal Jaworowski <raj@FreeBSD.org>

Use awk alone for extracting FDT_DTS_FILE instead of grep/cut, which is
simpler and more robust.

Submitted by: Andrzej Tobola

# 3c5326bf 13-Jun-2010 Rafal Jaworowski <raj@FreeBSD.org>

Connect FDT infrastructure to the build system.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

# 6513cfc8 09-Jun-2010 Roman Divacky <rdivacky@FreeBSD.org>

Hook clang into the build on i386/amd64/powerpc.

Approved by: ed (mentor)

# 5ba4657c 20-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

Revert r208353. It did not work as I expected because WITHOUT_MAN is set
for bootstrap-tools target and WITHOUT_MAN_UTILS was implied by default.

Pointy hat: jkim

# 8a4b934b 20-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

We do not have to build makewhatis as a bootstrap tool when it is disabled
by WITHOUT_MAN_UTILS.

# b05756ac 20-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

Revert r208324. We still need it for installworld as $PATH is overriden.

# 727b4933 19-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

Remove makewhatis(1) from bootstrap tools. We no longer support source
upgrades from versions prior to 6.0 on head.

# 7fbeb03e 10-May-2010 Martin Matuska <mm@FreeBSD.org>

Enable liblzma support in libarchive
Adjust dependencies for programs using libarchive
Add xz and linkage against liblzma to rescue system

Approved by: kientzle, delphij (mentor)
MFC after: 2 weeks

# 762c7db2 23-Apr-2010 Florent Thoumie <flz@FreeBSD.org>

- Take libinstall.a out of pkg_install and make it a proper shared library.
- Rework the wrapper support to check libpkg version as well as pkg_install
version.
- Add libfetch to _prebuild_libs.
- There are no new features introduced.

Notes: the API is not stable, so basically, do not use libpkg in your
projects for now. Also there's no manpage for libpkg yet, because the API
will change drastically. I repeat, do not use libpkg for now.

# 096924c9 22-Apr-2010 Alexander Leidinger <netchild@FreeBSD.org>

Remove explicit setting of NO_CTF in WMAKEENV and in the make call for
the buildkernel. This way makeoptions WITH_CTF=yes not only works when
compiling the tradtitional way, but also when using buildkernel. This
does not enable the CTF part of the world, it still defaults to without
CTF info.

The cross/build-tools/bootstrap targets are not affected by this, they
still have and should keep the explicit NO_CTF.

Notified by: np

# f672e5fb 14-Apr-2010 Warner Losh <imp@FreeBSD.org>

Add note about TARGET_ARCH

# e56900fc 24-Mar-2010 Xin LI <delphij@FreeBSD.org>

Expose MACHINE_CPU while building lib32 target.

# 460f173d 07-Mar-2010 Antoine Brodin <antoine@FreeBSD.org>

Remove old documents when they are not compressed.
(NO_INFOCOMPRESS, NO_DOCCOMPRESS or NO_MANCOMPRESS)

MFC after: 1 month

# 0f49f7eb 26-Jan-2010 Ruslan Ermilov <ru@FreeBSD.org>

Regen the list of prebuild libraries using tools/make_libdeps.sh.

# c1f5e730 23-Jan-2010 Antoine Brodin <antoine@FreeBSD.org>

Unbreak world:
- WITHOUT_OPENSSH (and WITH_KERBEROS)
- WITHOUT_KERBEROS and WITH_GSSAPI

PR: 137483
Submitted by: bf
MFC after: 2 weeks

Note: this breaks harder world WITHOUT_GSSAPI (and WITH_KERBEROS), but well

# 84bee0d7 21-Jan-2010 Ed Schouten <ed@FreeBSD.org>

Remove libulog from the bootstrap again.

libulog now only provides functions that are used by various packages
from the ports tree, namely the libutempter ones. There is no reason to
link it into the crunch/fixit binaries anymore.

# 6f7be14a 14-Jan-2010 Jilles Tjoelker <jilles@FreeBSD.org>

In 'make delete-old', use 'exec' to redirect an fd persistently.

That is, write 'exec 3<&0' instead of '3<&0'. Due to an sh(1) bug fixed in
r199953, the latter also persisted, provided that fd 3 was not open before.
With newer sh or fd 3 open, it would not delete orphaned catpages.

MFC after: 2 weeks

# 03bc68ca 30-Dec-2009 Ed Schouten <ed@FreeBSD.org>

Disable K&R style function definitions for WARNS=6.

Unfortunately there are two slight problems with that:

- Yacc and lex might generate code that generates warnings because of
this. Require yacc and lex to be rebuilt during bootstrap. I'm not
incrementing __FreeBSD_version here, because I assume someone else
will do this eventually.

- When running `make buildkernel', it uses share/mk from the source
treeo to build aicasm. Because aicasm also depends on lex, this would
break. Lower WARNS to 5 for now. We should just increment it to 6
again somewhere in the very far future.

# 62012822 15-Dec-2009 Warner Losh <imp@FreeBSD.org>

Add NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN},
which disables doing a make obj. Use it when you know it will work
only. KERNFAST now implies NO_KERNELOBJ, since you don't need to keep
doing obj when doing incremental kernel builds.

# 17c79ad0 11-Dec-2009 Ed Schouten <ed@FreeBSD.org>

Convert pam_lastlog(8) to libulog.

The information used by the "Last login:"-line is obtained by using
ulog_setutxfile(3) to switch to the lastlog database. Login and logout
are performed using the utility functions ulog_login(3) and
ulog_logout(3).

This also means we must build libulog during bootstrap.

Approved by: des

# 98c98d78 01-Nov-2009 Roman Divacky <rdivacky@FreeBSD.org>

Replace -iprefix with -isystem. We only need alternative header
files search path and thus -isystem is sufficient. -iprefix is
meant to do something entirely different.

Approved by: ed (mentor)
OKed by: ru, kan
Tested by: make universe

# 8d5ed6e7 28-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

Now that the zoneinfo data is automatically updated when a new world
is installed, we should at least have the tzsetup tool available!

Suggested by: Andriy Gapon <avg@freebsd.org>
Noticed by: Ben Kaduk <minimarmot@gmail.com>
MFC after: 1 week

# e5367da3 21-Oct-2009 Ruslan Ermilov <ru@FreeBSD.org>

Move sed(1) from cross-tools to bootstrap-tools.

# b6d632e4 12-Oct-2009 Alexander Nedotsukov <bland@FreeBSD.org>

Chase dependency changes in libgssapi_krb5 module introruced by
revision r197995.

# 767a0b2d 10-Sep-2009 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix comment about KERNFAST.

# 2286fe76 14-Jul-2009 Alexander Kabaev <kan@FreeBSD.org>

Second attempt at eliminating .text relocations in shared libraries
compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC
generates local calls to this function which result in absolute
relocations put into position-independent code segment, making dynamic
loader do extra work every time given shared library is being relocated
and making affected text pages non-shareable.

Reviewed by: kib
Approved by: re (kib)

# d48890cf 28-Jun-2009 Alexander Kabaev <kan@FreeBSD.org>

Back out previous revision until better tested fix is ready.

Approved by: re (impliciti, by approving previos check-in)

# a162c9ae 28-Jun-2009 Alexander Kabaev <kan@FreeBSD.org>

Eliminate .text relocations in shared libraries compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC generates
local calls to this function which result in absolute relocations put into
position-independent code segment, making dynamic loader do extra work everys
time given shared library is being relocated and making affected text pages
non-shareable.

Reviewed by: kib
Approved by: re (kensmith)

# 51a8ff0c 14-Jun-2009 Mark Murray <markm@FreeBSD.org>

Allow "make update" work with SVN, if you take the time to set up your
/etc/make.conf properly.

Only one SCM?
I do not think this is right.
Now I have fixed it.

# d0c7c272 04-Apr-2009 Warner Losh <imp@FreeBSD.org>

Revert c190007 at the request of Ruslan. It was not correct because
ar had been moved from cross tools to bootstrap tools when bsd ar was
introduced.

Submitted by: ru@

# 5c2ca8d0 18-Mar-2009 Warner Losh <imp@FreeBSD.org>

Add usr.bin/ar to the list of cross tools. Before, when we had gnu
ar, it was built in the gnu/usr.bin/binutils tree. Now it isn't.

Submitted by: John Hein

# badf7d25 15-Mar-2009 Warner Losh <imp@FreeBSD.org>

Restore missing OSREL definition that accidetnally dropped from an
earlier version of this patch.

# 8a6a076c 15-Mar-2009 Gabor Kovesdan <gabor@FreeBSD.org>

- Create the buildworld object directories with mtree instead of various
mkdir calls
- Remove the ugly workaroung from libc NLS, which was to create some of
these directories

# fe73c506 13-Mar-2009 Gabor Kovesdan <gabor@FreeBSD.org>

- Reenable Native Language Support in libc. This feature was disabled due
to possible breakages in the catalog handling code. Since then, that
code has been replaced by the secure code from NetBSD but NLS in libc
remained turned off. Tests have shown that the feature is stable and
working so we can now turn it on again.

- Add several new catalog files:
- ca_ES.ISO8859-1
- de_DE.ISO8859-1
- el_GR.ISO8859-7 (by manolis@ and keramida@)
- es_ES.ISO8859-1 (kern/123179, by carvay@)
- fi_FI.ISO8859-1
- fr_FR.ISO8859-1 (kern/78756, by thierry@)
- hu_HU.ISO8859-2 (by gabor@)
- it_IT.ISO8859-15
- nl_NL.ISO8859-1 (corrections by rene@)
- no_NO.ISO8859-1
- mn_MN.UTF-8 (by ganbold@)
- sk_SK.ISO8859-2
- sv_SE.ISO8859-1
(The catalogs without explicit source has been obtained from NetBSD.)

Approved by: attilio

# 555aaddf 13-Mar-2009 Ruslan Ermilov <ru@FreeBSD.org>

Don't put "install-info" to the list of install-tools if we're
installing with -DWITHOUT_INFO, otherwise one can experience a
failure trying to installworld on a system that is built with
-DWITHOUT_INFO (i.e., without /usr/bin/install-info).

Reported by: bland
MFC after: 3 days

# 25bacc78 13-Mar-2009 Warner Losh <imp@FreeBSD.org>

Implement the xdev target. When you define XDEV=arch XDEV_ARCH=arch,
you can build the cross development tools and install them as
$XDEV-freebsd-xxx for each tool. This allows one to use autoconf to
find the tools for cross building scenarios.

# d9ca85fc 21-Feb-2009 Ruslan Ermilov <ru@FreeBSD.org>

Fix build when WITH_SSP is set explicitly.

Submitted by: Jeremie Le Hen

# b61a9dcf 23-Jan-2009 Warner Losh <imp@FreeBSD.org>

Implement an idea from Sam Leffler:
make KERNFAST=blah buildkernel
is now a short cut for
make KERNCONF=blah -DKERNFAST buildkernel

This change works for all kernel config files not named "1". I did
that to make sure that
make -DKERNFAST buildkernel
remains the same as
make -DKERNFAST KERNCONF=GENERIC buildkernel
rather than trying to build and configure "1". I've never seen a
kernel config file named "1," so I think this is a good compromise.

# 79177775 14-Jan-2009 Warner Losh <imp@FreeBSD.org>

Add KERNFAST define. When defined, it skips all the config, depends
and clean steps. KERNFAST was selected to complement KERNCONF which
is typically used in these scenarios (especially with cross building).

Reviewed by: arch@

# 85cb1ccb 11-Nov-2008 David E. O'Brien <obrien@FreeBSD.org>

Add the kerberos5 libs to the install32 target.
(we've been building the all along, but never installing them)

# a9bff23c 23-Oct-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Back out testing aid that was inadvertantly committed as part of r184205.

Noticed by: rdivacky

# 1ede983c 23-Oct-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Retire the MALLOC and FREE macros. They are an abomination unto style(9).

MFC after: 3 months

# bcffa935 19-Sep-2008 David E. O'Brien <obrien@FreeBSD.org>

Rescue is "not yet" for MIPS.

# c7f23b87 19-Aug-2008 John Baldwin <jhb@FreeBSD.org>

If a CPUTYPE isn't specified, then don't use -march=k8 when compiling
32-bit compat libs on amd64 since -march=k8 may generate instructions
that are not implemented on Intel EM64T processors. Instead, use
a simpler set of default flags that should work on all amd64-capable
CPUs.

PR: amd64/113111
Submitted by: NIIMI Satoshi sa2c of sa2c.net
MFC after: 1 week

# 03d013bc 01-Aug-2008 John Baldwin <jhb@FreeBSD.org>

Various style fixes in the build32 rules.

Submitted by: bde (mostly)

# e68ed793 01-Aug-2008 John Baldwin <jhb@FreeBSD.org>

Tweak the support for using ldd on 32-bit objects a bit further.
Specifically, build a 32-bit /usr/bin/ldd32 on amd64 which handles 32-bit
objects. Since it is a 32-bit binary, it can fork a child process which
can dlopen() a 32-bit shared library. The current 32-bit support in ldd
can't do this because it does the dlopen() from a 64-bit process. In order
to preserve an intuitive interface for users, the ldd binary automatically
execs /usr/bin/ldd32 for 32-bit objects. The end result is that ldd on
amd64 now transparently handles 32-bit shared libraries in addition to
32-bit binaries.

Submitted by: ps (indirectly)

# 042df2e2 25-Jun-2008 Ruslan Ermilov <ru@FreeBSD.org>

Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
turned opt-in for stable branches depending on the consensus. You
can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
It is harmless to steal the knob as SSP symbols have been provided
by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
(sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
libc will be automatically downgraded to -fstack-protector because it
breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by: Jeremie Le Hen <jeremie@le-hen.org>

# 643d58f9 18-Jun-2008 David E. O'Brien <obrien@FreeBSD.org>

Add MIPS to the list of known arches.

# 51062e59 22-May-2008 John Birrell <jb@FreeBSD.org>

Add the DTrace build tools to the list of tools and pass NO_CTF to all
the stages of the build which don't require CTF conversion.

# 33f12199 07-May-2008 Doug Rabson <dfr@FreeBSD.org>

Fix conflicts after heimdal-1.1 import and add build infrastructure. Import
all non-style changes made by heimdal to our own libgssapi.

# 3d42ee26 14-Apr-2008 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap the build of btxld.

# dbdb679c 29-Mar-2008 Ruslan Ermilov <ru@FreeBSD.org>

Remove options MK_LIBKSE and DEFAULT_THREAD_LIB now that we no longer
build libkse. This should fix WITHOUT_LIBTHR builds as a side effect.

# b18c84b4 02-Mar-2008 Ruslan Ermilov <ru@FreeBSD.org>

Set AR=gnu-ar and RANLIB=gnu-ranlib on systems where we are forced
to use GNU tools. Remove the _WITH_GNUAR knob.

Prodded by: obrien

# 0be8836d 25-Feb-2008 Ruslan Ermilov <ru@FreeBSD.org>

Sort.

Prodded by: obrien

# d0ca9999 25-Feb-2008 Ruslan Ermilov <ru@FreeBSD.org>

Make again BSD ar(1) the default system ar(1), now properly handling
source upgrades by falling back to GNU ar(1) as necessary. Option
WITH_BSDAR is gone. Option _WITH_GNUAR to aid in upgrades is *not*
supposed to be set by the user.

Stop bootstrapping BSD ar(1) on the next __FreeBSD_version bump, as
there are no known bugs in it. Bump __FreeBSD_version to anticipate
this and to flag the switch to BSD ar(1), should it be needed for
something.

Input from: obrien, des, kaiw

# 646df953 05-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Satisfy a particularly obstinate nit-picker :)

# bcb20d7b 05-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Give usr.bin/kdump/kdump_subr.c the same treatment as usr.bin/kdump/ioctl.c
and usr.bin/truss/ioctl.c. This is the correct way to address the problem
that arises when doing an incremental build after a header used by kdump
has been removed (cf. i4b disconnect a while ago)

Explained by: ru
MFC after: 2 weeks

# 51dc1e12 23-Jan-2008 Ruslan Ermilov <ru@FreeBSD.org>

Support source upgrades from at least 6.0-RELEASE.

Reviewed by: imp, obrien

# 50df6ee3 22-Jan-2008 Andrey A. Chernov <ache@FreeBSD.org>

Conditionally add mklocale to bootstrap-tools

# 68c5515f 22-Jan-2008 Ruslan Ermilov <ru@FreeBSD.org>

Cleanup after last commit (remove undefined variables).

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

# 9074b900 16-Jan-2008 Christian Brueffer <brueffer@FreeBSD.org>

Remove WITHOUT_FORTRAN from the XMAKE target, it doesn't exist anymore.

Reviewed by: imp, kan
Approved by: rwatson (mentor)
MFC after: 3 days

# c93073c2 03-Dec-2007 Yaroslav Tykhiy <ytykhiy@gmail.com>

- Explicitly verify if all needed libs were found by ldd(1). Do so
through scanning its output as ldd(1) returns a non-zero status only
for really abnormal conditions such as an improper file format.
Now cp(1) won't get bogus "not" and "found" arguments if a lib
is missing. [1]

- Don't guess if an element of a complex pipeline is assigned to the main
shell or a sub-shell. Namely use stdio, not vars, to pass lists out from
loops. If using vars, there's the risk that a loop will run in a sub-shell
and the list won't make it to the main shell. It appears that braces and
parens give only limited control over the issue while stdio always works
as intended. Apply this solution to both $progs and $libs for consistency,
although I've failed to go without it only in the $libs part.

Requested by: emaste [1]

# 519bc416 31-Oct-2007 Yaroslav Tykhiy <ytykhiy@gmail.com>

Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:

1) ABI breakages should no longer affect installworld over the live system.

2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.

3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.

The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.

Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)

# 1602894e 15-Oct-2007 Ed Maste <emaste@FreeBSD.org>

If a required install tool is missing, provide a more friendly error
message (instead of cp's usage info).

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

# 2d797419 01-Oct-2007 Ruslan Ermilov <ru@FreeBSD.org>

Revise the list of directories we manually create under
${WORLDTMP} and ${LIB32TMP}; some of them are no longer
needed, and some were never needed.

Approved by: re (kensmith)

# 152f2a4a 01-Oct-2007 Ruslan Ermilov <ru@FreeBSD.org>

Always install libpthread.* symlinks if at least one of
the threading libraries is built. This simplifies the
logic in makefiles that need to check if the pthreads
support is present. It also fixes a bug where we would
build a threading library that we shouldn't have built:
for example, building with WITHOUT_LIBTHR and the default
value of DEFAULT_THREADING_LIB (libthr) would mistakenly
build the libthr library, but not install it.

Approved by: re (kensmith)

# 5224b41a 10-Jul-2007 Xin LI <delphij@FreeBSD.org>

Add sed(1) to cross tools. We do want newly built version during
buildworld.

Approved by: re (rwatson)

# a1cdbf32 26-May-2007 Ruslan Ermilov <ru@FreeBSD.org>

lex(1) no longer installs headers into GCC-internal dirs
(since src/usr.bin/lex/Makefile,v 1.20).

# 98a0900a 19-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Revision 1.576 removed too much. I didn't notice because my /usr is on
ZFS, which doesn't support flags...

# 25a362d7 18-May-2007 Alexander Kabaev <kan@FreeBSD.org>

GCC will now properly link libc with all shared objects in order to record
their dependency on libc and its versioned symbols. For that to work,
libc needs to be built before any other shared library that might depend
on it. Add necessary glue to make that happen.

# f27f8258 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Don't use a subshell where it isn't needed.

Noticed by: John E Hein <jhein@timing.com>

# 32cd239b 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Expose all of {check,delete}-old{,-dirs,-files,-libs}.

MFC after: 3 weeks

# 84478d58 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove stray comment which broke delete-old-dirs.

# d1e75b81 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Partially revert the check-old / delete-old modifications to clarify the
logic.

Apply similar modifications to {check,delete}-old-dirs, which I had
overlooked.

# ca224410 14-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Restore previous behaviour of aborting delete-old* if rm failed.

Pointed out by: netchild
MFC after: 3 weeks

# 61305271 13-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Greatly speed up {check,delete}-old* by replacing make loops with sh loops.

MFC after: 3 weeks

# 00fb440c 13-May-2007 Daniel Eischen <deischen@FreeBSD.org>

Enable symbol versioning by default. Use WITHOUT_SYMVER to disable it.
Warning, after symbol versioning is enabled, going back is not easy
(use WITHOUT_SYMVER at your own risk).

Change the default thread library to libthr.

There most likely still needs to be a version bump for at least the
thread libraries. If necessary, this will happen later.

# 1c22c47c 17-Apr-2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Link libzpool, ztest and zdb against libpthread.

Requested by: ru

# ceef0c31 05-Apr-2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Connect ZFS to the build.

# 31b4134f 08-Mar-2007 Rong-En Fan <rafan@FreeBSD.org>

Enable ncurses wide character support

Approved by: delphij (mentor)
Tested by: kris on pointyhat (early version), current@

# 857be7a4 01-Mar-2007 Ruslan Ermilov <ru@FreeBSD.org>

Bump the bootstrapping requirements for gensnmptree(1) and remove
a note in UPDATING that tried to work around the build breakage.

Tested by: jhb
OK'ed by: njl

# 51804c79 28-Feb-2007 Ruslan Ermilov <ru@FreeBSD.org>

Resurrect one of the patches from attic and refine the
lib32 build somewhat. Specifically, instead of spamming
${CC} et al with -I${LIB32TMP}/usr/include which can be
harmful (as has been demonstrated by the ncursesw WIP),
use slightly different approach to achieve the same goal.
This also simplifies things a bit.

Prodded by: rafan

# 9c827cec 27-Feb-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Clean the lib32 object directory with cleandir rather than rm -rf.

Discussed with: ru
MFC after: 2 weeks

# af5b5a0f 20-Jan-2007 Rong-En Fan <rafan@FreeBSD.org>

Switch to new ncurses build glue

Approved by: delphij

# 638b0a3e 27-Nov-2006 Ruslan Ermilov <ru@FreeBSD.org>

There was a timeframe where crunchgen(1) was broken; force
an upgrade during the build so those who are affected can
build world again.

# 87b8c12d 12-Nov-2006 Ruslan Ermilov <ru@FreeBSD.org>

There doesn't seem to be a real reason for include/ to be installed
so early.

# 61517751 16-Oct-2006 John Birrell <jb@FreeBSD.org>

Add sun4v to the TARGET_ARCH when just TARGET is set (like pc98 is done).

This is required for 'make universe'.

# ddd53429 08-Oct-2006 Kip Macy <kmacy@FreeBSD.org>

buildworld fixes for sun4v
not sure why pmap.c is included as it is unchanged

Approved by: rwatson (mentor)
Reviewed by: jmg

# 49e62f1c 07-Oct-2006 Ruslan Ermilov <ru@FreeBSD.org>

Shuffle _*_libs assigments (no functional changes).

# b1935562 07-Oct-2006 Ruslan Ermilov <ru@FreeBSD.org>

- Prebuild libgssapi only if building with Kerberos support.

- Remove libnetgraph from the list of prebuilt libraries as
no other library depends on it (snmp_netgraph.so does not
count as we don't build it in the "libraries" target).

- Restore libssh dependencies when compiling with Kerberos
support.

# 89edd7e5 08-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Previous revision wasn't enough for "make TARGET=<machine> build*"
to work. Some build-tools that are part of cross-tools (cc_tools)
also need to know the proper values of TARGET_ARCH and TARGET, so
tell them.

# 0f31538c 07-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

While experimenting with cross-building by specifying just TARGET,
I found one bug. Pass our idea of TARGET_ARCH and TARGET down to
XMAKE, the cross-tools make. Previously it worked because usually
TARGET_ARCH was specified on the initial make's command line.
This should also allow us to simplify the "universe" target, which
I'm currently testing.

# d2f03ebb 07-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Added timestamping to buildworld, similar to buildkernel.

# e6cb78fb 07-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

- Rewrite logic to guess TARGET_ARCH/TARGET to be more readable,
but without changes in behavior.

- Add sanity checking for TARGET_ARCH/TARGET.

# ffbebdce 07-Sep-2006 Warner Losh <imp@FreeBSD.org>

make "make TARGET=foo" work correctly. Before, it would fail to set
TARGET_ARCH correctly. Now it does, even for pc98. We should suggest
TARGET=foo in preference to TARGET_ARCH because the former is
unambiguous and the latter isn't, so update the docs.

This means that a long standing gripe I've had with this comes to a
close. I can build pc98 w/o specify both things. make TARGET=arm
works (rather than trying to build a arm:amd64 image and dying badly
in the attempt).

If you specify only TARGET_ARCH, then you get the old behavior.

# we can likely simplify the UNIVERSE target now to use this, but I'm not
# up for breaking that tonight :-).

# We should consider adding some kind of sanity check for TARGET_ARCH
# and TARGET.

# 1bb2049e 24-Aug-2006 Warner Losh <imp@FreeBSD.org>

Always make obj when building the libraries. This never hurts, and
helps some cross-architecture building tool installation patches that
I'm developing.

# 2b46c64c 22-Aug-2006 Ruslan Ermilov <ru@FreeBSD.org>

Remove alpha left-overs.

# c49d3a7d 09-Aug-2006 Alexander Leidinger <netchild@FreeBSD.org>

Remove sade from build-tools, the tinderbox problem should be fixed now.

# 2d0fba05 08-Aug-2006 Yoshihiro Takahashi <nyan@FreeBSD.org>

Add the sade to build-tools list. This fixes a tinderbox.

# dad90513 02-Aug-2006 Alexander Leidinger <netchild@FreeBSD.org>

Fix doxygen target.

Submitted by: "Alexander Mogilny" <sg@astral.ntu-kpi.kiev.ua>
Pointy hat to: netchild

# 6f13c7ad 06-Jun-2006 Warner Losh <imp@FreeBSD.org>

Also need to quote values so they can be passed on correctly.

# 621e4ae1 06-Jun-2006 Warner Losh <imp@FreeBSD.org>

Create a new target 'buildenvvars'. This target reports the build
environment for cross building (the same one you'd get interactively
in make buildenv). This cannot be a simple

make -f Makefile.inc1 -V WMAKEENV

because in PATH is not set correctly unless one takes a trip through
the Makefile/Makefile.inc1 indirection, the logic of which is too
large to reproduce outside of Makefiles.

# becc5c62 26-May-2006 Alexander Leidinger <netchild@FreeBSD.org>

Connect the kernel subsystem API documentation generation framework to
the build infrastructure: "make doxygen"

Changes to the man pages will be made when some defaults are revisited.

Requested by: gnn

# f6ce2a64 17-May-2006 Poul-Henning Kamp <phk@FreeBSD.org>

Send the pcvt(4) driver off to retirement.

# d6acfaf5 31-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Sort bootstrap-tools entries.

# 03e21a94 30-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Rebuild gensnmptree(1) on 700014 systems too. While 700014 corresponds
to post January 26 systems where gensnmptree(1) code was already fixed,
there was a timeframe between February 14 and February 27 when
usr.sbin/bsnmpd/ including gensnmptree was disconnected from build, so
if you upgraded in this timeframe, you ended up with the 700014 system
but still with a buggy gensnmptree binary. This also means not being
able to buildworld now.

Reported by: jhb
Attention: harti, keramida

# cea557ad 20-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Extend coverage of the MK_IPX build option to the following:

- <netipx> headers [1]
- IPX library (libipx)
- IPX support in ifconfig(8)
- IPXrouted(8)
- new MK_NCP option

New MK_NCP build option controls:

- <netncp> and <fs/nwfs> headers
- NCP library (libncp)
- ncplist(1) and ncplogin(1)
- mount_nwfs(8)
- ncp and nwfs kernel modules

User knobs: WITHOUT_IPX, WITHOUT_IPX_SUPPORT, WITHOUT_NCP.

[1] <netsmb/netbios.h> unconditionally uses <netipx> headers
so they are still installed. This needs to be dealt with.

# ca404c7d 19-Mar-2006 Maxime Henrion <mux@FreeBSD.org>

Change the default SUP command to use csup instead of CVSup for
"make update" when SUP_UPDATE is defined.

# 5740a2b6 18-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Convert NO_PROFILE and NO_LIB32 to new style.

# c3ed02cf 18-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Add the new "showconfig" target that displays build configuration.

Suggested by: phk

# e1fe3dba 17-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Reimplementation of world/kernel build options. For details, see:

http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by: imp, jhb, kris, phk, ru (all bugs are mine)

# 6cb9d90a 16-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

When building for pc98, don't create stray objects in the
usr.sbin/pcvt/keycap source directory.

Found by: phk
MFC after: 3 days

# 00602d09 08-Mar-2006 Giorgos Keramidas <keramida@FreeBSD.org>

After revision 1.4 of `src/usr.sbin/bsnmpd/bsnmpd/Makefile' the
gensnmptree utility is required at "make depend" time, because it
is used to generate `oid.h' for bsnmpd.

This means that all versions of HEAD before 2004/01/23 16:22:49 need
gensnmptree as a bootstrap util when it's not already installed as
part of the base system. The first __FreeBSD_version that we can
assume this can work is 700014 which happened after the gensnmptree
change (in -r 1.263 of `src/sys/sys/param.h', at 2006/02/17 14:14:15).

For __FreeBSD_version values before 700014 add gensnmptree to the
bootstrap tools, to allow upgrades from versions of FreeBSD before
that date.

Approved by: ru, harti

# e8a71dcc 27-Feb-2006 Ruslan Ermilov <ru@FreeBSD.org>

Detect that the "audit" group is missing earlier during install.

# 8a32134c 18-Feb-2006 Alexander Leidinger <netchild@FreeBSD.org>

A file can also be a link, so check not only for a file, but also for a link
in the delete-old and check-old targets.

We don't install a lib (libXY.so.Z) as a link, but an user may have created
something like this. This is dangerous if this link points to a different
version of the lib. So check for a link also in the *-lib targets (an
annoyed user which absolutely wants this redirection of a lib should use
libmap.conf instead of a link).

A directory can also be a link, but in this case just echo a message to
remove it by hand.

# 38311499 02-Jan-2006 Doug Rabson <dfr@FreeBSD.org>

Revert the previous change - the lib32 build should work now.

# 29af427b 02-Jan-2006 Doug Rabson <dfr@FreeBSD.org>

Temporarily disable the kerberos5 lib32 build while I try to fix it
properly.

# c0b9f4fe 29-Dec-2005 Doug Rabson <dfr@FreeBSD.org>

Add a new extensible GSS-API layer which can support GSS-API plugins,
similar the the Solaris implementation. Repackage the krb5 GSS mechanism
as a plugin library for the new implementation. This also includes a
comprehensive set of manpages for the GSS-API functions with text mostly
taken from the RFC.

Reviewed by: Love Hörnquist Åstrand <lha@it.su.se>, ru (build system), des (openssh parts)

# 667d8d10 07-Dec-2005 David E. O'Brien <obrien@FreeBSD.org>

Use cross-compile friendly spelling of CPUTYPE.

Submitted by: ru

# 620b3a0c 07-Dec-2005 Ruslan Ermilov <ru@FreeBSD.org>

Style, no functional changes.

# 21c4855e 07-Dec-2005 David E. O'Brien <obrien@FreeBSD.org>

SSE2 comes thru the users choice of CPUTYPE.

# fef891f7 07-Dec-2005 David E. O'Brien <obrien@FreeBSD.org>

Default to producing 'k8' COMPAT_32BIT bits, but allow override.

# 637750b9 06-Dec-2005 Warner Losh <imp@FreeBSD.org>

Back out my sh -> ${SHELL} change, since it will be a few days before
I can fix it better.

Requested by: ru@

# c26efd48 02-Dec-2005 Doug Ambrisko <ambrisko@FreeBSD.org>

Switch BUILD_ARCH in Makefile to use uname -p suggested by ru.
Switch strncpy to strlcpy suggested by gad and issue found by pjd.
Add to uname(3) man page describing:
UNAME_s
UNAME_r
UNAME_v
UNAME_m
Add to getosreldate(3) man page describing:
OSVERSION

Submitted by: ru, pjd/gad
Reviewed by: ru (man pages)

# d630a05f 01-Dec-2005 Doug Ambrisko <ambrisko@FreeBSD.org>

Add support to easily build FreeBSD unpacked in a chroot of another
FreeBSD machine. To do this add the man 1 uname changes to __xuname.c
so we can override the settings it reports. Add OSVERSION override
to getosreldate. Finally which Makefile.inc1 to use uname -m instead
of sysctl -n hw.machine_arch to get the arch. type.

With these change you can put a complete FreeBSD OS image into a
chroot set:
UNAME_s=FreeBSD
UNAME_r=4.7-RELEASE
UNAME_v="FreeBSD $UNAME_r #1: Fri Jul 22 20:32:52 PDT 2005 fake@fake:/usr/obj/usr/src/sys/FAKE"
UNAME_m=i386
UNAME_p=i386
OSVERSION=470000
on an amd64 or i386 and it just work including building ports and using
pkg_add -r etc. The caveat for this example is that these patches
have to be applied to FreeBSD 4.7 and the uname(1) changes need to
be merged. This also addresses issue with libtool.

This is usefull for when a build machine has been trashed for an
old release and we want to do a build on a new machine that FreeBSD
4.7 won't run on ...

# d53cdc6c 01-Dec-2005 Warner Losh <imp@FreeBSD.org>

In make buildenv, spell sh as ${SHELL}. In this case, we don't want
to hard code /bin/sh since we're forking it for the user to type
commands into. As such, ${SHELL} is the preferred thing users type
commands into.

# 4b2095e8 25-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Revert revision 1.416 and don't create a hierarchy before installing
a kernel. It's slower and is generally only applicable to RELENG_4.

# 1580b6c3 22-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak installworld.

# 0da07b29 21-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Get rid of SPECIAL_INSTALLCHECKS variable that isn't settable
by a user. Instead, add individual checks as dependencies to
the main "installcheck" target. Make sure that installkernel
etc. depend on it (including the UID/GID checks).

# 05359b9b 22-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Fold some common stuff into a macro ${KMAKE}.

# be174d0c 18-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add the NO_INCS knob to bsd.prog.mk and bsd.lib.mk to not include
bsd.incs.mk, and use it when installing 32-bit compat libraries
on amd64. This causes it to *not* overwrite native headers with
i386 versions, which was the case with <fenv.h> and <vgl.h>.

PR: amd64/83806
Prodded by: bde
MFC after: 1 week

# 006846f7 12-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Speed up stale catpages hunting by not running sed(1) for every catpage.

# 0f8bb094 12-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Don't check DESTDIR when making distributeworld; the latter expects
DISTDIR.

Reported by: nyan

# e4a93f1e 10-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add missing shared library interdependencies.

# e576df39 07-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Require DESTDIR to be set when installing for a different architecture.

# 6660f1d7 03-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Serialize access to the info/dir file; needed for parallel installs.

Reported by: scottl

I'm not very fond of using the non-standard lockf(1) here, but I
have no better idea at the moment. NetBSD uses ln(1) to create a
lock file, but this approach can result in a deadlock if make is
interrupted, leaving an orphaned lock file.

# 338953fb 20-Oct-2005 Ruslan Ermilov <ru@FreeBSD.org>

Force an upgrade to Groff 1.19.2.

# 188a72ee 23-Aug-2005 Brian Somers <brian@FreeBSD.org>

Fix a couple of typos

# a332ab6c 20-Aug-2005 Alexander Leidinger <netchild@FreeBSD.org>

Fix the "unexpected operator" bug some people are seeing.

First noticed by: kris

# edd04c6f 07-Aug-2005 Alexander Leidinger <netchild@FreeBSD.org>

Remove cat-pages without corresponding man-pages.

# 8dee0414 05-Aug-2005 Ruslan Ermilov <ru@FreeBSD.org>

- clean ${LIB32TMP} in _worldtmp
- clean ${OBJTREE}/lib32 in _cleanobj
- ensure that ${WORLDTMP} exists in build32

# 467610da 03-Aug-2005 Ruslan Ermilov <ru@FreeBSD.org>

- Remove duplicate setting from LIB32MAKE definition.
- Install lib32 bits using the real install(1) program.

# c8ef0ed5 03-Aug-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make delete-old* and friends useable for cross-builds.

# 1b24254b 30-Jul-2005 Alexander Leidinger <netchild@FreeBSD.org>

- Only make the delete-old related parts visible if one of the 3 targets
are called (wrapped in ".if make(...)"). This may reduce the amount of
memory needed for all other targets (the file lists are already large
and they will grow further).
- Be verbose in the batch case of the delete-old part too.

# 77d2ce5d 30-Jul-2005 Dag-Erling Smørgrav <des@FreeBSD.org>

Enforce the native environment requirement for {check,delete}-old-* at
run time, not parse time. This unbreaks cross-builds.

Pointy hat to: netchild

# af3e19a6 29-Jul-2005 Alexander Leidinger <netchild@FreeBSD.org>

- Move recently added dir into the correct section.
- Add a note about the organisation of the sections.
- Expand shell globs (they worked in a previous version of the delete-old
target, but not in this one).
- Use the correct way of checking for a native environment. [1]
- Add some more obsolete files.
- Fix some bad english. [1]

Suggested by: ru [1]
Approved by: mentor (joerg)

# c9275efa 25-Jul-2005 Dag-Erling Smørgrav <des@FreeBSD.org>

Disable thread support in BIND. It appears to reduce performance rather
than increase it, and seems to be the cause of the memory leaks which some
users have reported.

Requested by: dougb
MFC after: 5 days

# e2a36081 23-Jul-2005 Alexander Leidinger <netchild@FreeBSD.org>

Add delete-old and delete-old-libs targets:
- removes obsolete files/dirs or libraries.
- works in interactive (default) and batch mode
- respects DISTDIR
- documented in UPDATING and build(7)

The head of the file ObsoleteFiles.inc contains instructions how to add
obsolete files/dirs/libs to the list. Obviously one should add obsolete
files to this list, when he removes a file/dir/lib from the basesystem.

Additionally add check-old target:
- allows re@ to check if a file on the obsolete list resurfaces

Design goals:
- allows full control by the user (default interactive mode)
- possibility of scripted removal of obsolete files (batch mode)
- opt-in removal of files (explicit list of files)
- seperate removal of libs (2 delete targets)

Important design decissions:
- structured list of files to remove instead of a plain text file:
* allows to remove additional files if a NO_foo knob is specified
without the need to change the targets (no NO_foo knob is respected
yet)
- not using mtree like NetBSD does:
* mtree doesn't has an interactive mode

Discussed on: arch (long ago), current (this year)
Additional input from: re (hrs)
Approved by: mentor (joerg)

# a59f6433 15-Jul-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make the `distrib-dirs' target official and working properly
when cross-building (installing). (This is useful for NFS
installing world/kernel to another architecture machine.)

# 2b9fc5e6 06-Jul-2005 Alexander Kabaev <kan@FreeBSD.org>

Exclude build32 target from the list of toolchain and kernel-toolchain
dependencies. We do not need to build 32bit compat tools to compile
a kernel.

Approved by: re (scottl)
Reported by: jhb

# ece6831d 16-Jun-2005 Ruslan Ermilov <ru@FreeBSD.org>

Provide 32-bit runtime support on amd64 as a separate distribution, lib32.

Prodded by: obrien
Nodded by: peter
Approved by: re

# cb1e3c19 06-Jun-2005 Ruslan Ermilov <ru@FreeBSD.org>

Allow to override the compiler, linker, and assembler used to build 32-bit
shim libraries on amd64.

# c0913e73 30-May-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add install-info to the list of install tools now that we don't
always bootstrap texinfo.

Reported by: scottl

# 49bf419d 23-May-2005 Ruslan Ermilov <ru@FreeBSD.org>

Stop redundantly rebuilding texinfo on the next __FreeBSD_version bump.

# 7d23fba2 01-May-2005 Warner Losh <imp@FreeBSD.org>

Remove lame and ineffectual attempt to fix ipf breakage of tenderbox.

# a4f4bae7 30-Apr-2005 Warner Losh <imp@FreeBSD.org>

Add some subversive code to cleandir: remove the sbin/ipf tree
entirely to fix the tinderbox machine. This change will be reverted
once the tinderboxen are tindering again.

# 39d2cd6f 05-Apr-2005 Peter Wemm <peter@FreeBSD.org>

Merge from RELENG_5: invert WITH_LIB32 into NO_LIB32 so that we build the
32 bit libraries by default. Define NO_LIB32 in make.conf if you do not
want this.

# 6459b7da 05-Apr-2005 Peter Wemm <peter@FreeBSD.org>

Fix the lib32 build for amd64 after v1.238 of src/include/Makefile (imp).
That change exposed the fact that I'd forgotten to set $MACHINE here.

# 6eb46c30 27-Mar-2005 Ruslan Ermilov <ru@FreeBSD.org>

Fix AMD64 cross-builds when WITH_LIB32 is defined.

(Initially spotted by kris@ on RELENG_5.)

# 9d11d2b6 22-Mar-2005 Ruslan Ermilov <ru@FreeBSD.org>

Protect against DESTDIR being set during the build of build32.

Reported by: pav

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

# 0c5397aa 28-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap pwd_mkdb(8) and use its new feature during "make distribute".

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

# 6067dba1 28-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak buildworld.

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

Make the format of LC_COLLATE files architecture independent.

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

Bootstrap gencat(1).

OK'ed by: phantom

# 9bdd3e84 26-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Added the convenience "distribution" target which calls the
target of the same name from src/etc/Makefile with a proper
environment, suitable to be used during upgrades and cross-
builds.

# 88e7c7a4 27-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make it clear we no longer support source upgrades from
versions prior to 5.3.

# 552b98b9 27-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add missing continuation.

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

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

Inspired by: obrien

# 20bfae84 26-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Added the "buildenv" target, for developers only!

CAVEAT: if you run tcsh(1) from within this target, this will
reset your PATH making this target mostly useless. Careful!

Submitted by: jmg, ru

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

# 6fe37d13 22-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add endianness support to cap_mkdb(1), useful for cross builds.

# eac161ef 19-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add lorder(1) to the list of bootstrap-tools.

# fb64060c 19-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Allow to cross-build amd64 on non-i386.

# 951e4d1c 20-Jan-2005 Ruslan Ermilov <ru@FreeBSD.org>

In crunchgen(1), when calling make(1), don't redirect stderr to stdout,
just rely on the exit status to detect an error. This makes crunchgen(1)
safe to use with certain make(1) debugging flags.

MFC after: 1 week

# 4e6242df 29-Dec-2004 David E. O'Brien <obrien@FreeBSD.org>

Remove the special sparc64 time_t support.
If someone isn't running with a 64-bit time_t by now, they don't
track -CURRENT and would probably go to RELENG_5 vs. 6-CURRENT.

# 0f399181 22-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

Further fix the case mentioned in rev. 1.302. The
intent was (and still is) that if a user has say
CPUTYPE=i686 set in /etc/make.conf, we don't print
the assignment type warning unless TARGET_CPUTYPE
is overridden.

Unfortunately, the implementation was buggy, and
only recent changes to bsd.cpu.mk that swapped
canonical and alias values of some CPU types made
the bug apparent.

Here's what happens here.

- CPUTYPE=i686 is set in /etc/make.conf,
- bsd.cpu.mk reset it to "pentiumpro",
- Makefile.inc1 compares this canonical value
with the result of the following test,

make -f /dev/null CPUTYPE=pentiumpro -V CPUTYPE

and expects the result to be "pentiumpro" too,
but "i686" is returned, here's why. We have two
CPUTYPE variables, global, set to "i686" in
/etc/make.conf, and command-line (of a higher
precedence), set to "pentiumpro".

The following part of bsd.cpu.mk,

. elif ${CPUTYPE} == "i686"
CPUTYPE = pentiumpro

which is responsible for converting aliases to
canonical values, sees the value of the CPUTYPE
command-line variable first, "pentiumpro", and
no conversion is done -- the net effect is that
CPUTYPE global stays with its old value "i686",
and "make -V CPUTYPE" (which prints variables
in the global context) returns "i686".

The fix was to pass the CPUTYPE in the test above
as an environment variable instead of as a command
line variable, i.e.,

CPUTYPE=pentiumpro make -f /dev/null -V CPUTYPE

This time, CPUTYPE global is still set to "i686"
initially (by /etc/make.conf), and an envieronment
variable CPUTYPE (of a lower precedence) is set
to "pentiumpro". The .elif sees it's set to
"i686" and resets it to "pentiumpro", and so
"make -V" returns "pentiumpro".

NB: these various types of make(1) variables can
be very painful, especially when combined with
"make -V".

# 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

# 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

# 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

# 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

# 3a35b5b9 17-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

Minor tweaks in "make update" comments.

# 0228d5b6 01-Dec-2004 Peter Wemm <peter@FreeBSD.org>

Do not leave build droppings in /usr/src for usr.sbin/pcvt/keycap and
usr.bin/lex/lib for the 32 bit libraries on amd64. Add an explicit
obj for these two directories that are built in for the "libraries" target.

# d938e8d6 23-Nov-2004 Ruslan Ermilov <ru@FreeBSD.org>

Hopefully fix the "aicasm" build-tool issue when using ${KERNSRCDIR}
different from ${.CURDIR}.

Reported by: jhb

# 63d76a5f 20-Nov-2004 Peter Wemm <peter@FreeBSD.org>

In the amd64 hybrid libraries case, move the kerberos5 tools to before
building the kerberos5 includes. This is not the same patch that
Bjoern A. Zeeb came up with, but the credit still goes to him for finding
the problem. Thanks!

# 9291686f 14-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Oops, all my test boxes have NO_KERBEROS set, so I didn't hit the kerberos5
build tools problem. I'd missed the kerberos5/tools stuff entirely. Add
the missing bits.

# 6c58990d 13-Nov-2004 Bjoern A. Zeeb <bz@FreeBSD.org>

Add knob NO_NIS (fka NO_YP_LIBC) and make world compileable when set.
If turned on no NIS support and related programs will be built.

Lost parts rediscovered by: Danny Braniss <danny at cs.huji.ac.il>
PR: bin/68303
No objections: des, gshapiro, nectar
Reviewed by: ru
Approved by: rwatson (mentor)
MFC after: 2 weeks

# 0931d0a9 12-Nov-2004 Ruslan Ermilov <ru@FreeBSD.org>

Show stray files during "cvs update".

# f9faa1eb 10-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Ruslan told me I should have quoted the arch strings when comparing to
MACHINE_ARCH. Belatedly get around to doing it.

# fae9d999 10-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Change WANT_LIB32 to WITH_LIB32. Sorry for the whiplash folks.
It was pointed out to me that the convention we have is to use WITH_
elsewhere in the system, eg: ports etc. This is all temporary anyway
and presumably will be inverted to a NO_LIB32 or something like it in
the future.

# 1d9468ee 05-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Convert tools/lib32/build.sh into world connectable hooks. This still
rates pretty high on the "hack!" scale, but it works for me. Adding
-DWANT_LIB32 to the world build command line, or 'WANT_LIB32=yes' to
/etc/make.conf will include the 32 bit libraries with the build.

I have not made this default behavior. Cross compiling this stuff is an
adventure I have not investigated.

This is still a WIP. We needed this at work so that we could install from
a readonly obj tree - lib32/build.sh wasn't up to that.

# a35d8893 24-Oct-2004 Ruslan Ermilov <ru@FreeBSD.org>

For variables that are only checked with defined(), don't provide
any fake value.

# c5ebbe8f 11-Oct-2004 Peter Wemm <peter@FreeBSD.org>

Catch another gcc-3.3 c++ include path reference and update it to 3.4.

# 2a614447 27-Sep-2004 Doug Barton <dougb@FreeBSD.org>

1. Add much finer granularity to the NO_BIND knobs with the addition of:
NO_BIND_DNSSEC, NO_BIND_ETC, NO_BIND_NAMED, and NO_BIND_UTILS.

2. Make creation of directories in /usr/include that are only needed
in the WITH_BIND_LIBS case conditional.

Reviewed by: ru, des

# e19f6f27 21-Sep-2004 Ruslan Ermilov <ru@FreeBSD.org>

Hopefully fix alpha and sparc64 builds: on these architectures,
libpthread is provided by src/lib/libc_r.

Also, removed lib/bind from _generic_libs, "lib" will suffice.
Also, removed redundant lib/bind dependency on lib/libpthread
(as lib/bind is not in the _prebuild_libs, it's not needed).

Prodded by: trhodes@ reporting that des@ is on the flight

# cd3ee173 21-Sep-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

Switch from BIND 8 to BIND 9.

Submitted by: (in part) dougb@, trhodes@
Reviewed by: dougb@, trhodes@, re@
MFC after: 5 days

# d0beb853 07-Sep-2004 Warner Losh <imp@FreeBSD.org>

Although 'Unanimous Consent' appears to be a well defined and used in
the US Senate, Canadian Parliament and Australian Senate, it was
causing some confusion. After some consultation with Mark Murray,
change this to 'without objection' since often times a plain-speaking
term is preferable to a regionally used term.

Also, clarify that this procedure is to be used when for more mundane
matters that need a sanity check, but don't need the whole, ponderous
voting proceedure that more difficult issues require. Core members
that read email in any given 48 hour period are trusted enough to know
the difference and to provide the sanity check as necessary.

Reviewed by: markm

# db68d2a6 26-Aug-2004 Paul Richards <paul@FreeBSD.org>

Backout the CVSTAG variable, it could potentially be dangerous if
you track multiple releases in different trees.

Leave the CVSOPTIONS variable there since it could be useful.

# e5d264a3 25-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

Fix "make world DESTDIR=/mnt" to work again. A recent change
to make(1) that causes command-line variables to be passed as
command-line variables to sub-processes that make(1) executes
broke it. By changing the type of all DESTDIR variables used
internally in Makefile.inc1, from environment to command-line
variables of the highest priority, I was able to "make world"
with success, with the command-line variable DESTDIR set.

# e8826115 24-Aug-2004 Paul Richards <paul@FreeBSD.org>

Add a CVSTAG makefile variable that can be set in /etc/make.conf that
determines which CVS tag to track when running make update. This makes
it easier to configure a box to track a particular release if it does
automated updates from a cvs repository.

# 7c996c4a 18-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

A fix from rev. 1.52 of gnu/usr.bin/cc/cc_tools/Makefile was lost
in rev. 1.57. Fix this regression by making cc_tools a new-style
build-tool in Makefile.inc1. For details of what has been fixed,
please see the gnu/usr.bin/cc/cc_tools/Makefile,v 1.52 commit log.

Caught this by accidentally touching param.h while in the process
of cross-buildworld for amd64.

# 0ec443a0 18-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

Moved the MAKEOBJDIRPREFIX check from Makefile.inc1 to Makefile,
to suppress warnings with installworld and distributeworld when
env(1) cannot be found in the PATH.

# bf90c6ee 16-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

sys/boot seems to compile fine on Alpha; unbreak ``make release''.

Prodded by: re-alpha (wilko)

# 88e29990 11-Aug-2004 Hartmut Brandt <harti@FreeBSD.org>

Ensure that a new gensnmptree is built. This should fix the problems
with the snmp_atm module.

# 72e3b039 11-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

Enforce the check that MAKEOBJDIRPREFIX (if set) is set in environment
only, and not as a global (in /etc/make.conf) or command-line variable.

MAKEOBJDIRPREFIX has never been a global or command-line variable, and
the fact that it works in some scenarios for "make buildworld" doesn't
make it any more correct. Using it as a global or command-line variable
is error prone, discouraged, costs us lot of false build reports, etc.

This commit is aimed to fix it once and for all.

Anyone potentially objecting to this change is encouraged to read the
make(1) and make.conf(5) manpages, and the comments regarding the use
of the MAKEOBJDIRPREFIX variable in /usr/share/mk/bsd.obj.mk and
/usr/share/examples/etc/make.conf.

# de5b5e45 10-Aug-2004 Hartmut Brandt <harti@FreeBSD.org>

Fix recent breakage in rescue. We need to build a new crunchgen
that will not emit the bad MAKE=make line that caused the breakage.

Submitted by: ru

# 088cf0fb 09-Aug-2004 Hartmut Brandt <harti@FreeBSD.org>

Make make recurse into sub-directories and sub-makes when given
two -n flags. If only one -n flag is given the old behaviour
is retained (POLA). In order to make this working for installworld
change the IMAKEENV in this case so that the tools are found
(we have no temporary installation environment in this case).

Submitted by: ru (IMAKEENV part)

# e62200e7 09-Aug-2004 David E. O'Brien <obrien@FreeBSD.org>

The file(1) related build-tool moved to libmagic.

# 81efba8c 27-Jul-2004 Alexander Kabaev <kan@FreeBSD.org>

Bmake glue for GCC 3.4.2-prerelease.

# be628d28 08-Jul-2004 Hartmut Brandt <harti@FreeBSD.org>

Get rid of the THISHOST variable when building on sparc64. The problem
with it is that it is set by calling hostname and hostname isn't normally
in the path at that point.

# 2c67a07f 17-Jun-2004 David E. O'Brien <obrien@FreeBSD.org>

Third time's a charm?? (the logic was reversed from desired)
Time for sleep...

Submitted by: ru

# 6e009069 16-Jun-2004 David E. O'Brien <obrien@FreeBSD.org>

Grrr, use the userland spelling not the kernel tree spelling.

# f1e3e1c7 16-Jun-2004 David E. O'Brien <obrien@FreeBSD.org>

Fall out from Binutils 2.15: disable building the Alpha loader.

# b4c3fa62 17-May-2004 Ruslan Ermilov <ru@FreeBSD.org>

Allow buildworld and friends to complete when make(1) is called
with some debug flags (-d).

Noticed by: Gleb Smirnoff

# 11167919 13-May-2004 Ruslan Ermilov <ru@FreeBSD.org>

Record the libssl.so dependency on libcrypto.so. This should
help some ports that depend on libradius that recently gained
the dependency on libssl. This is also how the stock OpenSSL
build would link libssl.so on FreeBSD.

Prompted by: kris
OK'ed by: markm, nectar

# 466b960f 12-May-2004 Ruslan Ermilov <ru@FreeBSD.org>

Catch up with the current output of tools/make_libdeps.sh:

- Removed the stale dependency of libypclnt on librpcsvc.
- Fixed the dependency graph of libssh.

# b4b831ef 27-Apr-2004 Ruslan Ermilov <ru@FreeBSD.org>

- Added rad_demangle() for demangling user-passwords (needed for
MS-CHAPv1 MPPE-keys).
- Added rad_demangle_mppe_key() for demangling mppe-keys (needed
for MPPE-keys).
- Added some typecasts for avoiding compiler warnings.
- Fix: better handle wrong usage of the lib (if the programmer
has not called rad_create_request() but rad_put_*(), then a
weird error message was returned).
- Added a new function for putting the Message-Authenticator.
- Verify the Message-Authenticator, if it was found inside a
response packet and silently drop the packet, if the validation
failed.
- Implicitly put the Message-Authenticator, if the EAP-Message
attribute was added.
- Added some missing defines.

Submitted by: Michael Bretterklieber
PR: 46555

# 9de3b350 14-Apr-2004 Hartmut Brandt <harti@FreeBSD.org>

Move the SNMP MIBs and tree definitions from /usr/share/bsnmp to
/usr/share/snmp. This mirrors the use of /usr/local/share/snmp and
makes also more sense when non-bsnmp-specific MIBs go in.

# 43fc6762 13-Apr-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

Add a kernel-toolchain target which only builds the bits required to build
a kernel. This is essentially the same as the toolchain target, except
that it does not build headers and libraries.

Submitted by: ru

# 839274c7 24-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Added the `toolchain' top-level target, which builds enough of
buildworld, up to and including libraries, except for actually
building the world.

Requested by: many

# e5b369af 19-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Removed 3x2 dots I don't like. ;)

# 0aacff4d 19-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Create /usr/sbin in ${WORLDTMP}. I've accidentally removed it in
revision 1.343, but it's needed for btxld(8), and this fix (along
with the --enable-64-bit-bfd configured BFD on i386) allows other
architectures to successfully cross-build the i386 world.

Tested on: alpha

# ba3ae554 18-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Comment various stages of buildkernel, symmetrical to buildworld.

# 125499e5 14-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Don't scare non-root users attempting to build world.

# 2f00651d 13-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Create hierarchy before installing a new kernel. This is needed
because we require that a new kernel be installed prior to a new
world, and we may need some new directories to succeed.

Once MFCed, this will also help those poor souls who redundantly
``mv /modules /modules.old'' in RELENG_4 before an installkernel.

Requested by: many
MFC after: 3 days

# e436e60b 12-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Hide internal implementation details of UID/GID checks from the user.

# 2ff05f90 12-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Use find(1) instead of ``pw groupshow'' to detect missing groups.
Restore checks for recently added PF groups.

Reviewed by: mlaier

# 7698f25a 11-Mar-2004 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

Use 'pw groupshow' instead of 'id -g' to see if a group exists.

PR: 64073
Submitted by: jhb
MFC after: 5 days

# e12b910d 10-Mar-2004 Max Laier <mlaier@FreeBSD.org>

Back out id -g checks as they are wrong (sendmail group untouched).

Requested by: dwhite
Approve by: dwhite

# 0ab11e65 10-Mar-2004 Max Laier <mlaier@FreeBSD.org>

Add installcheck for proxy:proxy and authpf.

Suggested by: ru
Approved by: bms(mentor)

# 171ae50e 05-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Reword two more lines to avoid wrapping.

# b7d44576 04-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Minor stylistic improvements in the SPECIAL_INSTALLCHECKS section, mainly
to reduce the number of wrapped lines.

Suggested by: bde

# 9565bbf3 04-Mar-2004 Bruce Evans <bde@FreeBSD.org>

Improved the description of the installkernel targets.

Don't hide what we do to force failures for the installkernel targets
or other targets.

# afc6f086 03-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Commit the first set of files for changing time_t on freebsd/sparc64
from a 32-bit value to a 64-bit value. This commit does not actually
change anything. It merely provides instructions, scripts, and a safety
measure in Makefile.inc1 for people who want to make the change.

The real change to 64-bit time_t's on sparc64 is scheduled to happen
on March 10th, assuming that so major problems are found between now
and then by early-adopters.

Reviewed by: freebsd-sparc64

# 1e405604 13-Feb-2004 Ruslan Ermilov <ru@FreeBSD.org>

Drop directory existence checks.

OK'ed by: bde

# 11bf3600 31-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

Overhaul of kerberos5/ makefiles. Most significant changes are:

- Dropped support for standalone builds, this was only partially
supported anyway, and required so much magic in makefiles that
made life dangerous (e.g., by using the custom yacc rules).

- Got rid of .OBJDIR in makefiles -- makes building of individual
files possible again.

- Made the .x.c transformations -j safe.

- Reprogrammed LDADD to fix static build of some utilities that
was broken.

- Fixed LDFLAGS and DPADD in the WITH_OPENLDAP case -- positively
affects the contents of .depend files.

- Removed redundant .h's from SRCS, only kept those that are
generated.

- libkrb5/ INCS were bogusly installed again with libgssapi/.

- Made build-tools real tools with their own makefiles in
separate directories. This allows us to properly track
their dependencies, etc.

- Faster build, 21% less of makefile code!

Approved by: nectar
Reviewed by: markm
Silence on: arch

# b6a6dd18 23-Jan-2004 Hartmut Brandt <harti@FreeBSD.org>

Create the OID and tree files while building the modules and the daemon
instead of creating them by hand and storing them in the CVS tree. Add
gensnmptree to the bootstrap tools (it is used to generated these files).
This simplifies the update procedure.

Submitted by: ru

# bbe8270c 22-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

- Run makewhatis(1) in etc/Makefile at the end of "install".
- Removed redundant and undocumented NO_MAKEDB_RUN knob.

# 5151e722 16-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

Create ${WORLDTMP}/legacy/usr/include/c++/3.3 for usr.bin/lex.

# 33b53e37 16-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

lex(1) prior to flex.skl,v 1.8 and gen.c,v 1.7 requires bootstrapping.

Prodded by: nectar

# 897ca6eb 15-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

Alongside revision 1.382, don't build profiled libraries so early
in the build -- it's OK to keep this for the "make all" phase.

# 5091e3df 08-Dec-2003 Garance A Drosehn <gad@FreeBSD.org>

Fix a problem where 'make installworld' will fail and leave the
system in a messy state *if* the user is upgrading from a system
which has no /libexec to a system which builds a DYNAMICROOT, and
if that user has set DISTDIR (as documented for ports, but it turns
out that the same variable name is used for a completely unrelated
purpose in 'make release').

There are other possible fixes for this issue, and ru@ may later
decide to commit one of those fixes. I just wanted some fix in
ASAP, and this is the fix that I have tested.

Reviewed by: bde, imp, and ru

# 5257abea 16-Nov-2003 Gordon Tetlow <gordon@FreeBSD.org>

Invert the condition that installs the dynamic linker early, since
DYNAMICROOT is now the default. Also document -DNO_DYNAMICROOT since
that is going to be a documented feature.

Submitted by: matusita, rushani

# 360b288f 12-Nov-2003 Hartmut Brandt <harti@FreeBSD.org>

The snmp_netgraph module depends on libnetgraph. So add a dependency and
add libnetgraph to the list of prebuilt libraries in the main Makefile.

Reviewed by: ru

# cd7b6c1e 10-Nov-2003 Hartmut Brandt <harti@FreeBSD.org>

Make two directories under usr/share/bsnmp that are needed during
library build to install tree definition files and MIBS.

Okay'ed by: ru

# c54d7e02 03-Nov-2003 Ruslan Ermilov <ru@FreeBSD.org>

Don't be so chatty about building includes.

# 829340b1 04-Oct-2003 Ruslan Ermilov <ru@FreeBSD.org>

Retired the "most" and "installmost" targets -- they just
do not have a chance to work nowadays as we have a lot of
internal libraries in lib/.

Discussed with: marcel, wollman

# 9ed60552 15-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

Help those attempting to upgrade from static to dynamic root.

# 3d0d5c76 15-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

Catch up with libpthread/support/Makefile.inc,v 1.6 and revert
Makefile.inc1 revisions 1.365 and 1.367: libc_pic.a is no longer
necessary to build libpthread.so (ie: libkse.so).

# be01c222 07-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

- No need to create libfoo.so -> libfoo.so.X symlinks in /lib,
as it was decided that our toolchain will revert to looking
for libraries in /usr/lib only.

- Make /usr/lib/libfoo.so -> /lib/libfoo.so.X symlinks absolute
so that they still work if /usr is symlinked.

- Remove stale /usr/lib/libfoo.so.X libraries during install.

Discussed with: gordon, obrien, peter

# d61a976b 01-Sep-2003 Scott Long <scottl@FreeBSD.org>

Clarify the numbering of some of the build stages.

# e95130d9 30-Aug-2003 Ruslan Ermilov <ru@FreeBSD.org>

Revert rev. 1.378, and restore the correct arithmetic expression
syntax. The

make buildworld
mv /usr/include /usr/include.old
make installworld

issue has been fixed a month ago in Makefile,v 1.285, and there
is no valid reason to continue to keep the wrong syntax here --
buildworld takes care of upgrading a make for you if necessary.
But if you find yourself in an environment with an old make(1)
binary that breaks on this, and this is because you attempted
to run a target other than buildworld, don't whine but try again
with -DALWAYS_CHECK_MAKE defined -- it should do the trick.
Otherwise, if you still have a problem, please report it as a
bug and attach the ``make -dl ...'' output.

Reviewed by: marcel

# bb66285c 28-Aug-2003 Marcel Moolenaar <marcel@FreeBSD.org>

Remove the AFM (Anti-Footshooting Measure) added when we split the
5.x signal code from the 4.x signal code. The split happened in
Oct 2002 and we have had 2 releases since then. A kernel older than
5.0-R cannot reasonably be called a -current kernel anymore.

This does not break upgrading from an 10 month older kernel. It just
makes it more exiting.

# c3754771 26-Aug-2003 Warner Losh <imp@FreeBSD.org>

OSRELDATE should fallback to 'unknown' rather than the kernel that's
booted on this machine. This is a slightly better default to use.

Requested by: ru

# e4df6a7d 25-Aug-2003 Warner Losh <imp@FreeBSD.org>

Add @ before the shell invocation for the testing of sufficiently new sh.
No need to see this message twice.

# b21d83f1 25-Aug-2003 Warner Losh <imp@FreeBSD.org>

Fall back to using the kernel version for the OSRELDATE when
/usr/include/osreldate.h doesn't exist on the system. While this
could be worked around by saying something like 'make includes
OSLRELDATE=0' when this file doesn't exist, it is just as easy to
provide a fallback when the file we know we depend on doesn't exist.
While this doesn't make all targets work w/o a
/usr/include/osreldate.h, because some of the FreeBSD bootstrap tools
use this file. 'make includes' however does work.

Noticed by: peter, obrien (and likely others)
Pointy hat to: imp (for suggesting a method that depended on /usr/include)

# 0b0c9474 17-Aug-2003 Gordon Tetlow <gordon@FreeBSD.org>

In preparation for libraries being installed in /lib, add lib to the
list of build directories during the tool creation phase of the build.

# 234f7acb 24-Jul-2003 Mark Murray <markm@FreeBSD.org>

Don't lint(1) so early in the build. Its OK to keep this for the
"make all" phase.

# 234a6529 14-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Apparently we prefer underscores in new options. Sorry for the churn folks.

Requested by: obrien

# a20c015c 11-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Forgot that the rescue subdir needs to be a conditional for the
build-tools bit.

# 4d938af0 11-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Turn rescue back on, conditional to NORESCUE. We seem to be split on
using underscores or not, so I just randomly picked a style. I think
I have the logic correct, but if someone wants to give it a once over
that would be good.

Tim submitted a patch to fix the cross-building issues which I tested
with a tinderbox run for sparc64.

Submitted by: Tim Kientzle <kientzle@acm.org>

# dda36143 09-Jul-2003 Kris Kennaway <kris@FreeBSD.org>

Correct makefile syntax error in r1.375.

# 67599f45 07-Jul-2003 David E. O'Brien <obrien@FreeBSD.org>

Style nit.

# d0c749d3 06-Jul-2003 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

Use 'id' instead of 'grep' to detect the presence of the smmsp user/group.
This fixes the check for users with smmsp in NIS instead of their local
files.

Suggested by: peter
MFC after: 5 days

# 5dc63117 04-Jul-2003 Ruslan Ermilov <ru@FreeBSD.org>

Fixed style bugs related to parentheses in Makefile.inc1.

Submitted by: bde

Fixed nearby bug: propagate the root Makefile's idea of
the appropriate "make" binary down to release/Makefile.

# 18ecbedd 02-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

More NO_RESCUE to RESCUE transitions.

Submitted by: ru

# e9693da9 01-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Switch the logic on the /rescue bits from NO_RESCUE to RESCUE, at least
until there is a fix for cross building available.

# 3cc95654 30-Jun-2003 Ruslan Ermilov <ru@FreeBSD.org>

Put rescue/ into a correct slot in the SUBDIR list. Sort bootstrap-,
build-, and cross-tools lists, reformat lists for easier maintenance.

Submitted by: bde, ru

# a3d6b3e7 30-Jun-2003 Ruslan Ermilov <ru@FreeBSD.org>

Only bootstrap crunchide(1) and build crunchgen(1) when necessary.
The latter needs to be built either if it's used as a cross-tool
(${TARGET_ARCH} != ${MACHINE_ARCH}) or if it has backward compat
issues, like e.g. lack of the AMD64 support.

# 4e650399 29-Jun-2003 Gordon Tetlow <gordon@FreeBSD.org>

Do the deed and hookup /rescue to the build. As a result, always build
crunchgen and crunchide as cross-tools.

Submitted by: Tim Kientzle <kientzle@acm.org>

# e3724050 27-Jun-2003 Sean Kelly <smkelly@FreeBSD.org>

- Fix a typo.

PR: bin/53864
Submitted by: Lukas Ertl <l.ertl@univie.ac.at>
Approved by: jeff (mentor)

# 0147d2aa 22-Jun-2003 Hidetoshi Shimokawa <simokawa@FreeBSD.org>

Allow installkernel.debug and reinstallkernel.debug.

# c4529532 14-Jun-2003 Warner Losh <imp@FreeBSD.org>

Minor tweaks to the build process so that we can build 5.1-current on
4.8-stable:

Must build lib/libc before libpthread. Fix how we do this to be more
consistant with how lists are handled in the file. Also, don't bother
to prebuild libc if we're not building libpthread.

Submitted by: ru@
Reviewed by: bde@ (before ru@ submitted it)

# f212249a 14-Jun-2003 Dag-Erling Smørgrav <des@FreeBSD.org>

Do not bogusly set CSTD to the empty string.

# 21e24af3 07-Jun-2003 Warner Losh <imp@FreeBSD.org>

Add lib/libc to list of _prebuild_libs because we need the target
built libc_pic.a for libkse.

# This should finally fix the build on 4.x

Submitted by: kan

# 59d855a0 07-Jun-2003 Warner Losh <imp@FreeBSD.org>

When boot strapping from older systems, don't specify a C standard in
the bootstrap process. This allows one to more completely build from
a -stable box.

Reviewed by: ru@ (briefly)

# 652b5a75 31-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Wrap gperf & groff wth NO_CXX.

# a0218a2a 21-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak world build if NO_OPENSSL is defined but NO_KERBEROS is not.

Submitted by: Marius Strobl <marius@alchemy.franken.de>
Approved by: re (jhb)

# 7691f66a 19-May-2003 Dag-Erling Smørgrav <des@FreeBSD.org>

Retire the useless NOSECURE knob.

Approved by: re (scottl)

# 8ec00e70 18-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak parallel make of _includes after revision 1.356 changes.

Spotted by: bde
Approved by: re (scottl)

# 5d296100 17-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

-lbsdxml lives in lib/libexpat. *Blush*

Submitted by: tmm (Makefile.inc1)

# 81d5f438 17-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak world: record libgeom dependency on libbsdxml here too.

Forgotten by: ru
Submitted by: des
Verified by: tools/make_libdeps.sh
Approved by: re (scottl) (related change)

# 50da533c 15-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Use the installed world's idea of OSRELDATE rather than the kernel.
This was the initial intent anyway, and it became clear that it is
really necessary to treat it this way, as many people happen to run
with kernel newer than the installed world.

Submitted by: imp, ru
Approved by: re (scottl)

# a270eca5 04-May-2003 Bruce Evans <bde@FreeBSD.org>

Install symlinks to individual headers instead of symlinks to directories
in the SHARED=symlinks case. Symlinks to directories only work if all the
the necessary headers are in 1 directory, but the necessary headers are
scattered for at least ipfilter headers in <netinet>. This change also
avoids polluting /usr/include with non-headers; the /usr/include hierarchy
is now independent of the setting of SHARED.

Submitted by: ru (edited to fix netgraph/bluetooth/include and machine/pc)
PR: 44148

# 4ee05d29 05-May-2003 Mark Murray <markm@FreeBSD.org>

Negate the logic of MAKE_KERBEROS5, and replace it with NO_KERBEROS.

# 22bd4d16 03-May-2003 Warner Losh <imp@FreeBSD.org>

Many developers run with userland != to kernel. While this isn't
supported, it usually works for months at a time. Allow these people
to override the OSRELDATE of their installed world when things don't
match and the exact OSRELDATE matters and is different than the
kernel. Now that Makefile.inc1 depends more and more about which date
you have to optimize the pieces it builds, it may be necessary to
pessimize things if its guesses are wrong.

If OSRELDATE is already set, we won't fork the sysctl to find out what
the kernel's date is.

Developers on IRC suggested that they run mismatches all the time as
well.

Reviewed by: obrien

# dd2aac02 01-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

For the time being, upgrade the whole Groff (to version 1.19),
but stop doing so again on the next __FreeBSD_version bump.

# 01b63a10 29-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Restore the ordering of NO's and remove one redundant NOLINT.

Reviewed by: markm

# 945e0cea 30-Apr-2003 Mark Murray <markm@FreeBSD.org>

Fix "make world" for the WANT_LINT case. The various build tools
must not try to lint(1) stuff at *-tools time; keep the linting
for the actual build (which comes later).

# 007bf12e 30-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Groff after 2002/10/15 has no known backward compatibility issues,
but we always want the latest macro files.

# 69e74195 16-Apr-2003 John Baldwin <jhb@FreeBSD.org>

Rename KRNLSRCDIR to KERNSRCDIR and allow it to be overridden. The name
change was to be consistent with other overridable variables such as
KERNCONFDIR and KERNCONF.

# c2400c8e 14-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

kbdcontrol.c rev. 1.35 and onwards support the KEYMAP_PATH
environment variable, and don't need to be bootstrapped.

# 692ebfe9 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

yacc(1) with skeleton.c rev. 1.29 in HEAD and rev. 1.28.2.1 in RELENG_4,
and onwards, are believed to not require bootstrapping.

# da54b929 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

xargs.c rev. 1.10 in HEAD and rev. 1.9.2.1 in RELENG_4,
and onwards, have support for the -J option we need.

# 47c95a33 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

elf2aout.c,v 1.6 and onwards have no known backward compatibility issues.

# 710b5ef8 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

uudecode.c rev. 1.23 in HEAD and rev. 1.13.2.3 in RELENG_4,
and onwards, have no known backwards compatibility issues.

# 7a9bf940 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Only create directories that are really needed.

# ad1520bd 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Install bootstrap-tools into a separate subtree of ${WORLDTMP}.
This allows us to use them as early as possible while building
bootstrap-, build-, and cross-tools. Some cleanups to follow.

This change resolves the gperf(1) bootstrapping issue (missing
-E option) in gnu/usr.bin/cc/cc1plus while in the cross-tools
stage when upgrading from 4.0-RELEASE.

# cb66f4dd 12-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Make sure legacy stuff comes last. Some tools that use
legacy stuff (binutils) depend on this order.

For this to work, provide (and use) specialized versions
of bsd.prog.mk and bsd.lib.mk that include the standard
versions first, then augment CFLAGS, DPADD, LDADD, and
LDFLAGS as necessary, with the legacy stuff.

Tested on: 4.0-RELEASE

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

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

# c0006b49 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Put back the undocumented change from rev. 1.334 too: no
need to create ${WORLDTMP}/legacy/usr/include explicitly.

# 5675749e 06-Apr-2003 Warner Losh <imp@FreeBSD.org>

Put back parts of 1.335 and 1.336 that 1.337 accidentally backed out.

Submitted by: ru

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

# 5ceb21ff 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Always remove ${WORLDTMP}/build/usr/include, even in the NOCLEAN
case. This way, we won't have stale compatibility headers there.

# cfc236e8 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Moved libbuild target to where it belongs. Added a comment.

# 32054bbb 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Fixed buildworld stages names in comments.

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

We can't use ${WORLDTMP}/usr/{include,lib} for the compat layer. This
is because we populate these directories later, and a subsequent
-DNOCLEAN build may fail. So, we put them in
${WORLDTMP}/build/usr/{include,lib} instead and adjust Makefile.boot.

Again, this works on -stable and -current, but might break older
versions.

Submitted by: ru@

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

# 756ec6a4 04-Apr-2003 Warner Losh <imp@FreeBSD.org>

Diff reduction with my p4 changes:

Add @ before ${ECHODIR} where appropriate because we don't need to echo
the echo command... This gets rid of extra echo ===> in log files...

# cdcdfd87 01-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Parallelize (on the top-level SUBDIR list) the "all" stage of
buildworld. This gives 5-11% percent gain in real buildworld
times on various UP and SMP systems here. I used 4 * hw.ncpu
as an argument to "make -j" in my tests.

# b9040d98 01-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Pass NO_WARNS to the build-tool stage too; -Wsystem-headers
isn't known to the 4.x system compiler.

# effd19ed 31-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Enable cpp(1) warnings in system headers. GCC is oriented on
glibc which is externally maintained, so GCC ships with these
warnings turned off by default. This is also consistent with
the src/contrib/gcc/c-lex.c,v 1.2 change.

# fcdc2713 30-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Slightly improve buildworld times by excluding crunchide(1)
and kgzip(8) from the list of cross-tools during the normal,
non-"make release" buildworld.

Also, don't gratuitously build them, btxld(8) and elf2aout(1)
for native architecture builds, since they have no known
boostrapping issues along the supported upgrade path.

Prodded by: peter

# 8eb1c4ca 11-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Convert kgzip(8) to be an i386 cross-tool. This is needed for
cross-releasing i386 on different architectures. This version
provides an i386 version of <a.out.h>, and handles endianness.

Tested on: alpha, sparc64

# 4d9e5ead 08-Mar-2003 Mark Murray <markm@FreeBSD.org>

KerberosIV de-orbit burn continues. Disconnect from "make world".

# f93bdc08 06-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

With CVS_UPDATE, use read-only repository mode by default.

# f617fa52 04-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Doh, committed to the wrong branch.

Spotted by: johan

# 7adf0ebb 04-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

MFC: Ship with /etc/login.conf hashed.

Approved by: re

# 6192b1df 03-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Make sure the default install comes with /etc/login.conf hashed.

# 73ba057c 03-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Catch up with sys/conf/kern.post.mk,v 1.39 -- we can now use
plain ${CLEANDIR} to clean kernel and modules. This has an
additional nicety of respecting NOCLEANDIR.

# 2ff31e0d 24-Feb-2003 Ruslan Ermilov <ru@FreeBSD.org>

Ensure that build-tools end up in the object directory different
from the source directory. (This mostly affects the RELENG_4's
``make release'' release.5 target, where "rtermcap" build-tool
for release/sysinstall ends up in the source directory and later
steps of release.5 wipe it out.)

Spotted by: jhay

# 9a9c78bd 21-Feb-2003 Ruslan Ermilov <ru@FreeBSD.org>

Respect ``makeoptions NO_MODULES'' specified in the kernel config file.

# 24cc1d58 11-Feb-2003 Tom Rhodes <trhodes@FreeBSD.org>

Add -DNOMAN to the list.

# 07e5ffba 07-Feb-2003 Joseph Koshy <jkoshy@FreeBSD.org>

Catch typos in the kernel name specified for an "installkernel" invocation
early on, rather than failing later with an obscure error message.

Make error messages appear consistent.

# d0cfa43f 04-Feb-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Don't attempt buildworld if the path to the source-tree contains a comma.

Can be removed if the underlying issue is fixed.

Submitted by: Flemming Jacobsen <fj@batmule.dk>

# cbb66355 30-Dec-2002 David E. O'Brien <obrien@FreeBSD.org>

Move elf2aout back to /usr/bin -- it is a general development tool, not
a sysadmin tool.

# fc599016 02-Dec-2002 Ruslan Ermilov <ru@FreeBSD.org>

For installkernel, use the fresh tools (if we've built them with
buildworld).

Reviewed by: imp, marcel
Approved by: re (rwatson)

# 3f66c888 14-Nov-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make dynamic PAM modules depend on dynamic PAM library.

Requested by: des, markm

# 40c6b893 13-Nov-2002 Ruslan Ermilov <ru@FreeBSD.org>

Take __FreeBSD_version into account when BOOTSTRAPPING.

# fb404d6f 03-Nov-2002 Scott Long <scottl@FreeBSD.org>

Hook the aic7xxx modules up. This requires some extra care since aicasm
is a compiler tool and needs to be compiled by the host compiler. I've
tested this in i386->sparc cross-build, 4.7->current upgrade, normal
buildkernel target, and normal /sys/i386/compile/GENERIC configurations.

Submitted by: ru

# 60e155d9 28-Oct-2002 Ruslan Ermilov <ru@FreeBSD.org>

Emptify.

# 6ef0c770 26-Oct-2002 Peter Wemm <peter@FreeBSD.org>

DISTDIR is used by 'make release', lets see if this is enough to turn
off the execution test.

# 13f571a3 25-Oct-2002 Peter Wemm <peter@FreeBSD.org>

Provide a bit of anti-foot-shooting protection. Make sure that in the
non-cross cases without DESTDIR, that the bin/sh that we're about to
install works. Otherwise, a 'make installworld' without having already
rebooted with a post-signal-fix kernel is a rather big disaster when
important things like /bin/sh coredump.

# 017b462e 22-Oct-2002 Ruslan Ermilov <ru@FreeBSD.org>

_games is gone in rev. 1.305.

# dc2f663b 20-Oct-2002 Mark Murray <markm@FreeBSD.org>

Do not build the majority of the games. Remaining are the
"utility-like" games and everyone's favourite, fortune(6).

# 66422f5b 16-Sep-2002 Peter Wemm <peter@FreeBSD.org>

Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports. As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL. It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha

# c065f5b2 22-Aug-2002 Johan Karlsson <johan@FreeBSD.org>

Similar to bsd.subdir.mk, echo the name of the dir before
doing the cd. This is done for bootstrap-tools,
build-tools, cross-tools, and the libraries loop.

Reviewed by: ru
Approved by: sheldonh (mentor)
MFC after: 1 week

# d4f7b113 08-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

The intent in rev. 1.299 was to make the CPUTYPE assignment type check
bother "only those who attempts to set it to a different value". This
got broken in rev. 1.300 (that fixed another race).

Reported by: ache

# 10a6b1ff 07-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

Makefile.inc1 may eventually be merged with Makefile, so fix an
endless recursion bug similar to the one that has been fixed in
release/Makefile,v 1.698, in advance. A related fix to make(1)
has been committed in make/main.c,v 1.68.

Requested by: bde (who has them merged already)

# 9f3089ac 05-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

An empty CPUTYPE now means ``the default CPUTYPE'' in bsd.cpu.mk.
If there was no CPUTYPE assignment in /etc/make.conf, this would
cause the ``CPUTYPE assignment type'' check to falsely fail.

Reported by: johan

Fixed this by making sure we always pass the non-empty CPUTYPE.
Also make sure we use the correct set of share/mk files in our
test.

# 32f8ca45 02-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

TARGET_CPUTYPE should exist solely in Makefile.inc1, similar to
TARGET_ARCH and TARGET. This is problematic when one has the =
(unconditional) type of assigment for CPUTYPE in /etc/make.conf.
(This would override what was set on the command line to "make
buildworld".)

Add a (horrible) kludge to Makefile.inc1 to check the type of
assignment for CPUTYPE (only for those who attempts to set it to
a different value). Fix an example make.conf. Fix the kernel's
build-tools target (aicasm only at the moment) to catch up with
bsd.cpu.mk,v 1.15 (BOOTSTRAPPING replaced with NO_CPU_CFLAGS in
Makefile.inc1's BMAKE).

Reviewed by: jhb

# 22e256fd 30-Jul-2002 John Baldwin <jhb@FreeBSD.org>

- Define NO_CPU_CFLAGS during BMAKE and TMAKE (and thus XMAKE) so that
bsd.cpu.mk doesn't have to worry about compilers other than the current
version.
- Allow TARGET_CPUTYPE to override CPUTYPE in bsd.cpu.mk.
- Treat an empty CPUTYPE the same as an undefined CPUTYPE.
- For buildworld, buildkernel, etc., define TARGET_CPUTYPE to CPUTYPE for
native builds and define it to be empty for cross-builds.
TARGET_CPUTYPE is only defined if it is not already defined via the
commandline or environment.

# 609b7b31 24-Jul-2002 Ruslan Ermilov <ru@FreeBSD.org>

Inline ${_cxx_consumers}.

# 6b308680 24-Jul-2002 Peter Wemm <peter@FreeBSD.org>

We're done with 1.287 and 1.288 now.

Submitted by: ru

# 6faeb369 11-Jul-2002 Ruslan Ermilov <ru@FreeBSD.org>

Pass -DBOOTSTRAPPING to the kernel's build tool (sys/dev/aic7xxx/aicasm).
This way, it has a chance to be built with gcc 2.95.x (using the bandaid
in share/mk/bsd.cpu.mk,v 1.11).

Feedback timeout from: gordon

# b0346d34 01-Jul-2002 Juli Mallett <jmallett@FreeBSD.org>

libufs does not need built before most things, after all.

Submitted by: bde, ru

# a306cfd1 30-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Add libufs to prebuild_libs, since lots of things will want it, in time.

# 072f6798 21-Jun-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make NO_OPENSSL actually imply NO_OPENSSH, as documented in make.conf(5).

# f9382a3c 16-Jun-2002 Maxim Sobolev <sobomax@FreeBSD.org>

Don't try to build libssh if NO_OPENSSL is defined because NO_OPENSSL implies
NO_OPENSSH.

# 4093807d 06-Jun-2002 Ruslan Ermilov <ru@FreeBSD.org>

libfetch now depends on libcrypto and libssl.

# 99b73fff 31-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

On behalf of lib/compat/compat4x.i386/libusb.so.0.bz2.uu,v 1.1,
added uudecode(1) to bootstrap-tools.

# 3c67aa80 30-May-2002 Peter Wemm <peter@FreeBSD.org>

Ignore a c++ that is version other than 3.1 if it does not also match
cc's version. libgcc.a will have been clobbered and will no longer have
the old c++ support.

Submitted by: jhb

# f119dc7c 28-May-2002 Peter Wemm <peter@FreeBSD.org>

Bandaid for helping people who have a broken /usr/bin/c++ installation.

This only affects the -current early adopters and developers who have
done a 'make world' in the last few weeks and as a result installed a
gcc-3.1 version of /usr/bin/c++ but without the corresponding library
support that this now requires. This is a temporary hack that should be
deleted within a few weeks. In this case we will use the existing
gperf/groff one last time around for the early stage1 bootstrap. (This
isn't so bad, because we were unconditionally using the host one before)

# 0367ff75 28-May-2002 Peter Wemm <peter@FreeBSD.org>

Put on peril sensitive sunglasses and turn C++ stuff back on.

# 6af587dc 28-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed the world breakage caused by my last commit.
NOMAN is defined when building bootstrap-tools.

Submitted by: jhay

# a6290aac 27-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap makewhatis(1).

# 02c0301f 25-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Move elf2aout to usr.sbin/.

Approved by: jake

# b501b9b5 20-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap elf2aout(1) for sparc64; used to build sys/boot/sparc64/boot1.

# d246873e 18-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Back out rev 1.278. Seems we grew a getconf(1) that requires it.

# 17dbb179 18-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Remove local patch that crept in.

# ef446fb2 17-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Don't build gperf.

# 10b2978e 16-May-2002 Mark Murray <markm@FreeBSD.org>

Remove the perl bits from the build.

# 83f56d9a 15-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make sure to not yet build the GNU C++, but still allow
for the C++ progs to be built with e.g. an old compiler,
CXX=/usr/bin/c++, for the time being.

# 5d862037 15-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Rename `includes' to `buildincludes'.
Rename `incsinstall' to `installincludes'.
Make `includes' a -j safe shortcut for `buildincludes' + `installincludes'.
`buildincludes' and `installincludes' are SUBDIR friendly, if run directly.

# 1fbb6ab5 14-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Restore comment that got lost in revision 1.265.

# 1b690a48 14-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Do not run `includes' and `incsinstall' in parallel.

Spotted by: jhay

Parallel worlds and releases should be working again.

# c7b111cb 12-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Added new bsd.incs.mk which handles installing of header files
via INCS. Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files. Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.

Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1. Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):

kerberos5/lib/libtelnet/Makefile
lib/libbz2/Makefile
lib/libdevinfo/Makefile
lib/libform/Makefile
lib/libisc/Makefile
lib/libmenu/Makefile
lib/libmilter/Makefile
lib/libpanel/Makefile

Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.

Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD. Similarly for INCOWN, INCGRP,
and INCMODE.

Consistently use INCLUDEDIR instead of /usr/include.

gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.

These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".

# 42801998 12-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Quiet the peanut gallary and back out magical "breakage".

# bd7ce31c 09-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Turn off groff and gperf -- they will not compile with the in-tree Gcc 3.1.

# c3bb8639 09-May-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Add rpcgen to the bootstrap tools.

# fdc6a23f 09-May-2002 David E. O'Brien <obrien@FreeBSD.org>

`beforeinstall' w/the csu bits is a nop.

# 1b860b61 08-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Build our native CSU bits before the compiler-specific ones.
This helps in the compiler build.

# ce7c5cc8 07-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Make NO_CXX, really mean NO_CXX.

# 61e86e72 30-Apr-2002 Bruce Evans <bde@FreeBSD.org>

Sorted the directories in the rule for the includes target as much as
possible.

# 8f1f55e9 30-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Milestone #2 in cross-arch make releases. They now work!

You need to set TARGET_ARCH and possibly TARGET, the same
way you normally do it for a cross build(7).

Renamed `distribworld' to a more natutal `distributeworld'.

Put pwd_mkdb(8) under ${INSTALLTMP}; for `distributeworld'.

# d6e61d98 30-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Back out part of the revision 1.261: "etc" indeed needs to be
last for "distribute" to succeed -- the "make makedb" part of
the etc/Makefile:distribution target should be the last thing
made.

# 64b06e78 30-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make crunchide(1) a cross-tool; needed for cross-arch "make release".
Note that a.out is only supported for the non-cross i386 case.

# d672a609 29-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Parallel "make release" fixes.

# 6bde859f 26-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Milestone #1 in cross-arch make releases.

Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.

Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.

Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).

Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).

In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.

Moved the creation of the "crypto" dist from release.5 to
release.2.

In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.

Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.

Inline createBOOTMFS target.

Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.

Assorted fixes:

Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".

Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.

gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.

release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.

Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.

XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)

Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.

Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>

# b56f8802 20-Apr-2002 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

Despite the fact that it is documented in the handbook, the release notes,
and UPDATING and has been posted to both freebsd-current and
freebsd-stable, users are still not adding the required smmsp user and
group before doing an installworld. Therefore, don't let users do an
installworld unless they have followed directions.

Add a new installcheck Makefile target which installworld runs before
actually starting the installation. This target can be used by other parts
of userland as well. The first addition to the target is to check for the
smmsp user and group if NO_SENDMAIL isn't defined.

Others may add checks to this target as they see fit.

MFC after: 1 week

# 92815c0c 16-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Sort _startup_libs, _prebuild_libs, and _generic_libs lists alphabetically.

Submitted by: bde, ru

# dc173bd8 16-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Keep up with lib/Makefile,v 1.64 (uhh).

# 5de7148c 15-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix incorrect ordering in previous commit.

# 004e6863 15-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Add libypclnt to the prebuild library list, and record its dependency on
librpcsvc.

# 761139b1 13-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Add libypclnt to the includes target.

# 4d8bba46 12-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Add a tool (and the first application of it) that could be used
to automate building of libraries.

Prodded by: bde

# b2490f91 11-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

I now don't seem to be able to reproduce the -DNOCLEAN buildworld
breakage with ioctl.c. The .depend file should track dependencies
just fine, and the worst we can have is to miss new ioctls.

But I still think it's a good idea to have -DNOCLEAN build produce
the same ioctl.c as it would without -DNOCLEAN.

Prodded for a long time by: bde

# 04454986 11-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Don't special case i386/pc98, replace it with the smarter logic
of setting ${TARGET} -- make it default to ${MACHINE} if we are
not cross-building, and ${TARGET_ARCH} otherwise.

Set MAKEOBJDIREPREFIX based on ${TARGET}, not on ${TARGET_ARCH}.
This is useful if you want to cross-build pc98 worlds on i386.

# 66002be3 08-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Avoid cleaning modules twice in `buildkernel'.

# e69e7778 08-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap xargs(1) -- sys/conf/kmod.mk uses the new -J option.

PR: bin/36747

# 56f2a75b 03-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak buildworld after include/Makefile,v 1.167 commit.

# 1b88dfbd 01-Apr-2002 Josef Karthauser <joe@FreeBSD.org>

Back out lots of the last commit that was committed by accident.
(It's my test rig for some CVSUP,SUP code).

Spotted by: Michael G. Petry <petry@NetMasters.Com>

# 388f4c1d 01-Apr-2002 Josef Karthauser <joe@FreeBSD.org>

Install libusbhid.h during 'make includes'.

Requested by: jhb
MFC after: 3 days

# 9f1207d5 26-Mar-2002 Ruslan Ermilov <ru@FreeBSD.org>

Install sys/security/lomac/*.h to /usr/include/security/lomac/.

Install sys/<arch>/include/pc/*.h to /usr/include/machine/pc/.

PR: docs/29534

Install sys/netatm/*/*.h to /usr/include/netatm/*/.

Don't install compatibility symlinks for <machine/soundcard.h>
and <machine/joystick.h>. Three years is enough to be aware of
the change, and these weren't visible in the SHARED=symlinks
case.

Back out include/Makefile,v 1.160 that was a null change anyway
due to the bug in the path, and we now don't want to install
these headers because they would otherwise be invisible in the
SHARED=symlinks case.

Don't install IPFILTER headers. Userland utilities fetch them
directly, and they were not visible in the SHARED=symlinks case.

Resurrect SHARED=symlinks in Makefile.inc1.

PR: bin/28002

Prodded by: bde
MFC after: 2 weeks

# bd42830f 20-Mar-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make lint(1) a cross-tool.

(See commit log for usr.bin/xlint/Makefile,v 1.11 for what was wrong
with enabling build of lint libraries in rev. 1.12.)

This fixes cross-arch compiles (running binaries for a different arch
when generating lint.7 and lint libraries) and cross-branch compiles
(4.x -> 5.0 buildworld should be working again).

# 7b7aae42 20-Mar-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed the NO_PERL braino.

# 5ad400ab 16-Mar-2002 Mark Murray <markm@FreeBSD.org>

Update for Perl 5.6.1

# 9365c8a3 16-Mar-2002 Mark Murray <markm@FreeBSD.org>

Allow the use of NO_PERL as well as NOPERL. The latter is going to
be removed.

# 9c15e38a 06-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

1-true-AWK has a build-tool target.

# ea5c0da9 21-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

Obviate the need to set the COMPILER_PATH and LIBRARY_PATH in Makefile.inc1
to pick up the correct cross-tools (the compiler executables and binutils)
and special linker files (crt*.o). This is now controlled by a single knob,
TOOLS_PREFIX, when building cross-tools.

Fixed regression in Makefile.inc1,v 1.203 (-nostdinc). This clobbered target
architecture's CFLAGS with building host's CPUTYPE setting in /etc/make.conf,
and had a nice but nasty side effect of exposing some (normally hidden) bugs
in system headers.

(Attempt to move the "-nostdinc -I..." part of CFLAGS into the new CINCLUDES
(modeled after a similar CXXINCLUDES) eventually failed because hard-coding
${WORLDTMP}/usr/include to be the first in the include list does not always
work, e.g. lib/libbind.)

Compensate the -nostdinc removal by making cpp(1) built in the cross-tools
stage to not look for <> header files in the building host's /usr/include
(already committed as gnu/usr.bin/cc/cc_tools/freebsd-native.h, revisions
1.10-1.12, STANDARD_INCLUDE_DIR).

: $ /usr/obj/usr/src/i386/usr/bin/cpp -v /dev/null
:
: Before:
:
: #include <...> search starts here:
: /usr/obj/usr/src/i386/usr/include
: /usr/include
: End of search list.
:
: After:
:
: #include <...> search starts here:
: /usr/obj/usr/src/i386/usr/include
: /usr/obj/usr/src/i386/usr/include

(Disabling the use of GCC_INCLUDE_DIR in the FREEBSD_NATIVE case would fix
the duplicate above.)

Get rid of the (now unneeded) -I${DESTDIR}/usr/include magic in bsd.prog.mk
and bsd.lib.mk. Finish the removal of LDDESTDIR in bsd.lib.mk,v 1.55 -- we
no longer have users of it.

The required changes to gcc were already committed as contrib/gcc.295/gcc.c,
revisions 1.23 and 1.24.

Basically, this allows for the changes above plus makes gcc(1) persistent
about path configuration, whether it's configured as a native or a cross
compiler:

: $ /usr/obj/usr/src/i386/usr/bin/cc -print-search-dirs
: install: /usr/obj/usr/src/i386/usr/libexec/(null)
: programs: /usr/obj/usr/src/i386/usr/libexec/elf/:/usr/obj/usr/src/i386/usr/libexec/
: libraries: /usr/obj/usr/src/i386/usr/lib/
:
: $ /usr/obj/alpha/usr/src/i386/usr/bin/cc -print-search-dirs
: install: /usr/obj/alpha/usr/src/i386/usr/libexec/(null)
: programs: /usr/obj/alpha/usr/src/i386/usr/libexec/elf/:/usr/obj/alpha/usr/src/i386/usr/libexec/
: libraries: /usr/obj/alpha/usr/src/i386/usr/lib/

Reviewed by: bde, obrien

# 7a6051e8 14-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

The previous fix for broken -DMAKE_KERBEROS5 world was incomplete.
Finish it by adding kerberos5/lib/libvers to the build-tools list.

(I didn't notice it before because I tested my fix in a -DNOCLEAN
environment, and static libc.a was already in ${WORLDTMP}/usr/lib,
and libvers's make-print-version build tool used it for linking.)

Spotted by: John Indra <maverick@office.naver.co.id>

# 19f56da9 11-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed -DMAKE_KERBEROS5 world breakage in kerberos5/lib/libroken
(make-roken is a build tool). This bug was hiding itself after
a just fixed bug in cross-linker (binutuils/ld/Makefile,v 1.20).

The bug was fatal for cross builds; for example, an alpha binary
(make-roken) was attempted to be run on i386.

Added make-roken to the list of build-tools in libasn1. It only
worked because another build tool needs make-roken implicitly:

(build-tools: asn1_compile: print_version.o: roken.h: make-roken).

Spotted by: nectar

# e47a40e7 08-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

Now that cross-tools ld(1) has been fixed to look for dynamic
dependencies in the correct place, record the fact that -lssh
depends on -lcrypto and -lz.

Removed false dependencies on -lz (except ssh(1) and sshd(8)).
Removed false dependencies on -lcrypto and -lutil for scp(1).

Reviewed by: markm

# fac6ec1f 08-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

FreeBSD 4.1 bootstrapping aid (setproctitle(3) is in -lutil).

This backs out (sort of) delta 1.18 to perl/miniperl/Makefile.
Update to the ld(1) comment by peter in this revision:

ld(1) built as part of the cross-tools stage of buildworld has
been fixed to look for dynamic dependencies in the right place,
${WORLDTMP}/usr/lib, effective binutils/ld/Makefile,v 1.20.

Approved by: markm

# 0f958c27 28-Dec-2001 Paul Richards <paul@FreeBSD.org>

gnu/libexec has gone so remove it from the most targets.

# d235a1a0 23-Dec-2001 Chris D. Faulhaber <jedgar@FreeBSD.org>

Specify the full path to mktemp

# 0525c7ea 20-Dec-2001 Chris D. Faulhaber <jedgar@FreeBSD.org>

Use a more secure method of creating the temporary
install directory.

# 2694e8c7 13-Dec-2001 Warner Losh <imp@FreeBSD.org>

Move NO_WERROR from CROSSENV to BMAKE. In CROSSENV it disables it for
the entire build. We only want it for the bootstrap process.

Submitted by: ru

# 68f04dad 12-Dec-2001 Warner Losh <imp@FreeBSD.org>

Add NO_WERROR to the cross building environment so that we do not bail on
warnings generated by earlier versions of the compilers when bootstrapping.

Also a minor formatting nit in the tools list.

Reviewed by: markm

# 5f4a79e5 11-Dec-2001 Alexey Zelkin <phantom@FreeBSD.org>

Get rid of unsed since rev 1.109 of lib/Makefile WANT_CSRG_LIBM define.
Also replace internal make variable _libm with hardcoded path to lib/msun

Reviewed by: bde

# b69cb634 06-Dec-2001 John Baldwin <jhb@FreeBSD.org>

Just to be pedantic and more aesthetically pleasing, move the secure/
top-level subdirectory prior to share/ so that the top-level directories
are processed in alphabetical order.

# 09b50a98 19-Nov-2001 David E. O'Brien <obrien@FreeBSD.org>

Add the CVS knob so it may be overridden (or have options added).

Submitted by: Andrea Campi <andrea@webcom.it>

# b721f69c 15-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Don't cleandir also if MODULES_WITH_WORLD.

MFC after: 3 days

# acd9c8a8 15-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Typo fix (my test version doesn't have this...)

# 6a798cfa 15-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Run "make cleandir" if NO_MODULES are set, or there is no sys/modules
directory. Previous commit breaks buildkernel if NO_MODULES was set.
Sorry...

Noticed by: mike

# 4271dfbc 14-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

"make cleandir" before building a kernel and modules.

This will hopefully fix the recent 'I cannot compile linux module with
buildworld' problem. MFC will come shortly.

Submitted by: imura@ryu16.org

# 2ec22946 13-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Set full-path of cvsup.

In src/Makefile rev 1.232, environment variable PATH is set explicitly
to /sbin:/bin:/usr/sbin:/usr/bin. As a result, binaries located on
non-standard path cannot be executed without full-path (it's the change
of this revision).

However, cvsup is not in our base system -- you lose if you try to
"make update" without setting SUP in make.conf or command line argument.
I think it is safe to assume that cvsup is located at /usr/local/bin,
and it would help other people who first try to do "make update".

PR: 31932
MFC after: 1 day

# 2335a3d7 02-Nov-2001 David E. O'Brien <obrien@FreeBSD.org>

Bring Gawk back. There just isn't any other POSIX compliant AWK out there.
The biggest thing missing from Bell-Labs AWK is the character class regexes.

# 491beb71 31-Oct-2001 David E. O'Brien <obrien@FreeBSD.org>

Add 'awk' to the build-tools, so that the small utility used to build
one of the source files is made for the host, not target.

# 444ff633 25-Oct-2001 Ruslan Ermilov <ru@FreeBSD.org>

Fix cross-building further.

Introduce ${TARGET} defaulting to ${MACHINE} which should be set to
whatever your target ${MACHINE} is, and use that with world-related
stages. That is, to build pc98 on alpha, one now needs to set both
TARGET_ARCH=i386 and TARGET=pc98.

The scope of ${TARGET} is limited to Makefile.inc1 and cross-tools.

In particular, this change was tested to fix:

1. Cross building of "alpha" on i386. The breakage was introduced
by rev. 1.10 to sbin/i386/Makefile (missing <machine/cronyx.h>).

2. Descending into machine-specific subdirs for a different arch.
Previously, sbin/i386 and usr.sbin/boot0cfg were descended into
when cross-building "alpha" or pc98 on i386.

3. Fixes pc98 cross-building which was horribly broken, caused by
not setting MACHINE correctly (most ${MACHINE} == pc98 checking
Makefiles put -DPC98 to CFLAGS).

# 4448c79e 29-Sep-2001 Ruslan Ermilov <ru@FreeBSD.org>

Fix cross-building, etc:

1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!

2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.

We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.

Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.

That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.

3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.

There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:

1) They use (and depend on) the host environment.

2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.

In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.

4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.

5. Fixed "includes" to install secure/lib/libtelnet headers if
required.

Reviewed by: bde

# b4e13f7b 24-Sep-2001 Ruslan Ermilov <ru@FreeBSD.org>

Removed touch(1) from the list of installworld tools that
was added in previous revision for no apparent reason.

Submitted by: bde

# 9356546b 19-Sep-2001 Mark Murray <markm@FreeBSD.org>

Add which(1) the stuff that we need early on. The perl build needs it
to find miniperl.

# a1e0e968 17-Sep-2001 Ruslan Ermilov <ru@FreeBSD.org>

Run the `bootstrap-tools' and `cross-tools' stages with BOOTSTRAPPING
flag defined. This replaces the WORLD flag that got lost in revision
1.96.

# 02d4de15 29-Aug-2001 Bruce Evans <bde@FreeBSD.org>

Fixed world breakage. mkdir was not copied to ${INSTALLTMP}, but it is
used by src/include/Makefile in the SHARED=symlinks case.

# 934372e2 26-Aug-2001 Paul Richards <paul@FreeBSD.org>

Change the name of KRNLDEFDIR to KERNCONFDIR.

Suggested by Bruce, since the latter is more acceptable for a variable
that is externally visible.

Fix a style nit with a long line.

# f981dd25 26-Aug-2001 Paul Richards <paul@FreeBSD.org>

Add a variable KRNLDEFDIR that specifies where to find the kernel
config files.

It defaults to KRNLCONFDIR.

# a1a21b0e 26-Aug-2001 Mark Murray <markm@FreeBSD.org>

More libss removal.

# e2e0201c 26-Aug-2001 Mark Murray <markm@FreeBSD.org>

Adjust dependancies; now that a PAM module (pam_unix) can change
NIS passwords, libpam needs rpc dependancies.

# 4870a3d3 19-Aug-2001 Kris Kennaway <kris@FreeBSD.org>

Say goodbye to libss, which somehow managed to crouch hidden in the tree
for long after it was used.

# 1687fcd3 17-Aug-2001 David E. O'Brien <obrien@FreeBSD.org>

Use a build-tool to create the .mgc files.

Submitted by: ru (partial)
Obtained from: NetBSD (basic idea)
Reviewed by: bde, ru

# c4a5ef6e 04-Aug-2001 Thomas Moestl <tmm@FreeBSD.org>

Add some features to libdevstat, and overhaul the interface a bit:

1.) prefix all functions in the library with devstat_ (compatability
functions are available for all functions that were chaned in an
incompatible way, but are deprecated).
2.) Add a pointer to a kvm_t as the first argument to functions that
used to get their information via sysctl; they behave the same
as before when NULL is passed as this argument, otherwise, the
information is obtained via libkvm using the supplied handle.
3.) Add a new function, devstat_compute_statistics(), that is intended
to replace the old compute_stats() function. It offers more
statistics data, and has a more flexible interface.

libdevstat does now require libkvm; a library depedency is added, so
that libkvm only needs to be explicitely specified for statically linked
programs.
The library major version number is bumped.

Submitted by: Sergey A. Osokin <osa@freebsd.org.ru>, ken (3)
Reviewed by: ken

# 7bd0b867 29-Jul-2001 Dima Dorfman <dd@FreeBSD.org>

Enable the new libmp in the build, and disable libgmp and its
henchmen.

# 132463ca 09-Jul-2001 Mark Murray <markm@FreeBSD.org>

Axe S/Key. OPIE is the true and faithful successor.

# 9488e5f3 13-Jun-2001 Peter Wemm <peter@FreeBSD.org>

Part 2 of gensetdefs de-orbit burn. linker sets are now self contained
for ELF, see src/sys/linker_set.h log.

# d531238a 13-Jun-2001 Ruslan Ermilov <ru@FreeBSD.org>

WARNS= is fully functional again.

# 8411c946 11-Jun-2001 Ruslan Ermilov <ru@FreeBSD.org>

- Restore -nostdinc that got lost in rev.1.105; we don't
want host headers during `buildworld'.

- During `buildworld', install headers in a "copy" mode
until we decide what to do with the (currently broken)
SHARED=symlinks.

- Temporarily run `buildworld' with -DNO_WERROR, which
effectively disabled the -Werror bit of recently added
WARNS=X feature. This is required because adding the
-nostdinc bit back revealed bugs in some header files
that were hiding after not using -nostdinc.
It is unclear currently how exactly (and why) -nostdinc
affects gcc(1) warnings.

# 3f628ce1 28-May-2001 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap install(1).

# a24874dc 14-May-2001 Ruslan Ermilov <ru@FreeBSD.org>

Add kbdcontrol(1) to bootstrap-tools.
This fixes the upgrade path breakage in usr.sbin/sysinstall.

# 19a27152 26-Apr-2001 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Remove xlint from build-tools. This needs to be fixed in a different way.

# 1048d3c9 24-Apr-2001 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Add usr.bin/xlint to build-tools.

# 0a51d0d9 23-Apr-2001 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

${MAKEOBJDIRPREFIX}/usr/src/i386/usr/include/isc was being created as a plain
file during the bootstrapping process of a buildworld and contained the
last isc include file to be installed. It was meant to be a directory for
the isc include files.

# d8d4bc9a 17-Apr-2001 Ruslan Ermilov <ru@FreeBSD.org>

Add groff to bootstrap-tools.

# 3393f8da 26-Mar-2001 Kenneth D. Merry <ken@FreeBSD.org>

Rewrite of the CAM error recovery code.

Some of the major changes include:

- The SCSI error handling portion of cam_periph_error() has
been broken out into a number of subfunctions to better
modularize the code that handles the hierarchy of SCSI errors.
As a result, the code is now much easier to read.

- String handling and error printing has been significantly
revamped. We now use sbufs to do string formatting instead
of using printfs (for the kernel) and snprintf/strncat (for
userland) as before.

There is a new catchall error printing routine,
cam_error_print() and its string-based counterpart,
cam_error_string() that allow the kernel and userland
applications to pass in a CCB and have errors printed out
properly, whether or not they're SCSI errors. Among other
things, this helped eliminate a fair amount of duplicate code
in camcontrol.

We now print out more information than before, including
the CAM status and SCSI status and the error recovery action
taken to remedy the problem.

- sbufs are now available in userland, via libsbuf. This
change was necessary since most of the error printing code
is shared between libcam and the kernel.

- A new transfer settings interface is included in this checkin.
This code is #ifdef'ed out, and is primarily intended to aid
discussion with HBA driver authors on the final form the
interface should take. There is example code in the ahc(4)
driver that implements the HBA driver side of the new
interface. The new transfer settings code won't be enabled
until we're ready to switch all HBA drivers over to the new
interface.

src/Makefile.inc1,
lib/Makefile: Add libsbuf. It must be built before libcam,
since libcam uses sbuf routines.

libcam/Makefile: libcam now depends on libsbuf.

libsbuf/Makefile: Add a makefile for libsbuf. This pulls in the
sbuf sources from sys/kern.

bsd.libnames.mk: Add LIBSBUF.

camcontrol/Makefile: Add -lsbuf. Since camcontrol is statically
linked, we can't depend on the dynamic linker
to pull in libsbuf.

camcontrol.c: Use cam_error_print() instead of checking for
CAM_SCSI_STATUS_ERROR on every failed CCB.

sbuf.9: Change the prototypes for sbuf_cat() and
sbuf_cpy() so that the source string is now a
const char *. This is more in line wth the
standard system string functions, and helps
eliminate warnings when dealing with a const
source buffer.

Fix a typo.

cam.c: Add description strings for the various CAM
error status values, as well as routines to
look up those strings.

Add new cam_error_string() and
cam_error_print() routines for userland and
the kernel.

cam.h: Add a new CAM flag, CAM_RETRY_SELTO.

Add enumerated types for the various options
available with cam_error_print() and
cam_error_string().

cam_ccb.h: Add new transfer negotiation structures/types.

Change inq_len in the ccb_getdev structure to
be "reserved". This field has never been
filled in, and will be removed when we next
bump the CAM version.

cam_debug.h: Fix typo.

cam_periph.c: Modularize cam_periph_error(). The SCSI error
handling part of cam_periph_error() is now
in camperiphscsistatuserror() and
camperiphscsisenseerror().

In cam_periph_lock(), increase the reference
count on the periph while we wait for our lock
attempt to succeed so that the periph won't go
away while we're sleeping.

cam_xpt.c: Add new transfer negotiation code. (ifdefed
out)

Add a new function, xpt_path_string(). This
is a string/sbuf analog to xpt_print_path().

scsi_all.c: Revamp string handing and error printing code.
We now use sbufs for much of the string
formatting code. More of that code is shared
between userland the kernel.

scsi_all.h: Get rid of SS_TURSTART, it wasn't terribly
useful in the first place.

Add a new error action, SS_REQSENSE. (Send a
request sense and then retry the command.)
This is useful when the controller hasn't
performed autosense for some reason.

Change the default actions around a bit.

scsi_cd.c,
scsi_da.c,
scsi_pt.c,
scsi_ses.c: SF_RETRY_SELTO -> CAM_RETRY_SELTO. Selection
timeouts shouldn't be covered by a sense flag.

scsi_pass.[ch]: SF_RETRY_SELTO -> CAM_RETRY_SELTO.

Get rid of the last vestiges of a read/write
interface.

libkern/bsearch.c,
sys/libkern.h,
conf/files: Add bsearch.c, which is needed for some of the
new table lookup routines.

aic7xxx_freebsd.c: Define AHC_NEW_TRAN_SETTINGS if
CAM_NEW_TRAN_CODE is defined.

sbuf.h,
subr_sbuf.c: Add the appropriate #ifdefs so sbufs can
compile and run in userland.

Change sbuf_printf() to use vsnprintf()
instead of kvprintf(), which is only available
in the kernel.

Change the source string for sbuf_cpy() and
sbuf_cat() to be a const char *.

Add __BEGIN_DECLS and __END_DECLS around
function prototypes since they're now exported
to userland.

kdump/mkioctls: Include stdio.h before cam.h since cam.h now
includes a function with a FILE * argument.

Submitted by: gibbs (mostly)
Reviewed by: jdp, marcel (libsbuf makefile changes)
Reviewed by: des (sbuf changes)
Reviewed by: ken

# aeebb4e7 25-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

Add missing NOSECURE check for `includes' target.

Reviewed by: markm

# d9d1a7bb 22-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

Enhancement to 1.99 -> 1.100.
Avoid EPERM from ln(1) in a different (proper) way.

# afcf05e4 02-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

setlocale(3) has been fixed to match POSIX standard:
LC_ALL takes precedence over other LC_* envariables.

# 7de7569f 22-Feb-2001 John Baldwin <jhb@FreeBSD.org>

MACHINE_ARCH is the target arch to crossbuild to, not TARGET_ARCH.

Requested by: marcel

# 682d4db4 22-Feb-2001 John Baldwin <jhb@FreeBSD.org>

Document TARGET_ARCH.

# 58445af0 16-Feb-2001 Bruce Evans <bde@FreeBSD.org>

Removed some garbage (genassym(8) and its infrastructure).

# c1f3d847 14-Feb-2001 Mark Murray <markm@FreeBSD.org>

Fix make world.

# 2f74661c 23-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Provide backwards compatable recognition of ${KERNEL}. You should be
able to use KERNEL= again with buildkernel, but it will point you at
KERNCONF= and press on regardless.

# 6d84d742 22-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Sigh, I thought we still had the rm -rf objdir stuff in make world, which
would have taken care of the possibility of buildkernel crossing over
from one binutils set to another. Back out the part about turning off
'make clean' if the 'make depend' is still active, but add a NO_KERNELCLEAN
target instead that works like NOCLEAN but just for the kernel.

# 51dfb947 22-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Use 'make clean' instead of 'config -r', and only if the 'depend' step has
been skipped. We went to a lot of trouble to make the 'blow away' stage
unneeded, and it has not been needed for quite some time.

# 5963db0f 22-Jan-2001 Warner Losh <imp@FreeBSD.org>

As threatened in hackers@ on Friday, obviate the need for a buildworld
to preceed a buildkernel.

The buildworld is still required when upgrading across major releases,
across binutil upgrades and when config changes version. If
buildkernel breaks, and you haven't done a buildworld, then do not
complain unless you do a buildworld and it still breaks.

# c1ae5e3d 22-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Using "KERNEL" for buildkernel was a very very bad mistake. $KERNEL is
already used by the kernel makefiles themselves, and this leads to a lot
of trouble when people put "KERNEL=MYKERNEL" in make.conf. Bite the bullet
and change it to KERNCONF instead, before it gets too far entrenched.

The kernel Makefiles use ${KERNEL} as the name of what to install the
kernel as, eg: /boot/${KERNEL}/kernel or /${KERNEL}. This leads to much
unhappiness with things like /LOCAL instead of /kernel. buildkernel is
severely limited as it is only useful directly after a buildworld.

Reviewed by: jhb

# c80a5c4c 21-Jan-2001 Jordan K. Hubbard <jkh@FreeBSD.org>

Also add some timing information for kernel builds so that it's
easy to do "make world kernel |grep -e '^>>>'" and get a complete
event log.

# 26379603 19-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Create a build-tools target for sysinstall and rtermcap. This is still
not right because rtermcap would be reading the *host* termcap, not
from the termcap in the src tree. Besides, /usr/sbin/sysinstall
(not the crunched one in /stand) should use the runtime termcap
not the precompiled set.

# 3e530495 24-Dec-2000 KATO Takenori <kato@FreeBSD.org>

Removed pc98-hack of aout tools.

# d6deedef 03-Dec-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix cross-building once again.

Forgotten by: ache

# 0a0743b5 20-Nov-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix release, broken by the perl cross-build fixes.

The distribute target is basicly the same as an install. For
perl, this means that miniperl is needed. Since miniperl is
only present in the object directory, we need to make sure
the path is set correctly. To do this, we have make release
use a new distribworld target that sets the path before doing
a make distribute.

# ad879ce9 19-Nov-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix cross-building.

o Move building libperl and miniperl from build-tools to
cross-tools. libperl uses MACHINE_ARCH to determine the
right configuration, which doesn't match the build
machine when cross-building if they are built as build-
tools.
o Since miniperl needs to be built as a cross-tool, it
needs to be installed under /usr/obj so that it can be
used (cross-tools have a special object directory to
avoid build conflicts. As a downside, you can't easily
run cross-tools from their object directory). Remove
the install and distribute override targets. To avoid
having miniperl installed by installworld, remove it
from SUBDIR.
o We can't pickup miniperl from the object directory but
since it's installed, depend on PATH. This is save,
because the makefiles are run with a known path.
o Build libperl again as part of the library target. A
_libperl variable existed, but it was never defined.
o Add chmod to the list of saved tools, because perl
conditionally uses it during install.

The bootstrap-tools and cross-tools targets are modified to
avoid building profiled and shared libraries. While here,
have these targets build static binaries instead of shared
binaries.

Approved by: markm

# cb6f6857 10-Nov-2000 David E. O'Brien <obrien@FreeBSD.org>

libgcc now needs to be built earlier in the build.

Submitted by: jdp

# ae7c8a2b 28-Oct-2000 David E. O'Brien <obrien@FreeBSD.org>

* Bring back the guts of crt{i,n}.S. This allows C++ exceptions to work
when using the egcs and gcc-devel ports, along with GCC built from stock
public FSF sources. With out this change, FreeBSD will be removed from
the list of systems GCC 3.0 must be evaluated on before release. With
the effort some of us put into getting FreeBSD on this list, we should
not turn this effort into a waste, else we might not be worth fighting
for in the future. (note that Alpha and IA-64 versions of crt{i,n}.S
are needed)

* Switch from our own crt{begin,in} to those created from GCC's crtstuff.c.
This will allow us to switch to DWARF2 exceptions in the future, along with
staying in sync with any future GCC requirements.

* Break out our ELF branding bits into a seperate file. Currently this
is now included by our crt1.c files (since this functionality was part of
our native crtbegin.c). Later crtbrand.o will be merged in the creation
of crti.o.

# a62264fb 24-Oct-2000 Joseph Koshy <jkoshy@FreeBSD.org>

Fail the 'buildkernel' target if not even one of the specified kernel configuration
files was found.

Reviewed by: obrien

# 13387c45 12-Oct-2000 David E. O'Brien <obrien@FreeBSD.org>

Number the stages in the documentation to match what is printed out when
running.

# 18ebc2ea 17-Sep-2000 Justin T. Gibbs <gibbs@FreeBSD.org>

This is really gross.

If a user decides to forego a make depend during "make buildkernel",
they should get what they deserve if no previous make depend has
been run for that kernel. Instead, the build process includes
special instructions to unconditionally rebuild aicasm. When aicasm
moved to its own directory, this hack broke.

Correct the hack until a get buy off on killing it.

# 66bea2a0 17-Sep-2000 Warner Losh <imp@FreeBSD.org>

Add reinstallkernel target. Does same thing as installkernel, but
executes the reinstall target rather than the install target that
installkernel does.

# a3f02cc0 09-Sep-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Include libfetch in the includes target.

# 1b73d196 08-Sep-2000 Peter Wemm <peter@FreeBSD.org>

USA_RESIDENT is no longer required for buildworld, do not force it.

# ae78d52f 02-Sep-2000 David E. O'Brien <obrien@FreeBSD.org>

Allow one to specify what the installed kernel's name is by setting
"INSTKERNNAME".

Reviewed by: marcel

# 6fd0f272 12-Aug-2000 Josef Karthauser <joe@FreeBSD.org>

Define SUPHOST. If this is set a '-h ${SUPHOST}' is added to the
SUPFLAGS when a 'make update' is run. This means that the supfile
doesn't need to be edited because the -h will override the
CHANGE_THIS.FreeBSD.org host.

# ef102276 07-Aug-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Make the update target consistent; both ports and doc are updated
if their SUPFILE variables are defined _and_ NO_PORTSUPDATE and
NO_DOCUPDATE respectively are not defined.

Previously, only ports was updated and there was no way to prevent
this without undefining its SUPFILE variable.

PR: 17514
Reported by: Udo Erdelhoff <ue@nathan.ruhr.de>

# f7ff24ef 02-Aug-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix buildkernel and installkernel when KERNEL is defined in
/etc/make.conf.

PR: 20325
Submitted by: Johan Karlsson <k@numeri.campus.luth.se>

# a5061fba 23-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Argh... mtree has been removed from the bootstrap-tools. In that
case we need to save it in installworld. That latter I forgot...

Pointy hat: me

# dce97721 23-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Name all kernels 'kernel'. This fixes the incompatible behaviour
of the buildkernel and installkernel targets where the kernel
was called after the config name.

While here, fix the brokenness of the installkernel target. It
used to use ${IMAKEENV}, but since that has a very restricted
PATH, it couldn't find make(1). Use ${CROSSENV} instead.

# fa90cca2 23-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Remove mtree for bootstrap-tools. The -L switch change has been
backed out.

# a0982e93 22-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Don't save cp(1) in installworld. Its use has been replaced by
a use of install.

# eb263e04 19-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add awk and wc to the list of copied binaries for the installworld
target. These are needed by liloldr.

Found by: make release

# 39b909da 19-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add cp(1) to the list of binaries we need to save. The cp(1) command
is used by the installation of ld-elf.so when an existing version
exists.

# 2e826432 19-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Don't save install-info. We already have that built. We'll use
the one we built anyway.

# 767ab900 18-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Save any binaries we use by installworld, so that we won't use the
binaries we just installed. This allows a future upgrade target to
install a new system without intermediate reboots and also
prevents conflicts for parallel make runs where we might exec a
binary that's being installed at the same time.

# 7d66a72a 17-Jul-2000 Andrey A. Chernov <ache@FreeBSD.org>

Move mtree to bootstrap-tools and add PATH=${TMPPATH} to IMAKEENV to pick it

# 199b3e83 17-Jul-2000 Andrey A. Chernov <ache@FreeBSD.org>

Add mtree to cross-tools to make it updated for new -L option
It must solve make world breakage

# 58804eac 02-Jul-2000 Mark Murray <markm@FreeBSD.org>

Perl's version number needs to change.

# f307c8a7 25-Jun-2000 Mark Murray <markm@FreeBSD.org>

Rearrange Perl's build priority; it needs to get made earlier.

# 59bb1d9c 15-Jun-2000 Brian Somers <brian@FreeBSD.org>

Add -DNO_KERNELDEPEND and -DNO_KERNELCONFIG

Not reviewed by: sheldonh

# 625de7fe 09-Jun-2000 Brian Somers <brian@FreeBSD.org>

Set KERNEL=${INSTALLKERNEL} doing a make install in /sys/conf

# a82162d4 05-May-2000 Yoshihiro Takahashi <nyan@FreeBSD.org>

GENERIC98 is removed.

# fc5361f9 27-Apr-2000 Garrett Wollman <wollman@FreeBSD.org>

Make gperf be a bootstrap-tool, since we now depend on features of
the specific version in -current.

Approved in principle by: marcel

# 095a235e 27-Apr-2000 Garrett Wollman <wollman@FreeBSD.org>

Revert my changes to make gperf a build-tool; that was the wrong thing.
All builds had been broken; now just upgrade builds are until I or
someone else can figure out the Right Thing.

# 85a00bb0 27-Apr-2000 Garrett Wollman <wollman@FreeBSD.org>

Add gperf(1) to build tools. It should have been one before, but
gcc does not depend on version-specific gperf behavior (yet).

# 68924308 27-Apr-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Create ${KRNLOBJDIR} before running config(8), since config(8) does
not create required parent directories of the kernel compile
directory specified with its -d option.

# 9ad4708e 16-Apr-2000 Kris Kennaway <kris@FreeBSD.org>

Unbreak make world (libpam depends on libopie)

# f67ecfeb 30-Mar-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Fix the buildkernel and installkernel targets for the case where
KERNEL specifies multiple kernels.

PR: 17536
Submitted by: Johan Karlsson <k@numeri.campus.luth.se>

# 8d76bd01 29-Mar-2000 Ruslan Ermilov <ru@FreeBSD.org>

Get rid of "sticky" files when updating sources with cvs(1).

Approved by: peter

# bb49f794 08-Mar-2000 Kris Kennaway <kris@FreeBSD.org>

Buildworld fixes for NO_OPENSSH and NO_OPENSSL

Approved by: jkh

# 5bf514a3 28-Feb-2000 Mark Murray <markm@FreeBSD.org>

A lot of tools need to be built before compilation proper can happen.

# 84a9e747 24-Feb-2000 Mark Murray <markm@FreeBSD.org>

We have a new world order in libraries.

Goodbye libdes; Welcome libcrypto.

# 3da5eca4 20-Feb-2000 Jordan K. Hubbard <jkh@FreeBSD.org>

Docfix: Note krb5 flags.

PR: 16818
Submitted by: martti.kuparinen@nomadiclab.com

# 858b4471 03-Feb-2000 Ruslan Ermilov <ru@FreeBSD.org>

Now that bsd.lib.mk has PRECIOUSLIB feature back (rev 1.91),
we need -DNOFSCHG at stage 4 (building libraries) to support
non-root buildworlds.

Reviewed by: <buildworld@current.freebsd.org>

# 6f96b351 30-Jan-2000 David E. O'Brien <obrien@FreeBSD.org>

The readline includes handling was moved down a level in
src/gnu/libreadline -- reflect that change here.

Ok'ed by: JKH

# f0d6a665 29-Jan-2000 Warner Losh <imp@FreeBSD.org>

Back out 1.134. It works from 3.3R, but breaks cross compilation for too
little gain. I'll work out the issues after 4.0R is out.

# e208d108 28-Jan-2000 Warner Losh <imp@FreeBSD.org>

Remove Fortran from build tools. It isn't needed to build the system
and costs us an extra 2% to build it for no reason. It may break
building cross compilation environments for fortran, but that isn't
officially supported at this time anyway (also, the % of our user base
that would use that is < .001% imho). This does't break fortran (it
is built again later anyway).

Reviewed by: obrien
Tested by: make buildworld and make buildworld -DNOCLEAN

# d092560c 24-Jan-2000 Mark Murray <markm@FreeBSD.org>

Build Kerberos5 if the correct macro is set. This is not for the
faint_hearted; serious hackers only!

# f8c52b7c 18-Jan-2000 Kris Kennaway <kris@FreeBSD.org>

Require USA_RESIDENT to be 'NO' or 'YES' if building secure/

Reviewed by: marcel

# 85dd55e4 18-Jan-2000 Ruslan Ermilov <ru@FreeBSD.org>

Finally resolve the texinfo issue by moving it
from the cross-tools to the bootstrap-tools.

Requested by: bde, marcel

# 7e3e88c6 18-Jan-2000 Ruslan Ermilov <ru@FreeBSD.org>

For some reason compiler should be the last in the list of cross-tools.
Unbroke the world by moving gnu/usr.bin/texinfo before gnu/usr.bin/cc.

Submitted by: Jim Bloom <bloom@acm.org>

# 4928e3ce 17-Jan-2000 Ruslan Ermilov <ru@FreeBSD.org>

Add gnu/usr.bin/texinfo to the list of cross-tools.
We need an up-to-date `makeinfo' and `install-info'
at `world' and `install' stages.

Pointed out by: bde

# d8180fbd 12-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add gross hack to work around bogus dependency information created
by gnu/usr.bin/cc/cc_tools/Makefile. This bug is painfully visible
when making buildworld with -DNOCLEAN. This work around is beyond
dirty...

# 2a7a0de6 12-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix broken installkernel target. Don't use the WMAKE context to
install; use the IMAKE context.

Reported by: sheldonh

# 15e1a306 11-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Revert gratuitous change in rev. 1.123 which broke building world
as non-root.

Breakage caused by: green

# ae41b16c 11-Jan-2000 David E. O'Brien <obrien@FreeBSD.org>

Remove Bison from "bootstrap-tools" as we don't use it to build anything
in /usr/src/ anymore.

# 55904856 10-Jan-2000 Brian Feldman <green@FreeBSD.org>

This is the second half of unbreaking the world build. Add a -DNOHTML
corollary for -DNOINFO and -DNOMAN. I'll fix this properly (add
specific HTML doc magic) in the .mk files later; right now, just
unbreak the world.

# d4ab519b 11-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add the -r flag to CONFIGARGS instead of assigning to it so that
it's more easy to build a kernel with debugging information.

Suggested by: sheldonh

# f3bb8dbd 09-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add a buildkernel and an installkernel target. With these targets
users can more easily upgrade.

buildworld now makes usr.sbin/config in bootstrap-tools so that
when you first make buildworld, buildkernel will use config(8)
from the temp. world tree (and of course also the compiler).

Which kernel to built is determined by the KERNEL variable. You
can have as many kernels listed as you like. When a config file
exists for the given MACHINE it will be built. When KERNEL has
not been defined it will be set to "GENERIC GENERIC98".

The first valid kernel named in the list will be used by the
installkernel target.

When NOCLEAN is defined the kernel object directory is *not*
removed by config first. This is in line with normal buildworld
behaviour.

The buildkernel target makes aicasm in sys/dev/aic7xxx first and
unconditionally. This hack allows us to cross-build kernels and
can go away when the problem is solved in a structural way.

# 1d19afde 04-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add btxld to the list of cross-tools on machines that don't have it
natively (ie non-i386 architectures).

# 37379a44 30-Dec-1999 Mark Murray <markm@FreeBSD.org>

Grrrr... This was supoosed to go with the commit to kerberosIV/.../libroken's
Makefile.

Fix make world by building appropriate build-tools.

Submitted by: marcel

# a886640d 29-Dec-1999 David E. O'Brien <obrien@FreeBSD.org>

Restore changes I spammed.

# 253745e1 29-Dec-1999 David E. O'Brien <obrien@FreeBSD.org>

Allow the specification of a prefix for gcc to find all the various bits.
If one wishes to anchor the compiler toolchain tree somewhere other than /,
all one needs to do is set "TOOLS_PREFIX" to a different rooting.

Submitted by: marcel (in a different format and reworked by me)

# 4712894e 29-Dec-1999 Kris Kennaway <kris@FreeBSD.org>

Only make beforeinstall in libcrypto/libssl if they actually exist. I haven't
imported these on Freefall yet for the reasons previously explained.

Noticed by: asami

# 1a75f3dd 29-Dec-1999 Satoshi Asami <asami@FreeBSD.org>

Oops, the previous commit was bogus. I shouldn't commit something without
reading all my mail.

I still don't understand why this was was committed on freefall before
the libcrypto and libssl subdirectories were imported on freefall though.

# 019d7e0f 29-Dec-1999 Satoshi Asami <asami@FreeBSD.org>

Typo (libcrypto -> libcrypt).

# 47dbe12f 28-Dec-1999 Kris Kennaway <kris@FreeBSD.org>

Build openssl properly during make world.

# 7377751f 23-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't build caesar as a tool. fortune(6) doesn't depend on it
anymore. Update comments and variable names as well to wipe out any
traces that may confuse people in the future.

# 3eafbc1a 23-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Revert previous commit, and

o Add genassym to the list of cross-tools
o Remove sh hashing work-around, we don't need it anymore
o Clean more directories in WORLDTMP when NOCLEAN is specified

The sh hashing work-around is not needed anymore, because we don't
trigger the bug anymore.

When NOCLEAN is not defined, we wipe out the complete WORLDTMP,
including the object directories of the tools we have built. When
NOCLEAN is defined, we remove anything that we install anyway, which
is usr/bin, usr/games, usr/include, usr/lib and usr/sbin.

# 02fdddce 22-Dec-1999 Andrey A. Chernov <ache@FreeBSD.org>

Add ${WORLDTMP}/sbin to ${STRICTTMPPATH} - sysctl not found otherwise

# 76762624 20-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o make SHARED=symlinks a caller defined instead of a callee defined
property. This fixes the includes target when DESTDIR is empty.
o Do not make build-tools for f771 when NO_FORTRAN is defined.
o Add new build stage. See below.
o Change banners so that staging information is displayed.

The addition of the build-tools target broke the upgrade path because
we couldn't make use of previously built tools that were made for
compatibility reasons. Doing so would also result in the cross-compiler
being used and that is exactly what had to be avoided.

This is solved by designating the bootstrap-tools stage for building
anything that is needed for compatibility only and to create a new
stage (started after the build-tools stage) that handles cross-tools
building. We now have the following stages:
1. bootstrap-tools (for compatibility issues only)
2. build-tools
3. cross-tools (what it says)
4. world
5. install

Stages 1-4 (inclusive) are handled by buildworld.
Stage 5 is handled by installworld.

Any more stages and I'll join Nik in his quest for the
holy grail^W^Wworld :-)

# 5233a96c 17-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't build usr.sbin/pcvt/keycap on anything other than i386 when
building the libraries target. pcvt is i386 specific.

# bfc59eb8 16-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.

The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.

This is the last major update towards cross-building.

# f647fd15 15-Dec-1999 Bill Fumerola <billf@FreeBSD.org>

It is possible for someone to want to 'make update' wht SUPFILE not defined
while SUPFILE1 or PORTSSUPFILE are defined.

# 4ac29d1e 12-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Add colldef to the list of tools. It's needed on older systems.

# 0dd0e829 12-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Add gensetdefs to the list of tools.
o Don't set CFLAGS in the bootstrap env. It is very likely to be
overridden my any CFLAGS setting in /etc/make.conf. Setting it
here is almost useless. So far, it doesn't seem necessary.

# 845eb537 11-Dec-1999 Yoshihiro Takahashi <nyan@FreeBSD.org>

Build a.out tools if MACHINE_ARCH == i386 and MACHINE == pc98.
The boot2 for pc98 is still a.out program.

I made the original patch, and many problems were fixed by Marcel Moolenaar.

# 3f2aa30a 11-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't add MACHINE_ARCH to MAKEOBJDIRPREFIX when not cross-building.
This should fix make release.

Reported by: jhay, phk

# f80df2fa 10-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Don't make games/fortune/strfile if games does not exist or NOGAMES
has been defined.
o Make libraries before making depend.

# 08265f35 10-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Remove installworld related settings that I had as a safety-net and
for development. :-/

# 0ea234de 10-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

More cross-building related changes:
o Build tools before doing anything in or with the object tree.
o Tools don't use the object tree any more, but have there object
tree located in the temp. world.
o Use the proper make env. for cleaning and building the object tree.
o Don't create kernel include subdirectories in the temp. world. These
are removed later on and replaced by symlinks.
o Change the layout of the object tree:

The temp. world now is /usr/obj/${MACHINE_ARCH}${.CURDIR}/${BUILD_ARCH}.
/usr/obj can be set/changed by using MAKEOBJDIRPREFIX, and {.CURDIR}
obviously depends on where the source tree is located. MACHINE_ARCH
is the arch. for which the world is to be build and BUILD_ARCH is the
arch. on which we are building.

The object tree now is /usr/obj/${MACHINE_ARCH}${.CURDIR}.

This allows concurrent cross-builds and allows the object tree to be
shared on different archs., each doing the same cross-build. This of
course assumes that the output on Alpha (for example) is the same as
the output of an Alpha cross-build on i386 (for example).

The use of NOCLEAN is is still dangerous, but should be usable in many
more situations than before. It should now be possible to safely
restart an interrupted build with NOCLEAN without side-effects. Because
the tools don't share the object tree with the normal (cross-build), no
tools have to be rebuild.

# 7466caf4 09-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't make gdb, objc and f77 when building tools.

# aae5d688 09-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Make sure the links to the source tree end up in the source tree.

# db10927b 09-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Add usr/lib/compat/aout to the temp world. This is needed by release.
o If you can't beat them, join them: use symlinks to populate the obj
tree. This avoids using mtree.

# 894157f5 08-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Restore the upgrade path from -stable to -current and prepare for
non-root cross-building.

o Makefile.inc0 is not used anymore.
o The legacy aout build has been removed.
o Selectively build tools *before* building includes/libraries.
o Avoid using mtree to populate the obj tree.

# e13b3c78 25-Nov-1999 Julian Elischer <julian@FreeBSD.org>

Place netgraph entry into alphabetical position
along with the misplaced entries that it was next to.

# 30fdccdc 23-Nov-1999 David E. O'Brien <obrien@FreeBSD.org>

Revert to rev 1.91. Revs 1.9{2,3} were causing problems for people with
pre-Aug 4.0-CURRENT worlds and those with pre-GCC 2.95.2 worlds.

The problem with pre-Aug worlds is the installed Byacc and Bison doesn't
have necessary changes to compile either GCC 2.95 or EGCS 1.1.x.

The problem with pre-GCC 2.95 worlds is libgcc is built with the wrong
compiler. See rev 1.17 of src/gnu/lib/libgcc/Makefile (which used to live
in src/gnu/usr.bin/cc/libgcc) + commit messge for details of the requirements.

# 6de9679e 23-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Fix some bugs and make some policy changes.

o Send libmytinfo back to the afterlife. It was revived by mistake,
o Make gnu/lib/libgcc before making lib/libpam. This dependency has
been overlooked in constructing the list,
o make depend before make all. It's by using make depend that the
dependency was found in the first place and we need it to prevent
cleaning everything up before we start,
o Don't specify -DNOINFO -DNOMAN for the libraries target. Let the
target handle it. We can do away with a single run over the libs
if we make everything while we're there and only install the
libraries in the object tree.

# be4512ec 21-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Build tools against the host's includes and libraries. Also, don't
build make(1) twice and merge the bootstrap-libraries and libraries
targets.

This change solves the bug where build-tools, compiled against the
includes and libraries built from the sources failed to run on the
host, as was the case with the sigset_t change. With this update, a
buildworld will fail if the tools won't compile on the host. This
is solved in further commits where backward compatibility of the
tools is enlarged.

The libraries target has been fixed. The libraries are now build in
the proper order, satisfying the dependencies. The comment is updated
to reflect this.

The linux module and netboot have been removed from the list of tools.
More to follow.

Reviewed by: bde, imp

# f5c0c6ab 15-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Remove CROSS_MAKE_FLAGS.

# 0917704b 14-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

${MACHINE} -> ${MACHINE_ARCH}

All Makefiles now use MACHINE_ARCH for the target architecture.
Unification is required for cross-building.

Tags added to:
sys/boot/Makefile
sys/boot/arc/loader/Makefile
sys/kern/Makefile
usr.bin/cpp/Makefile
usr.bin/gcore/Makefile
usr.bin/truss/Makefile

usr.bin/gcore/Makefile:
fixed typo: MACHINDE -> MACHINE_ARCH

# 5dd05de9 25-Oct-1999 Julian Elischer <julian@FreeBSD.org>

install netgraph.h a bit earlier.

Submitted by: Boris Popov <bp@butya.kz>

# f24bb3a4 14-Oct-1999 Boris Popov <bp@FreeBSD.org>

Make libncp actually compiled.

Reviewed by: mdodd

# 6d77c2de 04-Oct-1999 Peter Wemm <peter@FreeBSD.org>

Add libkvm to the includes target.

# 1f687ff1 20-Sep-1999 Mark Murray <markm@FreeBSD.org>

Minor (but important) comment change.

# 7dd5e27c 04-Sep-1999 Bruce Evans <bde@FreeBSD.org>

FIxed disorder in the comments about library build order.

# da52b932 31-Aug-1999 Mark Murray <markm@FreeBSD.org>

Further preparation for tn3270's demise.

# 4c2a26e3 30-Aug-1999 Peter Wemm <peter@FreeBSD.org>

Update for ncurses5 aftermath..

# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$

# 4f1b474e 08-Aug-1999 John Polstra <jdp@FreeBSD.org>

Remove f2c-related stuff from the "includes" target and from a
comment. Fixes broken make world.

# d72e8db8 05-Aug-1999 John Polstra <jdp@FreeBSD.org>

Add usr.sbin/elf2exe to the build-tools target on the Alpha. This
fixes the make buildworld breakage in sys/boot/arc/loader.

# 17139066 06-Jul-1999 Warner Losh <imp@FreeBSD.org>

Per requests from the community, commit rudimentary cross compilation
support. I've been building world with these changes for months w/o
ill effect. I've also managed to build the cross tool chain for MIPS
with these patches.

Please note that the extent to which these patches work is largely
dictated by how well our tool chains support the cross compilation.
Building alpha binaries on i386 doesn't work. Supposedly building
i386 binaries on alpha does work, but I've not verified it with these
patches, however.

# 55496537 04-Jun-1999 Bill Fumerola <billf@FreeBSD.org>

${.CURDIR} doesn't have to be /usr/src, especially in a cvs checkout. Make
sure what is reported to the user is accurate.

Stolen From: mharo

# 03a6bd91 31-May-1999 Bill Fumerola <billf@FreeBSD.org>

'make update' in the ports directory.

# 7c2a64c4 03-May-1999 David E. O'Brien <obrien@FreeBSD.org>

Document NO_FORTRAN.

# 5a528acb 02-May-1999 Mark Murray <markm@FreeBSD.org>

Perl is moving up a maintenance version.

While I'm here - reorder crypto directories to better support
dependancies. Perl and others like it better that way.

# 7725a6c9 19-Apr-1999 Joseph Koshy <jkoshy@FreeBSD.org>

Change 'exists()' constructs to refer to directories in ${.CURDIR}.
Tested with a make world.

PR: misc/4395
Submitted by: J Wunsch
Reviewed by: bde

# db0343ca 11-Apr-1999 Dag-Erling Smørgrav <des@FreeBSD.org>

Don't build man page indices if NOMAN is defined.

PR: bin/11035
Submitted by: Chris Costello <chris@holly.dyndns.org>

# 5999400e 05-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

Clean up "lib-tools:", folding libgcc into the rest.

# a295bf4e 04-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

Remove a lingering reference to libg++.

# 68b7e6e7 03-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

Missed a gnu/usr.bin/cc/libgcc.

# 871b1fd2 03-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

EGCS will have some new includes that need to be installed.

# 15b7d605 02-Apr-1999 Peter Wemm <peter@FreeBSD.org>

Add libwrap to includes target, otherwise <tcpd.h> doesn't get installed
in time to build inetd. (If you already have /usr/include/tcpd.h, the
build doesn't fail. This mainly affects upgrades and 'make world' from
systems more than a few weeks old)

# 094f0393 30-Mar-1999 David E. O'Brien <obrien@FreeBSD.org>

An earlier version of Rev 1.66 was reviewed by bde and the issues were
hashed out with his gracious help.

# 5bcba11b 30-Mar-1999 David E. O'Brien <obrien@FreeBSD.org>

* Deal with libgcc's move from gnu/usr.bin/cc to gnu/lib.
Move was necessary as libgcc should be built with the freshly built
compiler and thus we must wait until the freshly built bits have been
installed somewhere so we can use them. libgcc presence in gnu/usr.bin/cc/
gets in the way of building the new compiler. We could have either
cd'ed to specific directories w/in gnu/usr.bin/cc/ and built and installed
individual bits, or move libgcc out of the way and let our normal subdir
building process work.

* Don't build libgcc in "bootstrap-libraries:" target it should not be
assumed the currently installed compiler can correctly build libgcc.
(as is the case for g++ 2.7.2 and EGCS' libgcc)

# af59b932 28-Feb-1999 Warner Losh <imp@FreeBSD.org>

The legacy boot stuff is available only on i386, not all architectures
which aren't the alpha. Test for MACHINE_ARCH == i386 rather than
MACHINE_ARCH != alpha.

# 2d932f16 26-Feb-1999 Jordan K. Hubbard <jkh@FreeBSD.org>

Add a new flag, "WORLD", for telling certain tools that they're
being build as part of a bootstrap.

# ad5ebf3f 14-Feb-1999 Dag-Erling Smørgrav <des@FreeBSD.org>

Ignore errors from chflags. This makes it possible to make installworld
with DESTDIR set to an NFS-mounted file system.

# 9c2bbd3b 27-Jan-1999 Jordan K. Hubbard <jkh@FreeBSD.org>

further refine the upgrade process.

# 08275689 23-Jan-1999 Mark Murray <markm@FreeBSD.org>

More broken crypt(3) backout.

# 2ccdfd96 22-Jan-1999 Brandon Gillespie <brandon@FreeBSD.org>

One more fix to remove secure/lib/libcrypt from the build (both
cases are now handled in lib/libcrypt, depending upon if
secure/lib/libcrypt/crypt-des.c exists)

Reviewed by: Mark Murray

# 3b5d5dca 19-Jan-1999 Mark Murray <markm@FreeBSD.org>

Help for Perl5 to make in cross-build environments.
Submitted by: Eivind Eklund

# b8c993ec 07-Jan-1999 Eivind Eklund <eivind@FreeBSD.org>

Don't do the ldconfig rescan if DESTDIR is set.

# c9ef6e40 06-Jan-1999 Peter Wemm <peter@FreeBSD.org>

``Disable'' a.out 'make world', as per flag day notification on current and
committers. A 'make aout-to-elf' is strongly encouraged. This isn't quite
the end of the line for people who have a real problem with updating yet,
but we've got to get this over and done with. Yes, it's bound to be a
couple of bumpy couple of days.

# fad499d2 06-Jan-1999 Bruce Evans <bde@FreeBSD.org>

Removed the weak spam of ${DESTDIR}/usr/include in the bootstrap
target (see the previous log message). This works for bootstrapping
from 2.2.7. It won't work for bootstrapping from 2.1.x, but that
fails due to include problems earlier.

# 1ff0f342 03-Jan-1999 Bruce Evans <bde@FreeBSD.org>

Backed out rev.1.49. It broke bootstrapping from 2.1.5 2.2.7 and
probably other versions by spamming ${DESTDIR}/usr/include in much
the same way as `make includes'.

Details for 2.2.7: the bootstrap target has always done a weak spam
of ${DESTDIR}/usr/include; we depend on it not installing any
significant anachronisms (it probably shouldn't touch the headers
at all; however, we may be depending on it for things like the
renaming of ts_nsec to ts_sec in <sys/time.h>). Rev.1.49 strengthens
the spam to everything in src/include. For 2.2.7, this is not
immediately fatal. However, the `make all' step in src/includes
is not followed by a `make clean' step, so new rpc headers are not
generated after we've bootstrapped rpcgen. This causes a fatal
error much later when the old (generated) rpc headers are used with
the current headers (sys/types.h and/or the non-generated rpc
headers).

Details for 2.1.x: the bug is immediately fatal. It gives definition
of errno that is not supported by 2.1.x's libc. The weak spam in the
restored version avoids this problem by not installing errno.h.
(Bootstrapping from 2.1.5 actually breaks much earlier.)

I think the header problems supposedly fixed by rev.1.49 were caused
by using NOCLEAN and having the build fall over when the weakly
spammed headers are active. Minor differences in the layout will
then cause the .depend files to point to nonexistent headers. It
is a feature for symlinks like errno.h -> sys/errno.h to not exist
early.

The other change in rev.1.49 breaks building obj directories if NOCLEAN
is set. It is only safe for _re_building with NOCLEAN set.

# cc854440 01-Jan-1999 Peter Wemm <peter@FreeBSD.org>

Reconnect pcvt hooks..

Reviewed by: core

# 40b84391 29-Dec-1998 Bruce Evans <bde@FreeBSD.org>

Backed out previous commit. It depends on a.out utilities and libraries
somehow being available even on pure elf systems.

# 621be745 30-Dec-1998 Bruce Evans <bde@FreeBSD.org>

Fixed bootstrapping of /usr/mdec/boot[12].

# 41da0323 28-Dec-1998 Peter Wemm <peter@FreeBSD.org>

Dip my toes into the fire and zap the leftover lkm hooks.. It seems they
try and recurse if the lkm dir exists for some reason but there isn't any
Makefile there. (eg: stray files prevented cvs update -P from removing the
empty dirs)

# 306f93f5 27-Dec-1998 Poul-Henning Kamp <phk@FreeBSD.org>

follow up to:
Pre 3.0 branch cleanup casualty #4: pcvt

# df00a036 21-Dec-1998 Matthew Dillon <dillon@FreeBSD.org>

Elf (and a.out?) rebuild of bootstrap tools appeared to be broken due to
some tools requiring header files, such as errno.h, that are softlinks.
The mini installation of include files in Makefile.inc1 wasn't doing
the job, so it has been ripped out and replaced with a true make of the
/usr/src/include/ directory (make all and make beforeinstall). I think
the original idea was to save time by not installing unnecessary header
files, but it doesn't really save all that much time.

Also, I have moved a NOCLEAN conditional to cover rebuilding the object
tree 'Rebuilding the ${OBJFORMAT} obj tree' section. This may or may not
be correct but it appears to function properly. If it is not correct we
need to find another way to avoid scanning every single file in the
entire source hierarchy for make restarts.

# 70152088 12-Dec-1998 Matthew Dillon <dillon@FreeBSD.org>

Grr. removed. backed-out. sorry!

# fed7770a 12-Dec-1998 Matthew Dillon <dillon@FreeBSD.org>

This needs to be commited now to fix usbd for make world

# 23284b17 28-Nov-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Revert previous commit; write idea, wrong way.

# f8303e79 28-Nov-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Remove netboot from build order; it's not ready for the limelight
and probably doesn't belong there anyway.

# 127a2cfa 19-Nov-1998 John Polstra <jdp@FreeBSD.org>

Make sure libskey is built before libpam. It is required for one of
the PAM modules.

Fix the comments describing the PAM dependencies to be consistent
with other related comments.

# 3da08d4a 17-Nov-1998 John Polstra <jdp@FreeBSD.org>

Add libpam to the "includes" and "libraries" targets.

Build the ordered list of libraries in a variable "_libs" before
building any of them. This eliminates a little bit of duplicated
code. More importantly, it makes it easier to include or exclude
libraries with .if constructs, because the list can be built in
multiple steps using "+=".

# c271ea0e 17-Nov-1998 John Polstra <jdp@FreeBSD.org>

Note the requirement that libcrypt be built before libkrb.

# d5f87f1a 15-Nov-1998 John Birrell <jb@FreeBSD.org>

Remove share/info from build tools because it breaks the build when
INFODIR is set.

# 5a51bc8e 12-Nov-1998 John Polstra <jdp@FreeBSD.org>

Add libradius and libtacplus to the includes target. Note their
dependence on libmd.

# 0eda097a 05-Nov-1998 Mike Smith <msmith@FreeBSD.org>

Typo , -> .

Submitted by: Shaun Courtney <shaun@emma.eng.uct.ac.za>

# fafe9c62 04-Nov-1998 Peter Wemm <peter@FreeBSD.org>

sys/modules/linux has a build-tools target

# 2bb39627 03-Nov-1998 Peter Wemm <peter@FreeBSD.org>

Add usr.bin/gensetdefs to build-tools; it is used for src/sys/modules and
maybe for other things that use linker sets under ELF.

# 2a6c45c9 17-Oct-1998 Bruce Evans <bde@FreeBSD.org>

Don't add /usr/games to $PATH. Adding it here can only work for the
`make world' case, and only made a difference for the evil NOTOOLS case
of `make world' since games tools are installed in ${TOOLROOT}/usr/bin
if they are built, but the PR was for normal builds. This is fixed
in rev.1.14 of src/games/fortune/datfiles/Makefile.

PR: 7936

# 59bec036 16-Oct-1998 Bruce Evans <bde@FreeBSD.org>

Fixed missing directories in the libraries target:
- in the elf case, csu must be built and installed before any shared
libraries. It wasn't, but we usually used a stale version that
happened to work. E.g., in the !NOTOOLS case we used the version
built and installed by the bootstrap-libraries target. Only cross
building was completely broken.
- the shared libmd must be built and installed before any shared
libraries that link to it. It wasn't, but we sometimes used a stale
version that happened to work, as above. For elf, this caused
bogus linkage of the target shared libatm and libopie with the host
static libmd. It isn't clear what this actually breaks, except for
cross compiling. For aout, the shared libmd is not built at all, so
all shared libraries linked to libmd may be broken. The linker
reports them by spewing RRS warnings.

Note that building src/lib early and building subdirs of src/lib in
the correct order in src/lib/Makefile doesn't help, since the subdirs
are all built before any are installed.

Fixed bitrot in the comments about the ordering requirements.

# 24f6ecd4 13-Oct-1998 Robert Nordier <rnordier@FreeBSD.org>

Include btxld in build-tools only for i386.

# daf326ce 13-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Conditionalise boot block building on i386.

# 14b49748 11-Oct-1998 Robert Nordier <rnordier@FreeBSD.org>

Remove sys/boot from the install as well.

# 1b9112ea 11-Oct-1998 Robert Nordier <rnordier@FreeBSD.org>

In src/Makefile.inc1:
Remove /sys/boot from legacy-build.
Add btxld to build-tools.
In src/sys/Makefile:
Add /sys/boot for i386 ELF.

I'm still not sure why the new boot code was being built along with the
legacy stuff, which meant a completely wrong default environment for it.

This may well still be the wrong way to go about this, but it can't work
all that much worse than it has been.

# 04e2ebf5 11-Oct-1998 Peter Wemm <peter@FreeBSD.org>

Comment about libm and libmd being needed for some libraries.
Prompted by: bde

Also. Don't build & install legacy lkm's when NOLKM has been set.
Otherwise it gets built in the src tree rather than obj, because the
previous 'make obj' at the start of legacy-build does respect NOLKM.

# 2de520a5 10-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Move OBJFORMAT hack to the correct line; what can I say, it was very
late. :)

# e313ef33 10-Oct-1998 KATO Takenori <kato@FreeBSD.org>

PC-98 uses different boot code from IBM-PC. So, MACHINE is used
instead of MACHINE_ARCH.

Submitted by: Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>

# 07bf7f4a 10-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Quick commit to see if I can't fix Robert's i386/boot problem in one line.
If this doesn't work, we'll try something else.

# 322a4708 10-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Don't chain makes with &&; apparently this is evil for parallelism.
According to: bde

# 87ee69f0 09-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Clean up the boot targets a bit.
Suggested by: jdp

# e2d56569 08-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Make both types of boot targets.

# 400b2cc5 05-Oct-1998 Mike Smith <msmith@FreeBSD.org>

Add libstand to the includes target.

# 5ca77c07 25-Sep-1998 Søren Schmidt <sos@FreeBSD.org>

Backout my last commit.
Find another way to get the LKM's rebuild.

# db8b174e 25-Sep-1998 Søren Schmidt <sos@FreeBSD.org>

Build the LKM's both on aout & ELF systems.

Reviewed by: jkh

# bc767300 23-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

Add printf(1) to the list of early-build tools.
(needed to build Amd, and causing the -jN crowd problems w/o being here)
((I will revisit the usage of printf(1) in building Amd at a later time))

# 51a6b2cb 23-Sep-1998 Mark Murray <markm@FreeBSD.org>

Complete the Perl NOSHARED repair. I had not ensured that the shared library
was constructed early enough, so perl was linking against the static lib.
This was breaking perl under ELF, as perl could not load shared objects
(in fact would dump core).

# b510e4c2 21-Sep-1998 John Birrell <jb@FreeBSD.org>

Remove the bootstrap-rtld target which wasn't needed.

Install the rest of the legacy libraries (like libgcc.a, libl.a).

Add games to the user's path to avoid the temptation for people to
hack paths to unsuitable tools.

# 52984c04 17-Sep-1998 Andreas Klemm <andreas@FreeBSD.org>

Purely cosmetic but useful change.
Make output of make world more readable for grep. Now a
grep '>>>' world.log
shows you the single stages through which the bootstrap
process went as discussed on -current. Could be used to
debug the bootstrap mechanism in case of trouble more
easily. Would be fine if any further @echo "..." messages
containing a description, what's going on, could use the
new format: @echo ">>> ..."

# d8004495 17-Sep-1998 Poul-Henning Kamp <phk@FreeBSD.org>

Two patches from the HARP people:

Various Makefile related fixes.

-Wformat fixes.

Submitted by: Mike Spengler <mks@networkcs.com>

# c3deaba9 16-Sep-1998 Justin T. Gibbs <gibbs@FreeBSD.org>

libscsi is obsoleted by CAM.

# 3f8c4506 15-Sep-1998 Poul-Henning Kamp <phk@FreeBSD.org>

(this is an extract from src/share/examples/atm/README)

===================================
HARP | Host ATM Research Platform
===================================

HARP 3

What is this stuff?
-------------------
The Advanced Networking Group (ANG) at the Minnesota Supercomputer Center,
Inc. (MSCI), as part of its work on the MAGIC Gigabit Testbed, developed
the Host ATM Research Platform (HARP) software, which allows IP hosts to
communicate over ATM networks using standard protocols. It is intended to
be a high-quality platform for IP/ATM research.

HARP provides a way for IP hosts to connect to ATM networks. It supports
standard methods of communication using IP over ATM. A host's standard IP
software sends and receives datagrams via a HARP ATM interface. HARP provides
functionality similar to (and typically replaces) vendor-provided ATM device
driver software.

HARP includes full source code, making it possible for researchers to
experiment with different approaches to running IP over ATM. HARP is
self-contained; it requires no other licenses or commercial software packages.

HARP implements support for the IETF Classical IP model for using IP over ATM
networks, including:

o IETF ATMARP address resolution client
o IETF ATMARP address resolution server
o IETF SCSP/ATMARP server
o UNI 3.1 and 3.0 signalling protocols
o Fore Systems's SPANS signalling protocol

What's supported
----------------
The following are supported by HARP 3:

o ATM Host Interfaces
- FORE Systems, Inc. SBA-200 and SBA-200E ATM SBus Adapters
- FORE Systems, Inc. PCA-200E ATM PCI Adapters
- Efficient Networks, Inc. ENI-155p ATM PCI Adapters

o ATM Signalling Protocols
- The ATM Forum UNI 3.1 signalling protocol
- The ATM Forum UNI 3.0 signalling protocol
- The ATM Forum ILMI address registration
- FORE Systems's proprietary SPANS signalling protocol
- Permanent Virtual Channels (PVCs)

o IETF "Classical IP and ARP over ATM" model
- RFC 1483, "Multiprotocol Encapsulation over ATM Adaptation Layer 5"
- RFC 1577, "Classical IP and ARP over ATM"
- RFC 1626, "Default IP MTU for use over ATM AAL5"
- RFC 1755, "ATM Signaling Support for IP over ATM"
- RFC 2225, "Classical IP and ARP over ATM"
- RFC 2334, "Server Cache Synchronization Protocol (SCSP)"
- Internet Draft draft-ietf-ion-scsp-atmarp-00.txt,
"A Distributed ATMARP Service Using SCSP"

o ATM Sockets interface
- The file atm-sockets.txt contains further information

What's not supported
--------------------
The following major features of the above list are not currently supported:

o UNI point-to-multipoint support
o Driver support for Traffic Control/Quality of Service
o SPANS multicast and MPP support
o SPANS signalling using Efficient adapters

This software was developed under the sponsorship of the Defense Advanced
Research Projects Agency (DARPA).

Reviewed (lightly) by: phk
Submitted by: Network Computing Services, Inc.

# 7004be9b 15-Sep-1998 Justin T. Gibbs <gibbs@FreeBSD.org>

Hook up beforeinstall targets for libcam and libdevstat

# c4e8b7e4 09-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

I don't want to be the only one to use ``cut''. Use ``sed'' instead.

# 8f748848 09-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

Add ``usr/bin/cut'' to "build-tools" target.
Used in usr.sbin/amd/include/newvers.sh.

# ddf0071c 09-Sep-1998 Mark Murray <markm@FreeBSD.org>

Remove the NOPERL block to building Perl5.

Perl 5 will rebuild/bootstrap itself next time a make world is done
with this in effect.

# fad8371b 09-Sep-1998 Mark Murray <markm@FreeBSD.org>

Add the Perl5 bootstrap tools.

# 62dfd75a 09-Sep-1998 Mark Murray <markm@FreeBSD.org>

Another place to set NOPERL.

# ff5fcc93 04-Sep-1998 Satoshi Asami <asami@FreeBSD.org>

Remove tcl from /usr/src, according to prior agreement. BTW, tcl-8.0 *is*
a port so there is nothing to be done on that side now.

Approved by: jkh
===
To: "Jordan K. Hubbard" <jkh@time.cdrom.com>
cc: Andreas Klemm <andreas@klemm.gtn.com>, current@freebsd.org
Subject: Re: Make this a relese coordinator decision (was Re: ports-current/packages-current discontinued)
From: David Greenman <dg@root.com>
Date: Sun, 03 Aug 1997 20:23:31 -0700

>decision is, I'll respect it.

Another chance to architect people's principles...I can hardly wait. Seems
quite appropriate for a Sunday - I just need to get one of those collection
plates (and money envelopes) so I can profit, too. :-)
Tcl stays in /usr/src for now, but it needs to be kept up to date; same
for perl. If Jordan doesn't have "setup" (written in tcl) ready for 3.0,
then tcl will be yanked prior to the 3.0 release (and made into a port).
As for the ports tree only supporting the last FreeBSD release, this seems
sensible to me. The "ports" have always been a moving target between releases
and the problem is only going to get worse when we expand to supporting other
processor architectures. In any case, Satoshi is and always has been in charge
of the ports tree and whatever he wants to do with it (within reason :-)) is
his decision.
Does this cover the issue completely? I admit to deleting messages in this
thread with unusual fervor (people have FAR too much time on their hands!).
There's a fair bit of reasoning behind the above, but since everyone is sick
of arguing about this, I'll spare you the analysis.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project

# d64c14ce 05-Sep-1998 John Birrell <jb@FreeBSD.org>

Change i386 in a few paths to ${MACHINE} to support MACHINE=pc98.

# 146cbe7e 03-Sep-1998 John Birrell <jb@FreeBSD.org>

Only run ldconfig if the OBJFORMAT is aout.

# 741d299c 01-Sep-1998 John Birrell <jb@FreeBSD.org>

Force NOMAN and NOINFO on legacy-install as well as legacy build.

# ff1284f6 31-Aug-1998 John Birrell <jb@FreeBSD.org>

Add a target to check the consistency of the make OBJFORMAT variable
with the object format determined by objformat. This prevents foot
shooting (a form of boot scooting for hackers?) where local changes
to /etc/make.conf or /etc/make.conf.local try to override OBJFORMAT
in an incomplete way.

# f471c448 31-Aug-1998 John Birrell <jb@FreeBSD.org>

MACHINE -> MACHINE_ARCH to allow PC98 to define MACHINE=pc98.

Submitted by: Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>

# 11fb97da 30-Aug-1998 John Birrell <jb@FreeBSD.org>

E-day build system changes.

- Moved most of the guts of Makefile to Makefile.inc1 to become the
backend for the build system.
- The new Makefile doesn't suffer from problems including the wrong
sys.mk because it doesn't use anything in there or bsd.own.mk. So,
from now on, the proper build command is just `make world' (or
buildworld).
- The intermediate makefiles called Makefile.inc0 and Makefile.upgrade
fiddle with the OBJFORMAT and MAKEOBJDIRPREFIX variables so that
both aout and elf object trees can coexist. Makefile.upgrade contains
the aout->elf transition build.
- A cross build environment is now very close to reality. Specifying
TOOLDIR, setting OBJFORMAT and MAKEOBJDIRPREFIX allow that.

See the comments in Makefile for more info.

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


# 2726978b 05-Jul-2022 Warner Losh <imp@FreeBSD.org>

Makefile.inc1: Remove redundant test for armv[67]

If MACHINE is arm, then MACHINE_ARCH is going to be either armv6* or
armv7*.

Sponsored by: Netflix


# 1c024976 01-Aug-2023 John Baldwin <jhb@FreeBSD.org>

Makefile.inc1: Enable requesting the universe toolchain.

make universe builds a cross toolchain under HOST_OBJTMP/tmp via the
universe-toolchain target. However, doing a plain 'make buildworld'
after a universe/tinderbox run (e.g. to reproduce a failure and test
the fix for it), will try to build a new cross toolchain under
OBJTMP/tmp which can be tedious. This commit adds a make variable
(UNIVERSE_TOOLCHAIN) which can be used similar to CROSS_TOOLCHAIN to
request an external toolchain. If this variable is set (value doesn't
matter), the the universe toolchain is used as an external toolchain.

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


# 9f811192 27-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Fix list-old-libs by deleting stray pipe

Reported by: Yuri <yuri@aetern.org>
Fixes: 264594efbe69 ("Makefile.inc1: Automatically generate _LIBCOMPATS and list-old-* libcompats")


# 2a4d73f3 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Reinstate kbdcontrol bootstrap for BUILD_WITH_STRICT_TMPPATH

During BUILD_WITH_STRICT_TMPPATH builds we need to symlink the host's
kbdcontrol into WORLDTMP/legacy/bin so that it can be used. For
completeness, also check if the host has it, since technically the host
could have been built with WITHOUT_LEGACY_CONSOLE (though given nobody's
screamed since this code was removed that's likely not something that
gets hit in practice), and handle BOOTSTRAP_ALL_TOOLS (especially since
that case will cover cross-building if and when kbdcontrol can be built
on non-FreeBSD).

This allows a BUILD_WITH_STRICT_TMPPATH tinderbox to pass.

This partially reverts commit 33550b47391330362ea58984aa3fd691f6219ee0.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41202


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

Makefile.inc1: Add new buildetc and installetc targets

These implement the steps that etcupdate (and mergemaster) need in order
to build their pristine trees, avoiding the need to use internal targets
and variables. Additionally, buildetc includes the steps needed to build
with BUILD_WITH_STRICT_TMPPATH enabled, since we need some host tools to
be available during the various build and install steps.

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


# 8fc3059b 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Split _cleanworldtmp out from _worldtmp

This mirrors _cleanobj vs _obj, and will be used by etcupdate to ensure
its build tree has host tools available when BUILD_WITH_STRICT_TMPPATH
is enabled by default (whether in the source tree, like CheriBSD, or in
a system config file).

Note that due to line length the .MAKE .PHONY dependency line is split
into two, one for the filtered WMAKE_TGTS and one for the filtered
.ALLTARGETS.

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


# 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


# 81805ec3 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

depend-cleanup.sh: Generalise lib32 code and avoid duplication

By passing through _ALL_libcompats we can avoid hard-coding the list of
libcompats in depend-cleanup.sh. This cleanup also makes clean_dep
shorter by using a loop instead of handling each case explicitly (at the
expense of slightly tweaked logging).

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


# 264594ef 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Automatically generate _LIBCOMPATS and list-old-* libcompats

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


# 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


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

Makefile.inc1: add LIBCOMPAT_INCLUDE_DIRS to reduce arch ifdefs

In preparation for adding support for building lib32 on arm64,
add a list of architecture-specific include directories,
LIBCOMPAT_INCLUDE_DIRS, then replace the architecture-specific
ifdefs throughout the file with simple loops. Another commit
will add a definition of LIBCOMPAT_INCLUDE_DIRS for aarch64.

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


# c70dd03a 10-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Make sure MACHINE(_ARCH) are exported for depend-cleanup.sh

We run depend-cleanup.sh twice during the build. The second time is the
normal run, where we run it under WMAKEENV and thus have CROSSENV's
MACHINE(_ARCH)=${TARGET(_ARCH)} in the environment. However, the first
time is for bootstrap-tools, where it's run under BMAKEENV and we don't
have any assignments to MACHINE(_ARCH) in the environment, meaning the
script sees them as unset. In practice this doesn't matter since the
only use doesn't apply to bootstrap-tools, but it could be a future
issue. Thus, explicitly export them for depend-cleanup.sh and have the
script verify they're set.

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


# 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


# bd9049ee 21-Jun-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix prebuild race between libpam and libtacplus.

Fixes: 21850106fdda
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D40702


# 2e0d99a9 08-Jun-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Fix distributeworld mtree mangling for dist root dir

The trailing slash means that ./base itself doesn't get mangled and
remains as-is in the output, leading to a stray /base in base.txz for
NO_ROOT builds and thus in the installed system. Since this action is
running on a line whose file matches one listed by find (and we're
printing all of these as part of that distribution), we don't need to
care about the possibility of a path like ./basefoo/bar where the path
prefix isn't ./base, and can thus just drop the slash rather than
needing something more complicated like "slash or whitespace or EOL" as
one might first think.


# 469727c9 08-Jun-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Use INSTALL_DDIR for distributeworld's distrib-dirs

INSTALL_DDIR is the canonicalised version of DESTDIR/DISTDIR. Whilst
most of what distrib-dirs does doesn't need the canonicalised form, it
is responsible for installing the POSIX and en_US.US_ASCII NLS symlinks
to C, and therefore needs the canonicalised version for those two uses
of install for NO_ROOT builds, since our install does a naive text-based
prefix strip when creating the METALOG entry rather than a smarter path
semantics-aware one (which itself is really a bug, and has bitten us
many times). As a result, using plain DESTDIR/DISTDIR instead can result
in the METALOG having ./path/to/destdir/base/usr/share/nls/$LOCALE
rather than ./base/usr/share/nls/$LOCALE and then being filtered out
when creating base.meta (or, if you're unlucky and the absolute path
begins with base or tests, weird things will probably happen).

Given this footgun an audit of DESTDIR uses is probably in order,
especially those using DESTDIR/DISTDIR, but this is sufficient for now.


# f7057652 10-Apr-2022 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: use make builtin :ts instead of sed

Commit 3eb1b4da3cf7 replaced "xargs -n1" with a sed expression to
convert from space to newline as a list separator for *-old-* targets.
Dan Nelson followed up with a suggestion to use make's built-in :ts
instead, which should be slightly more efficient.

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


# a1bf1a1a 23-Apr-2023 Simon J. Gerraty <sjg@FreeBSD.org>

showconfig - ignore options that do not start with A-Z

When building on various hosts it can be handy to create pseudo
options like MK_host_egacy - building on a host that needs libegacy.

Such options should be ignored by showconfig

Reviewed by: emaste


# 10172ce3 12-Apr-2023 John Baldwin <jhb@FreeBSD.org>

Stop stripping 'sf' suffixes from architecture names.

riscv64sf was the only architecture with an 'sf' suffix.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D39497


# 1ca12bd9 12-Apr-2023 John Baldwin <jhb@FreeBSD.org>

Remove the riscv64sf architecture.

Reviewed by: jrtc27, arichardson, br, kp, imp, emaste
Differential Revision: https://reviews.freebsd.org/D39496


# 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


# 9e914c7a 14-Mar-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Add new DISK_IMAGE_TOOLS_BOOTSTRAP option

This will build etdump, makefs and mkimg as bootstrap tools to allow
easily creating disk images. Note that etdump is bootstrapped due to its
use in the release scripts for building ISO images.

Reviewed by: emaste, arichardson
Differential Revision: https://reviews.freebsd.org/D39072


# d7a491dd 06-Mar-2023 Ed Maste <emaste@FreeBSD.org>

make showconfig: set MACHINE and MACHINE_ARCH

Previously these were not set for the showconfig target, so took the
host's value rather than the target. As a result some machine-dependent
kernel options were not reported with correct defaults in the src.conf
manpage.

PR: 269994
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38926


# dda4d972 02-Mar-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Support building with macOS Ventura's AMFI Launch Constraints

As of macOS Ventura, Apple-signed binaries cannot be run if copied away from
their system location. This security feature doesn't really make sense for
boring things like sh(1), more so for applications with special entitlements,
but it's universally present, and results in the following error:

>>> Install check world
bmake[2]: "/Users/Jess/cheri/freebsd/Makefile.inc1" line 572: warning: "MAKEFLAGS= CPUTYPE=dummy /Users/Jess/cheri/build/freebsd-riscv64-build/bmake-install/bin/bmake -f /dev/null -m /Users/Jess/cheri/freebsd/share/mk MK_AUTO_OBJ=no -V CPUTYPE" exited on a signal
bmake[2]: "/Users/Jess/cheri/freebsd/Makefile.inc1" line 575: CPUTYPE global should be set with ?=.

As with host-symlinks, we don't actually need to copy the files on macOS, since
we're not updating the current machine, so copy its approach and just symlink
them instead.

MFC after: 1 week


# 3dfd18a7 13-Feb-2023 John Baldwin <jhb@FreeBSD.org>

Remove support for the base/* toolchain ports.

These ports have been removed so these knobs are no longer meaningful.

This reverts commit 608289394f655d0635c71233248b734010fb4d2f.
This reverts commit 39eb07f172921a581ee9b33ca2765905f4235202.

Reviewed by: imp, bapt, emaste
Differential Revision: https://reviews.freebsd.org/D38562


# b4f7a31f 08-Feb-2023 Kyle Evans <kevans@FreeBSD.org>

buildworld: drop config(8) dependencies from bootstrap

We may still need them for other parts, so just remove the dependency
relationship for now and simplify config's place in bootstrap-tools.

Reviewed by: imp
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D38277


# 0dfaefa9 08-Feb-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

depend-cleanup.sh: Simplify the logic, and clean bootstrap tools.

* There's no need to check if the file exists before grepping it; if it does not exist, grep will fail, which is what we want. Just redirect the error message to /dev/null.
* There's no need to split the .o and .pico cases; the bodies are identical, so combine the conditions. Use a glob to avoid a false negative if one exists but not the other.
* Also run depend-cleanup.sh on the bootstrap build tree. This unbreaks the build after 29c5f8bf9a01.

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D38447


# a1e3fb8f 10-Mar-2022 Eugene M. Kim <astralblue@gmail.com>

Fix _REVISION to be always major.minor

Introduced in commit 613fe53, _REVISION was redefined to be just the
major version (14) instead of major.minor (14.0) iff:

- PKG_VERSION was not overridden (default), and
- Branch was -CURRENT, -STABLE, or -PRERELEASE.

This introduced side effects in other parts of the code which expected
_REVISION to be major.minor:

- make-pkg-package.sh target triple became amd64-portbld-freebsd14
(should be amd64-portbld-freebsd14.0);
- Versioned cross dev symlink name became amd64-freebsd14-<tool>
(should be amd64-freebsd14.0-<tool>)

Also, compounded with commit ea9a92d (which was introduced afterward
and removed minor version from _REVISION incorrectly using :S with a
regex) this also caused pkgbase repo to use a wrong PKG_ABI with a minor
version (FreeBSD:14.0:amd64) when a custom PKG_VERSION was specified.
(Note, without a custom PKG_VERSION the bug was not triggered because in
that case _REVISION was already major-only.)

This commit fixes both problems by introducing and using MAJOR_REVISION
instead of redefining _REVISION. Existing uses of _REVISION now see
major.minor again, except PKG_ABI (ex: FreeBSD:14:amd64, as described
above) and PKG_VERSION (ex: 14.snap20220311121531) need only the major
version and now use MAJOR_REVISION instead.

PR: 262600, 262601
Reviewed by: imp, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/592


# d4fdfd3f 29-Jan-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Restore adding tzsetup to _basic_bootstrap_tools

ITOOLS is only the list of programs to make a copy of during install, it
doesn't cause anything to be bootstrapped. Thus, by removing tzsetup
from _basic_bootstrap_tools, we end up without it on non-FreeBSD, and so
we error out trying to copy it to INSTALLTMP.

Note that _basic_bootstrap_tools is only used for BOOTSTRAP_ALL_TOOLS
(which is why zic was moved away from it). Should tzsetup evolve such
that the host version is insufficient on older FreeBSD it can be moved
to be more like zic, but that seems unnecessary for what is likely to
remain a simple tool.

This partially reverts commit 7a4a520064cb7fbff79560113682d6fe1a1ae9ee.

Fixes: 7a4a520064cb ("Fix cross-build from STABLE or older CURRENT.")


# 4ebd18cf 29-Jan-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Print the right PATH for missing install tool error

We override PATH for which but then go and print the non-overridden
PATH, which leads to rather confusing messages.

Fixes: 5bb9250e0af4 ("Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD")


# 95016839 27-Jan-2023 John Baldwin <jhb@FreeBSD.org>

Revert "Don't omit bsd.compiler.mk for the nested delete-old in buildworld."

The original motivation (src.opts.mk needing bsd.comppiler.mk to
determine if CXX is supported) is no longer relevant now that CXX is
non-optional.

This reverts commit b9cb80883bce6dc992cf05ae2e59089a60d311ec.


# ac4c695a 16-Nov-2022 Ed Maste <emaste@FreeBSD.org>

Retire WITHOUT_CXX option

Several important base system components are written in C++, and the
WITHOUT_CXX option produced a system that was not fully functional.
Just accept this, and remove the option to build without C++ support.

This reverts commit adc3c128c6603054586a993d117e5dd808deac17.

Reviewed by: brooks, kevans, jhb (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33108


# 7a4a5200 25-Jan-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix cross-build from STABLE or older CURRENT.

Previously, zic and tzsetup were both listed as install tools and basic
bootstrap tools. Actually, tzsetup is an install tool while zic is a
non-basic bootstrap tool.

Fixes: 783c318fd118
Sponsored by: Klara, Inc.
Reviewed by: jrtc27, emaste
Differential Revision: https://reviews.freebsd.org/D38195


# 34ac629b 20-Jan-2023 Alex Richardson <arichardson@FreeBSD.org>

Shell-escape assignments to PATH in the top-level makefiles

Since 16fbf0191243e7c9dff6615b1424b5d39186b36c PATH is no longer set
to a hardcoded value on non-FreeBSD build hosts, so we can end up with
spaces in $PATH. Instead of only escaping PATH I updated all `env PATH=`
uses in the toplevel makefile. While many of these currently can't
contain any special characters (since the build would have failed
already), in theory this gets us closer to allowing build/source
directory to contain e.g. spaces.


# 20a66ab4 29-Sep-2022 Ed Maste <emaste@FreeBSD.org>

Retire CLANG_IS_CC option

A small reduction in build infrastructure complexity; when we had both
Clang and GCC in the tree it was useful to have both built, and choose
one or the other to install as /usr/bin/cc. Now only Clang is in the
tree, and there is no point in building and installing base Clang but
not providing it as cc (and c++, cpp).

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37075


# b9cb8088 18-Nov-2022 John Baldwin <jhb@FreeBSD.org>

Don't omit bsd.compiler.mk for the nested delete-old in buildworld.

src.opts.mk will need bsd.compiler.mk to determine if CXX is
supported. Without this, src.opts.mk always marks CXX as broken and
attempts to delete all dependencies of MK_CXX from WORLDTMP.

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


# 470fb726 24-Oct-2022 Ed Maste <emaste@FreeBSD.org>

build: Use `rm -fv` for BATCH_DELETE_OLD_FILES

It's possible to have files with odd permissions in the tmproot (or
sysroot), causing rm to prompt for each one during e.g. buildworld.
Add -f to forcibly delete these.

Reviewed by: brooks
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37111


# 77becb93 05-Oct-2022 Brooks Davis <brooks@FreeBSD.org>

Rename MACHINE_ABI and TARGET_ABI

The MACHINE_ABI and TARGET_ABI variables are used to set the middle of
the target triple (e.g., "-unknown-" or "-gnueabihf-"). They are not set
by any tool in the base system and I've only found the latter mentioned
in one review online. As such, rename them to to MACHINE_TRIPLE_ABI and
TARGET_TRIPLE_ABI to clear the way to use MACHINE_ABI as a supplement to
MACHINE_CPU, etc.

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


# 0aa27001 01-Oct-2022 Dag-Erling Smørgrav <des@FreeBSD.org>

Put OPIE to rest.

Differential Revision: https://reviews.freebsd.org/D36592


# fcf12081 15-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1 release bsd.own.mk: Introduce and use TAR_CMD

Our uses of tar rely on BSDisms, and so do not work in environments
where GNU tar is the default tar. Providing a TAR_CMD variable like
some other commands allows it to be overridden to use bsdtar in such
cases.

Reviewed by: brooks, delphij, gjb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35813


# 5e0a749c 15-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Set LC_COLLATE in distributeworld for glibc compatibility

distributeworld relies on "foo" sorting directly before "foo type=...",
but with glibc both en_US and en_GB have "fooa" sort between "foo" and
"foo z", resulting in some files (in particular, id due to "ident"
sorting before "id type=" but after "id") not being included in the meta
files and thus not included in the dist tarballs. Forcing use of the C
locale ensures this does not occur.

Reviewed by: brooks
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35812


# 445421ab 15-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Honour DB_FROM_SRC for NO_ROOT distributeworld

Currently the host's database files are used, but on non-FreeBSD these
are not necessarily sufficient; in particular, Linux does not have a
wheel group. Instead, use -N to use the in-tree database files when
creating the METALOG entries, as is done for the recursive makes via
IMAKE_MTREE.

Reviewed by: brooks
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35810


# 93f5ab12 14-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Bootstrap crunchgen after removing -dc from linker invocation

In ec81497cc726 crunchgen was updated to remove -dc from the linker
invocations in its generated makefile output, as this flag is no longer
necessary, and is going to be an error with lld 15.

Update the BOOTSTRAPPING conditions for copying the crunchgen binary
from the host, or actually bootstrapping it when necessary. Since
ec81497cc726 did not bump __FreeBSD_version, I have chosen the nearest
values.

Fixes: ec81497cc726
MFC after: 3 days


# 7e45839a 13-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Fix -DNO_ROOT distributeworld certctl usage

Currently for distributeworld we pass DESTDIR to certctl.sh as an
environment variable, which sets the default value in the script.
However, for -DNO_ROOT builds, CERTCTLFLAGS has METALOG_INSTALLFLAGS
which includes -D ${DESTDIR}, overriding the custom DESTDIR pointing at
the base dist directory.

Moreover, in order to ensure that the METALOG includes the base/ prefix
for all the files, we need to have certctl call install with -D set to
DESTDIR/DISTDIR without the /base suffix but also ensure the files get
installed to DESTDIR/DISTDIR/base.

Fix these by passing the custom DESTDIR to certctl via -D rather than in
the environment and to pass the /base suffix in the distributeworld case
via the newly-added -d option.

We also need to run certctl rehash before we generate the .meta files
from the METALOG, not after, otherwise they won't include the METALOG
additions, so move the certctl rehash call.

Finally, add a missing semicolon that results in no message being
printed in the missing openssl case. By not including the semicolon,
else echo "..." is treated as extra arguments to certctl, which is lax
in its argument parsing and ignores additional arguments, and the
semicolon and fi after the intended echo terminate the if statement as
normal so there's no syntax error at the shell level. This is harmless
as we weren't trying to do anything other than echo anyway, all that
happens is the echo doesn't actually get run.

Reported by: markj (missing semicolon)
Reviewed by: brooks, kevans
Obtained from: CheriBSD
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35809


# b1807136 13-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Add a missing ${dist} to distributeworld for usr/include/i386

Not including ${dist} results in the following non-fatal error printed
once per extra distribution:

mkdir //usr/obj/usr/src/amd64.amd64/release/dist/usr/include/i386
mkdir: //usr/obj/usr/src/amd64.amd64/release/dist/usr/include: No such file or directory
*** Error code 1 (ignored)

Also fix a whitespace nit on this line whilst here.

Reviewed by: brooks
Fixes: a09ea2bbc305 ("amd64: add an i386 include directory")


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

installworld: improve portability of ldd use

b3b462229f97 added a case statement to ignore lines containing strings
in square brackets such as "[vdso]" and "[preloaded]". On MacOS
Monterey where /bin/sh may be zsh, this fails with:

/bin/sh: -c: line 0: syntax error near unexpected token `;;'

Invoke grep in the pipeline to remove such lines instead.

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


# a09ea2bb 13-Jun-2022 Brooks Davis <brooks@FreeBSD.org>

amd64: add an i386 include directory

This directory will hold i386-specific headers that are needed for
-m32 support on amd64 and where the amd64 and i386 cases have too
little in common for combining them to make sense. Files to be
installed will come in later commits.

With the currently required set of files, this could be done with
another INCGROUP in include/Makefile, but at least one file that
might want -m32 support (ieeefp.h) conflicts with a files installed
in /usr/include.

Reviewed by: jhb, imp


# 1838bd0f 05-Feb-2022 Dimitry Andric <dim@FreeBSD.org>

Merge llvm-project release/14.x llvmorg-14-init-18315-g190be5457c90

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18315-g190be5457c90.

PR: 261742
MFC after: 2 weeks


# 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

# 47bcbde9 17-Apr-2022 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

bintrans: move files to a new directory

And reflect the change in various places.

# 4cd4841a 05-Apr-2022 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

Modularize uuencode and uudecode by wrapping them in bintrans.c

The program will be installed as bintrans, uuencode, uudecode,
b64encode, and b64decode and will be responsible for running the coders
according to their historical behavior.

Additionally, bintrans will be able to take a parameter designating
the coder and accept all its options in this form:
bintrans <coder> [options]
and the behavior should be the same as if
<coder> [options]
was invoked.
This has the advantage that adding coders won't require installing them
as binaries.

Move uudecode files to uuencode since the latter is the one that
provides the manual page.

Reviewed by: delphij (previous version)
Differential Revision: https://reviews.freebsd.org/D32943

# a8267ecc 01-Apr-2022 Ed Maste <emaste@FreeBSD.org>

Speed up *-old-* make targets by using sed instead of xargs

Targets like 'list-old-files' used "xargs -n1" to produce a list with
one file per line. Using xargs resulted in one fork+exec for each
Argument, resulting in rather long runtime. Instead, use sed to split
the list. On one machine `make list-old-files` took 30s wall clock time
with xargs and less than 1s with sed.

Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34741

# b3b46222 01-Apr-2022 Ed Maste <emaste@FreeBSD.org>

installworld: handle ldd including preloaded objects

The installworld target makes a temporary copy of binaries to be used
during the install. Libraries that they depend on are also included,
found by using `ldd`.

After commit 0913953c9ed0 ldd started listing preloaded objects,
including [vdso], under a [preloaded] header. Skip ldd output that is
enclosed in square brackets.

Reviewed by: cy, kib [earlier version]
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34734

# 3b17e19f 01-Mar-2022 Warner Losh <imp@FreeBSD.org>

bootstrap: bump minimum supported version

Bump the minimum supported version to build -current from to 11.3R in
preparation of removing support for older systems. 11.4R was selected
as the most recent version to go out of support.

Sponsored by: Netflix
Reviewed by: delphij, emaste
Differential Revision: https://reviews.freebsd.org/D32444

# 33550b47 01-Mar-2022 Warner Losh <imp@FreeBSD.org>

bootstrap: No need for kbdcontrol bootstrap anymore

We only need kbdcontrol when bootstrapping from FreeBSD 10 or
pre-FreeBSD 11.0 current. Since we can no longer build from these
versions of FreeBSD, remove the support for bootstrapping them.

Sponsored by: Netflix

# 3e65b7d9 11-Feb-2022 Warner Losh <imp@FreeBSD.org>

cleankernel: A target to delete the kernel compile file

With the meta-build, it's always a NO_CLEAN build. Provide a way to
remove so one can rebuild from scratch. 'cleankernel' will delete the
kernel and modules object directories. Document this in build(7).

Sponsored by: Netflix
Reviewed by: debdrup, markj
Differential Revision: https://reviews.freebsd.org/D32978

# ea9a92d2 10-Feb-2022 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: synthesize PKG_ABI from newvers.sh variables

Previously we inspected ${WSTAGEDIR}/usr/bin/uname to determine PKG_ABI,
but the file will not exist in some cases - for example, if building
only kernel packages. We can instead synthesize the PKG_ABI from
information already provided by newvers.sh.

Reviewed by: kevans, manu (both earlier rev)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34249

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

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

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D34175

# 0a902e42 25-Jan-2022 John Baldwin <jhb@FreeBSD.org>

Stop trimming 'hf' suffixes from MACHINE_ARCH.

This was only used for MIPS hard-float architectures.

Reviewed by: imp
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D34018

# 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

# 77da558c 20-Jan-2022 John Baldwin <jhb@FreeBSD.org>

check/delete-old: Auto-generate lib32 entries for libraries.

- Add usr/lib32/libfoo.so.N for lib/libfoo.so.N.

- Add usr/lib32/foo for usr/lib/foo.

- Treat casper libraries special since they are installed to
/usr/lib32 instead of /usr/lib32/casper and thus map
usr/lib/casper/foo to usr/lib32/foo.

Note that OLD_DIRS and MOVED_LIBS entries are not duplicated, only
OLD_FILES and OLD_LIBS.

Reviewed by: imp, emaste
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33324

# 57ba3f00 20-Jan-2022 John Baldwin <jhb@FreeBSD.org>

Use MOVED_LIBS for libraries moved between /usr/lib and /lib.

Add a MOVED_LIBS variable similar to OLD_LIBS except that MOVED_LIBS
is used for the cases that a library's name doesn't change, but it
just moves between /usr/lib and /lib. This will be used by a future
change to auto-generate lib32 old files entries for which these cases
need to be ignored (a moved library remains in /usr/lib32).

Suggested by: emaste
Reviewed by: emaste
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33848

# 21baf42c 11-Jan-2022 John Baldwin <jhb@FreeBSD.org>

Add list-old-{dirs,files,libs} targets.

These targets generate a raw list of the candidate old files roughly
corresponding to the values of OLD_DIRS, OLD_FILES, and OLD_LIBS.
Currently list-old-files also includes uncompressed manpages in
addition to compressed manpages.

Use these targets in the implementation of check-old-* and
delete-old-* to replace duplicated logic.

Reviewed by: imp, emaste
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33327

# adc88b9c 07-Jan-2022 Ed Maste <emaste@FreeBSD.org>

Build libclang also if LLDB is enabled

LLDB depends on libclang as it uses Clang as the expression parser.
Previously setting WITHOUT_CLANG but leaving LLDB enabled (as default)
resulted in a build failure.

Users who set WITHOUT_CLANG in order to reduce build time or size
might want to set WITHOUT_LLDB in addition to WITHOUT_CLANG, or use
WITHOUT_TOOLCHAIN instead.

PR: 260993
Reported by: eugen
Reviewed by: dim
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

# 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

# 7a171e30 15-Dec-2021 Warner Losh <imp@FreeBSD.org>

test-includes: Build a library instead of a binary

We need to build the .o's, but don't need to link. Build a static
library instead of a binary to accmoplish this. This removes the need to
have all the libc and crt stuff built, which is required for a
binary. In addition, trying to build a non-standard binary runs into
trouble with undefined symbols on arm related to EABI, even when using a
simplified startup with -nostdlib -e start.

Turn back on testing includes, now that it works.

Sponsored by: Netflix
Reviewed by: brooks, markj (prior version)
Differential Revision: https://reviews.freebsd.org/D33452

# 6a2b72bf 14-Dec-2021 Warner Losh <imp@FreeBSD.org>

Remove test-includes build

This is making the CI red. I believe this is because we do a clean build
w/o metamode in the tinderbox, so none of the artifacts needed to build
a binary are present. However, I've not recreated the problem locally
yet to confirm. Remove this while I investigate. This partially reverts
dd55767b86bc. The rest of the commit causes no harm w/o the explicit
test here.

Sponsored by: Netflix

# dd55767b 14-Dec-2021 Warner Losh <imp@FreeBSD.org>

Test various header files to ensure they can be included by themselves.

A number of header files in sys/* have, going back to 7th Edition Unix
in 1979, reqiured other files (like sys/types.h) to compile. Likewise
the 4BSD networking code has had prerequisites. However, going back to
around the turn of the 21st century, other systems have made them be
independently include-able (wide-spread header include protection
post-dates 7th edition Unix by maybe 3 or so years judging from USENET
source postings). Start down the path of making them all independently
include-able by creating this test that fails buildworld when they are
not.

The file 'badfiles.inc' contains a list of the currently broken files
that cannot be included w/o any prerequisites. As files are fixed, 'make
badfiles.inc' should be re-run to remove them from the list. Note: All
files that start with an underscore are considered internal and not
tested.

Please note: once a file is removed from badfiles.inc, it must pass on
all architectures. Buildworld through at least the _includes target is
needed to ensure its working (though a buildkernel should also be done
on all architectures as well).

Sponsored by: Netflix
Reviewed by: brooks, markj
Differential Revision: https://reviews.freebsd.org/D32498

# b8cacb38 09-Dec-2021 Warner Losh <imp@FreeBSD.org>

mips: Remove mips as a recognized build target.

Remove mips as a recognized build target in advance of its removal from
the tree.

Sponsored by: Netflix

# 59f4abfa 07-Dec-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Allow to specify PKG_ABI on the command line

This is useful for creating kernel package without having to buildworld
before as we use uname from the world stage dir to get the ABI.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D33323
Sponsored by: Beckhoff Automation GmbH & Co. KG

# 8f7eb330 06-Dec-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Bootstrap libcrypt on non-FreeBSD for libroken

After f0a6ab51e6da, we need libroken's dependencies to be present; in
particular, libcrypt is not present on macOS, and so needs to be
bootstrapped. We include this on Linux too for consistency and to avoid
future compatibility issues, even if strictly unnecessary currently.

Fixes: f0a6ab51e6da ("src.libnames.mk: Include dependencies when bootstrapping from non-FreeBSD"
MFC after: 1 week

# 8d5d3295 06-Dec-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Bootstrap libz when cross-building from non-FreeBSD

This is needed now libdwarf depends on libz.

Fixes: dbf05458e3bd ("libdwarf: Support consumption of compressed ELF sections")
MFC after: 1 week

# 9b135747 30-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

kern.pre.mk: allow to use and customize elfdump during kernel build

Reviewed by: emaste
Discussed with: jrtc27
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32960

# aaa4cd7f 28-Nov-2021 Juraj Lutter <otis@FreeBSD.org>

Makefile.inc1: Silence an error in make packages

Silence an error in "packages" target, like:

eval: /usr/src: Permission denied

on systems without subversion present.

Reviewed by: emaste
Approved by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33153

# 7b3642da 26-Nov-2021 Mark Johnston <markj@FreeBSD.org>

Hoist cddl prebuild lib dependency definitions out of a MK_ZFS block

The compilation of several libraries under cddl/lib is not conditional
on MK_ZFS = "yes", so their dependency on libspl is not conditional
either. Unbreak buildworld when WITHOUT_ZFS is set.

Reported by: bz
Fixes: 9e9c651caceb ("cddl: fix missing ZFS library dependencies")
MFC after: 1 week

# 483a2262 24-Nov-2021 Ed Maste <emaste@FreeBSD.org>

Add ncurses/form to _prebuild_libs to fix build

Reported by: bz

# 8502220d 19-Nov-2021 Warner Losh <imp@FreeBSD.org>

Revert "Bootstrap: Prune building from pre-FreeBSD 11 support"

This reverts commit a420a672bc53bd3928626aa5d0ec5b41c0471356.

kevans pointed out some potential problems here, so reverting until
I can fix them.

# a420a672 10-Oct-2021 Warner Losh <imp@FreeBSD.org>

Bootstrap: Prune building from pre-FreeBSD 11 support

We don't need to bootstrap lex or md4 anymore.
Cat doesn't need to be bootstrapped (but is needed for buildkernel)
cruncgen doesn't need to be bootstrapped at all.
kbdcontrol isn't needed

Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/554

# 27a04f59 18-Nov-2021 Warner Losh <imp@FreeBSD.org>

Add warning that MIPS is being removed in FreeBSD 14.0

MFC After: 3 days
Sponsored by: Netflix
Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D32853

# 9e9c651c 16-Oct-2021 Greg V <greg@unrelenting.technology>

cddl: fix missing ZFS library dependencies

In 9fae47666 zfsd got a libspl dependency to avoid undefined references.
However that workaround did not help external consumers of libzfs_core.

Fix all missing dependencies lld 13 and the rtld complain about.

Reviewed by: freqlabs, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D32521

# e5adb145 10-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

Remove arm/linux from sysent toplevel target

Sponsored by: The FreeBSD Foundation
Fixes: 65e485014b0dcf53e0

# eab5358b 24-Oct-2021 Mateusz Piotrowski <0mp@FreeBSD.org>

Makefile.inc1: Remove mentions of removed target "update"

This is follow-up to commits e290182bcf38 and 1f7d11e636ab.

# 1a724aa9 18-Oct-2021 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove lorder from build/cross tools

As lorder is not used by the base system build there is no need to
include it in bootstrap-tools or NXBDIRS.

Fixes: 0e1e341b486c ("Stop using lorder and ranlib when...")
Sponsored by: The FreeBSD Foundation

# e2e2c622 13-Oct-2021 Kyle Evans <kevans@FreeBSD.org>

native-xtools: avoid libllvm while populating the sysroot

Prior to 021385aba562, MK_CLANG=no was sufficient to avoid descending
into lib/clang, but the referenced change added a couple of other
enabling knobs. Turn those off, too, to continue avoiding libllvm.

With this change, we no longer end up with a libllvm using the wrong
default target triple; `poudriere jail -cx` works once again.

Reported by: bhughes, imp, probably others
Fixes: 021385aba562 ("Add WITH_LLVM_BINUTILS to install LLVM ...")

# c05b382e 11-Oct-2021 Warner Losh <imp@FreeBSD.org>

Revert "bootstrap: No need to disable shared libraries for bootstrap tools"

This reverts commit e8f26e5dc859a8fbc663e108421f657325ca3054.

Although the change worked locally, it's breaking something in the CI
build for the riscv64 build (which makes no sense it would only break
that since we're building host tools to bootstrap at that point).

Sponsored by: Netflix

# e8f26e5d 11-Oct-2021 Warner Losh <imp@FreeBSD.org>

bootstrap: No need to disable shared libraries for bootstrap tools

There's no need to disable shared libraries when building the bootstrap
tools. This was added on 2000 (commit ad879ce9552c) when the perl
bootstrap was added (libperl and miniperl) and saved a fair amount of
time (perl took a long time to build on 2000-era hardware).

For many years now, however, we rarely build any libraries when
bootstrapping. Even when we do, the optimization saves at most a few
seconds when upgrading since the libraries built have been small. Shared
libraries are more robust accross versions that static libraries due to
creaping dependencies (we aren't crossing versions of share libraries,
though, just using what's on the host). In addition, linux and macos
have been building like this for some time because static binaries on
those systems are difficult to impossible.

Sponsored by: Netflix
Reviewed by: arichardson, bapt
Differential Revision: https://reviews.freebsd.org/D32443

# 4d7876aa 06-Oct-2021 Kyle Evans <kevans@FreeBSD.org>

build: slap a libtinfo dependency on libncurses

This mirrors the SUBDIR_DEPEND in lib/ncurses/Makefile.

Reported by: jenkins (e.g., riscv64 build #23984)
Fixes: 396851c20aeb ("ncurses: split libtinfo from libncurses")

# cbc83e37 22-Sep-2021 Baptiste Daroussin <bapt@FreeBSD.org>

ncurses: chase dependency changes in the source tree

Differential Revision: https://reviews.freebsd.org/D32098

# cf0ee873 12-Sep-2021 Konstantin Belousov <kib@FreeBSD.org>

Drop cloudabi

According to https://github.com/NuxiNL/cloudlibc:
CloudABI is no longer being maintained. It was an awesome experiment,
but it never got enough traction to be sustainable.

There is no reason to keep it in FreeBSD.

Approved by: ed (private mail)
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D31923

# 895545d0 11-Sep-2021 Doug Rabson <dfr@FreeBSD.org>

Fix spelling of BUILDENV_SHELL

# 021385ab 06-Sep-2021 Alex Richardson <arichardson@FreeBSD.org>

Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain

When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as
ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones.
Having the LLVM binutils instead of the elftoolchain ones allows us to use
features such as LTO that depend on binutils that understand LLVM IR.
Another benefit will be an improved user-experience when compiling with
AddressSanitizer, since ASAN does not symbolize backtraces correctly if
addr2line is elftoolchain addr2line instead of llvm-symbolizer.
See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html
for more details.

This is currently off by default but will be turned on by default at some
point in the near future.

Reviewed By: emaste

Differential Revision: https://reviews.freebsd.org/D31060

# 1e4c8029 24-Aug-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Fix bootstrapping to actually build lldb-tblgen for later use

Because MK_LLDB=no is in BSARGS, the bootstrap-tools recursive make does
not add lldb-tblgen to _clang_tblgen, causing it to not be built. This
means that the build currently always uses the host's lldb-tblgen
(which, whilst currently it appears to work, could in future break if
TableGen backends are added or altered) and, if it doesn't exist (either
because the current FreeBSD system was built with it disabled, or you're
building on macOS/Linux), fails. Linux and macOS cross-builds used to
work simply because LLDB was previously in BROKEN_OPTIONS when building
on non-FreeBSD.

Instead, move MK_LLDB=no from BSARGS to XMAKE. This ensures that the
lib/clang build in cross-tools continues to not build LLDB parts for the
bootstrap toolchain (both to save time/space on FreeBSD, and because our
vendored LLDB does not include the macOS and Linux host files so those
would fail to build).

The DIRDEPS target is updated to move MK_LLDB=no from the BSARGS block
that mirrors Makefile.inc1 to the line that disables additional
toolchain components. The DIRDEPS build likely suffers from the same
issue currently, but having never used it and not being familiar with
how it works I am leaving that as-is. If it does suffer from the same
issue it should be easily reproducible by renaming /usr/bin/lldb-tblgen
or moving it to a directory not in PATH.

Fixes: 31ba4ce8898f ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after: 1 week
Reviewed by: dim, emaste, imp
Differential Revision: https://reviews.freebsd.org/D31531

# ab3a1809 24-Aug-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Make sure sub-makes see MK_CLANG_BOOTSTRAP=no when XCC is a path

Currently we override MK_CLANG_BOOTSTRAP to no so we don't build a
bootstrap compiler, but subdirectories don't see that and so the hack in
bsd.sys.mk to prefer our includes over Clang's resource dir for external
toolchains is not enabled unless you use -DWITHOUT_CLANG_BOOTSTRAP
explicitly on top of XCC (which tools/build/make.py does not do),
causing duplicate definition errors when building rtld-elf due to the
use of -ffreestanding (Clang's stdint.h will use the system one when
hosted, but its own when freestanding, and only has glibc's preprocessor
guards, not FreeBSD's).

This broke when dropping CLANG_BOOTSTRAP from BROKEN_OPTIONS.

Fixes: 31ba4ce8898f ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after: 1 week
Reviewed by: imp, arichardson
Differential Revision: https://reviews.freebsd.org/D31529

# 298ee47e 18-Aug-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

localedef: unbreak WITHOUT_LOCALES

After 0fa5403d493b ("pkgbase: move locales into their own package") we
need usr.bin/localedef as a bootstrap tool independent on where
WITHOUT_LOCALE was specified as we ALWAYS process C.UTF-8.

At the same time LOCALES= in the local Makefile is empty but
C.UTF-8 with WITHOUT_LOCALES. C.UTF-8 is excluded from FILES, and thus
after the replacement FILES= is set to only .LC_CTYPE which results in
a build failure not knowing how to build that. Tweak the substitution to
replace only non-empty words so that FILES remains harmlessly empty.

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

# 4b7bf842 17-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

bootstrap-tools: Don't copy host tools with make -n

# a3ddd7c9 17-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

_worldtmp: Fix some sub-makes not working with make -n

# cc134505 16-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Add missing lex/yacc dependency for mkesdb/mkcsmapper bootstrap

This causes build failures on macOS where the build can end up invoking
an incompatible m4 binary.

Fxies: 2de949cf85d0 ("Remove mkcsmapper_static and mkesdb_static from build-tools")

# 54247ce1 07-Aug-2021 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: Avoid hanging if pkg is not installed

For `pkg --version`, Redirect stdin from /dev/null to avoid waiting on
/usr/sbin/pkg's bootstrap prompt if the pkg package is not installed.
Also redirect stderr to /dev/null to discard the warning message in
this case.

Reported by: mjg
Fixes: 4e224e4be7c3 ("pkgbase: accommodate pkg < 1.17")
Sponsored by: The FreeBSD Foundation

# 61ed578e 04-Aug-2021 Mitchell Horne <mhorne@FreeBSD.org>

Prefer MK_SSP=no to SSP_CFLAGS=

It is more idiomatic. CFLAGS is only augmented with $SSP_CFLAGS when
$MK_SSP != "no".

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31401

# bcd2f41f 04-Aug-2021 Mitchell Horne <mhorne@FreeBSD.org>

mk: format some option lists

Alphabetize and give each option its own line, ahead of making another
change to these lists. This makes future diffs easier to read.

Reviewed by: imp, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31399

# b60770fc 03-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native-xtools build

Fixes https://github.com/freebsd/poudriere/issues/894
Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line")
X-MFC-With: d0c737e18

# 2482ea42 03-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

Revert "Fix native-xtools build"

This reverts commit 36269b82318280ef184c953b90674f5905e0f53f.

This had an unintended change included.

# 36269b82 03-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native-xtools build

Fixes https://github.com/freebsd/poudriere/issues/894
Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line")
X-MFC-With: d0c737e18

# 2de949cf 02-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Remove mkcsmapper_static and mkesdb_static from build-tools

Build them as part of the bootstrap-tools phase instead.

Reviewed by: emaste (no objections)
Differential Revision: https://reviews.freebsd.org/D28181

# 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

# bbd16236 01-Aug-2021 Wolfram Schneider <wosch@FreeBSD.org>

add the time(1) command to the list of install tools

Reported by: dhw
Approved by: dhw
Differential Revision: https://reviews.freebsd.org/D31373

# 99feb137 01-Aug-2021 Wolfram Schneider <wosch@FreeBSD.org>

`make buildworld' with time logging for each stage

PR: 257141
Reviewed by: sjg,emaste
Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D31154

# 4dbac528 28-Jul-2021 Ed Maste <emaste@FreeBSD.org>

pkgbase: improve pkg --version parsing

In some cases `pkg --version` might produce unexpected or additional
output. Use a regex /^[0-9.]+$/ to match only the line containing the
version number.

Reported by: Michael Butler on freebsd-current@
Fixes: 4e224e4be7c3 ("pkgbase: accommodate pkg < 1.17")
Sponsored by: The FreeBSD Foundation

# 4e224e4b 26-Jul-2021 Ed Maste <emaste@FreeBSD.org>

pkgbase: accommodate pkg < 1.17

6cafdee71d2b adapted the pkgbase build for 1.17, but broke Cirrus-CI's
use of PKG_FORMAT=tar (the quarterly package set still has pkg 1.16).
Because of this I disabled the pkgbase build and test in 2bfba2a04b05.

Now, check `pkg --version` and use the old logic for < 1.17.

To be reverted once we no longer encounter pkg 1.16 in Cirrus-CI (i.e.,
via GCP cloud images) to avoid keeping this extra complexity around.

PR: 257422
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31324

# 6cafdee7 04-May-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Track pkg 1.17

With pkg 1.17 the extention is always .pkg, packing_format is also now deprecated.

# c5d1d88a 05-Jul-2021 Alex Richardson <arichardson@FreeBSD.org>

Don't build lldb-tablegen if MK_LLDB=no

Split out from D31060.

Reviewed by: emaste

# 0333fad1 11-Jun-2021 John Baldwin <jhb@FreeBSD.org>

Remove svnlite.

Reviewed by: bcr, imp, emaste
Differential Revision: https://reviews.freebsd.org/D30737

# e290182b 11-Jun-2021 John Baldwin <jhb@FreeBSD.org>

Remove 'make update'.

In the CVS days this used be a wrapper around either CVS or CVSup and
used to support updating src, doc, and ports checkouts. With the move
to subversion this only supported updating src and was itself a
wrapper around 'svn update'. With Git, users are probably better off
using appropriate Git commands directly to update without needing an
explicit make target as a wrapper.

Reviewed by: bcr, imp, emaste
Differential Revision: https://reviews.freebsd.org/D30736

# 689c7e79 31-May-2021 Mitchell Horne <mhorne@FreeBSD.org>

libpmc: always generate libpmc_events.c

The jevents build tool will create an empty table if it doesn't find any
events, so we can remove the extra $MACHINE_CPUARCH checks.

Reviewed by: gnn, ray, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30531

# c6081dea 21-May-2021 Marcin Wojtas <mw@FreeBSD.org>

Add elfctl to toolchain.

Add elfctl program to toolchain to allow modifying ELF feature flags
during system build.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D29552

# 50179c5ec 23-Mar-2021 Glen Barber <gjb@FreeBSD.org>

Makefile.inc1: unbreak bootstrap when kbdcontrol does not exist

Reviewed by: arichardson
MFC after: 12 hours
MFC target: stable/13, releng/13.0
Differential Review: https://reviews.freebsd.org/D29200
Sponsored by: Rubicon Communications, LLC ("Netgate")

# 4a847a6c 18-Mar-2021 Baptiste Daroussin <bapt@FreeBSD.org>

Revert "bootstrap: add tic to the bootstrap tools"
Since we don't build and install the terminfo db anymore this is not
needed

This reverts commit b6a51d39e3a2e2f75d5b42a8c17a531063258a15.
This reverts commit e5e4845959ac60110677df302a68c220dff75abe.
This reverts commit 0af562d7e1850bbef230d30805c101b26588a3ed.

# e5e48459 01-Mar-2021 Alex Richardson <arichardson@FreeBSD.org>

Makefile.inc1 "Avoid duplicate script for target" warning

This happens if -DBOOTSTRAP_ALL_TOOLS or when building on non-FreeBSD.

# b6a51d39 25-Feb-2021 Baptiste Daroussin <bapt@FreeBSD.org>

bootstrap: fix a last edit typo

Reported by: cy

# 0af562d7 22-Feb-2021 Baptiste Daroussin <bapt@FreeBSD.org>

bootstrap: add tic to the bootstrap tools

tic is necessary early in the build to be able to build the terminfo
database later on.

Tested by: manu, jbeich

# 5cf6f1c4 30-Jan-2021 Alex Richardson <arichardson@FreeBSD.org>

Remove the MK_LIBCPLUSPLUS option

This option has been equivalent to any form of C++ support since libstdc++
was removed. Therefore, replace all MK_LIBCPLUSPLUS uses with MK_CXX.

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

# 123ae304 20-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

build: remove LIBPTHREAD/LIBTHR build options

WITHOUT_LIBTHR has been broken for a little over five years now, since the
xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building
a useful system without threading support is becoming increasingly more
difficult.

Additionally, in the five plus years that it's been broken more reverse
dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among
others) that make it more and more difficult to reconcile the effort needed
to fix these options.

Remove the broken options.

PR: 252760
Reviewed by: brooks, emaste, kib
Differential Revision: https://reviews.freebsd.org/D28263

# 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")

# 26490d9b 18-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: allow update-packages for first-run of packaging

If ${REPODIR}/${PKG_ABI} does not exist when we begin real-update-packages,
skip the comparison with the non-existent previous repository and just
finish the repo off. This allows external scripts to just assume they can
run `update-packages` rather than figuring out if they'd previously run
`packages` for this Version/Arch combo.

PKG_VERSION_FROM_DIR was added so that we could perhaps detect the three
distinct cases:

1.) If the repo has not yet been created, PKG_VERSION_FROM_DIR will be
empty.
2.) If the repo is in some intermediate state between created and fully
initialized, PKG_VERSION_FROM_DIR may point to the ABI directory.
3.) If the repo is fully initialized, then PKG_VERSION_FROM_DIR points to
the latest build to compare to.

Option #2 is explicitly unhandled at the moment, but this is no different
than it was before.

Reviewed-by: manu
Differential-Revision: https://reviews.freebsd.org/D28229

# 613fe532 14-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases

The current postfix conversions are:

CURRENT / STABLE / PRERELEASE, 12.x-CURRENT becomes 12.snapYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1.YYYYMMDDhhmmss
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2.YYYYMMDDhhmmss
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3.YYYYMMDDhhmmss
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1
RELEASE-pX -> pX, so 12.1-RELEASE-p1 becomes 12.1p1

Note that for development branches we will start to drop the minor version
component entirely, which more closely matches how these branches are
physically named (stable/NN).

snap is a new prefix that was added to pkg in [0], which is simply a more
verbose version of the current ".s" used.

As noted, build timestamps are also added to ALPHA/BETA/RC versions. This
is largely irrelevant for re@ snapshots because they will only produce one
set of snapshots for each alpha/beta/rc, but external folks may produce
multiple in that timeframe -- at least for alpha. For them, it is
imperative that the builds have a differentiating characteristic like this
rather than multiple builds across multiple revisions being versioned
identically.

[0] https://github.com/freebsd/pkg/pull/1929

Reviewed by: gjb, manu
Submitted by: rene (original, original version)
Differential Revision: https://reviews.freebsd.org/D28167

# 95ae95d4 18-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: limit PKG_VERSION_FROM calculation to real-update-packages

PKG_ABI is defined in some other targets that do not need to shell out and
calculate PKG_VERSION_FROM. Moreover, it produces extra errors when
bootstrapping an initial pkgbase repo, as the /latest link doesn't exist
yet.

# da8cc827 13-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: collapse -PRERELEASE into STABLE/CURRENT case for version suffix

-PRERELEASE exists as a given stable/X branch while the next minor version
release is in progress. From a functional standpoint, it should be treated
as -STABLE since it'll typically be a superset of what's included in the
concurrent releng branch.

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D28166

# 9af9e7c5 15-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: default to installing all specified kernels

These only get staged off to the side, not installed into the system. Let's
change the default for packages/update-packages to be less surprising.

MFC after: 1 week
Reviewed by: manu, meena <me igalic co>
Differential Revision: https://reviews.freebsd.org/D28190

# 03cab14e 14-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

Revert "pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases"

This reverts commit aef769614f921660cb0262412426034cf5395ae5.

While the package names are a bit prettier this confuse pkg about upgrading :
$ pkg version -t 13.0.s2021011313063 13.0.a1
>
$ pkg version -t 13.0.s2021011313063 13.0_ALPHA1
<

Note that the current scheme isn't good when bumping from ALPHA to BETA or
even BETA to RC:
$ pkg version -t 13.0_ALPHA1 13.0_BETA1
=
$ pkg version -t 13.0_BETA1 13.0_RC1
=

But more thoughts have to be put into this renaming.

# aef76961 14-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases

The current postfix conversions are:

CURRENT / STABLE -> .sYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3
PRERELEASE -> .p, so 11.3-PRERELEASE becomes 11.3.p
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1

Submitted by: rene (original version)
Differential Revision: https://reviews.freebsd.org/D20734

# 44b8b2a0 16-Dec-2020 Bryan Drewery <bdrewery@FreeBSD.org>

Makefile.inc1: Avoid using release/Makefile for VERSION.

release/Makefile.inc1 has git executions that were being ran for each of
these lookups. The results were not needed so just lookup what we want
directly instead.

Reviewed by: gjb, rlibby, emaste (maybe)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27643

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

Rename NO_WERROR -> MK_WERROR=no

As suggested in D27598. This also supports MK_WERROR.clang=no and
MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses.

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

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

Stop passing MK_WARNS=no for bootstrap tools

I got annoyed by the number of warnings that the CheriBSD build was
emitting. It turns out that we are emitting lots of warnings during
bootstrap because bootstrap tools are built with the default compiler
flags and ignore the warnings flags that are set in bsd.sys.mk.

Looking at git blame, it appears that MK_WARNS=no has been passed since
rS112869, replacing the -DNO_WERROR option that was added in rS87775.

This commit changes MK_WARNS=no back to -DNO_WERROR. We need to pass
-DNO_WERROR, since the system compiler might have new warnings that we
don't know about yet, and we shouldn't fail the build in that case.

Reviewed By: imp, brooks
Differential Revision: https://reviews.freebsd.org/D27598

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

Add mkimg to the list of bootstrap tools

Having this as part of the bootstrap tools is useful to build disk images
to boot in QEMU (especially when building on a Linux/macOS host where
mkimg is not available). We have been bootstrapping mkimg in CheriBSD for
a long time (using LOCAL_XTOOL_DIRS) but I believe this is also useful
upstream.

Reviewed By: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D27602

# f1829643 06-Jan-2021 Toomas Soome <tsoome@FreeBSD.org>

vtfontcvt is part of bootstrap toolset and should always be built

Reported by: Peter Jeremy

# 821aa63a 04-Jan-2021 Baptiste Daroussin <bapt@FreeBSD.org>

ncurses: only keep the version with widechar support

Only keep the widechar version of ncurses as libncursesw.so.9

Keep the old name to avoid breaking the ABI compatibility (the non
widechar version libncurses.so.9 is not binary compatible with
libncursesw.so.9) since all ports and base are already only linking
against the widechar version we can simply remove libncurses.so.9

Since the .9 version only lived in the dev branch and never ended in a
release, it is simply removed and not added to any binary compat
package.

Add symlinks to keep build time compatibility for anyone linking against
-lncurses

# 4401fa9b 04-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: rename PKGSIGNKEY to PKG_REPO_SIGNING_KEY

this way, it'll be automatically picked up by poudriere
That's quite handy when building pkgbase!

Submitted by: Mina Galić <me@igalic.co>
Reviewed By: bapt, bcr (manpages)
Differential Revision: https://reviews.freebsd.org/D27690

# fe7dff17 15-Dec-2020 Ed Maste <emaste@FreeBSD.org>

Remove additional GDB leftovers missed in r368667

# f7ff7baa 04-Dec-2020 Alex Richardson <arichardson@FreeBSD.org>

crunchgen: fix NULL-deref bug introduced in r364647

While porting over the local changes from CheriBSD for upstreaming, I
accidentally committed a broken version of find_entry_point(): we have to
return NULL if the value is not found instead of a value with
ep->name == NULL, since the checks in main were changed to check ep instead
of ep->name for NULL.

This only matters if the crunched tool cannot be found using normal lookup
and one of the fallback paths is used, so it's unlikely to be triggered
in rescue. However, I noticed that one of our CheriBSD test scripts was
failing to run commands under `su` on minimal disk images where all
binaries are hardlinks to a `cheribsdbox` tool generated with crunchgen.

This also updates the bootstrapping check in Makefile.inc1 to bootstrap
crunchgen up to the next version bump.

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D27474

# 80cedb80 20-Nov-2020 Bryan Drewery <bdrewery@FreeBSD.org>

Add lists for customizing legacy and bootstrap-tools.

Reviewed by: arichardson
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27200

# 4ae78e70 20-Nov-2020 Alfredo Dal'Ava Junior <alfredo@FreeBSD.org>

[POWERPC64LE,POWEPCSPE] set default kernel config for powerpc64le and powerpcspe variants

Default KERNCONF for powerpc64le should be GENERIC64, and powerpcspe should
select MPC85XXSPE

Reviewed by: bdragon,emaste
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D27257

# 0e55bb7b 13-Nov-2020 Alex Richardson <arichardson@FreeBSD.org>

Makefile.inc1: remove no-longer required variable

This variable is unsed since r364760 but I forgot to delete it in that commit.

Reported By: bdrewery

# 8da6fc4d 04-Nov-2020 John-Mark Gurney <jmg@FreeBSD.org>

fix the docs, this was always wrong... In some cases, DISTDIR is set
automatically by tools via /etc/make.conf, so remind people (me) where
to find where it's set..

It would be nice for someone to document what DISTDIR is better than:
where the file for a distribution gets installed

# 0ac8aa55 02-Nov-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add incremental packages

This adds a new target update-packages which will create the new packages
compared to the last run.

This is how to use it:
At this point we cut a release
$ make buildworld ...
$ make buildkernel
$ make packages

There is now a PKG_VERSION directory with latest link pointing to it
Distribute the packages to server

$ something something that update the source tree
$ make buildworld ...
$ make buildkernel
$ make update-packages
You know have a PKG_VERSION directory in the REPODIR and latest link pointing to it.
In PKG_VERSION dir only the packages which differs from the latest run are
named PKG_VERSION, otherwise the old packages are there.

The process is :
Build the new packages in the PKG_VERSION directory
Compare the internal data with the PKG_VERSION_FROM version. The comparison is done
by checking the internal hash of the packages.
By default PKG_VERSION_FROM is set to what the latest link points to.
If the old and new version matches, we rm the new package and cp the old one.

Differential Revision: https://reviews.freebsd.org/D25984

# 73577bf0 24-Oct-2020 Ryan Moeller <freqlabs@FreeBSD.org>

flua: Add a libjail module

libjail is pretty small, so it makes for a good proof of concept demonstrating
how a system library can be wrapped to create a loadable Lua module for flua.

* Introduce 3lua section for man pages
* Add libjail module

Reviewed by: kevans, manpages
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D26080

# 3ac62888 18-Oct-2020 Alex Richardson <arichardson@FreeBSD.org>

Significantly speed up mkimg_test

It turns out that the majority of the test time for the mkimg tests isn't
mkimg itself but rather the use of jot and hexdump which can be quite slow
on emulated platforms such as QEMU.

On QEMU-RISC-V this reduces the time for `kyua test mkimg_test` from 655
seconds to 200. And for CheriBSD on QEMU-CHERI this saves 4-5 hours (25%
of the time for the entire testsuite!) since jot ends up triggering slow
functions inside the QEMU emulation a lot.

Reviewed By: lwhsu
Differential Revision: https://reviews.freebsd.org/D26796

# e5ccad50 12-Oct-2020 Alex Richardson <arichardson@FreeBSD.org>

Fix build with -DBOOTSTRAP_ALL_TOOLS

sbin/sysctl can no longer be bootstrapped on FreeBSD 12 after r366465,
so create a symlink to the host tool instead of trying to build it.

# 55be47b8 29-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

Makefile.inc1: sysent: allow subordinate sysent targets to run in parallel

makesyscalls.lua (and indeed makesyscalls.sh) are both safe to be run in
parallel, so let's do it.

This is a trivial difference because runtime per-target is pretty small, but
I like seeing it run in parallel when my muscle memory types `make -sj4`.

Reviewed by: brooks, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26594

# b75abea4 22-Sep-2020 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC64LE] Set up powerpc.powerpc64le architecture

This is the initial set up for PowerPC64LE.

The current plan is for this arch to remain experimental for FreeBSD 13.

This started as a weekend learning project for me and kinda snowballed from
there.

(More to follow momentarily.)

Reviewed by: imp (earlier version), emaste
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D26399

# 6129f33e 21-Sep-2020 Alex Richardson <arichardson@FreeBSD.org>

Prefer bootstrapped tools when running certctl.sh

Otherwise we get lots of warnings when building on Linux/macOS during
installworld:
Scanning /local/scratch/alr48/cheri/output/freebsd-x86/usr/share/certs/blacklisted for certificates...
install: invalid option -- 'U'
Try 'install --help' for more information.
install: invalid option -- 'U'
....

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D26481

# e307eb94 21-Sep-2020 Toomas Soome <tsoome@FreeBSD.org>

loader: zfs should support bootonce an nextboot

bootonce feature is temporary, one time boot, activated by
"bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.

By default, the bootonce setting is reset on attempt to boot and the next
boot will use previously active BE.

By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will
be set permanently active.

bootonce dataset name is recorded in boot pool labels, bootenv area.

in case of nextboot, the nextboot_enable boolean variable is recorded in
freebsd:nvstore nvlist, also stored in boot pool label bootenv area.
On boot, the loader will process /boot/nextboot.conf if nextboot_enable
is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf
processing on next boot.

bootonce and nextboot features are usable in both UEFI and BIOS boot.

To use bootonce/nextboot features, the boot loader needs to be updated on disk;
if loader.efi is stored on ESP, then ESP needs to be updated and
for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated
(gpart or other tools).

At this time, only lua loader is updated.

Sponsored by: Netflix, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25512

# fe815331 18-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

build: provide a default WARNS for all in-tree builds

The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by: emaste, brooks, ngie (all earlier version)
Reviewed by: emaste, arichardson (depend-cleanup.sh change)
Differential Revision: https://reviews.freebsd.org/D26455

# ca4b73c3 17-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

Promote the installworld `certctl rehash` to distributeworld

Contrary to my belief, installworld is not sufficient for getting certs
installed into VM images. Promote the rehash to both installworld and
distributeworld (notably: not stageworld) and rehash the base distdir so we
end up with /etc/ssl/certs populated in the base dist archive. A future
commit will remove the rehash from bsdinstall, which doesn't really need to
happen if they're installed into base.txz.

While here, fix a minor typo: s/CERTCLTFLAGS/CERTCTLFLAGS/

MFC after: 1 week

# 185e8af0 16-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

installworld: run `certctl rehash` after installation completes

This was originally introduced back in r360833, and subsequently reverted
because it was broken for -DNO_ROOT builds and it may not have been the
correct place for it.

While debatably this may still not be 'the correct place,' it's much cleaner
than scattering rehashes all throughout the tree. brooks has fixed the issue
with -DNO_ROOT by properly writing to the METALOG in r361397.

Do note that this is different than what was originally committed; brooks
had revisions in D24932 that made it actually use the revised unprivileged
mode and write to METALOG, along with being a little more friendly to
foreign crossbuilds and just using the certctl in-tree.

With this change, I believe we should now have a populated /etc/ssl/certs in
the VM images.

MFC after: 1 week

# 073e4094 13-Sep-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove more old stale depend hacks

Current stale dependency hacks are in tools/build/depend-cleanup.sh.
These ones were almost a year old; remove them from Makefile.inc1.

# b7b5bdba 10-Sep-2020 Alex Richardson <arichardson@FreeBSD.org>

Ensure that the makewhatis symlink is added in the bootstrap-tools stage

We currently set MK_MAN=no in $BSARGS so MK_MAN_UTILS will also be false
which means that the makewhatis symlink will not be created.
This change fixes the build when using both -DBUILD_WITH_STRICT_TMPPATH and
-DBOOTSTRAP_ALL_TOOLS.

Tested by: andrew
Differential Revision: https://reviews.freebsd.org/D16761

# 75766799 07-Sep-2020 Ed Maste <emaste@FreeBSD.org>

Add WITH_/WITHOUT_CLEAN option to replace NO_CLEAN

This allows use of the standard src.conf configuration for controlling
whether the tree is cleaned before build or not. The default is still
to clean.

Setting either NOCLEAN or NO_CLEAN will mention the new src.conf option.
NOCLEAN remains a .warning, while for now NO_CLEAN is .info.

Reviewed by: bdrewery (earlier version)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22762

# 30d46e45 31-Aug-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: comment .endif to ease finding matching .if

# e2515283 27-Aug-2020 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)


# cd568e2b 27-Aug-2020 Ryan Moeller <freqlabs@FreeBSD.org>

libzfs: Also add the crypto dependency to Makefile.inc1

Reported by: kevans
Discussed with: kevans
Sponsored by: iXsystems, Inc.

# 3ce13dbc 25-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Use bootstrapped install(1) install of tools/install.sh in world stage

This should be noticeably faster due to fewer processes being forked and
also handles other flags such as -S or writing to METALOG.

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

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

Fix running the builddtb target on a noexec file system

Obtained from: CheriBSD

# 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

# 9e5787d2 24-Aug-2020 Matt Macy <mmacy@FreeBSD.org>

Merge OpenZFS support in to HEAD.

The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.

I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.

Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.

Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.

Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.

Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872

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

# ebae797c 24-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Also print number of available CPUs on Linux

Without this change the buildworld/buildkernel epilogue looks like this:
>>> World built in 249 seconds, sysctl: cannot stat /proc/sys/hw/ncpu: No such file or directory
ncpu: , make -j72.

Reviewed By: emaste, bdrewery
Differential Revision: https://reviews.freebsd.org/D26056

# 0f31fdf2 24-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Pass the installworld install(1) flags to make buildenv

This ensure that running make install inside buildenv correctly includes
the METALOG flags when building with -DNO_ROOT.

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

# 530134d2 21-Aug-2020 Bjoern A. Zeeb <bz@FreeBSD.org>

After the clang/llvm version 11 import LLD_VERSION is no longer used
upstream so Version.inc now only defines LLD_VERSION_STRING.

This breaks the WANT_LINKER_VERSION magic and might lead to us building
more than needed (e.g., for croos-tools).

Change the awk script to parse LLD_VERSION_STRING instead of LLD_VERSION,
which not only unbreaks the current situation but should also be backwards
compatible as dim points out.

PR: 248818
Reviewed by: emaste, dim (seems right and the way to go)
MFC after: 4 weeks
X-MFC before: 364284

# 440cec3f 12-Aug-2020 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)


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

Fix -DBUILD_WITH_STRICT_TMPPATH dtrace builds

Some of the scripts used for libdtrace invoke nawk instead of awk
(for example cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh).
When bootstrapping all tools, we get the nawk -> awk link while building
usr.bin/awk, but when linking/copying the dependencies from the host we
were only adding awk but not nawk.

This was silently generating invalid files when building libdtrace with
BUILD_WITH_STRICT_TMPPATH=1 since those scripts invoke nawk instead of
awk. In addition to adding the missing link this commit also adds
set -e to those scripts to catch errors like this in the future.

Reviewed By: markj, emaste
Differential Revision: https://reviews.freebsd.org/D26025

# 1a18ab42 11-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Allow overriding the tool used for stripping binaries

Since the make variable STRIP is already used for other purposes, this
uses STRIPBIN (which is also used for the same purpose by install(1).
This allows using LLVM objcopy to strip binaries instead of the in-tree
elftoolchain objcopy. We make use of this in CheriBSD since passing
binaries generated by our toolchain to elftoolchain strip sometimes results
in assertion failures.

This allows working around https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248516
by specifying STRIPBIN=/path/to/llvm-strip

Obtained from: CheriBSD
Reviewed By: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D25988

# a90022d4 11-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Replace / with | for PKG_WWW

PKG_WWW contain / char, replace the delimiter by a '|'.

Reported by: 0mp

# 82087d4b 11-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add PKG_NAME_PREFIX, PKG_MAINTAINER and PKG_WWW

This is useful for downstream users to customize the packages.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D26019

# 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

# 0d834e0f 07-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Fix duplicate assignment of _localedef in Makefile.inc1

The same .if exists a few lines below.

# 70fc0cc3 06-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add the possibility to choose the output dir

The output dir is set to ${REPODIR}/${PKG_ABI}/${PKG_VERSION} now.
Add the possibility to specify the last componant and set it by default
to ${PKG_VERSION} as before.
This is useful for tests and also for building packages with the same
PKG_VERSION provided to check differences.

# d0327929 06-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add a new variable PKG_TIMESTAMP

libarchive uses the SOURCE_DATE_EPOCH env variable to set the date of file
in an archive, this is useful for reproducibility.
Add a variable name PKG_TIMESTAMP that take a epoch time and set SOURCE_DATE_EPOCH
to this. By default it is the current time so no changes here.

# eb578fec 03-Aug-2020 Kyle Evans <kevans@FreeBSD.org>

Ensure libregex is built in time for googletest

In lib/Makefile, we document the dependency with SUBDIR_DEPEND

For buildworld orchestration, just prebuild libregex if GOOGLETEST is
enabled. googletest will get built in a later pass.

# 40056899 16-Jul-2020 Glen Barber <gjb@FreeBSD.org>

Move GIT_CMD a few lines down, so it is not in between SVN_*
lines.

Sponsored by: Rubicon Communications, LLC (netgate.com)

# ff1031c1 16-Jul-2020 Glen Barber <gjb@FreeBSD.org>

Add GIT_CMD, similar to SVN_CMD.

Sponsored by: Rubicon Communications, LLC (netgate.com)

# 0a9ab9f5 24-Jun-2020 Conrad Meyer <cem@FreeBSD.org>

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT. Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

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

# a19aa4f7 21-Jun-2020 Kyle Evans <kevans@FreeBSD.org>

Squash liblzma build race

As of r362452, liblzma depends on libmd but the buildworld build order
hadn't been amended to document the new dependency.

Reported by: jenkins via freqlabs
X-MFC-With: r362452

# 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

# 74e8d41e 06-Jun-2020 Ed Maste <emaste@FreeBSD.org>

Retire BINUTILS and BINUTILS_BOOTSTRAP options

As of r361857 all BINUTILS options are disabled by default - ports
have been changed to depend on binutils if they require GNU as, and
all base system assembly files have been switched to use Clang's
integrated assembler.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation

# 5843b6e7 05-Jun-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove stale dependency cleanup from 2018

# 694034e2 30-May-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove BINUTILS_BOOTSTRAP linker support

As of r359347 BINUTILS_BOOTSTRAP does not include the bfd linker.

# 697b271d 20-May-2020 Ed Maste <emaste@FreeBSD.org>

pkgbase: use -dev,-dbg instead of -development,-debug

-development is long and awkward, and is also inconsistent with prior art
from the Linux world, which uses -dev (Debian) or -devel (Red Hat). Follow
the Debian convention, and similarly for debug info packages.

Also remove redundant pkgbase development tag from includes. We already tag
include files with package=runtime,dev; there is no need to separately tag
them as dev.

Discussed with: bapt
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24139

# 20076f97 17-May-2020 Kyle Evans <kevans@FreeBSD.org>

Revert r360833, r360882: certctl rehash in installworld

This was solving the correct-ish problem in the wrong place. Noted by
brooks; while he didn't request a prompt revert, doing so now will
facilitate proper testing for the revised version of this.

# a93817e0 10-May-2020 Kyle Evans <kevans@FreeBSD.org>

buildworld: add back in missing semicolon

if foo; then blah else blah; fi has a drastically different meaning than
if foo; then blah; else blah; fi. Fix it.

Reported by: 0mp
X-MFC-With: r360833

# 70868d48 08-May-2020 Kyle Evans <kevans@FreeBSD.org>

installworld: attempt a certctl rehash at the tail end

This can be run as root or normal user with no problem; if they hadn't
twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to
rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL +
WITH_CAROOT with a populated /etc/ssl that they can then use with an
appropriate *ssl from somewhere else.

Cross-builds are fine because this will always use the host certctl, or just
nag if it's missing and it wasn't a WITHOUT_CAROOT build.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24641

# 61fbd61b 25-Apr-2020 Dimitry Andric <dim@FreeBSD.org>

Fix race between prebuilding libsbuf and libgeom

The latter needs the former, but with a multi-job build on a fast
machine, the race is sometimes lost. This leads to "ld: error: unable to
find library -lsbuf", when linking libgeom.so.

Submitted by: kevans
MFC after: 3 days

# 6fe257c7 13-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

Move shm_open dependency cleanup into a new home

r359461 introduced this nifty script to centralize these things, so add
shm_open.c there to remove a total of one (1) bad example from
Makefile.inc1.

Looked over by: emaste

# a8b8edb2 06-Apr-2020 Maxim Sobolev <sobomax@FreeBSD.org>

Normalize deployment tools usage and definitions by putting into one place
instead of sprinkling them out over many disjoint files. This is a follow-up
to achieve the same goal in an incomplete rev.348521.

Approved by: imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20520

# f382bac4 06-Apr-2020 Brooks Davis <brooks@FreeBSD.org>

Fix compilation with upstream clang builtin headers.

By using -nobuiltininc and adding the clang builtin headers resource dir
to the end of the compiler header search path, we can still find headers
such as immintrin.h but find the FreeBSD version of stddef.h/stdarg.h/..
first.

This is a workaround until we are able to settle on and complete a plan
to harmonize guard macros with LLVM. We've mostly worked out this on
FreeBSD systems by removing select headers from the installed set of
devel/llvm*, but that isn't a good solution for cross build.

Submitted by: arichardson
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17002

# e40fa28f 03-Apr-2020 Brooks Davis <brooks@FreeBSD.org>

Pass the real value of MK_TESTS_SUPPORT to distribution.

This allows kyua's config file to actually be installed.

Reported by: arichardson
Reviewed by: arichardson
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24268

# 4dad87a4 30-Mar-2020 Ed Maste <emaste@FreeBSD.org>

add shell script for stale dependency hack

It's rather awkward to debug issues with the dependency cleanup hacks
when implemented via make. Add a cleanup shell script and move the
libomp hack there as an initial example.

Reviewed by: brooks
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24228

# c42a6767 30-Mar-2020 Brooks Davis <brooks@FreeBSD.org>

Relax existence check of ${LOCALBASE}/bin/kyua

After the base kyua import the testsuite can utilize the in-base kyua
just fine.

Submitted by: Dries Michiels
Differential Revision: https://reviews.freebsd.org/D24230

# be2af8fb 27-Mar-2020 Brooks Davis <brooks@FreeBSD.org>

Use the real value of MK_TESTS_SUPPORT in _libraries.

We need to build kyua libraries for kyua. Because we set MK_TESTS=no,
we can't not set MK_TESTS_SUPPORT=${MK_TESTS_SUPPORT} because the latter
defaults MK_TESTS_SUPPORT to no.

This fixes WITHOUT_TESTS + WITH_TESTS_SUPPORT builds.

Reported by: Ruslan Garipov
Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24206

# eb61f7bd 26-Mar-2020 Emmanuel Vadot <manu@FreeBSD.org>

Stop building libl and liby

Those libs aren't needed anymore so stop building them for the bootstrap tools
or the compat libs.

Reviewed by: bapt, emaste
X-Differential Revision: D24171

# 52de22ca 24-Mar-2020 Mitchell Horne <mhorne@FreeBSD.org>

Makefile.inc1: override MACHINE for native-xtools

For the final step of the native-xtools target, "everything" is built
with TARGET and TARGET_ARCH set to the architecture we wish to
cross-build for. However, CROSSENV overwrites the values of MACHINE and
MACHINE_ARCH, setting them to be identical to TARGET and TARGET_ARCH.
For native-xtools this is undesirable since we are building binaries to
run on the host architecture, that can cross compile for the target
architecture.

When building native-xtools for RISC-V, this issue manifests as an invalid
argument for "-march". The compiler is invoked with the target triple of the
host architecture, but the CFLAGS inherited from bsd.cpu.mk are that of the
target architecture.

Reviewed by: imp, bdrewery
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23838

# f1af40b5 24-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove old (2018) stale dependency hacks

We handle a number of stale dependency issues on an ad-hoc basis, in
order to support ongoing NO_CLEAN builds. These hacks do not need to
be maintained indefinitely; now remove those for issues that are more
than a year old.

Sponsored by: The FreeBSD Foundation

# c260dbfb 21-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: set DB_FROM_SRC also for stageworld

stageworld, invoked from e.g. `make packages`, shouldn't rely on the
build host's users/groups.

Sponsored by: The FreeBSD Foundation

# dadc342d 18-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Revert r359083, fixed properly by r359088

r359083 introduced a workaround for stale libomp dependencies during a
regular (no -DNO_CLEAN) buildworld. r359088 addressed the reason the
clean step missed libomp, so revert the workaround.

Sponsored by: The FreeBSD Foundation

# 0d02682c 18-Mar-2020 Ed Maste <emaste@FreeBSD.org>

invoke _cleanobj_fast_depend_hack unconditionally

Apparently make ${CLEANDIR} is leaving stale entries in .depend files;
for now invoke the hacky cleanup in both the -DNO_CLEAN and normal
(no -DNO_CLEAN) cases.

In collaboration with: dim
Sponsored by: The FreeBSD Foundation

# 564b9ff2 17-Mar-2020 Brooks Davis <brooks@FreeBSD.org>

Add an internal liblua and use it in flua.

The new liblua will be used in a forthcoming import of kyua.

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

# dfcef1de 17-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: add a note when deleting stale dependencies

We have ad-hoc stale dependency handling in Makefile.inc1 to handle the
cases where file extensions change, but it appears that some cases are
not functional. Add a note when about to clean stale deps to help
when investigating failure reports.

Sponsored by: The FreeBSD Foundation

# 450cc341 12-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: move dependency hack comment to the block it applies to

# 3b1781b4 12-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Extend r358907 to explicitly remove stale lib32 dependency

After r325072 stale lib32 dependencies were not remooved. A more
holistic approach is needed to address this but for the immediate issue
(-DNO_CLEAN builds across r358851) just readd the explicit lib32 path.

Reported by: dim
Sponsored by: The FreeBSD Foundation

# 0efe25f9 12-Mar-2020 Dimitry Andric <dim@FreeBSD.org>

Allow -DNO_CLEAN build across r358851.

The openmp 10.0.0 import renamed one .c file to .cpp, and this is
something our dependency system does not handle correctly. Add another
ad-hoc cleanup to get rid of the stale dependency.

PR: 244251
MFC after: 6 weeks
X-MFC-With: 358851

# 13f7dbe8 09-Mar-2020 Ed Maste <emaste@FreeBSD.org>

retire amd(8)

autofs was introduced with FreeBSD 10.1 and is the supported method for
automounting filesystems. As of r296194 the amd man page claimed that it
is deprecated. Remove it from base now; the sysutils/am-utils port is
still available if necessary.

Discussed with: cy
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

# 134b3783 29-Feb-2020 Ed Maste <emaste@FreeBSD.org>

retire in-tree GPL dtc devicetree compiler

Now that we no longer have GCC 4.2.1 in the tree and can assume FreeBSD
is being built with a C++11 compiler available, we can use BSDL dtc
unconditionally and retire the GPL dtc.

GPL dtc now has FreeBSD CI support via Cirrus-CI to help ensure it
continues to build/work on FreeBSD and is available in the ports tree
if needed.

The copy of (copyfree licensed) libfdt that we actually use is in
sys/contrib/libfdt so the extra copy under contrib/dtc/libfdt can be
removed along with the rest of the GPL dtc.

Reviewed by: kevans, ian, imp, manu, theraven
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23192

# c4501804 28-Feb-2020 Ed Maste <emaste@FreeBSD.org>

retire the LLVM_LIBUNWIND option

LLVM's libunwind is used on all FreeBSD-supported CPU architectures and
is a required component.

Reviewed by: brooks (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23123

# 57f80467 28-Feb-2020 Ed Maste <emaste@FreeBSD.org>

remove GCC 4.2.1 build infrastructure

As described in Warner's email message[1] to the FreeBSD-arch mailing
list we have reached GCC 4.2.1's retirement date. At this time all
supported architectures either use in-tree Clang, or rely on external
toolchain (i.e., a contemporary GCC version from ports).

GCC 4.2.1 was released July 18, 2007 and was imported into FreeBSD later
that year, in r171825. GCC has served us well, but version 4.2.1 is
obsolete and not used by default on any architecture in FreeBSD. It
does not support modern C and does not support arm64 or RISC-V.

Thanks to everyone responsible for maintaining, updating, and testing
GCC in the FreeBSD base system over the years.

So long, and thanks for all the fish.

[1] https://lists.freebsd.org/pipermail/freebsd-arch/2020-January/019823.html

PR: 228919
Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23124

# eb834d9f 19-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Take LINKER_FREEBSD_VERSION from numerical field after dash

Summary:
With COMPILER_FREEBSD_VERSION, we use a numeric value that we bump each
time we make a change that requires re-bootstrapping, but with the
linker variant, we instead take the entire part after "FreeBSD", as in
this example version output:

LLD 9.0.1 (FreeBSD c1a0a213378a458fbea1a5c77b315c7dce08fd05-1300006) (compatible with GNU linkers)

E.g., LINKER_FREEBSD_VERSION is currently being set to
"c1a0a213378a458fbea1a5c77b315c7dce08fd05-1300006". This means that
*any* new upstream lld version will cause re-bootstrapping.

We should only look at the numerical field we append after a dash
instead. This review attempts to make it so.

The only thing I am not happy about is the post-processing of awk output
in Makefile.inc1. I notice that our awk does not have gensub(), so it
can't substitute a numbered sub-regex with \1, \2, etc. Suggestions
welcome. :)

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23691

# 75ababf8 06-Feb-2020 Warner Losh <imp@FreeBSD.org>

Restore missing comment

I was overly agressive about removing the entire comment. It was still
valid, except the part about being only for some architectures.

Reviewed by: emaste
Differenial Revision: https://reviews.freebsd.org/D23523

# 5672c764 02-Feb-2020 Warner Losh <imp@FreeBSD.org>

Per the firm plan, start to remove sparc64

The sparc64 architecture is being removed from FreeBSD 13, starting
now. This removes it from the top level only. It is the only
architecture that didn't see substantial work after the call to get
things working with the external toolchain.

# 43e84039 31-Jan-2020 Ed Maste <emaste@FreeBSD.org>

retire BSD_CRTBEGIN option

BSD crt is currently used on all architectures (other than sparc64).
Remove the option and use BSD crt everywhere as part of the GCC 4.2.1
retirement plan.

https://lists.freebsd.org/pipermail/freebsd-arch/2020-January/019823.html

PR: 239851
Reviewed by: andrew, brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23122

# 7ec5e1c4 22-Jan-2020 John Baldwin <jhb@FreeBSD.org>

Remove support for auto-selecting an external binutils.

All of the in-tree architectures not supported by in-tree binutils are
supported by lld, so the condition is now always false. It also
didn't fully work since the external binutils are installed into a
directory that uses the host's OS version, not the target OS version.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D23294

# 9ccace3f 19-Jan-2020 Ed Maste <emaste@FreeBSD.org>

pkgbase: allow the pkg format to be overridden

Compressing .txz packages can be rather slow, and speed is likely more
important than disk space during development. Allow package format to
be set via PKG_FORMAT make variable.

Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23257

# c530c791 18-Jan-2020 Ed Maste <emaste@FreeBSD.org>

pkgbase: cache pkg ABI for all world/kernel packages

Rather than invoking `pkg config ABI` repeatedly.

Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23255

# 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

# 7c883770 08-Jan-2020 Ed Maste <emaste@FreeBSD.org>

Remove prereq lib support for GNU unwinder

LLVM's libunwind is used for all archs, as of r356514. As GCC 4.2.1
will soon be removed, and with it the GNU unwinder, start simplifying
the prereq/startup lib logic in Makefile.inc1. From here if there are
any unwinder bugs (on any arch) the path foward is to fix LLVM's
libunwind.

# cd0d51ba 04-Jan-2020 Kyle Evans <kevans@FreeBSD.org>

Provide libssp based on libc

For libssp.so, rebuild stack_protector.c with FORTIFY_SOURCE stubs that just
abort built into it.

For libssp_nonshared.a, steal stack_protector_compat.c from
^/lib/libc/secure and massage it to maintain that __stack_chk_fail_local
is a hidden symbol.

libssp is now built unconditionally regardless of {WITH,WITHOUT}_SSP in the
build environment, and the gcclibs version has been disconnected from the
build in favor of this one.

PR: 242950 (exp-run)
Reviewed by: kib, emaste, pfg, Oliver Pinter (earlier version)
Also discussed with: kan
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22943

# 36afd1d2 03-Jan-2020 Kyle Evans <kevans@FreeBSD.org>

Makefile.inc1: remove libcompiler_rt from _startup_libs

libcompiler_rt is already present in _prereq_libs, which will get built just
before _startup_libs and in advance of shared libc. Dedupe.

# 39eb07f1 02-Jan-2020 John Baldwin <jhb@FreeBSD.org>

Look for cross toolchain makefiles in /usr/share/toolchains.

The freebsd-binutils and freebsd-gcc* packages install toolchain
makefiles to /usr/share/toolchains rather than LOCALBASE.

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

# eb4977bd 01-Jan-2020 Warner Losh <imp@FreeBSD.org>

Remove arm/arm as a valid target.

TARGET=arm now defaults to TARGET_ARCH=armv7
TARGET_ARCH=arm is no longer valid.

Bump __FreeBSD_version to 1300073

Tested with make universe. Any stale LINT-V5 config files remaining in the tree
will fail the universe build. However, LINT-V5 was removed in r355119.

This retirement has been planned since last summer. The armv5 port is fragile:
it works OK for some peeople, and fails badly for others. There's a number of
subtle bugs in busdma, pmap and other MD parts of thee system that present
themselves under load or in unusual circumstances (like fsck after a
crash). stable/8, branched 10 years ago, was the last reliable release. Since
the support burden is larger then the benefit, the consensus view is armv5
should be removed from the tree.

Discussed with: arm@ mailing list and arm developer community.

# f6e159c6 13-Dec-2019 Ed Maste <emaste@FreeBSD.org>

revert r355609

# c039e959 11-Dec-2019 Ed Maste <emaste@FreeBSD.org>

libpmc: build json event support also on arm64

# 0ecf09af 11-Dec-2019 Ed Maste <emaste@FreeBSD.org>

connect arm linuxulator to top-level make sysent

Reported by: kevans

# c590fd27 11-Dec-2019 Ed Maste <emaste@FreeBSD.org>

Make NOCLEAN an error instead of a warning

The warning was added in r289728 (over four years ago) and at that time
NO_CLEAN was already the correct spelling for over a decade.

Make NOCLEAN an error as the next step to removing these backward
compatibility shims.

# 3e105562 26-Nov-2019 Ed Maste <emaste@FreeBSD.org>

Update Makefile.inc1 dtc comment

We use the BSDL dtc by default now (as long as we're using a C++11
compiler).

# 97900b44 19-Nov-2019 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_LINKER: Fix rebuilding lld every time.

This is due to LLD_REVISION_STRING being renamed to LLD_REVISION in
r351442 and the value being moved to another location in r351965.

`make test-system-linker` can be used to see the values being used here.

Reported by: ler

# 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

# 9d919726 13-Nov-2019 John Baldwin <jhb@FreeBSD.org>

Refine r354661 to unbreak the GCC_BOOTSTRAP case.

MK_CLANG_IS_CC controls installing links for GCC, not just clang. Set
MK_CLANG_IS_CC to the value of MK_CLANG_BOOTSTRAP. This will leave it
as "no" if no bootstrap compiler is being built or GCC 4.2.1 is being
used as the bootstrap compiler, and "yes" if clang is being used as
the bootstrap compiler.

Submitted by: bdrewery (kind of, he suggested this on IRC while I was
testing the original patch)
Reviewed by: kevans, imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D22350

# a99d99e5 12-Nov-2019 John Baldwin <jhb@FreeBSD.org>

Force MK_CLANG_IS_CC on in XMAKE.

This ensures that a bootstrap clang compiler is always installed as cc
in WORLDTMP. If it is only installed as 'clang' then /usr/bin/cc is
used during the build instead of the bootstrap compiler.

Reviewed by: imp
MFC after: 1 month
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D22332

# c723af11 08-Nov-2019 Ed Maste <emaste@FreeBSD.org>

suggest xtoolchain package if binutils and GCC bootstraps are both broken

Previously we checked for only BINUTILS_BOOTSTRAP as a broken option
and suggested installing the binutils package. This was originally done
for arm64 where we used the in-tree Clang with external binutils package.

Add a case to the warning to suggest instead the full xtoolchain package
if we have no in-tree compiler either.

Differential Revision: https://reviews.freebsd.org/D21851

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

Revert r354518 and commit the intented fix rather than the diagnostic
check.

This fixes the definition of MK_LIB32 in Makefile.inc1.

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

Fix the ARCH check for LIB32 from Makefile.inc1.

# 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

# 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

# 4196949c 23-Oct-2019 John Baldwin <jhb@FreeBSD.org>

Strip "sf" suffix when generating a target triple.

This fixes the target triple used when compiling riscv64sf with clang.

Discussed with: mhorne
MFC after: 2 weeks
Sponsored by: DARPA

# dfe76e95 21-Oct-2019 Ed Maste <emaste@FreeBSD.org>

Additional fix for -DNO_CLEAN build across r353340 and r353381

opensolaris_atomic.S is now only used on i386 with opensolaris_atomic.c
used on other platforms. After r353381 it doesn't exist on those
platforms so the stale dependency would result in a build error.

r353408 addressed this issue for cddl/lib/libzpool, but it persisted
with the opensolaris and zfs modules.

# 01a69565 19-Oct-2019 Andriy Gapon <avg@FreeBSD.org>

buildkernel: always add standard kernel configuration include path

This should change nothing for kernel configurations at the standard
locations in the source tree. However, if KERNCONFDIR is used to
specify a custom location for a kernel configuration file (e.g., out of
tree), then both the custom location and the standard location, in this
order, will be used as include paths for config(8). This will allow the
kernel configuration to include files from both locations.

Reviewed by: bdrewery
MFC after: 16 days
Differential Revision: https://reviews.freebsd.org/D22057

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

Build compat libraries before "everything".

This is required for us to link programs against compat versions of
libraries.

Reviewed by: bdrewery, jhb
Sponsored by: DARPA, AFRL

# 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

# a1ff92a5 10-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Fix -DNO_CLEAN build across r353340 and r353381

opensolaris_atomic.S is now only used on i386 with opensolaris_atomic.c
used on other platforms. After r353381 it doesn't exist on those
platforms so the stale dependency would result in a build error.

# 9122aeea 09-Oct-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r353316 through r353350.


# 0ed89481 08-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN build across r352689.

Split the LIBCOMPAT case because the usual egrep only matches in
LIBCOMPAT on amd64.

# 8b3bc70a 08-Oct-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r352764 through r353315.


# c1d45320 01-Oct-2019 Kyle Evans <kevans@FreeBSD.org>

Add a top-level makeman target

Abstracting away the details of how src.conf(5) is generated is arguably a
good thing; do so with a top-level makeman target.

# f9fd94f5 30-Sep-2019 Brooks Davis <brooks@FreeBSD.org>

Update cloudabi(32|64) sysents with "make sysent".

MFC after: 1 week

# c6b00391 28-Sep-2019 John Baldwin <jhb@FreeBSD.org>

Disable build of LOCAL_MODULES for cross-builds by default.

WITHOUT_LOCAL_MODULES can be set to disable LOCAL_MODULES for native
builds. WITH_LOCAL_MODULES can be set to leave it enabled for cross
builds.

This does not use a knob in kern.opts.mk because the options framework
does not currently support options whose default varies on the build
type. I discussed a few options there with Warner (e.g. maybe having
a tri-state where the default value is "auto" and having Makefile.inc1
apply logic when MK_LOCAL_MODULES is set to "auto"), but Warner ok'd
this approach for now until a better solution is implemented.

Requested by: many
Reviewed by: imp (in person at EuroBSDCon)
Differential Revision: https://reviews.freebsd.org/D21608

# 668ee101 26-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r352587 through r352763.


# 9ccd2fde 25-Sep-2019 Kyle Evans <kevans@FreeBSD.org>

Adjust Makefile.inc1 syscall sub commit

# 3e25d1fb 25-Sep-2019 Kyle Evans <kevans@FreeBSD.org>

Add linux-compatible memfd_create

memfd_create is effectively a SHM_ANON shm_open(2) mapping with optional
CLOEXEC and file sealing support. This is used by some mesa parts, some
linux libs, and qemu can also take advantage of it and uses the sealing to
prevent resizing the region.

This reimplements shm_open in terms of shm_open2(2) at the same time.

shm_open(2) will be moved to COMPAT12 shortly.

Reviewed by: markj, kib
Differential Revision: https://reviews.freebsd.org/D21393

# f05b9584 21-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r352537 through r352586.


# af3ccc07 20-Sep-2019 Baptiste Daroussin <bapt@FreeBSD.org>

Ensure libthr is always built before libprivatezstd when building the
startup libs

Reported by: "Galazka, Krzysztof" <krzysztof.galazka@intel.com>

# 0f80acb9 19-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r352436 through r352536.


# d567f909 18-Sep-2019 Baptiste Daroussin <bapt@FreeBSD.org>

Add native support for zstd to libarchive

Note that old pkg will failed to build after this. A recent ports tree (one
providing pkg 1.12+) is required to build. Older already built pkg, should
continue working as expected

PR: 238797
Exp run by: antoine
Reviewed by: cem
Approved by: cem
Differential Revision: https://reviews.freebsd.org/D20752

# 84ee6de9 02-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Always build lldb-tblgen, for now, and add a note.

# a32f82c2 26-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang plus lldb (enabled via MK_LLDB).

# 13212983 20-Jun-2019 Antoine Brodin <antoine@FreeBSD.org>

Add head(1) to native-xtools so that it can be used in qemu-user jails

# 0026fec5 16-Jun-2019 Rene Ladan <rene@FreeBSD.org>

Differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases.

Currently APLHA packages are treated as CURRENT or STABLE versions,
resulting in e.g. 13.0.s20190615125609. This version number is indeed
different from the next version number but ALPHA2 would be nicer IMO.

For the BETA, PRERELEASE and RC phases the packages are versioned the
same as for releases, so 11.3-BETA1 is 11.3 and so is 11.3-RC1, meaning
that pkg cannot easiliy upgrade from the former the next. This happened
on my Raspberry Pi which runs pkgbase.

Submitted by: rene
Approved by: manu
Event: Berlin hackathon 2019
Differential Revision: https://reviews.freebsd.org/D20651

# cbc493c6 03-Jun-2019 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: clean up stale dependency hacks

Carrying on from r339607, remove ad-hoc dependency cleanup for changes
prior to June 2018.

Sponsored by: The FreeBSD Foundation

# e1216db5 03-Jun-2019 Maxim Sobolev <sobomax@FreeBSD.org>

Rollback the rest of the botched r348521. Re-work would be posted to
reviews. Sorry.

Reported by: Enji Cooper

# 5d280640 03-Jun-2019 Maxim Sobolev <sobomax@FreeBSD.org>

Leave mtree hardcoded for now. Reverting partially 348521 and also
the followup stopgap change, because I don't think it's a correct. I still
need to figure out where to stick it in. In cannot be in Makefile.inc1
and it cannot be in etc/Makefile from the looks of it to avoid
chicken-and-egg problem.

# a88c8ae7 03-Jun-2019 Warner Losh <imp@FreeBSD.org>

Stopgap fix to breakage from r348521.

MTREE is defined, while MTREE_CMD isn't, use it instead.
This may not be 'right' but it fixes the CI and other issues.

Submitted by: Andreas Nilsson

# 5ec57af4 02-Jun-2019 Maxim Sobolev <sobomax@FreeBSD.org>

Fix several places where tool name has been hardcoded:

install -> ${INSTALL}
mtree -> ${MTREE_CMD}
services_mkdb -> ${SERVICES_MKDB_CMD}
cap_mkdb -> ${CAP_MKDB_CMD}
pwd_mkdb -> ${PWD_MKDB_CMD}
kldxref -> ${KLDXREF_CMD}

If you do custom FreeBSD builds you may want to override those
in some cases.

Sponsored by: Sippy Software, Inc.

# 78473c58 28-May-2019 Justin Hibbits <jhibbits@FreeBSD.org>

Update __FreeBSD_version and Makefile check for r348347

libdwarf needs forcibly rebuilt after r348347.

# 7fc5693f 23-May-2019 Baptiste Daroussin <bapt@FreeBSD.org>

Change package the MTREEFLAGS and INSTALLFLAGS missed in r348185

Reported by: lwhsu

# 871b6b10 15-May-2019 Brad Davis <brd@FreeBSD.org>

Move master.passwd and group to lib/libc/gen/

libc was picked as the destination location for these because of the syscalls
that use these files as the lowest level place they are referenced.

Approved by: will (mentor), rgrimes, manu
Differential Revision: https://reviews.freebsd.org/D16728

# 9c8f66cb 08-May-2019 Antoine Brodin <antoine@FreeBSD.org>

Add wc(1) to native-xtools so that it can be used in qemu-user jails

# 8ae9b1fe 27-Mar-2019 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Use uname as ABI_FILE

Add some more missed in r345159

MFC after: 1 week

# 656898ab 19-Mar-2019 Wolfram Schneider <wosch@FreeBSD.org>

Improve english grammar for kernel built time

PR: 224433
Approved by: jhb
Differential Revision: https://reviews.freebsd.org/D19636

# 1d3a067e 16-Mar-2019 Wolfram Schneider <wosch@FreeBSD.org>

`make buildkernel' should display the build time in seconds

PR: 224433
Approved by: cem
Differential Revision: https://reviews.freebsd.org/D13910

# 08df8f82 14-Mar-2019 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Use uname as ABI_FILE

uname is always rebuild on FreeBSD so use this as ABI_FILE for pkg when
building pkg for pkgbase.
pkg uses uname too as default ABI_FILE as of commit d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599
https://github.com/freebsd/pkg/commit/d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599

Discussed with: bapt
MFC after: 1 week

# 328dcc68 12-Mar-2019 Wolfram Schneider <wosch@FreeBSD.org>

`make buildworld' should display the build time in seconds

PR: 224433
Reviewed by: emaste, @bdrewery
Approved by: cem
Differential Revision: https://reviews.freebsd.org/D13911

# 92dec625 19-Dec-2018 Mateusz Guzik <mjg@FreeBSD.org>

Remove iBCS2: plug a wart missed in r342242

Sponsored by: The FreeBSD Foundation

# 466ed83b 12-Dec-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: update stale wpa dependency removal statement

Only stale .depend files are removed; do not mention object files.

# 457e6311 10-Dec-2018 Ed Maste <emaste@FreeBSD.org>

Clean stale wpa dependencies and objects after r341759

The wpa update added some source files with the same name as a file in
another directory (found via .PATH in the previous version). Having a
stale entry in a .depend file means the new file won't be built, so test
for this case and if found remove all of wpa's dependency files.

MFC with: r341759
Sponsored by: The FreeBSD Foundation

# c10d927c 05-Dec-2018 Alex Richardson <arichardson@FreeBSD.org>

Fix newvers.sh with BUILD_WITH_STRICT_TMPPATH=1

newvers.sh runs mkfifo which did not exist before this change.
However, I didn't notice before because it is run from a function
where a missing command does cause a noticeable failure.

Reviewed By: emaste, markj
Differential Revision: https://reviews.freebsd.org/D18377

# 7dc61ac1 04-Dec-2018 Andrew Turner <andrew@FreeBSD.org>

Only gnu/lib/csu when MK_BSD_CRTBEGIN is off.

We were still building it from Makefile.inc1. Disable it there so we don't
try to build the GNU crtbegin/crtend when the BSD version was asked for.

PR: 233733
Reported by: lwhsu
Reviewed by: emaste
MFC with: r339738
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18428

# 6edf2846 18-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Fix -DNO_CLEAN amd64 build after r340463

Without this change I got the following error:
clang-7: error: no such file or directory: '..../lib/libc/amd64/string/bzero.S'

Reviewed By: mjg
Differential Revision: https://reviews.freebsd.org/D18031

# 8643808a 13-Nov-2018 Glen Barber <gjb@FreeBSD.org>

In followup to r340406, remove doc from the EXTRA_DISTRIBUTIONS
list and remaining references from the script used to create the
MANIFEST file used by bsdinstall(8).

No MFC is planned at this time.

Sponsored by: The FreeBSD Foundation

# 0a9fcf32 07-Nov-2018 Brooks Davis <brooks@FreeBSD.org>

Add a top-level make target to rebuild all sysent files.

The sysent target is useful when changing makesyscalls.sh, when
making paired changes to syscalls.master files, or in a future where
freebsd32 sysent entries are built from the default syscalls.master.

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

# cd6b0f0e 06-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Turn off BUILD_WITH_STRICT_TMPPATH by default

Building with a strict $PATH (without inheriting from the parent
environment) still causes build failures in some workflows/environemnts
that I have not yet tested.
I will try to bring this back once these issues have all been resolved
since it is actually extremely useful in tracking broken dependencies
and wrong assumptions about the build environemt.

Discussed With: brooks

# 4805dd68 06-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Remove btxld from symlinked host tools

It is only present on amd64/i386 systems which breaks buildworld on
other hosts. In fact there is no need to add it to the bootstrap tools
list since it is already included in the cross-tools phase.
However, for cross-tools it was only built if the host and target
architecture didn't match. After this change it is also built when we
are builtin with a strict $PATH.

Reported By: mmel

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

Keep inheriting $PATH when using system linker/compiler

I missed this case when testing r340157. For now just keep
$PATH when we aren't bootstrapping a compiler so that the build
can find cc/c++/ld without an absolute path.

Reported by: yuripv

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

Build the elftoolchain libraries as part of bootstrap-tools

It is not necessary to build libelf and libdwarf this early. Furthermore,
when building on Linux/MacOS, m4 will only be built during the bootstrap
tools phase and not be available in $PATH before.

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

# 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

# 9117dffc 31-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Avoid binutils test in cleandir/obj stages

Further to r339946 skip the .error case for lack of in-tree binutils
support when we haven't set the toolchain feature variables.

Discussed with: arichardson
Sponsored by: The FreeBSD Foundation

# d6be9fdd 31-Oct-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't run cc --version during cleandir/obj stages

This will no work when there is no cc in $PATH (which is the case before the
cross-tools stage once we no longer inherit $PATH in $WMAKE).
The variables set by bsd.compiler.mk/bsd.linker.mk are not needed in these
stages so this avoids a little bit of makefile parsing.

Reviewed By: emaste
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16814

# f4cbc81d 25-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Update elftoolchain bootstrapping test after r339083

Sponsored by: The FreeBSD Foundation

# 5acedb55 23-Oct-2018 Ed Maste <emaste@FreeBSD.org>

sort {delete,check}-old* output

It is more convenient to review old libraries, files, and directories
in order.

Sort check-* after checking for existence of files for efficiency, and
because /usr/lib/debug entries are added while iterating over the list.

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

# 74f65486 23-Oct-2018 Alex Richardson <arichardson@FreeBSD.org>

Only compute the X_COMPILER_*/X_LINKER_* variables when needed

When building CheriBSD we have to set XLD/XCC/XCFLAGS on the command line.
This triggers the $XCC != $CC case in bsd.compiler.mk (and the same for LD
in bsd.linker.mk) which causes it to call ${XCC} --version and
${XLD} --version (plus various awk+sed+echo calls) in every subdirectory.
For incremental builds and stages that only walk the source tree this is
often the majority of the time spent in that directory.

By only computing the value of the X_COMPILER_*/X_LINKER_* variables if
_WANT_TOOLCHAIN_CROSS_VARS is set we can reduce the number of cc/ld calls
to once per build stage instead of once per recursive make.

With this change (and no changes to the sources) the `make includes` stage
now takes 28 seconds at -j1 instead of 86 seconds.

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

# 730a7ce9 22-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: clean up stale dependency hacks

Our dependency tracking cannot directly cope with certain source tree
changes, particularly with respect to removing or moving source files or
replacing generated files. We have a collection of ad-hoc workarounds
to handle these cases. As there is a (small) build-time cost inherent
in these workarounds, we do not want to keep them indefinitely. Thus,
remove workarounds from 2017.

Sponsored by: The FreeBSD Foundation

# fc191b11 20-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Introduce src.conf knob to build userland with retpoline

WITH_RETPOLINE enables -mretpoline vulnerability mitigation in userland
for CVE-2017-5715.

Reported by: Peter Malcom
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17421

# b9583179 18-Oct-2018 Glen Barber <gjb@FreeBSD.org>

- Update head to 13.0-CURRENT.
- Bump MACHINE_TRIPLE, TARGET_TRIPLE, FBSD_MAJOR, FBSD_CC_VER,
FREEBSD_CC_VERSION, OS_VERSION.
- Update comment in UPDATING regarding debugging options.
- Remove debug.witness.trace=0 from installation media.
- Bump __FreeBSD_version.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# bfe5c1dc 13-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: clean up dependencies after r339348

r339348 switched bcopy from .s to .c. Add ad-hoc dependency cleanup
as done for similar cases.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

# e4a41be5 12-Oct-2018 Dag-Erling Smørgrav <des@FreeBSD.org>

Replace libldns's bootstrap dependency on libcrypto with one on libssl
(which in turn has a bootstrap dependency on libcrypto).

Submitted by: jkim
Approved by: re (gjb)

# d97bf519 11-Oct-2018 Dag-Erling Smørgrav <des@FreeBSD.org>

Move libssl up in the bootstrap order.

Submitted by: jkim
Approved by: re (gjb)

# 539a27e1 09-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Switch ntp's embedded libevent to 2.1.18

For OpenSSL 1.1.1 compatibility.

In Makefile.inc1 add (to the existing similar cases) a hack to handle
dependencies across the migration.

Reviewed by: jhb
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation.
Differential Revision: https://reviews.freebsd.org/D17481

# 0c0c965a 06-Sep-2018 John Baldwin <jhb@FreeBSD.org>

Re-enable kernel modules for the MALTA64EL kernel configuration.

Update the BOOTSTRAPPING check for libelf to require the fix for
mips64el object files committed in r338478 and re-enable kernel
modules in the MALTA64EL config file.

Reviewed by: emaste
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17054

# 26ffc1ab 28-Aug-2018 Li-Wen Hsu <lwhsu@FreeBSD.org>

Fix 'install: symlink usr/src/sys -> /sys: File exists' in distributeworld

Follow r334617, specify ${DISTDIR} (by ${INSTALL_DDIR}), '/base' and add
${INSTALLFLAGS} while installing the '/sys' symbolic link.

Reviewed by: bapt (earlier version), markj
Approved by: re (gjb), markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16877

# c97e5167 23-Aug-2018 Alex Richardson <arichardson@FreeBSD.org>

Only bootstrap localedef if ${MK_LOCALES} != "no"

During the build it is only used by share/ctypedef and share/colldef
which will not be built if ${MK_LOCALE} == "no". This saves a tiny bit
of time when building without locales.

Approved By: jhb (mentor)

# 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

# 7920ad94 17-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

libbe(3): Move build goop back out of cddl/

Some background: in the GSoC project, libbe/Makefile lived in lib/libbe. I
created projects/bectl branch, maintained the above for all of five
minutes before I misread Makefile.inc1 and decided that it couldn't possibly
build outside of cddl/, so I kicked the Makefile out into the cddl/ build
and all was good. The misreading was of the bit where .WAIT is added to
SUBDIR after lib, libexec but prior to building bin and cddl *only during
the install targets*, which is the critical part.

Fast forward- buildworld was still broken in my branch unbeknownst to me
because I didn't nuke my OBJDIR. Combing through Makefile.inc1 eventually
revealed the necessary magic to make sure that libbe's dependencies are
specified well enough, and it becomes clear what needs done to make a
non-cddl/ build work. This is an interesting prospect, because the build
split is kind of annoying to work with.

IGNORE_PRAGMA is added to avoid dropping WARNS by one more. This was
previously pulled in via cddl/Makefile.inc.

# 49f1692a 17-Aug-2018 Bjoern A. Zeeb <bz@FreeBSD.org>

METALOG, unless manually overwritten, is defined as ${DESTDIR}/${DISTDIR}/METALOG

In the create-world-packages target we manually piece this together (unless
it is undefined), without the DISTDIR. Normally DISTDIR is empty (unset) and
no one notices. Now DISTDIR is a well known long-standing PORTS environment
variable and if that is set in the local environment the path to METALOG
is wrong as it no longer is ${DESTDIR}/METALOG.

Long-term we should start to avoid "publicly well known" names for global
variables, for now just piece ${DISTDIR} in as well. This allows
create-world-packages to continue if DISTDIR is set in the env.

# 2502c66b 17-Aug-2018 Roger Pau Monné <royger@FreeBSD.org>

build: skip the database check when generating install media

There are several scripts and targets solely used to generate install
media, make sure DB_FROM_SRC is used in that case in order to prevent
checking the host database, which is irrelevant when generating
install binaries.

Sponsored by: Citrix Systems R&D
PR: 230459
Reviewed by: gjb
Differential revision: https://reviews.freebsd.org/D16638

# 35d2028f 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

libbe(3)/bectl(8): More SYSROOT/GCC build fixes

- Missing include path
- Fully specify libzfs's dependencies (except for deps pulled in by other
deps) in Makefile.inc1
- Drop WARNS back down to 2 for libbe(3). I do this with much hesitation,
but the libzfs headers are apparently a hot warning-filled mess as far as
GCC 4.2 is concerned.

# f335e41b 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

Add libzfs to prebuild_libs, libbe dependency on libzfs

# 2b720021a 09-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

Makefile.inc1: Add libl to -legacy as well

libl is needed for config(8), which is a bootstrap-tool. It is possible to
build a system WITHOUT_TOOLCHAIN to exclude lex and thus, libl. We still
need to support building from this kind of host, though.

While here, group the config(8) dependencies together and add a small
explanation. These can likely both be scoped more clearly, but this will
need some further investigation.

Reported by: rgrimes (not WITHOUT_TOOLCHAIN, but provoked investigation)
MFC after: immediately

# d0f408fa 08-Aug-2018 Roger Pau Monné <royger@FreeBSD.org>

build: skip the database check for the distributeworld target

distributeworld is used to generate install media, so it makes no
sense to check the host database since the install media can be
generated from any box, regardless of the version of FreeBSD it's
running.

Sponsored by: Citrix Systems R&D
Reviewed by: ian, gjb
Differential revision: https://reviews.freebsd.org/D16507

# 9898e6df 22-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Alpha-sort the list of user/group IDs to check at install time.

# fd46d8a8 22-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Remove the .if ${MK_FOO} wrappers around the user/group ID checks. These
names are referenced in mtree files without any conditional logic, so the
users/groups must exist even if the corresponding tool(s) are disabled.

# 07b95333 19-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Add ntpd to the list of users/groups to check before installing.

# 8b6b96c9 17-Jul-2018 Warner Losh <imp@FreeBSD.org>

As discussed several times on freebsd-arch, start to decommission armeb.

Remove armeb/arm from KNOWN_ARCHS.
Remove armeb from arm universe targets.

Differential Revision: https://reviews.freebsd.org/D16257

# 44a83ae3 16-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

Unconditionally build libnv in legacy

Rather than using a config(8) built from new tree linking libnv built on
host.

# 0d26206d 10-Jul-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix parsing of create-kernel-packages

MFC after: 3 days
Reported by: rene

# 88171893 05-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

config(8): De-dupe hint/env vars within a single file

r335653 flipped the order in which hints/env files are concatenated to match
the order in which vars are processed by the kernel. This is the other
hammer to drop.

Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the
latest value specified for a key. This leaves some duplicates if a variable
is specified in multiple hint/env files or via `envvar` in a kernel config,
but the reversed order of concatenation (from r335653) makes this a
non-issue as the latest-specified version will be seen first.

This change also silently rewrote hint bits to use the same sanitization
process that ian@ wrote for r335642. To the kernel, hints and env vars are
basically the same thing through early boot, then get merged into the
dynamic environment once kmem becomes available and the dynamic environment
is created. They should be subjected to the same restrictions.

libnv has been added to -legacy for the time being to support the build of
config(8) with the new cnvlist API.

Tested with: universe (11 host & 12 host)
MFC after: 1 month

# 417d105f 05-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

Revert r336011,r336012 until I can competently test

# f1e0a986 05-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

Fix build after r336011

Add libnv to bootstrap-tools, use ${SRCTOP}/sys headers.

# d0338de5 01-Jul-2018 Wolfram Schneider <wosch@FreeBSD.org>

`make installworld' should display "completed" message if done

PR: 225159
Reviewed by: bdrewery
Approved by: cem (mentor)
Differential Revision: https://reviews.freebsd.org/D14057

# 2e90942f 30-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Fix clang-tblgen flip-flop building after r335707.

The build of this would have MK_LLVM_TARGET_ALL=yes for bootstrap-tools
but MK_LLVM_TARGET_ALL=no for cross-tools and thus would rebuild between
the two.

MFC after: 2 weeks
X-MFC-with: r335707
Sponsored by: Dell EMC

# 55a5b46a 29-Jun-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't change directory owner to root when building with -DNO_ROOT

Currently the mtree calls in Makefile.inc1 all change the directory owner
to match the spec file. However, we should not be doing this during
distributeworld if -DNO_ROOT is passed. Additionally, when creating the
WORLDTMP directory hierachy there is no need to change the owner to root so
we now always pass the -W flag when populating WORLDTMP.

This is also required for building FreeBSD on Linux/Mac since the required
groups/users will not exist there which is how I discovered this issue.

Reviewed By: emaste, bdrewery, imp
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D14185

# 8706983f 28-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix unknown target check after r335450.

X-MFC-with: r335450
Pointyhat to: bdrewery
Sponsored by: Dell EMC

# 151578dc 28-Jun-2018 John Baldwin <jhb@FreeBSD.org>

Remove the various build flag hacks for GCC cross-compile.

The xtoolchain GCC packages have not required these flags since ports
commits r465416 and r466701. The in-tree GCC 4.2.1 has also been patched
in r335716 and r335717 to correctly honor --sysroot when looking for
includes and libraries.

Reviewed by: bdrewery
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D16055

# 52b7824b 28-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER/LINKER: Fix cross-build support after r335706.

X-MFC-With: r335706
MFC after: 2 weeks
Sponsored by: Dell EMC

# f59e5352 28-Jun-2018 Brad Davis <brd@FreeBSD.org>

Simplify using bsd.endian.mk and have it provide CAP_MKDB_ENDIAN, since it is
the most common usage.

Approved by: bapt (mentor)

# 7c3f17c5 27-Jun-2018 Brad Davis <brd@FreeBSD.org>

Chase the pwd_mkdb endian changes.

Approved by: bapt (mentor)

# 01f124b4 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

tinderbox: Only build clang/lld once if needed.

Need to handle LLD_BOOTSTRAP separately (for archs like i386).
This would be much better off with an off-by-default option like
SHARED_TOOLCHAIN that universe force-enabled. Then a normal buildworld
would store the toolchain there if enabled and otherwise in WORLDTMP
with only the 1 arch selected.

MFC after: 3 weeks
Sponsored by: Dell EMC

# eed6d55d 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Clang: Only build needed target for bootstrap compiler.

This will disable the new LLVM_TARGET_ALL option which will only
enable the required target.

This only impacts the bootstrap compiler in WORLDTMP, not the target compiler
that will be installed.

MFC after: 2 weeks
Reviewed by: sbruno, dim (earlier version)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16021

# 631e709f 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Add LLVM_TARGET_ALL option.

LLVM_TARGET_* will auto be set based on LLVM_TARGET_ALL and MK_CLANG.

If LLVM_TARGET_ALL is disabled, during a cross-build, then SYSTEM_COMPILER
and SYSTEM_LINKER are auto disabled.

This option should be used by users rather than the per-arch LLVM_TARGET
options as it is simpler to maintain for them should the supported
target list change.

MFC after: 2 weeks
Reviewed by: sbruno, dim
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16020

# e4b0a90e 25-Jun-2018 Brooks Davis <brooks@FreeBSD.org>

Normalize the g(eom,cache,part,...) build.

Rather then combining hardlink creation for the geom(8) binary with
shared library build, move libraries to src/lib/geom so they are
built and installed normally. Create a common Makefile.classes
which is included by both lib/geom/Makefile and sbin/geom/Makefile
so the symlink and libraries stay in sync.

The relocation of libraries allows libraries to be build for 32-bit
compat. This also reduces the number of non-standard builds in
the system.

This commit is not sufficent to run a 32-bit /sbin/geom on a 64-bit
system out of the box as it will look in the wrong place for libraries
unless GEOM_LIBRARY_PATH is set appropriatly in the environment.

Reviewed by: bdrewery
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15360

# 9b844631 21-Jun-2018 Ed Maste <emaste@FreeBSD.org>

Rename usr.bin/elfcopy to usr.bin/objcopy

We always install ELF Tool Chain's elfcopy as objcopy, so to avoid
confusion rename the src directory containing our reach-over Makefile
to match.

Requested by: jhb
Sponsored by: The FreeBSD Foundation

# cb623f63 20-Jun-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: rename build metadata file to toolchain-metadata.mk

The metadata file contains more than just compiler metadata.

Discussed with: bdrewery

# 6e6be2bb 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Reduce exec and fstat overhead for non-build targets.

This is mostly targetting 'make showconfig' and 'make test-system-*' for
the benefit of makeman and universe-one-clang work.

Sponsored by: Dell EMC

# a7d84af8 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Add WITH_SYSTEM_LINKER, on by default, that avoids building lld when possible.

This works similar to WITH_SYSTEM_COMPILER added in r300354. It only
supports lld via WITH_LLD_BOOTSTRAP.

When both SYSTEM_COMPILER and SYSTEM_LINKER logic passes then libclang
will not build in cross-tools. If either check fails though then
libclang is built.

The .info is reworked to notify when libclang will be built since if
either clang or lld needs to be rebuilt, but not the other, the
notification can lead to confusion on why "clang is building".

-fuse-ld= is not used with this method so some combinations of compiler
and linker are expected to fail.

A new 'make test-system-linker' target is added to see the logic results.

Makefile.inc1:
CROSS_BINUTILS_PREFIX support had to be moved higher up so that XLD
could be set and MK_LLD_BOOTSTRAP disabled before checking SYSTEM_LINKER
logic as done with SYSTEM_COMPILER. This also required moving where
bsd.linker.mk was read since XLD needs to be set before parsing it. This
creates a situation where src.opts.mk can not test LINKER_FEATURES or
add LLD_BOOTSTAP to BROKEN_OPTIONS.

Reviewed by: emaste (earlier version)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15894

# 78187278 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Rework WITHOUT_LLD/TOOLCHAIN fix from r327892 for cross-tools.

MK_LLD is for the installed lld while MK_LLD_BOOTSTRAP is for the build
tool. For WITH_SYSTEM_LINKER it is necesarry to separate the logic of
these two. When building libllvm TOOLS_PREFIX will be defined and
MK_LLD_BOOTSTRAP should be checked instead.

Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15837

# d74021d6 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Rework how the ld link is handled in WORLDTMP from r322811.

LLD_BOOTSTRAP (build) is independent of LLD_IS_LD (installed) so they
should not be based on each other.

This is related to upcoming WITH_SYSTEM_LINKER work.

Reviewed by: emaste
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15836

# 2d2aba18 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

TARGET_TRIPLE is needed much earlier now for CROSS_BINUTILS_PREFIX check.

This was missed in r335394 since the check became exists(/usr/local) in
my testing.

X-MFC-With: r335394
MFC after: 2 weeks
Sponsored by: Dell EMC

# d18e2bca 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix detection for binutils bootstrap package.

The path was changed recently in the port to be the full target triple.

MFC after: 2 weeks
Sponsored by: Dell EMC

# 4d64cb78 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Let CROSS_BINUTILS_PREFIX work without a trailing slash.

Reported by: jhb
MFC after: 2 weeks
Sponsored by: Dell EMC

# 8a854b36 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER: Should use X_ vars for comparing wanted version.

It is XCC used during the build of target binaries that replaces the
bootstrap compiler.

Also slightly tweak style.

MFC after: 2 weeks
Sponsored by: Dell EMC

# aafc3339 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix X_COMPILER_* and X_LINKER_* not being passed to installworld environment.

This could lead to 'sh: head: not found' warnings which were a symptom
of running 'ld --version' during installworld. This was only happening
with XCC or XLD set. It is intended that cc and ld do not run during
installworld. The metadata for these are already stored in
compiler-metadata.mk added in r316794.

This also removes redundant CROSSENV additions that were for
WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, and WITHOUT_TOOLCHAIN
which all don't have a cc or ld in their PATH during install.

Reported by: Mark Millard
MFC after: 2 weeks
Sponsored by: Dell EMC

# cf43faaa 18-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Don't bootstrap lld if an external linker is used.

Sponsored by: Dell EMC

# 2a821fd9 17-Jun-2018 Ian Lepore <ian@FreeBSD.org>

Build LOCAL_LIB_DIRS along with system lib dirs, rather than building them
in parallel with LOCAL_DIRS and all the other system post-libs stuff.

# f39bffc6 16-Jun-2018 Konstantin Belousov <kib@FreeBSD.org>

Rework ofed build.

Aligns the build with the FreeBSD traditional approach to not build in
contrib/, and to track inter-dependencies between libraries.

With help from: bdrewery
Reviewed by: bdrewery, hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D15648

# 4e3db1e0 15-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Assert that a build is done before an install.

This should also catch cases where the wrong MAKEOBJDIRPREFIX is used for
install.

MFC after: 2 weeks
Sponsored by: Dell EMC

# 6f1f2b19 15-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Only build jevents if MK_PMC is yes and only for amd64 in libcompat.

Sponsored by: Dell EMC

# 8590505f 09-Jun-2018 Mark Johnston <markj@FreeBSD.org>

Bump __FreeBSD_version after r334881 and force libdwarf to be rebuilt.

Reported by: O. Hartmann <ohartmann@walstatt.org>
Reviewed by: bdrewery

# 521ef556 05-Jun-2018 Ed Maste <emaste@FreeBSD.org>

Handle -DNO_CLEAN builds across brk/sbrk rewrite in r334626

Sponsored by: The FreeBSD Foundation

# 8dc84f09 04-Jun-2018 Brad Davis <brd@FreeBSD.org>

Move /sys symlink creating out of etc/Makefile.

This is prep for etc/Makefile going away.

Approved by: bapt (mentor)

# 7d1c2b74 31-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmc/pmu: enable for i386 as well

# 41e258c4 30-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmc/jevents: fix cross-compile _to_ amd64

Reported by: emaste

# 959826ca 26-May-2018 Matt Macy <mmacy@FreeBSD.org>

pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
vendor provided pmu-events tables and sundry cleanups.

The vendor pmu-events tables provide counter descriptions, default
sample rates, event, umask, and flag values for all the counter
configuration permutations. Using this gives us:

- much simpler kernel code for the MD component
- helpful long and short event descriptions
- simpler user code
- sample rates that won't overload the system

Update man page with newer sample types and remove unused sample type.

# 5506ceb8 26-May-2018 Matt Macy <mmacy@FreeBSD.org>

Revert r334242 "pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the"
because of squash commit messages

# 49281356 26-May-2018 Matt Macy <mmacy@FreeBSD.org>

pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
vendor provided pmu-events tables and sundry cleanups.

The vendor pmu-events tables provide counter descriptions, default
sample rates, event, umask, and flag values for all the counter
configuration permutations. Using this gives us:

- much simpler kernel code for the MD component
- helpful long and short event descriptions
- simpler user code
- sample rates that won't overload the system

Update man page with newer sample types and remove unused sample type.

Squashed commit of the following:

commit 4459d43eff815bec08ccc5533dbe5de846f03128
Author: Matt Macy <mmacy@mattmacy.io>
Date: Sat May 26 00:06:31 2018 -0700

libpmc: fix pmu function signatures for non amd64

commit a2cb8bbc586c65d41f9b291430a2261ec67b59fe
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:38:11 2018 -0700

pmcstat: fix indentation of usage

commit f686954b15ff56a833ac80404898977cb80a265b
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:19:49 2018 -0700

pmclog(3): add callchain and pmcallocatedyn, remove pcsample

commit 73e13a0d2e9498c81c150d14d022050cee7511bb
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:19:00 2018 -0700

pmclog.h: GC pcsample field

commit 3e93ffd65da641fa657539dad3c48e281f8b5798
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:05:57 2018 -0700

hwpmc: make Intel core CPUs use external event tables

commit 634f5fae1e1644ac324003136c66cd9c619d1c93
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:00:06 2018 -0700

pmclog: update log record types, bump PMC_MAJOR
- explicitly make log record types a multiple of 8 bytes
- hook in pmu event types for pmc_allocate records
- remove references to no longer PCSAMPLE record

commit 83d84fcd2d65bdf6ddcb2e155a22f0cfa2a9c225
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 21:52:10 2018 -0700

libpmc: add support for having vendor table driven pmc_allocate

commit 9e6ad63c40c2fce8404847ace5078ca6cb33a736
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 19:11:33 2018 -0700

hwpmc_core: add accessors for EVSEL & UMASK, make IAP_UMASK useful to user

commit 859dceb93daa6419a48c794db99b6758e5b041c9
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 19:09:45 2018 -0700

pmcstat: update usage and man page as well as make -L consistent with pmccontrol

commit 79c7d8597e28c2eb13f5f9113e65ec2792ca57b1
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 18:07:03 2018 -0700

pmu_util: add support for all current intel event keywords

commit d8089c7f6a6c8527f38324252b1ffb47004694c6
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 17:45:00 2018 -0700

add description for new arguments

commit 058336740bab53c62ec88a3a026ea848cf3878c6
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 17:38:15 2018 -0700

libpmc: move pmu_events table and pmu_utils out of libpmcstat so that they can be used by pmc_allocate

commit 049b66b382e2f833c3f47bc8df9e750cb265709f
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 16:12:41 2018 -0700

pmcstat: hook pmu_events counter description utility routines in

commit f5e01e7b37a691dc045e1aa16b3ebdd162515de8
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 16:11:59 2018 -0700

pmu_events: add utility routines for listing counters and their descriptions

commit cba4d4f8907f772279f86f18f915e0d74d33ac56
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 16:09:50 2018 -0700

pmu-events: expand out skylake regex to simplify string matches

# c2decc35 25-May-2018 Brooks Davis <brooks@FreeBSD.org>

Support -DNO_CLEAN builds across r334223+r334224.

# 77301553 24-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmcstat: Don't build pmu tables on !amd64 until the corresponding
util routines have been written and tested. Currently building them
breaks the build on power64

Reported by: emaste

# 810c4dcd 24-May-2018 Brooks Davis <brooks@FreeBSD.org>

exect() was removed in 2018, not 2017.

# e98bbcf9 23-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmcstat: compile in events based on json description

# 754a9d6c 27-Apr-2018 Ed Maste <emaste@FreeBSD.org>

Bump min supported release for building HEAD to 10.3

r307825 and r333017 disallow building FreeBSD-HEAD from 9.x or 10.x
versions that have some clang issues. The minimum supported Subversion
revisions and osreldates containing the fix are:

Version Min Rev osreldate
9.x r286035 903509
10.x r286033 1002501

9.3 is the final 9.x release and does not contain the r286035 fix.
10.3 is the first 10.x release with the fix. Thus, in practice 10.3 is
the oldest release that can build HEAD.

Although it may still be possible to build HEAD from an up-to-date
stable/9 it's not worth maintaining the special case when the branch
itself is unsupported and there are no usable releases from that branch.

Old UPDATING entries can be removed and the Clang warning in UPDATING
may be updated, in a future commit.

Approved by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15209

# 27d86a1c 26-Apr-2018 Ed Maste <emaste@FreeBSD.org>

Correct r307825 BOOTSTRAPPING test for unsupported upgrade

__FreeBSD_version has five digits after the major number, but the min
versions in the test had an extra 0 (so the test was always false).

# d3292755 12-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN builds across r332443.

# d9b41671 06-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Support -DNO_CLEAN builds across r332119.

# e4e7a46b 05-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN buildworld after r332080.

# 523bfea2 04-Apr-2018 Ed Maste <emaste@FreeBSD.org>

remove special handling for stale ptrace dependencies

r318957 added special handling for stale ptrace dependency files to
support a -DNO_CLEAN build in a tree last built before r305012. That
revision is now over a year and a half old, so retire the special case.

Sponsored by: The FreeBSD Foundation

# 62d6bc39 04-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN builds over r332048.

# af94761a 20-Mar-2018 Ed Maste <emaste@FreeBSD.org>

Correct comment date in r331255

Reported by: jhb

# aa9ceac4 20-Mar-2018 Ed Maste <emaste@FreeBSD.org>

Remove stale generated assym.s files after r331254

So that -DNO_CLEAN builds work.

This should be reverted after a sufficient transition period (perhaps 3
or 6 months).

Sponsored by: The FreeBSD Foundation

# fb6d3be5 14-Mar-2018 Kyle Evans <kevans@FreeBSD.org>

pkgbase: Fix post-install script for kernel packages

kernel.ucl uses a hardcoded boot/kernel for kldxref, which is the incorrect
directory when we're installing extra kernels that aren't the "default"
kernel (placed at boot/kernel).

Fix this by instead using a new %KERNELDIR% that we now replace in
Makefile.inc1 with "kernel" for the default kernel and "kernel.${_kernel}"
for these extra kernels so that, e.g. /boot/kernel.SHIVA, will get properly
kldxref'd upon update and avoid outdated linker.hints.

Reviewed by: gjb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14689

# 2f513483 26-Feb-2018 Brooks Davis <brooks@FreeBSD.org>

Improve wording of error message when CROSS_TOOLCHAIN is not found.

Reported by: emaste, jhb

# 0df651d7 25-Feb-2018 Brooks Davis <brooks@FreeBSD.org>

Allow CROSS_TOOLCHAIN to be a path to a file.

This allows working with custom cross toolchains without the need to
create files in /usr/local/share/toolchains.

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

# 55927f28 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Properly lookup values if they were empty.

Spotted by: rpokala
X-MFC-With: r329676
MFC after: 2 weeks
Sponsored by: Dell EMC

# 0f8995a9 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Only lookup SVN once and rename to SVN_CMD.

MFC after: 2 weeks
Sponsored by: Dell EMC

# c0d9f07d 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Avoid looking up VCS_REVISION for every sub-make call to Makefile.inc1.

MFC after: 2 weeks
Sponsored by: Dell EMC

# 49a1108a 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Move SVNVERSION_CMD into the one place that uses it.

This code, which is basically `svnversion || svnliteversion`, generates
2 fstatat(2) for every directory in PATH for every Makefile parsed that
includes bsd.own.mk. This can add up for things like generating a Ports
index (Poudriere) or building a dependency graph for base.

Sponsored by: Dell EMC
MFC after: 2 weeks

# c1c35c10 09-Feb-2018 Warner Losh <imp@FreeBSD.org>

sort needs to be in ITOOLS since find -s was changed to find | sort.

# 207efdb3 07-Feb-2018 Warner Losh <imp@FreeBSD.org>

Add a note about why we have the conditional before including
bsd.compiler.mk. It's so fmake from older 9.x systems still
works (still a supported build config, and having the note here
will let us know when we can cull it more easily).

Also pull in a related change from include to sinclude from
arichardson@'s cross building work, as well as it's companion in
Makefile.inc1 with a note about why we do the odd thing there.

Submitted by: archardson
Differential Revision: https://reviews.freebsd.org/D14241

# 48164080 07-Feb-2018 Ed Maste <emaste@FreeBSD.org>

add retpoline compiler and linker feature flags

These features indicate that the compiler and linker support the
retpoline speculative execution vulnerability (CVE-2017-5715)
mitigation.

Reviewed by: dim, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14228

# fb1df203 06-Feb-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't hardcode /usr/bin as the path for mktemp in build tools

It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is in
/bin there.

Reviewed By: bdrewery
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D13937

# a564880c 25-Jan-2018 Wolfram Schneider <wosch@FreeBSD.org>

`make installkernel' should display a completed message if done

PR: 225159
Reviewed by: bdrewery
Approved by: cem (mentor)
Differential Revision: https://reviews.freebsd.org/D13940

# 553b3bb8 24-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

test-system-compiler: Display X_ variants for compiler/linker.

Sponsored by: Dell EMC

# 1c0cac23 24-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

X_COMPILER_* may not be defined.

Sponsored by: Dell EMC

# ebe45c64 16-Jan-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't build share/syscons in build-tools stage if MK_SYSCONS == "no"

Reviewed By: emaste, jhb
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12926

# fe8be588 12-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Ensure MK_LDD for bootstrap-tools matches MK_LLD_BOOTSTRAP.

This fixes building libllvmminimal with MK_LLD support when WITHOUT_LLD
or WITHOUT_TOOLCHAIN are set, which are install flags not build tools
flags.

Reported by: sbruno
Tested by: sbruno
Sponsored by: Dell EMC

# d52c29e7 11-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Cache LINKER_FEATURES to fix the wrong ones being used.

Submitted by: Dan McGregor <dan.mcgregor@usask.ca>

# e93e5bb0 31-Dec-2017 Ian Lepore <ian@FreeBSD.org>

Allow use of .WAIT in the LOCAL_DIRS and LOCAL_LIB_DIRS lists.

A comment in Makefile.inc1 has long stated that LOCAL_DIRS are built last,
after the base system. Incremental improvements in parallel building over
the years have led to LOCAL_DIRS being built in parallel with base system
directories. This change allows the .WAIT directive to appear in LOCAL_DIRS
and LOCAL_LIB_DIRS lists to give the user some control over parallel
building of local additions.

Differential Revision: https://reviews.freebsd.org/D13622

# 3670d4c7 05-Dec-2017 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: map mips MACHINE_/TARGET_ARCH to triples

This helps Clang MIPS builds.

Reviewed by: bdrewery, jhb (earlier version)
Differential Revision: https://reviews.freebsd.org/D12171

# 9b43e3da 05-Dec-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Ensure GCC files are cleaned up.

Because we force enable MK_GCC when building we need to also force
enable it for the cleaning phase. Otherwise the NXB_TARGET files
are found in the next build's kernel-toolchain phase and cause
an error.

Reported by: sbruno
X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC

# 4a51c708 04-Dec-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Fix build without META_MODE for GCC archs.

The initial kernel-toolchain is built with TARGET=MACHINE but
we want GCC to have files generated for TARGET=NXB_TARGET
instead later on. Just clean the files between building of
the toolchain and nxb binaries which will let it rebuild
when needed.

Reported by: sbruno
X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC

# 388290b8 24-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix for multi-threaded lib32 compat build on amd64.

Sponsored by: Mellanox Technologies

# e8333057 24-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Simplify the build dependencies when building the OFED libraries.

Suggested by: bdrewery@
Sponsored by: Mellanox Technologies

# 937d37fc 18-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r325842 through r325998.


# 3faecc70 18-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make -n' for {reinstall,distribute}kernel.

PR: 201779
Sponsored by: Dell

# 7a310b06 16-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Update list of hardcoded OFED build order dependencies for
the buildworld target.

Sponsored by: Mellanox Technologies

# 92b800cc 15-Nov-2017 Ed Maste <emaste@FreeBSD.org>

Sort pkgbase mtree metadata, for reproducible builds

Packaged base packages are created by running the stageworld and
stagekernel targets with -DNO_ROOT, and converting the resulting mtree
file into a set of pkg plists. If stage* is run with multiple processes
the order of entries in the mtree file may be nondeterministic, and the
resulting package tbz also had nondeterministic file ordering.

The mtree file generated by -DNO_ROOT builds consists of one line per
file, with the filename starting in the first column, so is easily
sorted. There's one exception: the first line of the mtree file is a
comment, but the # character sorts before the filenames anyhow and needs
no special treatment.

PR: 223673
Reviewed by: bapt, gjb
Sponsored by: The Linux Foundation, Core Infrastructure Initiative
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13103

# ca987d46 14-Nov-2017 Warner Losh <imp@FreeBSD.org>

Move sys/boot to stand. Fix all references to new location

Sponsored by: Netflix

# 7202739f 13-Nov-2017 Alex Richardson <arichardson@FreeBSD.org>

Only build the libmagic build-tools if MK_FILE != no

Before this patch libmagic was always built in the build-tools phase
even if -DWITHOUT_FILE was specified.

Reviewed by: emaste, jhb
Approved by: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12925

# f649ab27 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

cleanworld only needs a tree walk if the expected .OBJDIR is .CURDIR.

Sponsored by: Dell EMC Isilon

# 9cde684d 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Fix for GCC archs.

- This also adds in a _cleanobj step as needed.
- This redirects TARGET/TARGET_ARCH to NXB_TARGET/NXB_TARGET_ARCH in
Makefile.inc1 as the main build needs to be for MACHINE rather
than TARGET.

First build the toolchain and then use that as an external toolchain
to build the needed directories and NXB_TARGET-toolchain, all as
MACHINE files though via TARGET_TRIPLE=MACHINE_TRIPLE.

The NXBDIRS is evaluated in the 'everything' submake as it needs to be
based on TARGET's src.opts.mk values, such as MK_GCC=yes when building
on a MK_CLANG=yes MACHINE. This can likely be changed to a specific
_native-xtools-everything target later and the funky late evaluation
of SUBDIR_OVERRIDE removed.

X-MFC-With: r325001
Pointyhat to: bdrewery
MFC after: 2 months
Sponsored by: Dell EMC Isilon

# ae9f7248 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

rescue ipf: Remove hacks and link in libipf directly.

Sponsored by: Dell EMC Isilon

# fa65e3a5 09-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Handle some .OBJDIR == .CURDIR cases.

- If OBJROOT is SRCTOP then don't add on TARGET.TARGET_ARCH. This
only happens at the top-level, and for sub-directories when the
user is clever with MAKEOBJDIRPREFIX=/.
- Don't bother checking 'test -w' on .CURDIR.
- Properly set OBJTOP/OBJROOT to SRCTOP in various needed cases.
- Check if the OBJDIR is writable even for *clean* targets since it
determines which .OBJDIR the user gets; If they cannot write to an
existing eligible .OBJDIR then it needs to clean in .CURDIR instead.
- Add guard to cleanworld/cleanuniverse from removing SRCTOP.
- Ensure OBJTOP is proper for .OBJDIR=.CURDIR which fixes finding
libraries since src.libnames.mk is based on OBJTOP.
- Avoid some chdir(2) for modifying .OBJDIR

Sponsored by: Dell EMC Isilon

# 3fa561a4 07-Nov-2017 Warner Losh <imp@FreeBSD.org>

Note interactive shell errors for make buildenv and add a warning for
people tempted to add back the || true to get rid of them.

Sponsored by: Netflix

# 996e4759 04-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix nested MAKEOBJDIRPREFIX breaking various release/buildworld/toolchain targets.

This problem was caused by r325329 and r325350.

For the release(7) targets, some will run mm-mtree.sh which itself runs make
with a MAKEOBJDIRPREFIX. The execution of that script leaks OBJROOT,
MAKEOBJDIR, and MAKELEVEL=1 in the environment. This causes the mm-mtree makes
to not do some basic setup of OBJROOT and only use this special
MAKEOBJDIRPREFIX case which fails to empty out MAKEOBJDIRPREFIX for further
nested makes, such as a tree walk. If that tree walk sets OBJROOT/OBJTOP such
as r325329 is doing, then the wrong OBJDIRs end up being used due to the
unemptied MAKEOBJDIRPREFIX being preferred over the proper MAKEOBJDIR.

Pointyhat to: bdrewery
Sponsored by: Dell EMC Isilon

# 2abeba9d 03-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r318105: Don't use NO_OBJ at top-level, use NO_OBJWALK.

NO_OBJ has a very specific meaning in sub-directories in that no object
directory will be made. If a user wanted to skip the 'make obj' phase then
passing -DNO_OBJ would break all sub-directories from building properly. Using
NO_OBJ internally also causes issue with NO_OBJ handling being added in
share/mk/bsd.init.mk soon.

Sponsored by: Dell EMC Isilon

# 2c36cefe 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r325329: Store all WORLDTMP objects back in the same directory.

This still keeps the reduced MAKEOBJDIRPREFIX (SRCTOP) redundancy
removed in the OBJDIR, but now keeps all early phase objects
in the same directory rather than split per phase.

The problem of splitting per phase is that later phases want to link in
libraries from earlier phases and base their location on ${OBJTOP}.

Pointyhat to: bdrewery
Reported by: mjoras, Mark Millard
Sponsored by: Dell EMC Isilon

# fe480405 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r325342: Always ensure WORLDTMP exists.

Reported by: Herbert J. Skuhra
Sponsored by: Dell EMC Isilon

# 89bd07e9 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

DIRDEPS_BUILD: Cleanup leftover WORLDTMP files.

This will force any existing objects to rebuild if their .meta
files reference files from WORLDTMP. This is a problem after
the UNIFIED_OBJDIR effort caused buildworld and DIRDEPS_BUILD
to share an OBJDIR. Without cleaning these files the
Makefile.depend files end up with odd tmp/legacy/... entries
since some bootstrap-tools linger from there and otherwise
don't rebuild. Removing the files causes anything having
used WORLDTMP to rebuild.

Sponsored by: Dell EMC Isilon

# 4dc89c4d 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Reduce MAKEOBJDIRPREFIX path spam by specifying a direct objdir to use.

Sponsored by: Dell EMC Isilon

# 3d165b2f 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools/xdev: Store these in a location including both MACHINE/TARGET.

Given MACHINE/MACHINE_ARCH=amd64, TARGET=arm64 and TARGET_ARCH=aarch64,
this change will build them in a location such as:
/usr/obj/usr/src/amd64.amd64/nxb/arm64.aarch64/
and
/usr/obj/usr/src/amd64.amd64/xdev/aarch64-freebsd/

Sponsored by: Dell EMC Isilon

# c10062b9 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add a 'make cleanuniverse'.

This will remove all build files for the source directory
when MK_UNIFIED_OBJDIR is enabled.

Sponsored by: Dell EMC Isilon

# dfa09989 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.

This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for
native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to
a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>. This
new format is used regardless of cross or native build. It allows
easier management of multiple source tree object directories.

The UNIFIED_OBJDIR option will be removed and its feature made permanent
for the 12.0 release.

Relnotes: yes (don't note UNIFIED_OBJDIR option since it will be removed)
Prior work: D3711 D874
Reviewed by: gjb, sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Discussed with: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12840

# f0696740 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Follow-up r325087: Need to build lib/clang before lld.

LLD needs headers generated by the full libllvm.

X-MFC-With: r325087
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 651c6845 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

kernel-toolchain: Fix improper build order after r325244.

Due to removing some targets that the previous .ORDER: ${WMAKE_TGTS}
set, it was no longer being respected; _build_tools was coming
immediately.

Pointyhat to: bdrewery
X-MFC-with: r325244
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 5a4121a8 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

kernel-toolchain: Skip world _obj and _cleanobj phases.

There's no good reason to treewalk the entire tree removing old OBJDIRS
and creating new ones when 'includes', 'libraries', and 'everything' are
all skipped. The only shared directory in the existing toolchain target
and world is build-tools. So handle cleaning in it directly if needed
only for the directories it wants to build.

The extra _obj/_cleanobj walks came in the initial kernel-toolchain
addition in r128189.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 7cd84b56 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

build-tools: De-special-case the gcc tools build.

It merely wanted to use 'all' rather than 'build-tools' so just
add a build-tools target to the Makefile.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 555c6e60 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r297998: Remove redundant TOOLS_PREFIX in XMAKE.

Sponsored by: Dell EMC Isilon

# 337698b7 30-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Allow SYSTEM_COMPILER to be used after r325001.

Now that a proper sysroot is used and a separate target list, it should
be safe to skip building the initial cross-compiler.

X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC Isilon

# 601594ed 30-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

cleanworld: No need to cleandir if MK_AUTO_OBJ is enabled.

Sponsored by: Dell EMC Isilon

# 0255bc13 29-Oct-2017 Warner Losh <imp@FreeBSD.org>

Return proper status from buildenv.

make buildenv BUILDENV_SHELL=<some command> more useful. Remove '||
true' from the command line so that errors are properly
returned. There appears to be no reason for it, and it dates back to
the original commit by ru@.

Sponsored by: Netflix

# be1ef37b 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Consolidate duplicate cross-tools build/install list into XDEVDIRS.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 86c4ac99 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Remove excess '/' since XDTP is asserted to be an absolute path.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# c16a698b 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Fix build for platforms needing LLD.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 57820ca8 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Add missing 'make obj' treewalk for 'make includes'.

It is possible that building headers requires an OBJDIR.
The other phases of xdev have their own 'make obj' calls
where needed, such as inside 'make libraries' itself.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 5bd47cc5 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Change native-xtools to not install by default; add a native-xtools-install.

Without this the user has to mess with 'make -f Makefile.inc1 ...' to figure
out where the files are installed in the OBJDIR and then they need to copy them
to where they really wanted them. Using DESTDIR may be problematic after
r325001 as well.

The files will be installed to DESTDIR/NXTP where NXTP defaults to /nxb-bin.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 24830684 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix xdev TARGET/TARGET_ARCH assertion and expand to native-xtools.

The top of Makefile.inc1 requires TARGET/TARGET_ARCH be defined. Just
building 'make xdev' would already set them, so this error was never
triggered. Moving it to Makefile fixes the problem.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# bb3f65ea 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Disable AUTO_OBJ as a make argument to ensure it really is disabled.

If the user sets this to yes as a make argument too we still want
to ensure these do not get enabled.

Sponsored by: Dell EMC Isilon

# 0a3c9523 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Remove comment: debug files can be useful for build tools.

Sponsored by: Dell EMC Isilon

# 67d2f51a 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move some LIBCOMPAT tmpdir logic setup to its own build target.

Its own build target was already handling mtree extractions
just as _worldtmp did, so the other cleaning of the
tmpdir makes sense here as well.

Sponsored by: Dell EMC Isilon

# a3d90ddf 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

MK_TESTS is disabled in early phases, no need for TESTBASE extraction here.

Sponsored by: Dell EMC Isilon

# 53f3deb1 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

FAST_DEPEND clean hack: Remove lib32/soft files properly.

Only remove them if the option is enabled and also handle libsoft
by using the proper LIBCOMPAT_OBJTREE. LIBCOMPAT:D will expand
the text after it as a proper glob to the command line if LIBCOMPAT
is defined.

Sponsored by: Dell EMC Isilon

# fb3d959c 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move FAST_DEPEND cleanup hack into its own target and call from _cleanobj.

The _worldtmp target is for setting up WORLDTMP. Nothing between _worldtmp
and _cleanobj will read these files. Move to its own target since it is
so large.

Sponsored by: Dell EMC Isilon

# 354ffd53 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

We don't need LIB32 directories extracted in early phase legacy/WORLDTMP dirs.

This reverts some changes from r289662

Sponsored by: Dell EMC Isilon

# 64ec6792 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Disallow using a colon ':' in source checkout paths.

This leaks into the PATH handling for WORLDTMP and breaks
finding cross-tools. The PATH handling could be fixed to
properly quote but is not worth the effort.

Also allow this sanity check to always run even with 'make -n'.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 5e3b9061 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move sendmail special check into a _sanity_check target.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# a13a8505 25-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Cleanup pieces missed in r315057 which made mandoc mandatory

Sponsored by: Dell EMC Isilon

# ca95e9dd 25-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native-xtools build to use a proper sysroot.

This takes longer but should reliably produce working binaries.
The old version linked against system libraries and headers
which would be a problem if building a native-xtools against
a newer source than the host system. With a proper sysroot made
first this is not a problem.

This also allows:
- NXBDIRS to be built in parallel
- NXBDIRS to be installed to NXBDESTDIR in parallel
- SYSTEM_COMPILER logic to work again. Note that because this change
is adding a sysroot phase the compiler may be built up to twice now.
The first is the "cross-compiler" even though it is for the native
architecture, but it is still built to ensure the latest compiler
is used to generate the binaries, unless SYSTEM_COMPILER allows
/usr/bin/cc to be used. Then the target compiler is built
which is actually a cross-compiler since it runs on native host
but generates TARGET.TARGET_ARCH binaries.

Note this also changes the path used for the OBJDIR. It used to use
/usr/obj/target.target_arch/nxb/<srcdir> for objects and
/usr/obj/target.target_arch/nxb-bin for installed files, but now uses
/usr/obj/nxb/target.target_arch/<srcdir> for objects and
/usr/obj/nxb/target.target_arch/<srcdir>/nxb-bin for installed files.
- NXBDESTDIR can be specified for where to install or queried with
`make -f Makefile.inc1 TARGET=... TARGET_ARCH=... -V NXBDESTDIR`

This could potentially be improved to reuse an existing sysroot. The
problem is with building the SUBDIR_OVERRIDE list it needs to use a
different OBJDIR since it is building all statically. We don't want to
pollute the existing 'buildworld' OBJDIR and cause confusion on the next
build. Using a separate OBJDIR for the 'everything' phase mostly works
except for some things like linking in INTERNALLIBS that exist in the
other OBJDIR.

MFC after: 1 month
Sponsored by: Dell EMC Isilon

# b1237142 25-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Follow-up r319593: Don't use host headers in a fresh new build.

Sponsored by: Dell EMC Isilon

# 71a6afa2 10-Oct-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Do not print error when running make check-old on system
without catpages directories

Reported by: dim

# 0b972ac9 05-Oct-2017 Warner Losh <imp@FreeBSD.org>

Support armv7 builds for userland

Make armv7 as a new MACHINE_ARCH.

Copy all the places we do armv6 and add armv7 as basically an
alias. clang appears to generate code for armv7 by default. armv7 hard
float isn't supported by the the in-tree gcc, so it hasn't been
updated to have a new default.

Support armv7 as a new valid MACHINE_ARCH (and by extension
TARGET_ARCH).

Add armv7 to the universe build.

Differential Revision: https://reviews.freebsd.org/D12010

# 0c059da3 03-Oct-2017 Cy Schubert <cy@FreeBSD.org>

When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

This is the correct patch.

Reviewed by: ngie (previous version, r302865)
MFC after: 2 months
Differential Revision: D7167

# 84f54c4f 03-Oct-2017 Cy Schubert <cy@FreeBSD.org>

Revert r324246. This is not exactly what was intended.

# 74e0e295 03-Oct-2017 Cy Schubert <cy@FreeBSD.org>

When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

Reviewed by: ngie (previous version, r302865)
MFC after: 2 months
Differential Revision: D7167

# b505dd63 25-Sep-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Do not print error when running make delete-old on system
without catpages directories

# 6d0ab078 05-Sep-2017 Ryan Libby <rlibby@FreeBSD.org>

Makefile.inc1: bump elf tool chain version check after PR 215350 fix

This causes builds to use the in-tree libdwarf with the bug fix instead
of the host library.

Reviewed by: bdrewery, emaste, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12239

# e133ecbb 27-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Respect MK_TCSH with build-tools and native-xtools

This helps reduce the WORLDTMP footprint slightly.

Based on a patch I submitted 5 years ago to GNATS.

PR: 174051
MFC after: 2 weeks
Relnotes: yes (anyone who cross-builds with MK_TCSH=yes will run into
build failures if the host doesn't have tcsh(1))
Reminded by: Fabian Keil <fk@fabiankeil.de>

# 6323f724 22-Aug-2017 Ed Maste <emaste@FreeBSD.org>

Set MK_LLD_IS_LD to MK_LLD_BOOTSTRAP for cross-tools

LLD_BOOTSTRAP is intended to control the linker used to link world and
kernel, while LLD_IS_LD is intended to control the linker installed in
that world.

Force LLD_IS_LD equal to LLD_BOOTSTRAP for the cross-tools build and
install phase, so that lld will be installed as the ld to run on the
host, when LLD_BOOTSTRAP is set.

PR: 221543
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12072

# 53d1eddd 15-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Revert r322327, r322352, r322358:

Disconnect the dependency on the kernel package from the runtime
package. There are a number of problems here:

1) The runtime package installed into a chroot or a jail would
include the kernel package, changing the behavior of how jails
work now [1];

2) As result of (1), it is possible a binary may incorrectly
resolve kernel symbols [2]; in addition, it is possible there
will be unexpected fallout with 32-bit jails on a 64-bit host
kernel [2].

Noticed by: brd [1]
Discussed with: kib [2]
MFC after: 3 days
MFC note: record-only to wipe from the merge tracker
Sponsored by: The FreeBSD Foundation

# ebd2eeb3 11-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Add SVNVERSION_CMD to bsd.own.mk, adding the capability to include
svnversion metadata to the runtime and kernel packages.

Instead of traversing src/sys, as is done by newvers.sh for uname(1),
a full tree walk is done to prevent userland and/or modifications
from not being reflected in a modified tree (M).

MFC after: 5 days
Sponsored by: The FreeBSD Foundation

# 1866d42e 11-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Fix indentation from r322401.

MFC after: 3 days
MFC with: r322401
Sponsored by: The FreeBSD Foundation

# 33f8570d 11-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Avoid creating kernel-dbg.txz distribution sets and kernel-debug
packages when MK_DEBUG_FILES is 'no'.

MFC after: 5 days
Sponsored by: The FreeBSD Foundation

# 15373377 10-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Indent nested conditionals for readability.

Sponsored by: The FreeBSD Foundation

# 16398a11 09-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Add a dependency on the kernel package for the runtime package.

The idea here is that, provided upstream pkg(8) maintainers accept
the proposed change, the kernel.ucl will contain a post-install
script causing pkg(8) to emit a message informing to reboot the
system after the kernel is upgraded using 'pkg upgrade', so the
new userland is installed on the running new kernel. At present,
this functionality does not exist in pkg(8), but will help ensure
the upgrade path follows that from UPDATING. To work around this
for now, evaluate ASSUME_ALWAYS_YES, and prompt the user if they
wish to proceed if not set to true.

Since there is a kernel dependency, and a non-GENERIC kernel may
be in use, update Makefile.inc1 to replace '%KERNCONF%' in the
runtime.ucl with the first-built kernel set either via command line
or in make.conf(5).

MFC after: 5 days
Sponsored by: The FreeBSD Foundation

# 8422e09e 07-Aug-2017 Dimitry Andric <dim@FreeBSD.org>

Follow-up to r321684 (Don't use libc++ when cross-building for gcc
arches), and handle two more cases where libc++ includes could be
incorrectly enabled, in case the host compiler is clang 5.0.0, and the
target (cross) compiler is gcc 4.2.1.

Noted by: bdrewery
MFC after: 3 days
X-MFC-With: 321684

# 91234af7 01-Aug-2017 Bryan Drewery <bdrewery@FreeBSD.org>

CCACHE_BUILD: Follow-up r321880: Fix some PATH issues with buildworld.

- bsd.compiler.mk: Must ensure that the CCACHE_WRAPPER_PATH comes first
in PATH.
- Makefile.inc1: Must prepend the CCACHE_WRAPPER_PATH into BPATH as it
overrides the PATH set in bsd.compiler.mk in sub-makes. The PATH
set in bsd.compiler.mk is not exported and doing so would cause it to
then override the BPATH set from environment. The only sane solution
is to prepend into BPATH as needed.
CCACHE_PATH could possibly be used for some of this as well.

Sponsored by: Dell EMC Isilon

# 5aa73fa2 01-Aug-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_CLEAN: No need to run delete-old if the directories don't exist.

X-MFC-With: r321443
MFC after: 1 month
Sponsored by: Dell EMC Isilon

# dca576be 01-Aug-2017 Ian Lepore <ian@FreeBSD.org>

In xdev-links, when installing symlinks to the cross-compiler pieces that
includes the OS version (armv6-freebsd12.0-cc, etc), use the OS version of
the compiler/world source code, not the version of the build host machine.

# 1681d1de 28-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Don't use libc++ when cross-building for gcc arches

Since we imported clang 5.0.0, the version check in Makefile.inc1 which
checks whether to use libc++ fires even when the compiler for the target
architecture is gcc 4.2.1. This is because only X_COMPILER_VERSION is
checked. Also check X_COMPILER_TYPE, so it will only use libc++ when an
external gcc toolchain is used.

Reviewed by: emaste, rpokala
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11776

# 18388aa4 25-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_CLEAN: Hide delete-old output.

It is full of distracting noise about UPDATING and may confuse
the user about what is actually being deleted. It is also
possible to have directories removed on every run with
use of WITHOUT_ knobs that the mtree files do not
account for and for which the directories are incorrectly
in OLD_DIRS currently.

X-MFC-With: r321443
MFC after: 1 month
Sponsored by: Dell EMC Isilon

# b7c6a063 25-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Only build libzfs_core in 'make libraries' if needed.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 63c534e7 25-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Remove unneeded dependency for libzfs.

This dependency does nothing since cddl/lib/libzfs is never
added into the 'make libraries' dependency chain
directly.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 1ae1311d 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP.

This prevents situations with -DNO_CLEAN from finding stale headers or
libraries in places that no longer exist or have moved. It avoids
the need to remove all of WORLDTMP by reusing what we already know
is obsolete.

MFC after: 1 month
Sponsored by: Dell EMC Isilon

# dc75d44e 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

The .depend.obj cleanup hacks are only needed with -DNO_CLEAN.

Sponsored by: Dell EMC Isilon

# cd283100 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move llvm Options.inc hack from r321433 for NO_CLEAN to lib/clang/libllvm.

The files are only ever generated to .OBJDIR, not to WORLDTMP (as a
sysroot) and are only ever included from a compilation. So using
a beforebuild target here removes the file before the compilation
tries to include it.

MFC after: 2 months
X-MFC-With: r321369

# edcc769f 24-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Cleanup stale Options.inc files from the previous libllvm build for
clang 4.0.0. Otherwise, these can get included before the two newly
generated ones (which are different) for clang 5.0.0.

Reported by: Mark Millard
MFC after: 2 months
X-MFC-With: r321369

# 0f827d7a 08-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

makeman: Don't show META_MODE ABI rebuild warnings.

Reported by: dim
Sponsored by: Dell EMC Isilon

# 9bb3819b 08-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER: Ensure there is not a stale compiler in WORLDTMP.

In a scenario of cross-building it is possible that an OBJDIR's WORLDTMP
contains an older compiler in WORLDTMP/usr/bin/cc that is not rebuilt
if SYSTEM_COMPILER logic is triggered. This compiler was still
incorrectly used. Address this by removing WORLDTMP/usr/bin/cc and all
of the hardlinked files associated with it. Also do this for c++ for
GCC builds.

Sponsored by: Dell EMC Isilon
MFC after: 1 week

# f45c7805 05-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix create-kernel-packages with multiple BUILDKERNELS after r320284

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: ngie

# a28412b0 24-Jun-2017 Ed Maste <emaste@FreeBSD.org>

Clean up stale dependencies after r320278

Our current approach to dependency tracking cannot cope with switching
generated asm syscall stubs into C wrappers. Perpetuate the hack in
Makefile.inc1 to paper over the problem until we can take a holistic
approach to fixing dependency problems.

Differential Revision: https://reviews.freebsd.org/D11344

# 0369270f 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_ROOT: Remove excessive // when DESTDIR/DISTDIR are empty.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 2d5cc538 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

compiler-metadata: Properly handle cross-build OBJDIR.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

# 275219cf 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Expose only the create-packages-* targets since they set needed DEST/DIRDIR.

The other targets just fail confusingly otherwise.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 10c93529 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Parallelize individual kernel packaging.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# f77b03aa 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow actually building individual world packages in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 48c22674 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow creating kernel/world packages in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 00c44825 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow staging world/kernel in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# dd7b4c15 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow stageworld/stagekernel to run with make jobs.

The -B was originally added in projects/release-pkg r289381 as a copy
of what 'make world' did at the time. The -B was removed from
the 'installworld' call in 'world' in r303844 though. The staging
of files is safe to run in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# d20bd9e4 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Set compiler metadata for stageworld/distributeworld.

This fixes LD errors during 'make packages' but also for the unlikely case of
'buildworld' on 1 system and 'packages' on another [1].

PR: 212877 [1]
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 81b4423f 22-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Pass along LINKER_* vars during installworld and show in test-system-compiler.

Sponsored by: Dell EMC Isilon

# 817366f1 20-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

buildworld: Pass which world phase the build is in down to submakes.

This is useful for having directories behave differently depending
on the phase - such as enabling SUBDIR_PARALLEL or disabling
redundant building of library directories already done by
earlier 'make _libraries'.

Sponsored by: Dell EMC Isilon

# 35fb812a 19-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

buildworld: Define SYSROOT to WORLDTMP.

This is to allow downstream Makefiles to know for sure they are building
against a sysroot rather than only depending on ${DESTDIR} or other
assumptions.

This also exports it into buildenv.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# ff6c17c9 12-Jun-2017 Ed Maste <emaste@FreeBSD.org>

remove stale dependencies for utimens* wrappers removed in r319663

Use a similar approach to r318957 (which was for ptrace dependencies):
grep the .depend file for the old source file and delete the stale
dependency if found.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11091

# 69db9346 07-Jun-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Fix src.conf.5 generation

When makeman is generating src.conf(5) it tries to test all variation of options
including WITH_DIRDEPS_BUILD. it results in an error when filemon(4) is not
loaded.

Export variables that are needed to prevent this behaviour.

Helped by: sjg

# c8fab231 04-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Force a host tool rebuild for ino64 in r318736.

Sponsored by: Dell EMC Isilon

# 1a9cc831 04-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Add framework to force rebuilding for major ABI changes.

Normally META_MODE ignores host files for "meta mode" decisions on whether a
file should be rebuilt or not. This is because a simple installworld can
update timestamps and cause the next build to rebuild all host tools, when the
previous ones may not have any changes in the source tree. These tools are
normally still ABI compatible. They are only rebuilt if NO_META_IGNORE_HOST is
set from the workaround/hack in r301467.

One of the major problems with this is when a host tool has objects spread
across many revisions that have mixed-ABI. For example, if struct stat were to
change on the host, some objects for a tool may have different ideas of that
struct's definition. If just 1 source file were modified and rebuilt and
linked into the tool, then that toll will have mixed-ABI objects and crash.
This exact thing happened with the ino64 commit in r301467 followed by a
trivial update to libbfd in r318750. The resulting binary would crash in
buildworld.

Sponsored by: Dell EMC Isilon

# 86f2d54f 03-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Connect makewhatis.

This speeds up some port staging, namely perl.

# 9f685734 01-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Connect lld.

This will ensure that aarch64 gets a working native /usr/bin/ld rather
than requiring the aarch64-binutils hack in Poudriere, or emulating
the aarch64 lld.

PR: 217189
Reported by: swills, jbeich

# bd1c3bad 30-May-2017 Ed Maste <emaste@FreeBSD.org>

add a rescue/sh sanity check before installworld on the running system

FreeBSD does not guarantee kernel forward compatibility (that is,
running a newer userland on an older kernel). The documented upgrade
procedure specifies that installkernel should be performed, followed by
a reboot and then installworld. As a sanity check when installing onto
the running system (DESTDIR is / or unset), attempt to run "sh echo OK"
using rescue from the objdir. If rescue fails (e.g., because the system
has not been rebooted and the "old" kernel lacks a system call required
by the to-be-installed world), abort the installation.

This should avoid ino64 foot-shooting when the proper upgrade procedure
is not followed.

Reviewed by: allanjude, gjb, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10987

# 55b87d46 26-May-2017 Ed Maste <emaste@FreeBSD.org>

rm stale ptrace dependencies after r305012

This is similar to r318912, except that ptrace.[sS] was previously a
file in the source tree, not a generated assembly wrapper.

Check for the existence of ptrace.[sS] in the .depend file to determine
if we have to clean it up. This is a bit hackish and will not be left
in place indefinitely, but provides a useful example case when
investigating a better solution in bmake.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10930

# 90d4415d 25-May-2017 Ed Maste <emaste@FreeBSD.org>

libc: rm stale generated files which are no longer syscalls

This is an attempt to help -DNO_CLEAN builds after r302092 (which
removed the pipe libc syscall wrapper) and r318736 (which removed
getdents, lstat, mknod, and stat).

Dependencies cannot cope with certain source tree changes,
particularly with respect to removing source files and replacing
generated files. Handle these cases from _worldtmp in an ad-hoc
fashion.

Reviewed by: bdrewery, cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10876

# ac4ef3f9 25-May-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Now that roff documentation has been disconnected from the build, it is no
longer necessary to have groff(1) as a bootstrap tool

# c596c287 09-May-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add a -DNO_LIBS to skip building the libraries phase as well.

This is useful for cases where -DWORLDFAST is useful.

Sponsored by: Dell EMC Isilon

# 16892c77 09-May-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Support -DWORLDFAST to skip all build steps up to 'libraries' and 'everything'.

This allows for building the world against the already-created
host/sysroot environment. It is not overly useful outside of cases of
large-impact changes such as a testing a new compiler. It will
allow quickly getting back to an error in the target-phases of the
build where a new compiler is being used.

Sponsored by: Dell EMC Isilon

# 6d75a7a8 09-May-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Support skipping 'make obj' tree-walk.

This is part of a larger effort for WITH_AUTO_OBJ and a WORLDFAST
option.

Sponsored by: Dell EMC Isilon

# d5392a41 08-May-2017 John Baldwin <jhb@FreeBSD.org>

Honor WITHOUT_LIB32 on mips64.

The closing paren for the list of architectures that should enable LIB32
by default was in the wrong place resulting in LIB32 always be enabled on
mips64 regardless of WITH_LIB32/WITHOUT_LIB32.

Submitted by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Obtained from: CheriBSD
Sponsored by: DARPA / AFRL

# a17665bc 20-Apr-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Replace again GNU diff with BSD diff

After a firts failed attempt, BSD diff is now good enough to replace
GNU diff.

Relnotes: yes

# 5e50a318 18-Apr-2017 Glen Barber <gjb@FreeBSD.org>

Use relative symlink for 'latest' to allow repo to work after being
moved.

Submitted by: woodsb02
MFC after: 3 days
PR: 217197
Sponsored by: The FreeBSD Foundation

# 848d5e92 13-Apr-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Cache compiler metadata and reuse it at installworld time.

Right after cross-tools, a compiler-metadata.mk file is created that
stores all of the bsd.compiler.mk metadata. It is then read in
with a fail-safe during installworld time.

The file is explicitly removed when invoking cross-tools to ensure that
a stale file is not left around from odd manual 'make _cross-tools' ->
'make installworld' invocations.

This fixes several issues:
- With WITH_SYSTEM_COMPILER (default yes on head and no on releng/11.0):
If you build on a system where the bootstrap compiler does not
build due to the host compiler matching the in-tree one, but then
installworld on another system where that logic fails (a
bootstrap compiler is needed), the installworld immediately fails
with:
sh: cc: not found
Note that fixing this logic may then hit a case where a rebuild is
attempted in installworld. Normally cc would be ran with
'CFLAGS+=ERROR-tried-to-rebuild-during-make-install' to cause an
error such as:
cc: error: no such file or directory: 'ERROR-tried-to-rebuild-during-make-install'
However, now it will just fail with the 'cc: not found' error.
Inspection of the compile line will show
'ERROR-tried-to-rebuild-during-make-install'; It's not useful to
set CC to anything other than 'cc' during install as it is more
helpful to see the attempted compile rather than some other bogus
error.
- This now avoids running bsd.compiler.mk (cc executions) even more
during installworld. There are compiler-dependent SUBDIR in the
tree which required having a compiler during install.

There is at least 1 case where CC is still executed in the install,
such as from a LOOKUP!= in secure/lib/libcrypto/Makefile.inc checking
for 'vzeroall' support. This is not significant for installworld
as the lookup has a fallback (and hides its error) and only modifies CFLAGS,
thus it's not worth fixing.

PR: 212877
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# d5b29b60 13-Apr-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Pass COMPILER_FEATURES down to submakes for installworld.

This is for WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, external
compiler, etc.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# ffe63c8b 08-Apr-2017 Ed Maste <emaste@FreeBSD.org>

Introduce LLD_BOOTSTRAP to control lld as bootstrap linker

Add WITH_LLD_BOOTSTRAP and WITHOUT_LLD_BOOTSTRAP knobs, similar to the
Clang bootstrap knobs.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10249

# 1bf5e133 07-Apr-2017 Ed Maste <emaste@FreeBSD.org>

do not require binutils port when using lld as ld

r279908 added logic to Makefile.inc1 to automatically set
CROSS_BINUTILS_PREFIX for architectures not supported by the in-tree
binutils: arm64 when first introduced, and later riscv64 as well.

LLVM's LLD linker is now included in the base system, and is enabled by
default for arm64 and capable of linking world and kernel. Thus, avoid
automatically setting CROSS_BINUTILS_PREFIX and requiring the binutils
port if WITH_LLD_IS_LD is true.

Reviewed by: kan
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10310

# dbbb03c2 06-Apr-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Fix build-tools still sometimes rebuilding during target build.

In a cross-build, the build-tools are native host binaries. We do not
want to rebuild them when building for the target. Bmake previously
did not support checking .NOMETA on an existing target, so .NOMETA_CMP
was used here. However, .NOMETA_CMP still triggers meta mode conditions
if the number of commands or the command changes. In r312467 the paths
to build ncurses files were modified and thus triggered meta mode to
rebuild the build tools (make_keys, make_hash) in ncurses during the
target build. Bmake 20160604 committed in r301462 changed .NOMETA to
also skip meta mode logic for an existing .meta file as well, thus it
is now the proper fix here.

I explored moving the build-tools output to WORLDTMP/tools with
relatively good success, but have concerns that doing so would be
problematic for downstream vendors who use LOCAL_TOOL_DIRS and
expect the tools to be in current OBJDIR for the target. It also
adds more complexity into finding the tools during target build
and handling of where they are for rescue/rescue and
mkcsmapper_static/mkesdb_static which should really not be connected in
build-tools anyway.

MFC after: 2 weeks
Reported by: many
Sponsored by: Dell EMC Isilon

# 35070067 21-Mar-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Rename _cc to _gcc to be more clear.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

# 2c5ddcf8 19-Mar-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Temporary readd GNU diff

etcupdate requires --change-group-format it is not easy to implement
in bsd diff so for now readd GNU diff

# 5714b701 11-Mar-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Fix native-xtools after replacement of GNU diff

# 97ab006d 10-Mar-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Remove the WITHOUT_MANDOCDB option

mandoc database is activated since FreeBSD 11.0, let's remove the previous
database format for FreeBSD 12.0

# 0e4e8f1b 06-Mar-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Added comments for why nmtree/libmd are bootstrapped.

# 51c6e78d 05-Mar-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix bootstrapping mtree after r313404 for older systems.

r313404 made libnetbsd require sha384.h from libmd. Libmd added it in
r292782. Update BOOTSTRAPPING to account for this.

Reported by: bde
Reviewed by: ngie

# 6ae9acde 23-Feb-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r313896 through r314128.


# 6fc94bc4 21-Feb-2017 Warner Losh <imp@FreeBSD.org>

Document why cat is a bootstrap tool.

# 74464d3c 18-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Include ${LOCALBASE}/bin in $PATH when running "make checkworld"

Some of the tests in devel/atf // devel/kyua rely on the tools being in $PATH,
which means that the tests fail when run via "make checkworld" because $PATH
is restricted to exclude directory elements like "${LOCALBASE}/bin".

MFC after: 1 week
Sponsored by: Dell EMC Isilon

# 66df1425 18-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Quote path to doxygen/kyua in test(1) -x check

This is a basic stopgap against ${LOCALBASE} containing spaces in it

MFC after: 1 week
Sponsored by: Dell EMC Isilon

# 68a558ec 17-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Fix after libc++ update in r300873.

The xdev build needed the same fixes as libcompat and external toolchain
support needed for handling of --sysroot, -L, -B, etc.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# e36b831f 17-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Build yacc which is needed for recent libpcap updates.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 9e580940 17-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE+xdev: Don't rebuild build-tools during normal build.

See r297997 for more information.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

# f9edb084 05-Feb-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r313055 through r313300.


# e2972270 03-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Remove LOCAL_LIB_DIRS warning added in r275839.

The case for which this was added, r274807, causes this warning to
always show. LOCAL_DIRS=foo LOCAL_LIB_DIRS=foo/lib. The only case in
which r274807 is a problem is if foo/Makefile does not contain
SUBDIR+=lib, which is a normal convention. LOCAL_LIB_DIRS is a special
hack only to get a library into the _generic_libs list for the
'make libraries' bootstrapping phase. The old behavior changed in
r274807 was only in head during the 10.0 cycle, so the warning was
only ever needed until release anyhow.

Reported by: ngie
MFC after: 1 week
Sponsored by: Dell EMC Isilon

# c6dc1332 03-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Fix typo in variable name (_REDUNDENT_LIB_DIRS -> _REDUNDANT_LIB_DIRS)

MFC after: 3 days
Sponsored by: Dell EMC Isilon

# 27f134b6 03-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Add missing readelf.

The switch to elftoolchain's readelf in r280859 caused native-xtools
to no longer build readelf. This fixes poudriere builds not using
a native readelf when expected.

Reported by: strejda on freenode
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 65575c14 29-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r312894 through r312967.


# 2b375b4e 27-Jan-2017 Yoshihiro Takahashi <nyan@FreeBSD.org>

Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes: yes

# d63b10f0 27-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Update clang400 branch for LD_AS_LLD -> LD_IS_LLD

# 14f850f3 27-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r312720 through r312893.


# f52e4bdf 26-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Rename LLD_AS_LD to LLD_IS_LD, for consistency with CLANG_IS_CC

Reported by: Dan McGregor <dan.mcgregor usask.ca>

# 737872e9 25-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Also apply WITH_LLD_AS_LD to build tools

Previously WITH_LLD_AS_LD installed LLD as /usr/bin/ld in the target
system, but still used the GNU BFD ld to link the binaries in that
target. LLD 4.0.0 can link the FreeBSD/amd64 world and kernel so use
LLD as the build-time linker as well when the knob is set.

Reviewed by: dim
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9226

# 7666f500 21-Jan-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Import mandoc cvs snapshot 20170121 (pre 1.14)

Note that mandoc does not use anymore sqlite3 but a home made database format
An important improvement has been made as well in makewhatis performance:
Tests on my laptop shows makewhatis on the entire system goes from 26s to 12s


# 69b4d461 06-Jan-2017 John Baldwin <jhb@FreeBSD.org>

Enable /usr/lib32 for o32 binaries on mips64.

Build and install an o32 set of libraries on mips64 suitable for
running o32 binaries via COMPAT_FREEBSD32. Enable COMPAT_FREEBSD32 in
MALTA64.

Reviewed by: jmallett, imp
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D9032

# 94ef145e 02-Jan-2017 Enji Cooper <ngie@FreeBSD.org>

Only bake krb5_config.h support in to ssh(3), etc if both MK_GSSAPI and
MK_KERBEROS_SUPPORT != no

This fixes the odd case where someone specified MK_GSSAPI=no and
MK_KERBEROS_SUPPORT=yes (which admittedly, probably doesn't make sense,
but the build system doesn't prevent this case today, and it didn't when
I filed the bug back in 2011 either).

MFC after: 2 weeks
PR: 159745

# 715652a4 02-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Make native-xtools build correctly after clang/llvm 3.9.0 import

During the clang/llvm 3.9.0 import, the build structure for it was
completely revamped. This broke the native-xtools target.

It first attempts to build libllvmminimal, then the llvm-tblgen and
clang-tblgen executables, but these fail to link because they are linked
to the 'full' libllvm by default, as they normally are during the
'world' stage.

To make these link against libllvmminimal instead, define TOOLS_PREFIX,
similarly as during the bootstrap-tools phase. The value itself is
empty, as we don't really want to use a prefix.

Reviewed by: imp
PR: 215684
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9026

# aeb76c0b 16-Dec-2016 Matthew Seaman <matthew@FreeBSD.org>

Revert r309339, thus re-instating r309314

The original problem with conflicting definitions of ${PKG_CMD} was
solved by r427523 in ports (see https://reviews.freebsd.org/D8677), so
this should be safe now.

Reviewed by: gjb
Approved by: gjb
Differential Revision: https://reviews.freebsd.org/D8120

# 629582ca 10-Dec-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Now that external gcc directly natively links to libc++ we can remove
the dirty hack made to fake libstdc++

# 158c18ff 02-Dec-2016 Warner Losh <imp@FreeBSD.org>

dd is currently a bootstrap tool. It really doesn't have any business
being a bootstrap tool. However, for reproducible build output,
FreeBSD added dd status=none because it was otherwise difficult to
suppress the status information, but retain any errors that might
happen. There's no real reason that dd has to be a build tool, other
than we use status=none unconditional. Remove dd from a bootstrap tool
entirely by only using status=none when available. This may also help
efforts to build the system on non-FreeBSD hosts as well.

Differential Revision: https://reviews.freebsd.org/D8605

# ebc7f2b8 30-Nov-2016 Glen Barber <gjb@FreeBSD.org>

Revert r309314, which breaks installing ports.

Requested by: antoine
Differential Revision: https://reviews.freebsd.org/D8120 (related)
Sponsored by: The FreeBSD Foundation

# 26e28783 30-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Cleanup old debug dirs in delete-old-dirs target

Any .debug or .symbols files under /usr/lib/debug which correspond to
OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up
by the delete-old target. Make this also apply to any OLD_DIRS entries.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D8683

# 91c915fa 30-Nov-2016 Matthew Seaman <matthew@FreeBSD.org>

Allow a user-overridable setting 'PKG_CMD' to control the command used
to create a repo during 'make packages'

This would have been useful for a situation I found myself in where
pkg(8) had been upgraded to a version that wanted the FBSD_1.5 ABI
version but libc.so.7 had not been upgraded, and only provided
FBSD_1.4. I found I needed to update libc in order to run pkg, and I
also needed to use pkg to update libc... Which is why pkg-static
exists, but there's currently no way to tell the build system to use
pkg-static instead of pkg.

This creates a variable PKG_CMD, default value 'pkg', that can be
overridden from the command line.

Reviewed by: gjb
Approved by: gjb
Differential Revision: https://reviews.freebsd.org/D8120

# 0aa5466e 25-Nov-2016 Ed Maste <emaste@FreeBSD.org>

Add WITH_LLD_AS_LD build knob

If set it installs LLD as /usr/bin/ld. LLD (as of version 3.9) is not
capable of linking the world and kernel, but can self-host and link many
substantial applications. GNU ld continues to be used for the world and
kernel build, regardless of how this knob is set.

It is on by default for arm64, and off for all other CPU architectures.

Sponsored by: The FreeBSD Foundation

# 67bc8c8b 19-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r308491 through r308841.


# 7804dd52 16-Nov-2016 Ruslan Bukin <br@FreeBSD.org>

Add full softfloat and hardfloat support for RISC-V.

Hardfloat is now default (use riscv64sf as TARGET_ARCH
for softfloat).

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8529

# 7c6d0bb1 12-Nov-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move libsysdecode-specific hack out of buildworld.

This should fix the lib32 build since it was not removing the generated
ioctl.c. This file is generated by a find(1) call, so cannot use normal
dependency tracking methods.

Reported by: jhb
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

# 2828dafc 10-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r308227 through r308490.


# 111bf579 10-Nov-2016 Antoine Brodin <antoine@FreeBSD.org>

Add limits(1) to native-xtools so that it can be used in qemu user-mode jails

# c7fbd772 04-Nov-2016 Ed Maste <emaste@FreeBSD.org>

Connect new LLVM-based libgcc_eh & libgcc_s to the build

Compiler-rt and LLVM's libunwind provide a suitable replacement for
libgcc.a, libgcc_eh.a, and libgcc_s.so.

Remove the now-unused LLVM_LIBUNWIND block from gnu/lib/libgcc.

PR: 213480 [exp-run]
Reviewed by: brooks, ed
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8189

# a2b802ce 02-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r303250 through r308226.


# e4195e2e 01-Nov-2016 Jonathan Anderson <jonathan@FreeBSD.org>

Add rules to build LLVM IR binaries and libraries.

Running `make libfoo.ll` or `make libfoo.bc` within a library directory
will now give us an LLVM IR version of the library, and `make foo.full.ll`
or `make foo.full.bc` will give us an IR version of a binary.

As part of this change, we add an LLVM_LINK variable to sys.mk that can be
specified/overridden using an external toolchain.

Reviewed by: bdrewery, brooks
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8388

# 02ebdc78 31-Oct-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r307736 through r308146.


# 5bca2215 31-Oct-2016 Ruslan Bukin <br@FreeBSD.org>

Add full softfloat and hardfloat support for MIPS.

This adds new target architectures for hardfloat:
mipselhf mipshf mips64elhf mips64hf.

Tested in QEMU only.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D8376

# 90136961 23-Oct-2016 Warner Losh <imp@FreeBSD.org>

Tweak the UPDATING message a bit about the upgrade path.
Add some automation into Makefile.inc1 to to enforce known good
upgrade from source paths.

# dc9b124d 21-Oct-2016 Justin Hibbits <jhibbits@FreeBSD.org>

Create a new MACHINE_ARCH for Freescale PowerPC e500v2

Summary:
The Freescale e500v2 PowerPC core does not use a standard FPU.
Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor
unit, which doubles as a FPU. The PowerPC SPE ABI is incompatible with the
stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this.
Additionaly, the SPE opcodes overlap with Altivec, so these are mutually
exclusive. Taking advantage of this fact, a new file, powerpc/booke/spe.c, was
created with the same function set as in powerpc/powerpc/altivec.c, so it
becomes effectively a drop-in replacement. setjmp/longjmp were modified to save
the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by
the SPE).

Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not
support double-precision floating point.

Also, without a new MACHINE_ARCH it would be impossible to provide binary
packages which utilize the SPE.

Additionally, no work has been done to support ports, work is needed for this.
This also means no newer gcc can yet be used. However, gcc's powerpc support
has been refactored which would make adding a powerpcspe-freebsd target very
easy.

Test Plan:
This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222
(P1022-based) board, compiled against the new ABI. Base system utilities
(/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot
multiuser.

Reviewed By: bdrewery, imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D5683

# 5763f796 21-Oct-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r307383 through r307735.


# c615275c 20-Oct-2016 Ed Maste <emaste@FreeBSD.org>

Don't build libssp as a prereq lib if WITHOUT_SSP is set

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

# 801b3919 19-Oct-2016 Ed Maste <emaste@FreeBSD.org>

Fix MK_SHAREDOCS test from r306864

Groff is needed only if MK_GROFF and MK_SHAREDOCS are both true.

# 242b2482 09-Oct-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r306412 through r306905.


# 24ff5a32 08-Oct-2016 Baptiste Daroussin <bapt@FreeBSD.org>

groff is not needed in the bootstrap tools if the system is built
WITHOUT_SHAREDOCS

MFC after: 2 weeks

# 335bcabe 28-Sep-2016 Ed Maste <emaste@FreeBSD.org>

Merge ^/head r306303 through 306411.


# f987297f 27-Sep-2016 Ed Maste <emaste@FreeBSD.org>

Add a WITHOUT_DIALOG src.conf(5) knob

It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup).

Reviewed by: dteske
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7969

# 2aeb0380 02-Sep-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r305220 through r305300.


# fcc803df 01-Sep-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Bump __FreeBSD_version for crunchgen META_MODE fix in r305254.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.

# 4d611b2b 23-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix in-tree GCC builds after r304681.

There were a few issues.
- In-tree GCC won't have X_COMPILER_TYPE defined but will have
WANT_COMPILER_TYPE==gcc set from the SYSTEM_COMPILER logic that can
be used. Make the clang check specific to clang as well to ensure
-target doesn't leak into a GCC build.
- When using a cross-compiler GCC (with a default sysroot or arch) and also
passing --sysroot, it basically forgets all internal paths for
libraries. We've already worked around this quite a bit for
the external toolchains. Now for the in-tree bootstrap cross-compiler
GCC, also pass in the needed -B${WORLDTMP}/usr/lib to find the crt
object files, but also -isystem and -L to fix the paths. This creates
quite a spammy build log, but it is clear and still achieves the goals
and stays consistent between internal and external build flags.
Reducing the spam by using the '=' prefix feature will help and be
done later.

MFC after: 3 days
X-MFC-With: r304681
Reported by: bz
Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

# bb0cd1b5 23-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Always pass in -target and --sysroot flags for the build.

The internal bootstrap compiler has a default sysroot set by TOOLS_PREFIX
and target set by TARGET/TARGET_ARCH. However, there are several needs to
always pass an explicit --sysroot and -target.
- External compiler needs sysroot and target flags.
- External ld needs sysroot.
- To be clear about the use of a sysroot when using the internal compiler.
- Easier debugging.
- Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to
the flip-flopping build command when sometimes using external and
sometimes using internal.
- Allow using no lld which has support for default paths.

The default sysroot in the bootstrap compiler is not changed. The
buildenv compiler will still work with its default and will also
include -target/--sysroot from CC in the environment.

MFC after: 3 days
Discussed with: emaste, brooks (BSDCam)
Reviewed by: emaste
Sponsored by: EMC / Isilon Storage Division

# 0295d98c 15-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Trim unneeded bootstrap after r301470 made 9.1 the minimum supported release.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

# c8de0c57 12-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Avoid showing the bootstrap make command for check-old, etc.

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

# 14009f5e 10-Aug-2016 Li-Wen Hsu <lwhsu@FreeBSD.org>

Only remove empty directories before packaging.

This preserves files are intentionally empty, most of them are in tests.txz

Reviewed by: bdrewery
MFC after: 3 days

# 87ae8210 29-Jul-2016 Mark Johnston <markj@FreeBSD.org>

Add libprocstat prebuild library dependencies.

X-MFC-With: r303531

# a7e13d50 29-Jul-2016 Mark Johnston <markj@FreeBSD.org>

librtld_db: Use the auxv to figure out where to look up loader symbols.

Previously, librtld_db just hardcoded /libexec/ld-elf.so, which isn't
correct for processes that aren't using the native ABI. With this change,
librtld_db can be used to inspect non-native processes; in particular,
dtrace -c now works for 32-bit executables on amd64.

MFC after: 1 month

# fd406aa3 27-Jul-2016 Ed Maste <emaste@FreeBSD.org>

Remove ${OBJDUMP} as it is not used by the base system

It was added to sys.mk relatively recently (r274503) for EFI builds
but is no longer used by the base system. The in-tree binutils are
outdated, will not be updated, and will be removed in the future.
Remove it from the toolchain build now to slightly simplify the build
and make sure we don't grow an accidental dependency.

Note that this affects only the toolchain build, and does not affect
/usr/bin/objdump in the built world.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6460

# 73371266 24-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't disable binutils/elftoolchain bootstrapping with external compiler.

This was a regression from r300349.

Setting MK_CROSS_COMPILER=no forces the compiler bootstraping *and* the
binutils/elftoolchain bootstrapping to be disabled in share/mk/src.opts.mk.
The only intent with using an external compiler is to disable bootstrapping of
the compiler. The binutils/elftoolchain bootstrapping must still occur unless
XAS is set. This did not affect WITH_SYSTEM_COMPILER.

Now that setting an external compiler sets both MK_CLANG_BOOTSTRAP and
MK_GCC_BOOTSTRAP to no, and MK_CROSS_COMPILER does the same via
share/mk/src/opts.mk, remove redundant logic that checks for
MK_CROSS_COMPILER. It will not always be true now that MK_CROSS_COMPILER==no
when an external compiler is used and --sysroot/-target is needed.

Reported by: sbruno
Pointyhat to: bdrewery
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

# a9254587 24-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix empty WANT_COMPILER_TYPE when neither compiler is bootstrapped.

Bug in r303272.

MFC after: 3 days
X-MFC-With: r303272
Sponsored by: EMC / Isilon Storage Division

# b17f5b22 24-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER: Rework the logic to allow a 'make test-system-compiler'.

1. Always calculate what the expected values are.
2. Add 'make test-system-compiler' to show all of the computed values
vs the wanted values.
3. Extend the .info line to buildkernel/kernel-toolchain/toolchain/_cross-tools.
4. Consolidate all of the logic to one condition.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

# 4143850b 21-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add LOCAL_XTOOL_DIRS to add into cross-tools.

Sponsored by: EMC / Isilon Storage Division

# fe50ba05 19-Jul-2016 Ed Maste <emaste@FreeBSD.org>

Include makewhatis in ITOOLS when MK_MAN_UTILS is true

Previously it was conditional on MK_MAN. It's possible to build
FreeBSD with man pages but without man page tools. MK_MAN_UTILS
is the conditional used in share/man/Makefile for determining whether
makewhatis is executed at install time, so it is the proper one for
ITOOLS as well.

PR: 210142
MFC after: 1 week

# bcc238ea 15-Jul-2016 Cy Schubert <cy@FreeBSD.org>

Revert r302865 and it's sister r302866 as r302865 causes some breakage.

Reported by: Guy Yur <guyyur@gmail.com>

# 507cef93 14-Jul-2016 Cy Schubert <cy@FreeBSD.org>

When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

Reviewed by: ngie@
MFC after: 1 week
Differential Revision: D7167

# b987685f 12-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r302670 and r302671 for now.

MACHINE_CPUARCH smells like MACHINE except for arm64/aarch64 which
has it backwards.

# 79156eb7 12-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Create a TARGET_CPUARCH thing to go with MACHINE_CPUARCH.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7160

# 6cdb0cba 11-Jul-2016 Glen Barber <gjb@FreeBSD.org>

Fix TARGET_TRIPLE for 12.0-CURRENT.

Submitted by: rene
Sponsored by: The FreeBSD Foundation

# a356b784 07-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_COMPILER: Don't enable for xdev or native-xtools.

Otherwise they get no compiler.

Reported by: swills
Tested by: swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

# 48413367 28-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_COMPILER: Avoid using GCC4.8+ logic on native GCC4.2 platforms.

As the XXX notes, these should really be checking MK_GNUCXX since there is
already a version check in share/mk/src.opts.mk to disable it. Fixing that
here is more complex though. This could also be using X_COMPILER_FEATURES
but uses X_COMPILER_VERSION to keep in sync with the src.opts.mk logic.

Tested by: andreast
Sponsored by: EMC / Isilon Storage Division
Approved by: re (gjb)

# 07394091 15-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native powerpc64 build of lib32 with in-tree GCC.

- This was broken by r300350 and r300885.
- Add some comments around the external GCC logic since it is spread out
and in need of some cleanup.
- The problem was that X_COMPILER_TYPE is always defined from CC->XCC's
default, so if /usr/bin/cc is GCC (as it is on native powerpc64) then
X_COMPILER_TYPE was getting GCC and triggering the external logic in
Makefile.libcompat. It was intended to always provide -isystem with
GCC since --sysroot is used into the lib32 sysroot which won't modify
the header path without the -isystem. The use of the libc++/std=c++11
override was only intended to be used for external compilers though
(more accurately GCC 4.8+ but that's a separate assumption to
cleanup). Apply the same logic from Makefile.inc1 to Makefile.libcompat
to only add the libc++ override when needed for external compilers.

Pointyhat to: bdrewery
Tested with: native ppc64 (swills), universe, ppc64 xtoolchain,
amd64 xtoolchain, sparc64 cross-build of ppc64 (host GCC 4.2)
Reported by: andreast, swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

# 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

# aa06dfc9 05-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

legacy: Avoid building/installing headers twice.

Sponsored by: EMC / Isilon Storage Division

# 4d40df1b 05-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add a MINIMUM_SUPPORTED_OSREL and bump it to 900044.

This is actually a revision in the stable/9 branch released as 9.1. The
localedef build requires xlocale from this period.

Sponsored by: EMC / Isilon Storage Division

# 95348a57 04-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix incorrect logic in r301394.

Reported by: Mark Millard

# b4dd4229 04-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r301287: Pass external compiler metadata when used.

This fixes WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, external compiler, to
pass the external compiler metadata rather than the ${CC} metadata. On
a build host that has clang as CC it was passing the clang metadata rather than
GCC metadata during the build.

# bbfcc681 03-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITHOUT_CROSS_COMPILER: Fix installworld.

Since no WORLDTMP/usr/bin/cc is created, cc cannot be found
during installworld time since /usr/bin is not in the PATH.
Pass along the known compiler metadata to allow installworld
to work. The same fix was used for WITH_SYSTEM_COMPILER.

A better route would be to store a cookie in buildworld
containing this compiler metadata and then using that
at install time, rather than rerunning cc.

Reported by: Mark Millard
Sponsored by: EMC / Isilon Storage Division

# c371433e 03-Jun-2016 Dimitry Andric <dim@FreeBSD.org>

For clang, move the definition of FREEBSD_CC_VERSION into its own header
file, lib/clang/freebsd_cc_version.h, instead of reusing Version.inc.
The header is only included from one .cpp file in the clang tree.

This minimizes the number of .cpp files that need to be rebuilt if the
version is bumped.

Discussed with: bdrewery

# f661dbee 29-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

GCC External: Revert r300886, r300904, r300917, r300918

The fix in r300873 is mostly enough. A fix for lib32 will be
committed.separately.

# ce00342b 27-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move external GCC compiler hacks to bsd.sys.mk.

This allows respecting -nostdinc, -nostdinc++ and -nostdlib before
making the decision to add in -isystem, etc. The -isystem flags
are problematic for building lib/libc++ and lib/libcxxrt which wants
to only use its own headers.

More information the need of these flags can be found at
https://gcc.gnu.org/ml/gcc/2016-03/msg00219.html

This also reverts r300873.

Sponsored by: EMC / Isilon Storage Division

# 5929ee29 27-May-2016 Glen Barber <gjb@FreeBSD.org>

Make PKG_VERSION aware of '-ALPHA*'.

Submitted by: Ben Woods
Sponsored by: The FreeBSD Foundation

# eb9b07bb 26-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_AUTO_OBJ: Fix crunchgen builds.

Passing MAKEOBJDIRPREFIX to the main prog build (rescue) would confuse
WITH_AUTO_OBJ and cause it to create a recursed object directory that
then broke the actual prog build. This is normally not a problem since
we do not call 'make -f prog.mk obj' before building anything in it.

Crunchgen(1) also assumes that if -o is not passed then if an object
directory does not already exist then it should build in the source
directories. The normal buildworld process will have already ran 'make
obj' in each of the component directories so this is not a problem.
With WITH_AUTO_OBJ though this is not the case. So we must tell
crunchgen(1) that MK_AUTO_OBJ=yes will create the directory and to not
require it be present before generating its Makefile.

Sponsored by: EMC / Isilon Storage Division

# 016448a5 26-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Move the kernel support to kern.pre.mk.

This allows using META_MODE directly from the kernel build directory.
This also allows removing a hack from the DIRDEPS_BUILD kernel target.

Sponsored by: EMC / Isilon Storage Division

# 2d86a958 26-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove leftover _crunchide from r283108

# 9729cf09 26-May-2016 Dimitry Andric <dim@FreeBSD.org>

Update libc++ to 3.8.0. Excerpted list of fixes (with upstream revision
numbers):

r242679 Implement the plugin-based version of std::search. There are no
searchers yet; those are coming soon.
r242682 Implement the default searcher for std::experimental::search.
r243728 Add <experimental/any> v2.
r245330 implement more of N4258 - Cleaning up noexcept in the standard
library. Specifically add new noexcept stuff to vector and
string's move-assignment operations
r245334 Fix PR22606 - Leak pthread_key with static storage duration to
ensure all of thread-local destructors are called.
r245335 Fix PR23589: std::function doesn't recognize null pointer to
varargs function.
r247036 Implementation of Boyer-Moore and Boyer-Moore-Horspool
searchers for the LFTS.
r249325 Implement LWG#2063, and update the issues links to point to the
github generated pages
r249738 Split <ctype.h> out of <cctype>.
r249739 Split <errno.h> out of <cerrno>.
r249740 Split <float.h> out of <cfloat>.
r249741 Split <inttypes.h> out of <cinttypes>.
r249742 Split <math.h> out of <cmath>.
r249743 Split <setjmp.h> out of <csetjmp>.
r249761 Split <stddef.h> out of <cstddef>.
r249798 Split <stdio.h> out of <cstdio>.
r249800 Split <stdlib.h> out of <cstdlib>.
r249889 Split <wchar.h> out of <cwchar>.
r249890 Split <wctype.h> out of <cwctype>.
r249929 Split <string.h> out of <cstring>.
r250254 ABI versioning macros for libc++.
r251246 Fix LWG#2244: basic_istream::seekg
r251247 Fix LWG#2127: Move-construction with raw_storage_iterator.
r251253 Fix LWG#2476: scoped_allocator_adaptor is not assignable
r251257 Fix LWG#2489: mem_fn() should be noexcept
r251618 Implement P0004R1 'Remove Deprecated iostreams aliases'
r251766 Implement the first part of P0006R0: Adopt Type Traits Variable
Templates for C++17.
r252195 Implement P0092R1 for C++1z
r252350 Allow deque to handle incomplete types.
r252406 More of P0006R0: type traits variable aliases for C++17.
r252407 Implement LWG#2353: std::next is over-constrained
r252905 Implement P0074: Making owner_less more flexible
r253215 Implement P0013R1: Logical Operator Type Traits.
r253274 Implement P0007: Constant View: A proposal for a std::as_const
helper function template.
r254119 Add static_assert to set/multiset/map/multimap/forward_list/deque
that the allocator's value_type match the container's value_type.
r254283 Implement more of P0006; Type Traits Variable Templates.
r255941 LWG2485: get() should be overloaded for const tuple&&.
r256325 Fix LWG Issue #2367 - Fixing std::tuple and std::pair's default
constructors.
r256652 Fix for ALL undefined behavior in <list>.
r256859 First half of LWG#2354: 'Unnecessary copying when inserting
into maps with braced-init syntax'

Exp-run: antoine
Relnotes: yes


# 7e1b3c5e 23-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move binutils handling after src.opts.mk.

This fixes the arm64 build after r300348.

Sponsored by: EMC / Isilon Storage Division

# 6120aabd 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Opportunistically skip building a cross-compiler with SYSTEM_COMPILER set.

This will still build the compiler for the target but will not build the
bootstrap cross-compiler in the cross-tools phase. Other toolchain
bootstrapping, such as elftoolchan and binutils, currently still occurs.

This will utilize the default CC (cc, /usr/bin/cc) as an external compiler.

This is planned to be on-by-default eventually.

This will utilize the __FreeBSD_cc_version compiler macro defined in the
source tree and compare it to CC's version. If they match then the
cross-compiler is skipped. If [X]CC is an external compiler (absolute
path) or WITHOUT_CROSS_COMPILER is already set, then this logic is skipped.
If the expected bootstrap compiler type no longer matches the found CC
compiler type (clang vs gcc), then the logic is skipped. As an extra
safety check the version number is also compared from the compiler to
the tree version.

Clang:
The macro FREEBSD_CC_VERSION is defined in:
lib/clang/include/clang/Basic/Version.inc
For clang -target will be used if TARGET_ARCH != MACHINE_ARCH. This
is from the current external toolchain logic. There is currently an
assumption that the host compiler can build the TARGET_ARCH. This
will usually be the case since we don't conditionalize target arch
support in clang, but it will break when introducing new
architectures. This problem is mitigated by incrementing the version
when adding new architectures.

GCC:
The macro FBSD_CC_VER is defined in:
gnu/usr.bin/cc/cc_tools/freebsd-native.h
For GCC there is no simple -target support when TARGET_ARCH !=
MACHINE_ARCH. In this case the opportunistic skip is not done. If we
add proper support for this case in external toolchain logic then it
will be fine to enable.

This relies on the macros being incremented whenever any change occurs
to these compilers that warrant rebuilding files. It also should never
repeat earlier values.

Reviewed by: brooks, bapt, imp
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6357

# 76286f4b 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Enable external compiler logic if both bootstrap compilers are disabled.

Reviewed by: brooks
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6358

# c1b9d002 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Enable and utilize WITHOUT_CROSS_COMPILER logic for external CC.

This is a NOP.

Reviewed by: brooks, bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6354

# 34fb4407 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move external toolchain support earlier.

This is to consolidate external toolchain and WITHOUT_CROSS_COMPILER support.

Reviewed by: brooks, bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6353

# bf0c0f96 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Use META_MODE rather than .MAKE.MODE for buildkernel.

This is mostly a style change so that other code does not duplicate
it. The problem is when META_MODE needs to be disabled but it has
been overridden by .MAKE.MODE.

Sponsored by: EMC / Isilon Storage Division

# e873d4db 18-May-2016 Warner Losh <imp@FreeBSD.org>

Turns out, mipsn32el worked at one point, so add it back in.

Pointed out by: jmallet@

# 14e5b32d 18-May-2016 Warner Losh <imp@FreeBSD.org>

Fix negative logic error. We want gnueabihf ABI when we're NOT
requesting soft float ABI.

Noticed by: bdrewery

# 631dbc3b 18-May-2016 Warner Losh <imp@FreeBSD.org>

mipsn32el is not a thing, remove it from the list of valid
architectures. There's no definition for it, nobody uses it
and it is unlikely to ever work. We can put it back when someone
demonstrates it running...

The new default for armv6 is hard float, so extend that default
to the external toolchain support.

# ecb92e2d 18-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Combine restage/reinstall in a safe way.

Sponsored by: EMC / Isilon Storage Division

# 2c0e9e2a 18-May-2016 Warner Losh <imp@FreeBSD.org>

Make armv6 hard float abi by default. Kill armv6hf.
Allow CPUTYPE=soft to build the current soft-float abi libraries.
Add UPDATING entry to announce this.

Approved by: re@ (gjb)

# 396f5ab6 13-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Support libsoft for restage.

This is essentially fixing a merge conflict.

# d4ca5483 09-May-2016 Glen Barber <gjb@FreeBSD.org>

Revert r299292, which was not a mismerge. It has an additional horrible
side effect of replacing /etc/{master.,}passwd and /etc/group.

Submitted by: O. Hartmann
Pointyhat to: gjb (myself)
Sponsored by: The FreeBSD Foundation

# 381fcf10 09-May-2016 Glen Barber <gjb@FreeBSD.org>

Combine the 'reinstall' and 'restage' targets, which appears to have
been a mismerge.

Sponsored by: The FreeBSD Foundation

# 79ccc589 04-May-2016 Enji Cooper <ngie@FreeBSD.org>

Default NO_INSTALLEXTRAKERNELS to yes, not no

The old (^/stable/9) default was yes, not no ("no" was the new default
introduced recently that broke POLA). Restore it to keep POLA like
glebius intended in r299077

MFC after: 3 days
X-MFC with: r299086
Pointyhat to: ngie (research before assuming and committing next time)
Sponsored by: EMC / Isilon Storage Division

# c0fd4255 04-May-2016 Enji Cooper <ngie@FreeBSD.org>

Default NO_INSTALLEXTRAKERNELS to "no" to unbreak the build

MFC after: soon (was insta-MFCed -_-..)
Pointyhat to: glebius
Sponsored by: EMC / Isilon Storage Division

# f4ae78bd 04-May-2016 Gleb Smirnoff <glebius@FreeBSD.org>

Make it possible to override NO_INSTALLEXTRAKERNELS.

Reviewed by: gjb

# a1ff7af0 03-May-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

Misc. build: minor spelling fixes.

No functional change.

# 561e173f 26-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Allow buildkernel to create .meta files with curdir==objdir.

Without this the incremental build was broken since .depend.* are not
generated with .MAKE.MODE=meta and .meta files were not created to
track dependencies. Typically meta mode does not create .meta files
when building with curdir==objdir but the kernel build is special.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by: EMC / Isilon Storage Division

# 75a6cb4f 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix unset variables from r298417.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

# 40cf3344 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add more missing .PHONY

Sponsored by: EMC / Isilon Storage Division

# 59e2f057 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove redundant logic from the pkg-base merge.

These will be set from the logic right above it.

Reviewed by: gjb
Sponsored by: EMC / Isilon Storage Division

# ae001499 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make -n' for new packaging targets.

Sponsored by: EMC / Isilon Storage Division

# c943a53e 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add more missing .PHONY.

This also protects them from trying to create .meta files
with WITH_META_MODE.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by: EMC / Isilon Storage Division

# 97c316c6 21-Apr-2016 Ed Maste <emaste@FreeBSD.org>

Adjust BOOTSTRAPPING test after MFC of kbdcontrol's -P option

# fcede88b 18-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Add MK_AUTO_OBJ=no to ${MAKE} invocation if PKG_VERSION needs to be
created to avoid creating ${.OBJDIR}.

The duplicate REVISION/BRANCH/VERSION evaluation will be addressed
separately.

Sponsored by: The FreeBSD Foundation

# 0edd2576 15-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 473fda75 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE+filemon: Default -DNO_CLEAN enabled.

When using meta mode with filemon, the build is reliably incremental
safe. Bmake will use the meta files, along with filemon information,
to rebuild targets when their dependencies change, commands change,
or files they generate are missing.

Sponsored by: EMC / Isilon Storage Division

# fdff4951 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Pass along the default sysroot in bootstrap-tools to avoid rebuilds later.

Some of the clang libraries build in this phase and the cross-tools
phase. Later in the cross-tools phase when they build with a default
TOOLS_PREFIX, they see a changed build command in meta mode due to
the changed DEFAULT_SYSROOT. This is avoided by passing along
TOOLS_PREFIX earlier.

Sponsored by: EMC / Isilon Storage Division

# d1dd034d 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Don't rebuild build-tools targets during normal build.

This avoids 'build command changed' due to CFLAGS/CC changes during the
normal build. Without this the build-tools targets end up rebuilding
for the *target* rather than keeping the native versions built in
build-tools.

Sponsored by: EMC / Isilon Storage Division

# a561b106 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Mark some more .PHONY targets.

Sponsored by: EMC / Isilon Storage Division

# 7cbd0a29 13-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Simplify building libpam and fix libpam.a not containing the modules since r284345.

The change in r284345 moved the creation of openpam_static_modules.o to
lib/libpam/static_modules but never managed to get them into libpam.a.

Move this logic to lib/libpam/static_libpam and have it create a static
library for libpam.a The main lib/libpam/libpam will only create a
shared library. No redundancy in compilation or installation exists
in this solution.

This avoids requiring a pass with -D_NO_LIBPAM_SO_YET.

Sponsored by: EMC / Isilon Storage Division

# 9c831bbd 12-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# d13c4614 12-Apr-2016 Steve Wills <swills@FreeBSD.org>

Try harder to find svn

While here, elliminate last references to CVS_UPDATE and SUP_UPDATE

Reviewed by: gjb
Approved by: gjb

# 14cda706 11-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Set explicit ordering to prevent packaging failures with parallel
(-jN) make(1) jobs.

Sponsored by: The FreeBSD Foundation

# 7a888f32 07-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Avoid using DESTDIR in packaged-base targets, which can
cause bizarre packaging failures with non-default OBJDIR
and/or MAKEOBJDIRPREFIX and REPODIR set to a location not
within OBJDIR.

Reported by: many
Tested by: sef
Sponsored by: The FreeBSD Foundation

# 2263fb58 05-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 31f3abb1 05-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Fix errors packaging the base system when using non-default DESTDIR
and MAKEOBJDIRPREFIX.

Sponsored by: The FreeBSD Foundation

# 91da7698 05-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove leftover _LDSCRIPTROOT missed in r297270.

Sponsored by: EMC / Isilon Storage Division

# d6084013 04-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# d043a786 30-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix the external GCC build after r297271 by setting -L <sysroot>/usr/lib.

GCC does add <sysroot>/usr/lib to the library search path but it comes after
/usr/local/lib which can find ports libraries such as libedit.so. The
bad path comes in as /usr/local/lib/gcc/x86_64-portbld-freebsd11.0/5.3.0/../../../
which corresponds to <prefix>/lib.

This partially reverts r297271.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

# 497e8091 30-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove the old depend (mkdep) code and make FAST_DEPEND the one true way.

Reviewed by: emaste, hselasky (partial), brooks (brief)
Discussed on: arch@
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5742

# 915d57ae 28-Mar-2016 Ed Maste <emaste@FreeBSD.org>

simplify compile-time default keyboard map generation

In r296926 the -P <path> option was added to kbdcontrol, which enables
this change for a simplified compile-time default keymap build process.

PR: 193865
Reviewed by: Oliver Pinter
Tested by: Oliver Pinter
MFC After: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5708

# ac978f5a 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITHOUT_TOOLCHAIN: Fix includes not being staged in WORLDTMP.

This has been the case since r264930 and r274662.

Sponsored by: EMC / Isilon Storage Division

# 4e3252c4 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

CROSS_BINUTILS_PREFIX: Reduce redundant logic.

Sponsored by: EMC / Isilon Storage Division

# 5df2c3cc 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

External compiler: Remove redundant flags from CXXFLAGS.

The use of XCXXFLAGS is to assign it to CXX in CROSSENV.
XCFLAGS is also assigned here so there is no need to have
--syroot and -B flags again.

Sponsored by: EMC / Isilon Storage Division

# d63cb012 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITHOUT_CROSS_COMPILER: Fix this to use external compiler logic.

Without this the default toolchain in /usr/bin/ would not use
WORLDTMP via --sysroot, and would lack --target if cross-building.

PR: 196193
Related: D3970
Sponsored by: EMC / Isilon Storage Division

# 1b89301d 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Update flags for external GCC.

- The -L WORLDTMP/usr/lib is not needed as GCC is already adding in
-L =/usr/lib internally with --sysroot. It does not do this for
header include paths though, thus passing -isystem =/usr/include is
still needed.

For the forced libc++ usage:
- Use -isystem rather than -I for libc++ headers.
- Use -std=c++11 rather than gnu++11.
- Use -nostdinc++ to ensure GCC's headers don't leak in.

Sponsored by: EMC / Isilon Storage Division

# 1b337a34 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Build libcompat (lib32) with a --sysroot pointing into its stage directory.

This overrides the cross-compiler's default sysroot to use the WORLD32's
sysroot for building the lib32 libraries. Previously the cross-compiler
would default the sysroot to the 64bit WORLDTMP and -B/-L/-isystem flags
were used to build using the lib32 files. This leads to multiple issues
discussed later. Some extra headers are now needed to be staged since the
64bit WORLDTMP is not referenced at all for headers. The 64bit WORLDTMP
is still used via PATH for build tools. Overriding the default
target/arch is retained in the CC/CXX overrides.

This allows reverting the LDSCRIPT rewriting in installworld from r296921 and
r235122, thus allowing read-only objdirs to work for installing again.

This removes the need for _LDSCRIPTROOT.

This allows progressing the change to always use --sysroot for the build
rather than only relying on the cross-compiler's default sysroot. The
work for that is in D3970 and needed to resolve WITHOUT_CROSS_COMPILER
not using a --sysroot [1].

PR: 196193 [1]
Sponsored by: EMC / Isilon Storage Division

# b0b64494 22-Mar-2016 Glen Barber <gjb@FreeBSD.org>

Make WSTAGEDIR, KSTAGEDIR, and REPODIR configurable.

This should fix the 'packages' target when MAKEOBJDIRPREFIX or
DESTDIR is set in the make(1) environment or via command line.

Reported by: kmoore, sef, Marko Turk
Sponsored by: The FreeBSD Foundation

# 53835448 14-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# bb52d711 12-Mar-2016 Warner Losh <imp@FreeBSD.org>

Use the newly minted Makefile.libcompat to implement libsoft libraries
for the armv6 ABI switch. This also make WITH_LIBSOFT functional on
the arm platform. As a transition thing, this seems to work even
without switching the ABI (we basically build the same libraries
twice when MK_LIBSOFT=yes until the ABI cut over next
month). MK_LIBSOFT remains default no.

# cb1469fd 12-Mar-2016 Ed Maste <emaste@FreeBSD.org>

Bump BOOTSTRAPPING test for libelf after cross-endian fix in r296685

# dba75e9f 11-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move Makefile.lib32 to Makefile.libcompat and generalize it.

This is in preparation for LIBSOFT.

This file only supports *1* LIBCOMPAT value currently and must be capitalized.
In Makefile.libcompat given LIBCOMPAT=FOO there can be values set for
LIBFOOCFLAGS, LIBFOOCPUFLAGS, LIBFOOWMAKEENV, LIBFOOWMAKEFLAGS, LIBFOOCPUFLAGS,
and LIBFOODTRACE. These will have the standard cross-build values appended
onto them.

This could be extended to support multiple libcompat libraries in the future
once there is a need.

Reviewed by: imp
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5612

# 52023717 10-Mar-2016 Warner Losh <imp@FreeBSD.org>

Factor out lib32 generation to its own file. This is prep for a
similar Makefile.libsoft which will do the same for armv6 soft fp API
libraries in prep for pulling the trigger on moving to armv6 hard
float. Once there's two files, I'll work with bdrewery@ to merge the
two files as they are mostly the same. The high rate of churn for
Makefile* makes it quite difficult to make progress out of tree.

Differential Review: https://reviews.freebsd.org/D5566

# 7d536dc8 10-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 0481f785 08-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't ever create object directories here with MK_AUTO_OBJ.

Sponsored by: EMC / Isilon Storage Division

# b0bdd783 08-Mar-2016 Glen Barber <gjb@FreeBSD.org>

Avoid adding the '-release' suffix to non-debug kernel packages.

Sponsored by: The FreeBSD Foundation

# b655ec97 05-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# a36b180a 05-Mar-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r296369 through r296409.


# 34f4acc8 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Conditionalize building makewhatis(1) for upgrades that need it.

Remove building of the legacy makewhatis(1) since it was only needed for
6.0 upgrades.

On my 2.2 GHz system libsqlite3 takes 60-100 seconds to build, which due to
its serialized nature can hold up the build waiting on it to finish in
bootstrap-tools.

makewhatis(1) was only required to be a build tool to support upgrades
from 6.0 which was properly removed in r208324 but later reverted due to
installworld using it. The installworld issue was fixed in r275622
when it was added to ITOOLS. A BOOTSTRAPPING check was missed when
makewhatis(1) was replaced with mandoc in r283777.

Sponsored by: EMC / Isilon Storage Division

# 2bece0ce 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't add duplicates from LOCAL_LIB_DIRS.

This causes parallel failures.

Sponsored by: EMC / Isilon Storage Division

# 400b94bb 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix over/under-linking in contrib/ofed.

Sponsored by: EMC / Isilon Storage Division

# bd6daf52 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

NO_ROOT: Create the METALOG directory on installworld/distributeworld.

When not using NO_ROOT the DESTDIR is implicitly created by the
distrib-dirs call. However with NO_ROOT it is trying to write
to the METALOG right away before running distrib-dirs which
may fail.

Sponsored by: EMC / Isilon Storage Division

# 6cb64f84 04-Mar-2016 Ed Maste <emaste@FreeBSD.org>

Add dd as a bootstrap tool, for status= support

In r295757 I added status=none to buildworld's use of dd, but FreeBSD
versions before April 2014 lack support.

# 82aa34e6 03-Mar-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r296007 through r296368.


# 28c9d1af 02-Mar-2016 Glen Barber <gjb@FreeBSD.org>

Set ALLOW_BASE_SHLIBS when creating base packages to enable
shared library tracking.

Note, this requires a patched pkg(8) to do anything, but pkg(8)
does not complain when an option is specified that it does not
recognize.

Sponsored by: The FreeBSD Foundation

# 52259a98 02-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# c501d73c 25-Feb-2016 Mariusz Zaborski <oshogbo@FreeBSD.org>

Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.

Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by: drysdale@google.com, bdrewery
Approved by: pjd (mentor)
Differential Revision: https://reviews.freebsd.org/D4277

# 14e9c916 24-Feb-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r295902 through r296006.


# f4d0f67f 24-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

FAST_DEPEND: Skip 'make depend' for buildworld and kernel since it is auto-ran now.

Sponsored by: EMC / Isilon Storage Division

# 3a3f435f 23-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Include a 'package-pkg' target, intended for use for
architectures we do not provide upstream pkg(8) packages.

This is not tied to anything as-is, and likely will break
your system if used (based on experience with testing with
powerpc).

There is an overwhelming amount of evil happening here,
so until the issues are fixed, it will not be tied into the
'packages' target.

Sponsored by: The FreeBSD Foundation

# 90963403 23-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Set PORTSDIR if not already set.

Sponsored by: The FreeBSD Foundation

# debac084 23-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Further subdir-ize WSTAGEDIR and KSTAGEDIR base on the
TARGET/TARGET_ARCH value, since there are valid use cases
for having multiple on any given system.

Sponsored by: The FreeBSD Foundation

# 9893f787 21-Feb-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r295601 through r295844.


# 72c3aa02 17-Feb-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 4821f9ed 16-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Always include the kernel name in the resulting package.
While functionally expected to be a no-op on big-iron hardware,
embedded hardware (arm, mips) do not have a GENERIC kernel, so
the KERNCONF value must be included in the package to avoid
conflicting packages for the default kernel (RPI-B versus RPI2,
for example).

While here, correct the kernel name in the metadata.

Sponsored by: The FreeBSD Foundation

# 619a5d7b 15-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't descend into test directories for distribution->installconfig.

Sponsored by: EMC / Isilon Storage Division

# 0fe0fe11 15-Feb-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 90a47263 13-Feb-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r295544 through r295600.


# c1da2974 12-Feb-2016 Ed Maste <emaste@FreeBSD.org>

Add libpe for elfcopy(1) PE/COFF support

Sponsored by: The FreeBSD Foundation

# 4156ce4f 11-Feb-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r295351 through r295543.


# acf5bd83 09-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Remove unnecessary env(1) invocations.

Sponsored by: The FreeBSD Foundation

# a5395435 09-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Add logic to rotate the package repository, keyed on PKG_VERSION,
and create a 'latest' symlink to the PKG_VERSION repository path.

Suggested by: des
Sponsored by: The FreeBSD Foundation

# ea85204f 08-Feb-2016 Dag-Erling Smørgrav <des@FreeBSD.org>

Rename the signpackages target to sign-packages, and include it in the
packages meta-target so 'make packages' now does everything.

# ee1627c4 08-Feb-2016 Dag-Erling Smørgrav <des@FreeBSD.org>

Split the packages target into stage-packages and create-packages to make
it possible to roll new packages from an existing build without having to
restage them.

# bbb51924 07-Feb-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 71b7fa12 07-Feb-2016 Enji Cooper <ngie@FreeBSD.org>

Simplify running the FreeBSD test suite

Replace `make regress` (legacy test make target) and `make test` (incomplete
test make target added with the FreeBSD test suite) with make check as it's
consistent with other open source projects.

`make check` defaults to running tests from `.OBJDIR`, but can be overridden
with the `CHECKDIR` variable.

Add `make checkworld` target to simplify running the FreeBSD test suite from
`TESTSBASE` (i.e. the top-level tests directory), similar to buildworld.

Document `make check` and `make checkworld` in build(7).

Other minor changes:

- Rename intermediate file (`Kyuafile.auto`) to `Kyuafile` to simplify
`make check`.
- Remove terse warnings attached to `beforetest`/`aftertest`.
- Add kyua binary check to check target in suite.test.mk; error out if it's
not found

The MFC is [partly] contingent on other build related changes being MFCed.

Differential Revision: https://reviews.freebsd.org/D4406
MFC after: 2 months
X-MFC to: stable/10
Relnotes: yes
Reviewed by: bdrewery, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division

# a49d8b6e 06-Feb-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r294961 through r295350.


# 848f2374 04-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Silence a few command lines.

Sponsored by: The FreeBSD Foundation

# 5c52b2f5 04-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Rework the way <packagename>.ucl files are generated.
One of the major pain points with how this was implemented
is the requirement of in-tree, hard-coded <name>.ucl, as
well as <name>-<suffix>.ucl where <suffix> can be lib32,
profile, development, debug, or any combination of the four.

This created significant overhead when adding new packages
and any of the files in any of the combinations were missing.

Instead of test(1)-ing if the <packagename>.ucl file exists,
hand off to a script to figure out what the final ucl file
name should be before invoking pkg(8).

The default behavior is 'template.ucl' is used as a fallback.

This affects only the userland packages, as the kernel code
is already smart enough to handle these variations.

Sponsored by: The FreeBSD Foundation

# db9ba9ee 03-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Deduplicate distrib-dirs logic from r289086 in distribution.

This does it correctly this time, rather than the incorrect version in
r295167.

Sponsored by: EMC / Isilon Storage Division

# 3bea1c13 02-Feb-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 4be4b11f 02-Feb-2016 Conrad Meyer <cem@FreeBSD.org>

Revert r295167 at bdrewery's request

$ svn merge -c -295167 .

JHB reports Navdeep reports that it breaks distribution and etcupdate.

Approved by: bdrewery

# 221b3499 02-Feb-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# fb872bbc 02-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Deduplicate distrib-dirs logic from r289086 in distribution.

Sponsored by: EMC / Isilon Storage Division

# 7cd7d126 02-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Adjust install .WAITs for lib/ and etc/ to allow parallelization more.

Only 'installworld' needs to be protected and only when not using
-DNO_ROOT, which implies not installing to / and not needing the
lib dependency protections.

Sponsored by: EMC / Isilon Storage Division

# 1793d339 29-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Wrap long lines after recent commits.

Sponsored by: The FreeBSD Foundation

# 35854cea 29-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Make sure 'pkg config ABI' uses ABI_FILE for the target.

Sponsored by: The FreeBSD Foundation

# d9b0aafd 29-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Reorder execution in the 'packages' target so both userland
and kernel are staged before invoking the 'create-<foo>-packages'
targets.

Include PKG_VERSION value in the 'create-{world,kernel}-packages'
targets so the value is not redefined when packaging the kernel,
which otherwise results in inconsistent and confusing package
version results.

Sponsored by: The FreeBSD Foundation

# d7a8d386 28-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Avoid excessively invoking 'pkg bootstrap' if already done.

Sponsored by: The FreeBSD Foundation

# f61b1691 27-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Fix naming for multiple kernels when building/packaging more than one.

Sponsored by: The FreeBSD Foundation

# 3d98f473 27-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Add 'stagekernel' target, which invokes 'distributekernel'
with -DNO_ROOT to create the METALOG mtree(8) file.

Separate the default STAGEDIR for world (WSTAGEDIR) and kernel
(KSTAGEDIR).

Fix the 'create-kernel-packages' target to work properly.

Evaluate if 'kernel' is set when invoking mtree-to-plist.awk,
which splits the kernel and kernel.debug into separate plist
files.

Fix METALOG creation when building/packaging multiple kernels.

Sponsored by: The FreeBSD Foundation

# d46f0432 25-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Add a 'signpackages' target, which creates the pkg repository
metadata files and uses the path of PKGSIGNKEY for signing,
if set.

Sponsored by: The FreeBSD Foundation

# f9371dca 22-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Create a _pkgbootstrap target, and remove the env(1) prefix
to pkg(8) commands.

Move the resulting packages outside STAGEDIR to minimize
pollution.

When invoking 'pkg create', include the ABI in the REPODIR
path so the correct hierarchy is created for cross-builds.

Move the STAGEDIR and REPODIR declarations above the targets
that use them to keep things cleaner, and move the packages
target.

Include '-o ABIFILE=DESTDIR/bin/sh' in pkg(8) invocations in
the create-kernel-packages target.

Sponsored by: The FreeBSD Foundation

# bc3f9191 21-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Ensure pkg(8) is bootstrapped, and avoid prompting for confirmation
to install, in case the 'packages' target is run non-interactively.

Sponsored by: The FreeBSD Foundation

# ea2c42d8 13-Jan-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r293686 through r293849.


# e6068002 11-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 57ce33ac 11-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Correct a comment.

Submitted by: jhb

# 89d3f0ea 11-Jan-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r293430 through r293685.


# 1f17dba4 08-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Chase r292622: Update path to ioctl.c for incremental build hack.

Sponsored by: EMC / Isilon Storage Division

# 8dc7b23a 08-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix upgrading from OSVERSION 1000002-1000032 after r288829.

r288829 states that lex requires the latest m4, but was not always building it.
Move lex to the same logic as m4 since they are closely tied now.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
Reported by: Slawa Olhovchenkov <slw@zxy.spb.ru>

# b229c1a0 08-Jan-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r293280 through r293429.


# 0c9da521 07-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# b46e9175 06-Jan-2016 Gleb Smirnoff <glebius@FreeBSD.org>

Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF
won't be installed, only the first one would.

# 5dc6cc42 06-Jan-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r293175 through r293279.


# 1a5c9277 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 88343186 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Merge ^/projects/release-install-debug:

- Rework MANIFEST generation and parsing via bsdinstall(8).
- Allow selecting debugging distribution sets during install.
- Rework bsdinstall(8) to fetch remote debug distribution sets
when they are not available on the local install medium.
- Allow selecting additional non-GENERIC kernels during install.
At present, GENERIC is still required, and installed by default.

Tested with: head@r293203
Sponsored by: The FreeBSD Foundation

# c60009cc 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

In 'create-kernel-packages', do not exit with an error if NO_ROOT is
not set. The 'stageworld' target is invoked with -DNO_ROOT, so the
metalog file(s) will be created regardless.

This matches the behavior of 'create-world-packages'.

Sponsored by: The FreeBSD Foundation

# 51daa9fe 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Do not implicitly invoke 'buildworld' as part of the 'packages' target.

This retains the original behavior of release-related targets, which
assume 'buildworld' and 'buildkernel' have already happened.

Sponsored by: The FreeBSD Foundation

# b626f5a7 04-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH r289384-r293170

Sponsored by: The FreeBSD Foundation


# 34cdd776 31-Dec-2015 Dimitry Andric <dim@FreeBSD.org>

First part of updating llvm/clang build glue: getting llvm-tblgen,
clang-tblgen and clang itself built.

# 7144d5cb 23-Dec-2015 Sean Bruno <sbruno@FreeBSD.org>

Fixup native-xtools target for poudriere cross build jails after svn
r291955 by excluding all debug files.

Reported by: swills

Reviewed by: emaste

# 4a2a740e 19-Dec-2015 Enji Cooper <ngie@FreeBSD.org>

Always expose LOCALBASE, not just when CROSS_TOOLCHAIN is defined

Instead of using which(1) to look for doxygen, look for it in <LOCALBASE>/bin .
$PATH gets mangled by make buildenv, etc so it's better to just be explicit
about the path if someone uses that for instance.

Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division

# 37ded2a7 14-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r290423: Don't use CSH for buildenv shell.

It does not properly import PATH; the PATH is reset by included profile
files on startup which breaks the biggest feature of buildenv (using
sysrooted cc from WORLDTMP)

Spotted by: smh, kib
Sponsored by: EMC / Isilon Storage Division

# c492eb76 14-Dec-2015 Andrew Turner <andrew@FreeBSD.org>

Split KNOWN_ARCHES so we have one per line to simplify merging future
architectures.

# 1fdcc5e5 11-Dec-2015 Ruslan Bukin <br@FreeBSD.org>

Start support for the RISC-V 64-bit architecture developed by UC Berkeley.

RISC-V is a new ISA designed to support computer research and education, and
is now become a standard open architecture for industry implementations.

This is a minimal set of changes required to run 'make kernel-toolchain'
using external (GNU) toolchain.

The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv.

Reviewed by: andrew, bdrewery, emaste, imp
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D4445

# 9229b179 08-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix some makeman issues.

- Don't bother looking up REVISION/BRANCH/etc from release/, or the
CPUTYPE check, as these are not used for makeman and wastes time. The also
invokes auto.obj.mk after I reverted auto.obj.mk ignoring -V in r291312.
- Don't modify CC or PATH when WITH_CCACHE_BUILD or WITH_META_MODE is enabled
as it leads to bsd.compiler.mk errors.

Sponsored by: EMC / Isilon Storage Division

# 1c2a618b 07-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix spelling of internal hack.

Reported by: ngie

# 03173d2f 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

bsd.subdir.mk: Only recurse on called targets, rather than dependencies.

This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.

This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.

This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.

This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids
various issues such as the one fixed in r289462. As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.

Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438. This is so users do not get a probably broken build if they
run 'make all' from the top-level. Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion. Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.

This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331. This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk
for now.

I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack. If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.

Discussed on: arch@
MFC after: never
Sponsored by: EMC / Isilon Storage Division

# 6fa97020 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add NO_INSTALLKERNEL to undo the assumption that the first KERNCONF will be
installed as "kernel". This is relevant for packaging of the kernel when
not wanting a default "kernel.txz".

Submitted by: Russell Cattelan <cattelan@thebarn.com>
MFC after: 2 weeks
Obtained from: OneFS
Sponsored by: EMC / Isilon Storage Division

# 0a63717c 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Allow storing package(world|kernel) tarballs into a different location at PACKAGEDIR.

Submitted by: Russell Cattelan <cattelan@thebarn.com>
Discussed with: gjb
MFC after: 2 weeks
Obtained from: OneFS
Sponsored by: EMC / Isilon Storage Division

# b67490a3 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix errors being ignored in many phases of the build since the bmake integration.

Say it with me, "I will not chain commands with && in Makefiles"

This was originally fixed and explained quite well by bde@ in r36074. The
initial bmake integration caused 'set -e' to stop being used which lead to
r252419. Later 'set -e' expectations were fixed with bmake in r254980.

Because of the && here, errors would be ignored when building in parallel and
a dependency failed. Such as bootstrap-tools since it builds everything in
parallel. If any tool failed in obj/depend/all, it would just ignore the error
and continue to build. This later would result in cascaded errors that only
confused the real issue. This could also cause commands after the failed
command to still execute, leading to more confusion.

This should be fine if the command is in a sub-shell such as: (cmd1 && cmd2)

This reverts r252419.

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

# 7f911abe 27-Nov-2015 John Baldwin <jhb@FreeBSD.org>

Add support to libkvm for reading vmcores from other architectures.
- Add a kvaddr_type to represent kernel virtual addresses instead of
unsigned long.
- Add a struct kvm_nlist which is a stripped down version of struct nlist
that uses kvaddr_t for n_value.
- Add a kvm_native() routine that returns true if an open kvm descriptor
is for a native kernel and memory image.
- Add a kvm_open2() function similar to kvm_openfiles(). It drops the
unused 'swapfile' argument and adds a new function pointer argument for
a symbol resolving function. Native kernels still use _fdnlist() from
libc to resolve symbols if a resolver function is not supplied, but cross
kernels require a resolver.
- Add a kvm_nlist2() function similar to kvm_nlist() except that it uses
struct kvm_nlist instead of struct nlist.
- Add a kvm_read2() function similar to kvm_read() except that it uses
kvaddr_t instead of unsigned long for the kernel virtual address.
- Add a new kvm_arch switch of routines needed by a vmcore backend.
Each backend is responsible for implementing kvm_read2() for a given
vmcore format.
- Use libelf to read headers from ELF kernels and cores (except for
powerpc cores).
- Add internal helper routines for the common page offset hash table used
by the minidump backends.
- Port all of the existing kvm backends to implement a kvm_arch switch and
to be cross-friendly by using private constants instead of ones that
vary by platform (e.g. PAGE_SIZE). Static assertions are present when
a given backend is compiled natively to ensure the private constants
match the real ones.
- Enable all of the existing vmcore backends on all platforms. This means
that libkvm on any platform should be able to perform KVA translation
and read data from a vmcore of any platform.

Tested on: amd64, i386, sparc64 (marius)
Differential Revision: https://reviews.freebsd.org/D3341

# 20f68058 18-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove unneeded libmd from bootstrap-tools (reverting r246784).

The bootstrap-tools are supposed to be host tools, which in most cases, use
host headers and libraries. As such, directly including the src tree's headers
for libmd here causes the need to link libmd in since it will be built with
the new symbols (which /usr/lib/libmd.so) won't have unless it is new enough.
During the target build in buildworld the target headers are staged into
WORLDTMP and used via --sysroot, allowing the target xinstall to be built with
the new/target libmd.

The .PATH here was also not doing anything since xinstall does not use libmd
source files.

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks

# 2cc77b79 17-Nov-2015 Brad Davis <brd@FreeBSD.org>

Don't match on "version" when found as a value.

Approved by: bapt

# f2307a2a 13-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Avoid setting schg in the objtree for lib32 build.

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

# ddd945c7 09-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make cleanworld' to respect TARGET/TARGET_ARCH for cross-build objtrees.

This simplifies the logic to always try removing the objdir if it exists
and to fallback on a 'cleandir' if no objdir exists. The reasoning for
this is to avoid rm -rf src/* (r126024)

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks

# 2753ba1a 09-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Move 'make cleandir' from Makefile to Makefile.inc1.

This leads the way for fixing cross-build cleanup, and eventually replacing
'cleandir' with it during the build.

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks

# 9160419c 07-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add built-in ccache build support via WITH_CCACHE_BUILD option.

ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not
used to achieve a safe pseudo-incremental build. This is explained in
more detail upstream [1] [2]. It incurs about a 20%-28% hit to populate the
cache, but with a full cache saves 30-50% in build times. When combined with
the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the
resulting dependency file, which it does not do when using mkdep(1)/'CC
-E'. Stats are provided at the end of this message.

This removes the need to modify /etc/make.conf with the CC:= and CXX:=
lines which conflicted with external compiler support [3] (causing the
bootstrap compiler to not be built which lead to obscure failures [4]),
incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid
Clang errors with parenthesis, and did not work with META_MODE.

The option name was picked to match the existing option in ports. This
feature is available for both in-src and out-of-src builds that use
/usr/share/mk.

Linking, assembly compiles, and pre-processing avoid using ccache since it is
only overhead. ccache does nothing special in these modes, although there is
no harm in calling it for them.

CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap
compiler to hash the content of the compiler binary to determine if it
should be a cache miss. For external compilers the 'mtime' option is used
as it is more efficient and likely to be correct. Future work may optimize the
'content' check using the same checks as whether a bootstrap compiler is needed
to be built.

The CCACHE_CPP2 pessimization is currently default in our devel/ccache
port due to Clang requiring it. Clang's -Wparentheses-equality,
-Wtautological-compare, and -Wself-assign warnings do not mix well with
compiling already-pre-processed code that may have expanded macros that
trigger the warnings. GCC has so far not had this issue so it is allowed to
disable the CCACHE_CPP2 default in our port.

Sharing a cache between multiple checkouts, or systems, is explained in
the ccache manual. Sharing a cache over NFS would likely not be worth
it, but syncing cache directories between systems may be useful for an
organization. There is also a memcached backend available [5]. Due to using
an object directory outside of the source directory though you will need to
ensure that both are in the same prefix and all users use the same layout. A
possible working layout is as follows:
Source: /some/prefix/src1
Source: /some/prefix/src2
Source: /some/prefix/src3
Objdir: /some/prefix/obj
Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj'
This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace
all absolute paths to be relative. Using something like this is required due
to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache
adds into its hash for the object without CCACHE_BASEDIR.

distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc.
I have not personally tested this and assume it will not mix well with
using the bootstrap compiler.

The cache from buildworld can be reused in a subdir by first running
'make buildenv' (from r290424).

Note that the cache is currently different depending on whether -j is
used or not due to ccache enabling -fdiagnostics-color automatically if
stderr is a TTY, which bmake only does if not using -j.

The system I used for testing was:
WITNESS
Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes
DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
The arc was fully populated with src tree files and ccache objects.
RAM: 76GiB
CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16

The WITH_FAST_DEPEND feature was used for comparison here as well to show
the dramatic time savings with a full cache.

buildworld:
x buildworld-before
+ buildworld-ccache-empty
* buildworld-ccache-full
% buildworld-ccache-full-fastdep
# buildworld-fastdep
+-------------------------------------------------------------------------------+
|% * # +|
|% * # +|
|% * # xxx +|
| |A |
| A|
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 3744.13 3794.31 3752.25 3763.5633 26.935139
+ 3 4519 4525.04 4520.73 4521.59 3.1104823
Difference at 95.0% confidence
758.027 +/- 43.4565
20.1412% +/- 1.15466%
(Student's t, pooled s = 19.1726)
* 3 1823.08 1827.2 1825.62 1825.3 2.0785572
Difference at 95.0% confidence
-1938.26 +/- 43.298
-51.5007% +/- 1.15045%
(Student's t, pooled s = 19.1026)
% 3 1266.96 1279.37 1270.47 1272.2667 6.3971113
Difference at 95.0% confidence
-2491.3 +/- 44.3704
-66.1952% +/- 1.17895%
(Student's t, pooled s = 19.5758)
# 3 3153.34 3155.16 3154.2 3154.2333 0.91045776
Difference at 95.0% confidence
-609.33 +/- 43.1943
-16.1902% +/- 1.1477%
(Student's t, pooled s = 19.0569)

buildkernel:
x buildkernel-before
+ buildkernel-ccache-empty
* buildkernel-ccache-empty-fastdep
% buildkernel-ccache-full
# buildkernel-ccache-full-fastdep
@ buildkernel-fastdep
+-------------------------------------------------------------------------------+
|# @ % * |
|# @ % * x + |
|# @ % * xx ++|
| MA |
| MA|
| A |
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 571.57 573.94 571.79 572.43333 1.3094401
+ 3 727.97 731.91 728.06 729.31333 2.2492295
Difference at 95.0% confidence
156.88 +/- 4.17129
27.4058% +/- 0.728695%
(Student's t, pooled s = 1.84034)
* 3 527.1 528.29 528.08 527.82333 0.63516402
Difference at 95.0% confidence
-44.61 +/- 2.33254
-7.79305% +/- 0.407478%
(Student's t, pooled s = 1.02909)
% 3 400.4 401.05 400.62 400.69 0.3306055
Difference at 95.0% confidence
-171.743 +/- 2.16453
-30.0023% +/- 0.378128%
(Student's t, pooled s = 0.954969)
# 3 201.94 203.34 202.28 202.52 0.73020545
Difference at 95.0% confidence
-369.913 +/- 2.40293
-64.6212% +/- 0.419774%
(Student's t, pooled s = 1.06015)
@ 3 369.12 370.57 369.3 369.66333 0.79033748
Difference at 95.0% confidence
-202.77 +/- 2.45131
-35.4225% +/- 0.428227%
(Student's t, pooled s = 1.0815)

[1] https://ccache.samba.org/performance.html
[2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html
[3] https://reviews.freebsd.org/D3484
[5] https://github.com/jrosdahl/ccache/pull/30

PR: 182944 [4]
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Relnotes: yes

# a55d4ddd 07-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add a hack to workaround ZSH as BUILDENV_SHELL breaking CPUTYPE.

ZSH considers CPUTYPE a magic variable that will be the output of 'uname -m'
even if already set in environment when starting up.

The CPUTYPE?= check in Makefile.inc1 and supporting overriding CPUTYPE
manually in the buildenv shell make automatic workarounds too tricky
here. ZSH should really respect variables set in the environment before
trashing them.

X-MFC-With: r290423
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 3e4f384e 07-Nov-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head r290483


# 208f1083 05-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Allow 'make buildenv' to work anywhere in the src tree.

Sponsored by: EMC / Isilon Storage Division

# e4fa4faf 05-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Allow 'make buildenv' to default to the caller's shell by using SHELL.

Also pass BUILDENV=1 into the sub-shell to allow modifying PS1 in .profile such
as:
if [ -n "${BUILDENV}" ]; then
PS1="(buildenv) ${PS1}"
fi

SHELL defaults to 'sh' in share/mk/sys.mk, but is typically passed down by
the shell invoking make as well. Rather than forcing all 'buildenv' users
to use plain /bin/sh, let them use their favorite shell.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Discussed with: imp

# e5ff3aad 05-Nov-2015 Warner Losh <imp@FreeBSD.org>

Fix CC being wrong during install* targets.

Move CROSS_TOOLS stuff to top of file (before bsd.compiler.mk) so that
decisions made by bsd.compiler.mk can properly affect the defaults in
src.opts.mk. Move that to after bsd.compiler.mk. Add a comment about
why we include bsd.compiler.mk here despite the fact that src.opts.mk
currently does too. Also remove bsd.arch.inc.mk that's been OBE.

Differential Revision: https://reviews.freebsd.org/D4087

# a36eca08 04-Nov-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Rename libohash to libopenbsd.

libopenbsd is an internal library which
to bring in compatibility stuff from OpenBSD.
This will allow us to bring in more
OpenBSD utilities into the FreeBSD base system.

We similarly use libnetbsd for bringing in stuff from NetBSD.

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

# 3c3feed4 01-Nov-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 6aa2fe89 26-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add a note about DEPFLAGS which is currently a hack around not properly passing
CXXFLAGS to sub-makes.

The bad passing also causes bsd.dep.mk's logic to selectively pull only some
flags from C[XX]FLAGS to not apply which can be seen with '-L' being passed to
mkdep when using an external compiler.

# c9ec6256 23-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Replace common path with NXBDESTDIR.

Also combine some mkdir calls.

Sponsored by: EMC / Isilon Storage Division

# 5eedd0c0 23-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Fix build with WITH_DEBUG_FILES.

Sponsored by: EMC / Isilon Storage Division

# 68847f14 21-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Parallelize build-tools.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

# 8f9403e9 21-Oct-2015 Ed Maste <emaste@FreeBSD.org>

Warn that NOCLEAN is deprecated - use NO_CLEAN instead

NO_CLEAN has been the correct spelling for over a decade.

# 7f1636b7 21-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.

Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)

Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.

SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.

With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.

- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.

- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.

- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.

- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.

The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.

This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.

- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.

- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.

- Document these changes in build.7

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks

# e0499c11 21-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix my change in r289435 causing 'etc' to be added to SUBDIR when using
SUBDIR_OVERRIDE.

MFC after: 2 weeks
X-MFC-With: r289435
Sponsored by: EMC / Isilon Storage Division

# d82fd861 20-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add some missing '+', .MAKE, and .PHONY modifiers.

Some of these targets were lacking both .MAKE and a '+'. Others were just
inconsistent.

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

# 74c52c65 20-Oct-2015 Julio Merino <jmmv@FreeBSD.org>

Handle lib32 files during delete-old* when MK_LIB32=no.

Extend OptionalObsoleteFiles.inc to delete all lib32 files when MK_LIB32 is
set to no on a system that previously had lib32 libraries installed.

Also, to prevent "make delete-old-dirs" from always deleting lib32 directories
after an installworld, move the lib32 subtree to its own mtree file that only
gets applied when MK_LIB32=yes.

Test: Ran "make delete-old" and "make delete-old-libs" on a system that never
had MK_LIB32 enabled, and on a system where MK_LIB32 was enabled and later
disabled. Did this both on amd64 and powerpc64.

Test: Ran "make tinderbox" without errors.

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

# 031c294c 19-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# b02f187c 17-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove unneeded MK_CTF=no when MK_CDDL=no.

This has been handled since r228158 made MK_CTF dependent on MK_CDDL
in share/mk/bsd.opts.mk.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 4c339735 17-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix wrong PATH being set for world 'includes' stage after r289438.

The 'includes' target is currently a pseudo target in bsd.subdir.mk that
does 'cd ${.CURDIR} && ${MAKE} buildincludes && ${MAKE} installincludes',
versus all over targets that just recurse.

In Makefile.inc1 the older duplicated bsd.subdir.mk logic for calling
'includes' was being executed in each subdir directly, meaning 'cd lib && make
includes' became 'cd lib && make buildincludes && make installincludes'. Now
that the bsd.subdir.mk logic is used it is calling 'make buildincludes && make
installincludes' from the top-level which pulls in the PATH=<default path>
from /Makefile.

The sub-make logic for 'includes' in bsd.subdir.mk was attempted to be removed
in r289282 but turned out to be wrong. I have a working version now but
it is not yet ready for commit. So for now in Makefile.inc1 split out
'includes' to 'buildincludes' and 'installincludes' which will avoid the
problem.

MFC after: 2 weeks
X-MFC-With: r289438
Sponsored by: EMC / Isilon Storage Division

# 53c0e6d5 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

For 'buildenvvars' show any .exported variables as well to cover recent
exporting of OSRELDATE and VERSION. These already do export to 'buildenv'
fine.

Sponsored by: EMC / Isilon Storage Division

# a378087d 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Always export VERSION to the environment to avoid looking it up again in
sub-makes.

Some of the world phases that used plain '${MAKE} -f Makefile.inc1' were not
passing this variable along which caused them to look it up again. By
using bmake's .export we can remove it from all of the other environment
lines.

Add a comment about the usage for VERSION for ctfmerge.

Sponsored by: EMC / Isilon Storage Division

# 470c2b3a 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Export OSRELDATE so sub-makes don't look it up again.

We pass BOOTSTRAPPING=${OSRELDATE} to some of the sub-makes. Rather than
chase every ${MAKE} invokation, just export it as bmake lets us.

Sponsored by: EMC / Isilon Storage Division

# fb84a99e 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Rework the world subdir build targets to use the standard SUBDIR_PARALLEL mechanism.

Back in r30113, the 'par-*' targets were added to parallelize portions of
the build in a very similar fashion as the SUBDIR_PARALLEL feature used in
r263778. Calling a target without 'par-' (for 'parallel') resulted in the
standard bsd.subdir.mk handling without parallelization. Given we have
SUBDIR_PARALLEL now there is no reason to duplicate the handling here.

In build logs this will result in the ${dir}.${target}__D targets now showing
as the normal ${target}_subdir_${dir} targets.

I audited all of the uses of Makefile.inc1 and Makefile's targets that use
bsd.subdir.mk and found that all but 'all' and 'install' were fine to use
as always parallel.
- For 'install' (from installworld -j) the ordering of lib/ and libexec/
before the rest of the system (described in r289433), and etc/ being last
(described in r289435), is all that matters. So now a .WAIT is added in
the proper places when invoking any 'install*' target. A parallel
installworld does work and took 46% of the time a non-parallel
install would take on my system with -j15 to ZFS.
- For 'all' I left the default handling for this to not run in parallel. A
'par-all' target is still used by the 'everything' stage of buildworld
to continue building in parallel as it already has been. This works
because most of the dependencies are handled by the early bootstrap
phases as well as 'libraries' and 'includes' phases. This lets
all of the SUBDIR build in parallel fine, such as bin/ and lib/. This
will not work if the user invokes 'all' though as we have dependencies
spread all over the system with no way to depend between them (except
for the dirdeps feature in the META_MODE build). Calling 'make all'
from the top-level is still useful at least when using SUBDIR_OVERRIDE.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 23ffbc10 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix adding manpages installed by LOCAL_DIRS to whatis file.

The ordering of 'etc' in the install has a long history dating back to the
first time it was realized it needed to be "last" in r4486. That commit
still left it before LOCAL_DIRS though. By having it before LOCAL_DIRS
any manpages they install were not being added to the whatis database in the
install image. They would likely show up in the file after a periodic
rebuild of the file though.

Currently the whatis file is built by an 'afterinstall' hook in etc/Makefile
that calls share/man's 'makedb' target.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# c38230eb 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove lockf as an ITOOL.

It was added in r152006 to handle serializing access of info/dir when
installing INFO files. We no longer support INFO files since r276551
though.

Sponsored by: EMC / Isilon Storage Division

# 7e81b832 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Correct a bitrotted comment about installworld order requirements.

The case of make(1) using a new /bin/sh issue was fixed in r173219 when ITOOLS
was introduced.

There are still issues with mid-install errors leaving a system unusable that
are currently non-trivial to solve. The safest ordering requires installing
rtld, libc and libthr (in that order) before anything else. We don't do that
now though. Much improvement is needed here still.

Discussed with: kip and kan (rtld/library ordering)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

# 35511448 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove .MAKE from targets that do more than just run sub-makes, such as
calling rm or mtree.

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

# 651e2703 15-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix delete-old and check-old-files not removing old debug symbols.

This was handled for libraries in r256842 but for some reason was missed
for files (bsd.prog.mk).

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

# 7b9c2f16 15-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix buildworld with clean objdir after r289351.

Sponsored by: EMC / Isilon Storage Division

# 86f58908 15-Oct-2015 Glen Barber <gjb@FreeBSD.org>

Pass .MAKEFLAGS in the 'packages' target to allow parallel
builds.

Pass '-B' when invoking the 'stageworld' target, similar to
what is done for 'installworld'.

Sponsored by: The FreeBSD Foundation

# 324fd1ce 15-Oct-2015 Glen Barber <gjb@FreeBSD.org>

MFH to r289370

Sponsored by: The FreeBSD Foundation


# ba831a2c 14-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Consider top-level targets to be .PHONY as bmake won't build them
otherwise if a file with the same name is found in the directory.

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

# 33388a16 14-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add temporary workaround for .MAKE being applied to _worldtmp, since r251750.

This was causing files to be removed from the objdir when -n was used.
_worldtmp makes no sub-make calls.

A more comprehensive solution is coming involving fine-grained '+' where
appropriate.

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

# 07670b30 14-Oct-2015 Ed Maste <emaste@FreeBSD.org>

Create /usr/tests *.debug file directory hierarchy

Reviewed by: bdrewery, ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3896

# becbad1f 13-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# c69900f1 10-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 5d8d6498 10-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix installing config files as non root

Reported by: adrian

# 9be27fdc 09-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# dd985c8f 09-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Change make distribution so that it now call installconfig in all dirs along
with the current behaviour of calling "distribution" in the etc target.

This allows mergemaster/etcupdate to still work when some configuration will be
moved to be handled in the same directories their source code lives in.

# 89ef7a96 05-Oct-2015 Ian Lepore <ian@FreeBSD.org>

The latest version of lex requires the latest m4 to build, add a dependency
when running the build-tools stage.

The requirement is due to the -P flag used when running m4 from usr.bin/lex
Makefile to generate skel.c. With the old m4 that fails and the failure is
ignored, resulting in an empty(-ish) skel.c, which leads to later build
failures when the misconfigured new lex tool is run.

This enables building -current (and 10-stable after MFC) on a stable-8
system again.

MFC after: 3 days

# 6875f8e7 03-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remerge as previous one was broken


# 6ae1554a 02-Oct-2015 Colin Percival <cperciva@FreeBSD.org>

Final step of eliminating the "games" distribution: Merge src/games
(or what's left of it, at least) into src/usr.bin.

This change will not be MFCed.

Discussed at: EuroBSDCon 2014
Committed from: EuroBSDCon 2015

# 5a2b666c 01-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 9875367b 27-Sep-2015 Andriy Gapon <avg@FreeBSD.org>

remove unused sgsmsg utility (originally imported from opensolaris)

MFC after: 25 days

# 3cad5c68 25-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Make it easier to keep the bootstrap-tools args in sync.

Sponsored by: EMC / Isilon Storage Division

# 2518edf6 24-Sep-2015 Ed Maste <emaste@FreeBSD.org>

Remove EOL whitespace from Makefile.inc1

# b5512f3b 21-Sep-2015 Ed Maste <emaste@FreeBSD.org>

Move DTrace tools to cross-tools stage

Bootstrap tools exist for backwards compatibility support. DTrace tools
tools are also needed for cross builds, so belong in cross-tools.

Reviewed by: imp (earlier), markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2144

# 26b7188d 16-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Let makeman run 'make showconfig' without hitting the aarch64 error.

# 1b87f1f3 15-Sep-2015 Brad Davis <brd@FreeBSD.org>

Fix grammer in an error message

PR: 202310
Submitted by: Chris Petrik <chris@bsdjunk.com>
Approved by: will

# 286bbc34 14-Sep-2015 Mark Johnston <markj@FreeBSD.org>

Unconditionally build CTF tools in the bootstrap-tools phase of the build.

Stale CTF tools are a frequent source of DTrace issues, and they compile
quickly enough that the increase in build time is negligible.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D3670

# f94594b3 11-Sep-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Finish merging from head, messed up in previous attempt


# b779ff2b 12-Sep-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Rename kernel-pkgs into create-kernel-packages to be consistent with world

# b5ff185e 12-Sep-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 05f05f8b 02-Sep-2015 Gleb Smirnoff <glebius@FreeBSD.org>

The ${BUILDKERNELS:[2..-1]} appears to produce a non zero result for
a one word variable, which is quite unexpected from documentation.
So, to avoid double installation of a single kernel, protect the extra
kernels loop with ${BUILDKERNELS:[#]} > 1 conditional.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

# f3c7b830 01-Sep-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Not only build with buildworld, but also install with installworld all
alternative kernels.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

# 6d04a5ad 01-Sep-2015 Gleb Smirnoff <glebius@FreeBSD.org>

When building multiple kernels use [2..-1] to extract !INSTALLKERNEL
from BUILDKERNELS list. This is more strict, since INSTALLKERNEL by
definition is the first word of BUILDKERNELS list. The previous
code failed if INSTALLKERNEL is a substring of additional kernel name.

Reviewed by: gjb
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

# 23a32822 25-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from HEAD


# 0f3c3059 24-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove now unused LIBPRIVATEDIR

Sponsored by: Gandi.net

# c404eb64 23-Aug-2015 Warner Losh <imp@FreeBSD.org>

Sparc64 is the odd-man out, so form the if that way rather than
listing everybody else.

# 08474898 17-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Separate ELFTOOLCHAIN_BOOTSTRAP from BINUTILS_BOOTSTRAP

For most cases they are equivalent, but BINUTILS_BOOTSTRAP is a
BROKEN_OPTION on arm64 as the in-tree GNU binutils do not support it,
so we need a separate internal flag for ELF Tool Chain.

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

# 39d3a844 13-Aug-2015 Warner Losh <imp@FreeBSD.org>

Spell binaries in the customary way.

Submitted by: jhb@

# 1bc28ffc 13-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Roll WITHOUT_ELFTOOLCHAIN_TOOLS into WITHOUT_TOOLCHAIN

The option was added only to ease the transition from GNU Binutils to
ELF Tool Chain tools, and that process is now complete (for the viable
replacements). Noting the removal in UPDATING is sufficient as we have
not shipped a release with the option.

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

# d7768ad4 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Fix the fixing of the build I broke. rescue/rescue has the right
target, but rescue doesn't.

Pointy hat: imp@

# 572ec1c5 12-Aug-2015 Xin LI <delphij@FreeBSD.org>

Fix build.

# 9aca5ced 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Document build-tools better. Add rescue back because it builds /bin/sh
which has a build-tools target (see commit for how build-tools and
cross-tools differ).

# 1ddcdb76 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Why on earth have we been building rescue as a build tool for the past
12 years? Nothing downstream in the build uses it. Eliminate it as a
build tool.

Reviewed by: emaste@ ("just delete it")

# ad38a9d9 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Crunchgen needs to be bootstrapped to pick up the STRIP->STRIPBIN
changes to prevent the 'rescue: not found' errors from happening.
Bump FreeBSD_version to 1100078 since there's been no version bumps
since this change was made. Only people that installed since r284356
really need to do this bootstrapping, but since crunchgen needs to
bootstrap for other reasons, bumping the number was the simplest.

# d9933780 11-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Fix comment describing legacy target and wrap to 80 columns

# 8551ff3f 11-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Build libelf and libdwarf in the legacy stage

They need to be built and installed (including headers) prior to the
DTrace CTF tools.

Reviewed by: imp (as part of a larger change)
Sponsored by: The FreeBSD Foundation

# f600d35f 09-Aug-2015 Warner Losh <imp@FreeBSD.org>

cmp and cp are used by the kerberos install, so need to be imclided in
ITOOLS. They are tiny enough that I'm not making conditional: the
minuscule savings in disk space isn't worth the obfuscation of
Makefile.inc1.

# 1fd99f14 08-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

libavl is not needed anymore for localedef(1)

# 57df665a 07-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add localedef(1) to bootstrap tools

# b78ee15e 01-Jul-2015 Ruslan Bukin <br@FreeBSD.org>

First cut of DTrace for AArch64.

Reviewed by: andrew, emaste
Sponsored by: ARM Limited
Differential Revision: https://reviews.freebsd.org/D2738

# af38028d 27-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Make all shared library a relative symlink

This makes sysroot usable for cross building, it also removes the need for
_SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have no time
to test it)

Differential Revision: https://reviews.freebsd.org/D2920
Submitted by: imp, adrian
Tested by: adrian

# 0f20a3cd 21-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Only build gperf as a bootstrap tool if gcc is going to be built

# ffe11f41 20-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove temporary changes that crept in r284417 when it should not have

Reported by: antoine, jbeich

# baec3dae 16-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head@274131


# 18b2ee82 15-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Revert r284417 it is not necessary anymore

# dad2fb7e 15-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 3e82c722 03-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Revert r283938 it is not needed anymore and broken

gzip(1) cannot be used as bootstrap tools as it depends on syscalls that only
exists on HEAD

# 0bbe6da5 03-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

mandoc's makewhatis requires gnuzip to be in the path when deadling with
with compressed manpages.

This should fix spam during installworld: "exec: No such file or directory"

Reported by: many

# 75e20d65 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove libmandoc from bootstrap tools

# f5e4216e 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Only push libohash once in bootstrap tools

# 8faa40d1 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Switch to mandoc's version of makewhatis(8), whatis(1), apropos(1) utilities.

This change among other things improve search capabilities over the manpages
allowing fine grain query.

A new build option WITHOUT_MANDOCDB has been added to keep the ancient version
of the database and the tools. The plan is to entirely remove this option before
11.0-RELEASE.

Differential Revision: https://reviews.freebsd.org/D2603

# 645acf41 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Do not make libsqlite3 dependency chain only defined for kerberos, soon more
options would need libsqlite3 as well thus depends on this definitions

# 37a48d40 28-May-2015 Glen Barber <gjb@FreeBSD.org>

MFH: r282615-r283655

Sponsored by: The FreeBSD Foundation


# 8e9b16e5 26-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix build WITHOUT_CDDL by unconditionnaly adding libproc and librtld_db
on supported arches to the prebuild libs

# 2b42dcf7 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

_Really_, _Really_ fix buildworld by moving the conditionals down, fixing some
typos, and fixing the dependency when MK_LIBCPLUSPLUS != no

- `:D` operator evaluation is immediate, i.e. like .if defined(..). So r283159
was in effect a no-op commit.
- Fix dependency in MK_LIBCPLUSPLUS case in two ways:
-- lib/libc++ was the wrong dependency. It should have been libcxxrt.
-- lib/libc++ was missing __L, so again it was depending on the directory, not
the relevant .PHONY target.

Tested with: make tinderbox (amd64, arm, sparc64) and JFLAG=-j16
In collaboration with: bdrewery, imp, peter
BIG pointyhat to: ngie (for trying to commit things at 6am while staying up all
night working on other tasks)

# f3dba867 20-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Make kerberos use the same sqlite libraries as other sqlite consumer.

This reduces the number of copy of sqlite we have to just one and easier
tracking version of sqlite

Differential Revision: https://reviews.freebsd.org/D2443
Reviewed by: imp, stas, bjk

# cf13852b 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

Fix breakage I didn't fully solve in r283151 by depending on the .PHONY
target, not the directory when building libctf for libproc

Reported by: many, Jenkins
Submitted by: rodrigc

# 3f480759 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

Unbreak the arm64/sparc64 tinderbox by only compiling lib/libproc and
lib/librtld_db on architectures where they're supported

Reported by: bz, Jenkins
Pointyhat to: bapt

# ebfd9f66 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

cddl/lib/libctf isn't always a requirement for lib/libproc; its use is dependent
on MK_CTF != "no". Use the other divined value instead of reinventing the wheel

# 5731a3ce 19-May-2015 Enji Cooper <ngie@FreeBSD.org>

Add _more_ missing dependencies for lib/libproc to further squash build races

Verified via `cd lib/libproc; make -VLIBADD`

Pointyhat to: ngie

# d0edea4a 19-May-2015 Enji Cooper <ngie@FreeBSD.org>

Articulate all dependencies for lib/libproc to squash build races after r283139
on !arm64 and !sparc64

Pointyhat to: bapt
Sponsored by: EMC / Isilon Storage Division

# b61e5e48 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

Only build sys/boot/usb/tools if MK_USB != no

Sponsored by: EMC / Isilon Storage Division

# f4547478 20-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix buildworld by adding libproc and librtld_db to the _prebuild_libs
Those are needed to build libdtrace

# 7f36f2d0 19-May-2015 Ed Maste <emaste@FreeBSD.org>

Update crunch bootstrapping test for recent fixes

- r277259 crunchide: Correct 64-bit section header offset
- r281674 crunchide: always include both 32- and 64-bit ELF support

With built-in cross-size support we also no longer need a special case
for cross-build crunchide.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2576

# 4d372549 12-May-2015 Ed Maste <emaste@FreeBSD.org>

Remove redundant csu subdir logic

The appropriate subdirectories are handled by lib/csu/Makefile. There's
no need to duplicate this logic in Makefile.inc1 and lib/Makefile.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2523

# 55b13095 10-May-2015 Thomas Quinot <thomas@FreeBSD.org>

Unbreak build following rev. 282726

(Makefile.inc1): add dependency of xinstall on libmd to
avoid failure of parallel bootstrap.

(lib/libmd/*.h): do not redefine symbols if already
defined as macros (libcrypt uses the same sources internally,
redefining symbols with a prefix of its own).

Fixes build failures caused by previous change to libmd.

Reported by: ian
Pointy hat to: thomas

# 7757a1b4 03-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 363da138 01-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Replace groff's soelim by soeliminate(1) renamed soelim(1)

# 0484aa59 29-Apr-2015 Sean Bruno <sbruno@FreeBSD.org>

Setting PATH to anything is useless as a bare command. Its only relevant
if its set in the environement of each command seperately.

Move the PATH setting to the NXBMAKE variable so its picked up to find
the one-off gperf build for the native-xtools target.

Pointed Out by: ngie

# bf3befad 29-Apr-2015 Sean Bruno <sbruno@FreeBSD.org>

Fix native-xtools breakage when building a gcc enabled target on a clang
enabled host. Build a one-off gperf and put it in the PATH for the rest
of the target so the ONE call to gperf by the gcc build picks it up and
DTRT.

Reviewed by: imp

# 9dc634de 21-Apr-2015 Enji Cooper <ngie@FreeBSD.org>

Serialize all of _kerberos5_bootstrap_tools to avoid build failures involving
make bootstrap-tools

On the plus side, this also greatly reduces complexity

MFC after: 1 week
Pointyhat to: ngie
Reported by: Willem Jan Withagen <wjw@digiware.nl>

# 2d8d8e3c 17-Apr-2015 Ed Maste <emaste@FreeBSD.org>

Bump crunch BOOTSTRAPPING for ELF header offset fix in r277557

# c5e8e000 17-Apr-2015 Warner Losh <imp@FreeBSD.org>

RELEASEDIR was removed in FreeBSD 9.x, at the same time /boot/loader
stopped using kgzip in the release process. We no longer need to build
kgzip as a cross tool, and tests for RELEASEDIR are obsolete, so
remove both.

Differential Revision: https://reviews.freebsd.org/D2313

# 6c4f9295 16-Apr-2015 Enji Cooper <ngie@FreeBSD.org>

Defeat race with MK_KERBEROS == yes introduced with bootstrap-tools
parallelization work done in r279197

- kerberos5/lib/libroken requires kerberos5/tools/make-roken to build
- kerberos5/tools/asn1_compile, kerberos5/tools/slc, and usr.bin/compile_et
require kerberos5/lib/libroken and kerberos5/lib/libvers

This race is incredibly evident when cross-building sparc64 on
ref10-amd64.freebsd.org

MFC after: 1 week
Pointyhat to: ngie

# 008bd7c6 16-Apr-2015 Warner Losh <imp@FreeBSD.org>

People are still getting burned by the byacc upgraded, switch to
always doing byacc until someone figures out the more nuanced version
to switch off of.

# 4bf53d0b 03-Apr-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from HEAD


# b40d31d0 02-Apr-2015 Andrew Turner <andrew@FreeBSD.org>

Only use the CROSS_BINUTILS_PREFIX tool if it exists.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

# 76e2c537 02-Apr-2015 Dimitry Andric <dim@FreeBSD.org>

Ensure the cross assembler, linker and objcopy are used for the build32
stage, just like for the regular world stage.

Reviewed by: rodrigc, imp, bapt, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D2187

# 5ab58881 26-Mar-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Add --sysroot to the compiler flags for clang or gcc external toolchains

Before this fix, --sysroot was only added to the compiler flags if a clang
external toolchain was used.

Reviewed by: imp

# 996d8a0d 25-Mar-2015 Warner Losh <imp@FreeBSD.org>

Add some more explanation to the different phases of the build.

# b9a9d9ca 25-Mar-2015 Ed Maste <emaste@FreeBSD.org>

Force MK_INCLUDES for the legacy stage

As legacy executes "make installincludes" we don't want it to be
disabled by a src.conf setting.

Reviewed by: imp
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2143

# 8daa8167 19-Mar-2015 Andrew Turner <andrew@FreeBSD.org>

Start to import support for the AArch64 architecture from ARM. This change
only adds support for kernel-toolchain, however it is expected further
changes to add kernel and userland support will be committed as they are
reviewed.

As our copy of binutils is too old the devel/aarch64-binutils port needs
to be installed to pull in a linker.

To build either TARGET needs to be set to arm64, or TARGET_ARCH set to
aarch64. The latter is set so uname -p will return aarch64 as existing
third party software expects this.

Differential Revision: https://reviews.freebsd.org/D2005
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

# 8cf263c8 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

run pw_mkdb and cap_mkdb at post-installation for cross installation the version
from the host would be run but the generated files will be on the target
respecing the endianness of the target

# 9269ba46 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Always cleanup remnant plist in destdir if any

# ee1376bc 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix printing the package name when creating

# d3cd95cf 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Now that pkg create can directly accept both a file and a plist in command line,
directly use it

# 9d732154 17-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Detect ABI based on what would be packaged

# a8bed44a 17-Mar-2015 Ed Maste <emaste@FreeBSD.org>

When cross-building with an external toolchain we still need a target strip

It is used by at least crunchide(1).

# 59fa1525 17-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 215d02b7 17-Mar-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add LIB_CXX so that C++ libraries will use CXX to link.

This fixes C++ libraries not implicitly linking in libc++. This is
generally not an issue because the final linking with the compiled binary
will involve CXX via PROG_CXX or other means. It is however
inconsistent with libraries implicitly linking in libc and problematic
for trying to build libraries with '-z defs' to ensure all direct
dependencies are linked in.

libatf-c++ is currently the only consumer of this new feature.

Differential Revision: https://reviews.freebsd.org/D2039
Reviewed by: imp
Discussed with: bapt
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 5d3fd44b 15-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Directly use bmake's ':gmtime'

# 42450b49 15-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Create a "packages" target takes care of all the magic

# 7426d572 15-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 4c4073fd 12-Mar-2015 Ed Maste <emaste@FreeBSD.org>

Provide automatic cross-binutils path if no BINUTILS_BOOTSTRAP

The in-tree binutils does not support arm64, so will not work for the
forthcoming FreeBSD arm64 port. BROKEN_OPTIONS will include
BINUTILS_BOOTSTRAP, so provide a default CROSS_BINUTILS_PREFIX for this
case.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

# e22b7515 12-Mar-2015 Warner Losh <imp@FreeBSD.org>

It appears that xlint isn't used in the build process, so it certainly
doesn't need to be a build tool.

# ca0abefb 04-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add new create-world-packages target to generated the packages out of world

Dynamically figure out the list of targets based on tags passed on the mtrees
First sanity check that all packages have existing manifests
Generate the packages

Please note that for now the mtree needs more work as it has duplicate entries,
everything is not yet tagged

The packages now have generic entries and needs to be customize

# fa1e92b6 04-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# fe692231 26-Feb-2015 Ed Maste <emaste@FreeBSD.org>

Support CROSS_BINUTILS_PREFIX with in-tree compiler

Reviewed by: bapt, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1974

# 3e3b7072 22-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Fill in missing dependencies for dtrace related tools so the bootstrap-tools
compiles properly on older hosts

Pointyhat to: me
X-MFC with: r279197
MFC after: 2 weeks

# aebc0e35 22-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Parallelize building bootstrap-tools

Differential Revision: https://reviews.freebsd.org/D1901
MFC after: 2 weeks
Reviewed by: ian
No serious objections from: imp

# 9c633deb 18-Feb-2015 Jung-uk Kim <jkim@FreeBSD.org>

Fix bootstrap on systems with old yacc with small MAXTABLE.

# 784b6cd5 18-Feb-2015 Peter Grehan <grehan@FreeBSD.org>

Restore the ability to use clang as an external compiler. This was
inadvertently removed when support for external GCC was added.

Deprecate XFLAGS in favour of the newer XCFLAGS/XCXXFLAGS.

Tested with: make universe, make CROSS_COMPILER_PREFIX=/usr/bin/ buildworld
Reviewed by: imp, bapt

# bd9cab6f 17-Feb-2015 Rui Paulo <rpaulo@FreeBSD.org>

release: use xz via pipe when compressing the tarballs.

libarchive(3) doesn't support the new liblzma API yet, but this change
allows us to enable multi-threaded xz compression.
``make release'' should now finish in half the time on a machine with
several cores and fast disks (our typical build server).

This behaviour only applies when building a release and it doesn't
affect buildworld/installworld. To disable threaded xz compression,
set XZ_THREADS=1.

Reviewed by: gjb
Tested by: gjb

# 3b66656a 16-Feb-2015 Rui Paulo <rpaulo@FreeBSD.org>

Fix a typo when invoking tar(1) to create the debug distributions.

# d8fee543 12-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from HEAD


# 11d9aa67 11-Feb-2015 Colin Percival <cperciva@FreeBSD.org>

Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.

The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive. Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.

The next steps will be:

2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.

3. Merging src/games into src/usr.bin.

This change will not be MFCed.

Reviewed by: jmg
Discussed at: EuroBSDCon
Approved by: gjb (release-affecting changes)

# b48e3e73 11-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove remnant from texinfo

# c69a9896 10-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add a new target make stageworld which basically does the same job as:
make installworld distribution but preparing the mtree the same way
distributeworld does and respecting -DNO_ROOT

# cf4b80d8 09-Feb-2015 Glen Barber <gjb@FreeBSD.org>

Exclude 'tests' from DEBUG_DISTRIBUTIONS.

Sponsored by: The FreeBSD Foundation

# 64e55c39 09-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove remnants from texinfo

# 3f98b1eb 09-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add a user message to explain what package is being created

# 53200025 08-Feb-2015 Rui Paulo <rpaulo@FreeBSD.org>

Merge xz 5.2.0.

This brings support for multi-threaded compression. This brings close
N times faster compression where N is the number of CPU cores.
Because of this, liblzma now depends on libthr.

Soon libarchive will be modified to use the new lzma API.

Thanks to antoine@ for the exp-run.

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


# 0b6a052e 08-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove the verbose flag from pkg invocation as it is not in pkg releases yet

# 183a8ead 08-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add a new kernel-pkgs target to create pkg(8) packages from the kernel

The version scheme used is the following:
For stable/current branches:
${REVISION}.sYYYYMMDDhhmmss

s standing for snapshot

For releases branches:
${REVISION}_${PATCHLEVEL}

When packaging the kernel 2 different package are created per kernel
release (only contains the regular kernel and modules)
debug (contains the .symbols files)

Note that package the kernel (packaging world will follow the same rule) can
only by passing -DNO_ROOT to the build (hence can be done as a regular user)

To package the kernel:
make buildkernel
make distributekernel DESTDIR=/somewhere -DNO_ROOT
make kernel-pkgs DESTDIR=/somewhere -DNO_ROOT

The packages will be created inside the DESTDIR

# 9312c006 08-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

if BUILD_PKGS is set add sha256 hash into the metalogs

# 31a741f4 03-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Conditionalize building radius support into libpam, ppp, etc via
MK_RADIUS_SUPPORT

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

# 27051ca1 23-Jan-2015 Ed Maste <emaste@FreeBSD.org>

Restore addr2line to cross tools

Addr2line is not required for the build, and a per-arch binary is no
longer required with the switch to the ELF Tool Chain. However, building
these tools during the cross tools stage can be useful for developers
who cross build HEAD from stable/10, and adds very little to the build
time.

Reviewed by: ian, imp
Differential Revision: https://reviews.freebsd.org/D1583

# 8b817932 21-Jan-2015 Ed Maste <emaste@FreeBSD.org>

Fix bootstrap on systems with old libdwarf and WITHOUT_CDDL

ELF Tool Chain tools need libelf and libdwarf.

Submitted by: jmallett (earlier version)
Reviewed by: jmallett
Sponsored by: The FreeBSD Foundation

# da010b56 21-Jan-2015 Ed Maste <emaste@FreeBSD.org>

Remove addr2line from cross elftoolchain tools list

It is not required, and there is no reason to install it just because it
came with the binutils cross tools.

Sponsored by: The FreeBSD Foundation

# 2d281361 02-Jan-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove GNU texinfo from base along with all info pages.

To be able to info pages consider installing texinfo from ports print/texinfo or
via pkg: pkg install texinfo

Differential Revision: https://reviews.freebsd.org/D1409
Reviewed by: emaste, imp (previous version)
Relnotes: yes

# 7d612a43 30-Dec-2014 Ed Maste <emaste@FreeBSD.org>

Use BINUTILS_BOOTSTRAP knob for binutils only

Previously it also disabled building elftoolchain bootstrap tools such as
strip(1).

Differential Revision: https://reviews.freebsd.org/D1398
Reviewed by: imp
Sponsored by: The FreeBSD Foundation

# 851cc4c0 21-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Update the text for building texinfo with build-tools to reflect the fact
that make install is being called as well

MFC after: 1 week
X-MFC with: r276052

# 492c2b1f 21-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Build selective portions of gnu/usr.bin/texinfo as part of build-tools to
ensure that building on a host without makeinfo (i.e. a host where
make delete-old -DWITHOUT_INFO was run), then building with MK_INFO == yes
doesn't manifest in build errors when building info pages

This manifested itself like the following when I was build testing an MFC
change on stable/10:

makeinfo --no-split -I /usr/src/gnu/lib/libregex/doc -I /usr/src/gnu/lib/libregex/doc regex.texi -o regex.info
makeinfo: not found
*** [regex.info] Error code 127

make[6]: stopped in /usr/src/gnu/lib/libregex/doc
1 error

Tested on a head VM without makeinfo installed and by building with MK_INFO=yes

MFC after: 1 week

# 9e7d291e 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Fix accidental MK_DEBUG_FILES=no addition to NXBMAKE in r275909

X-MFC with: r275909
Sponsored by: EMC / Isilon Storage Division

# c8ed1da7 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Don't build full clang toolchain or clang extras in stages 1-3 of buildworld

MFC after: 1 week
Reviewed by: dim (as part of a "larger" diff)
Phabric: D1336
Sponsored by: EMC / Isilon Storage Division

# f703589e 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Fix building/installing tests when TESTSBASE != /usr/tests

The work in r258233 hardcoded the assumption that tests was the last component
of the tests tree by pushing tests as an explicit prefix for the paths in
BSD.tests.dist and /usr was the prefix for all tests, per BSD.usr.dist and all
of the mtree calls used in Makefile.inc1. This assumption breaks if/when one
provides a custom TESTSBASE "prefix", e.g. TESTSBASE=/mytests .

One thing that r258233 did properly though was remove "/usr/tests" creation
from BSD.usr.dist -- that should have not been there in the first place. That
was an "oops" on my part for the work that was originally committed in r241823

MFC after: 2 weeks
Phabric: D1301
Reviewed by: imp
Sponsored by: EMC / Isilon Storage Division

# f9d93ea7 17-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Fix sporadic build failures due to race when running make installworld
when strip gets replaced at install time by adding it to ITOOLS for the
default usr.bin/xinstall STRIP_CMD

This will fix the failure noted in this Jenkins build step:
https://jenkins.freebsd.org/job/Build-UFS-image/688/

This will also fix the issue reported by alfred@ dealing with installing on
targets that differ from build hosts (e.g. installing on i386/i386 when built
on amd64/amd64)

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

# 5f25ee9c 16-Dec-2014 Brooks Davis <brooks@FreeBSD.org>

Add an UPDATING entry and warning about the change in r274807 to help users
transition to the new behavior.

Discussed with: jmallett
Sponsored by: DARPA, AFRL

# 46fe68cd 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Add makewhatis to ITOOLS if MK_MAN != no

This will fix installation with differing host targets in installworld, so
one can build i386/i386 on an amd64 host, then install to an i386/i386 target

Reported by: alfred
Phabric: D1280
MFC after: 1 week

# 317b32d4 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Build gperf with xdev as part of _xb-bootstrap-tools

This will unbreak the build when "env MK_CXX=no make delete-old" has been run
on the build host post-r272849

Tested with the following commands:

/bin/sh
export __MAKE_CONF=/dev/null SRCCONF=/dev/null
export MK_CLANG=no MK_CLANG_BOOTSTRAP=no MK_GCC=yes MK_GCC_BOOTSTRAP=yes
export MK_GNUCXX=yes TARGET=armv6 TARGET_ARCH=arm make xdev
make toolchain
make xdev-build
sudo -E make xdev-install
/usr/armv6-freebsd/usr/bin/cc -dumpmachine | grep arm

X-MFC with: r272849
Reported by: Dan Raymond <draymond@foxvalley.net>, gjb


# 2bc62d50 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Build gperf with xdev as part of _xb-bootstrap-tools to unbreak the build
if/when MK_CXX == no and make delete-old has been run on the build host,
post-r272849

Tested with the following command:

% sudo env MK_CLANG=no MK_CLANG_BOOTSTRAP=no MK_GCC=yes MK_GCC_BOOTSTRAP=yes \
MK_GNUCXX=yes make xdev

# 1955a4bf 07-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Push the build-tools logic down into Makefile.inc1 so it's localized all in
one spot, and the potential for installing to the wrong DESTDIR is lower

# da976f9d 05-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

MFhead @ r275496


# 31942939 01-Dec-2014 Ed Maste <emaste@FreeBSD.org>

Build infrastructure for elftoolchain tools

Set WITH_ELFTOOLCHAIN_TOOLS in src.conf to use the elftoolchain version
of the following tools:

* addr2line
* elfcopy (strip / mcs)
* nm
* size
* strings

Reviewed by: bapt (earlier version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1224

# 1d91a058 28-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

share/termcap requires ex from usr.bin/vi in order to compile, and since usr.bin
comes after share in SUBDIR in Makefile.inc1, the build will fail when vi is not
installed on the build host

Run build-tools for usr.bin/vi and install ex, etc to WORLDTMP to enable building
share/termcap on hosts that don't have nvi installed on them

# f541dd9b 26-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Implement MK_RADIUS_SUPPORT to make libradius and assorted support optional

# 7e57795a 25-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Don't try and build 32-bit versions of hyperv / bhyve

# 0e97688f 21-Nov-2014 Brooks Davis <brooks@FreeBSD.org>

Slightly alter the handling of LOCAL_LIB_DIRS to skip addition of
directories in LOCAL_LIB_DIRS if they are subdirectories of directories
listed in LOCAL_DIRS. This allows a hierarchy like:

foo
foo/lib
foo/usr.bin
foo/usr.sbin

to be supported with LOCAL_DIRS=foo LOCAL_DIRS=foo/lib.

MFC after: 1 week
Sponsored by: DARPA, AFRL

# e163efb6 21-Nov-2014 Brooks Davis <brooks@FreeBSD.org>

Add a guard against attempting to invoke the buildenv target with -j# as
that silently exits rather than doing something useful.

MFC after: 1 week
Sponsored by: DARPA, AFRL

# e93397e5 16-Nov-2014 Sean Bruno <sbruno@FreeBSD.org>

Add mv, echo and hostname to the native-xtools target. Missed these
when profiling.

MFC after: 2 weeks

# e98c3c3f 16-Nov-2014 Sean Bruno <sbruno@FreeBSD.org>

Flush out many more static binaries that can be used in a jail for building
pkgs via poudriere. This removes a significant amount of emulation speeding
up run times.

Phabric: D1172
Reviewed by: imp
MFC after: 2 weeks

# 2c8c40a7 13-Nov-2014 Sean Bruno <sbruno@FreeBSD.org>

Add more static binaries to the native-xtools target. These help speed
up the cross builds significantly.

adding:
bin/sh
bin/csh
sbin/md5
usr.bin/bzip2
usr.bin/fetch
usr.bin/gzip
usr.bin/tar
usr.bin/unzip
usr.bin/xz

Phabric: D1146
Reviewed by: imp bdrewery
MFC after: 2 weeks

# 6e48c752 07-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Fix build race in Makefile.inc1 after r274226 by adding lib/libm__L dependency
for gnu/lib/libdialog

Sponsored by: EMC / Isilon Storage Division

# b78618fb 06-Nov-2014 Devin Teske <dteske@FreeBSD.org>

For really fast machines, an edge-case may exist where dpv(3) may be
built before contrib dependency, dialog(3). Add dialog(3) to the list
of _prebuild_libs to ensure that this does not happen.

Tested on: 11.0-CURRENT amd64 @ r274205
Thanks to: kargl, Larry Rosenman <ler@lerctr.org>, ngie, markj
Recommended by: ngie
Reviewed by: ngie, markj
MFC after: 21 days
X-MFC-to: stable/10 stable/9
X-MFC-with: 274116 274120 274121 274123 274144 274146 274192 274203

# 2b293f6a 06-Nov-2014 Devin Teske <dteske@FreeBSD.org>

SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for me.
Add to using _prebuild_libs in (top-level) Makefile.inc1.
NB: Unbreak build yet again (we'll get this right eventually)

Reviewed by: markj, ngie
Thanks to: ian, markj, ngie, Nikolai Lifanov <lifanov@mail.lifanov.com>
MFC after: 21 days
X-MFC-to: stable/10 stable/9
X-MFC-with: 274116 274120 274121 274123 274144 274146 274192

# 75c3b117 27-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Rename XFLAGS to XCFLAGS and XXFLAGS to XCXXFLAGS

This is less confusing names and actually more reflexting what they are intended
to.

Discussed with: brooks

# b55e8e6e 21-Oct-2014 Warner Losh <imp@FreeBSD.org>

My previous commit exposed an issue as it fixed a different
issue. lib/atf isn't a prereq_lib, since it isn't required for other
libraries to build. Remove it. The old kludge of always building it
had effectively been retired. Since we don't want to build the
libraries with the tests when we're bootstrapping, invent
MK_TESTS_SUPPORT which normally defaults to the current MK_TESTS
value, except when explicitly defined. Make lib/atf depend on it being
yes. When building the libraries set MK_TESTS to no, and
MK_TESTS_SUPPORT to the current value of MK_TESTS so that later stages
of the build work correctly. This should fix (and does for me)
people's issues with parallel builds racing between lib/atf and
libexec/atf. Since lib/atf is built during the libraries phase, the
race disappears.

# 983678dd 21-Oct-2014 Warner Losh <imp@FreeBSD.org>

Generate both userland and kernel option settings for showconfig.

PR: 191920

# e8a66c33 21-Oct-2014 Warner Losh <imp@FreeBSD.org>

You aren't allowed to test WITH_xxx or WITHOUT_xxx here, so remove it.
Even if you were allowed to test for it, the test makes no sense as it
always results in adding -DWITH_ATF unless WITH_ATF was already
defined. But if MK_ATF != no, then we know it was defined. This, in
turn, caused tools/build/options/makemake always think WITH_ATF is the
default, which removed control of that from sys.conf.mk.

To get the intent of the deleted comment, another mechanism is
required, assuming that the intent of that comment is desirable.

# 1ff70c71 21-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Make the external toolchain support grows to the knowleged of XXFLAGS for C++ dedicated flags
and DEPFLAGS for mkdep flags
Pass the path to the libc++ headers in both, enforce the gnu++11 standard in the XXFLAGS
to satisfy libc++ requirements pass the libc++ objectdir as a location where to find
libraries so it can find libstdc++.so and libstdc++.A

Reviewed by: imp

# a5edb5fb 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Add size(1) to the cross build toolchain

# 8329338c 08-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Fix typo

# 481d7bbf 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Add OBJCOPY to the list of external tools

# 46d3ab75 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Fix build when XCC is defined and X_COMPILER_TYPE is not

# 3dce4cb5 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Add CROSS_TOOLCHAIN macro select pre seeded external toolchain configuration files
The goal is to provide pre seeded toolchain configurations withing the ports tree
to allow the use of an external toolchain in a simple way:

make CROSS_TOOLCHAIN=powerpc64-gcc TARGET=powerpc TARGET_ARCH=powerpc64 buildworld

This will look for the external toolchain definition in /usr/local/share/mk/powerpc64-gcc.mk
While here add the notion of X_COMPILER_TYPE to the external toolchain framework to allow
to deal with differences between gcc and clang in regards of cross building

# 06429175 05-Oct-2014 Mark Johnston <markj@FreeBSD.org>

Fix dependency errors when linking libproc.

Reported by: Oliver Hartmann
X-MFC-With: r272488

# c36047bd 03-Oct-2014 Xin LI <delphij@FreeBSD.org>

Add dependencies to various libraries to libzfs and libzpool.

Submitted by: sef

# 3dde11c4 30-Sep-2014 Andrew Turner <andrew@FreeBSD.org>

Fix the TARGET_ABI value clang uses. It shpuld be gnueabi on all ARM
soft-float architectures, and gnueabihf for hard-float.

# 6d4766c1 01-Oct-2014 Andrew Turner <andrew@FreeBSD.org>

Remove MK_ARM_EABI, the armeb issues have been fixed. The code to support
the oabi is still in the tree, but it is expected this will be removed
as developers work on surrounding code.

With this commit the ARM EABI is the only supported supported ABI by
FreeBSD on ARMa 32-bit processors.

X-MFC after: never
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D876

# be26ce21 23-Sep-2014 Enji Cooper <ngie@FreeBSD.org>

Have distrib-dirs, distribution, hier, hierarchy, redistribute, and reinstall
depend on the .MAKE special target

This will allow users to do something like the following to print out the
results of the running the simulated make target with bmake, like some of the
other top-level make targets in Makefile.inc1:

% make -f Makefile.inc1 -n distribution TARGET=i386 TARGET_ARCH=i386

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 217c8381 17-Sep-2014 Will Andrews <will@FreeBSD.org>

Root the lib32 object tree under the overall object tree.

This enables a common root directory for all object files for a given tree,
which eases sharing a common MAKEOBJDIRPREFIX, and cleaning up of object trees.

In particular, one can simply (from the source directory) rm -rf /usr/obj$(pwd)
to destroy all object files for it. Or to copy/sync files, etc.

Reviewed by: bdrewery
CR: https://reviews.freebsd.org/D796
MFC after: 1 month
Sponsored by: Spectra Logic

# 5608fd23 19-Aug-2014 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r267233 for now. PIE support needs to be reworked.

1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
where it never would work anyhow, such as csu or loader. This suggests
there may be better ways of adding support to the tree. Many of these
cases can be fixed such that -fPIE will work but there is really no
reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
really building libraries but have been using bsd.prog.mk because the code
is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by: kib

# 75872267 18-Aug-2014 Warner Losh <imp@FreeBSD.org>

Create the native-xtools target. This target creates only the cross
building toolchain for the host computer. This toolchain produces
TARGET_ARCH and assumes the rest of the system contains libraries for
the target. It is intended to be used in a "qemu-user jail" where all
the binaries would otherwise be the target architecture's to build
ports. However, emulation of the compilers is too slow, so we build
native binaries for that. Rather than use the xdev produced binaries,
with all their weird links and paths, these binaries use the native
paths. They will not work unless installed into the qemu-user jail.

Differential Revision: https://phabric.freebsd.org/D518
Reviewed by: sbruno@

# 51483c42 15-Aug-2014 Enji Cooper <ngie@FreeBSD.org>

Fix atmconfig compilation when MK_ATM == yes and MK_BSNMP == no

Makefile.inc1:
Always compile gensnmptree with bootstrap-tools when MK_BSNMP != no
instead of depending on a potentially stale tool installed on the build host

sbin/atm/atmconfig/Makefile:
- Always remove oid.h to avoid cluttering up the build/src tree.
- Consolidate all of the RESCUE/MK_BSNMP != no logic under one
conditional to improve readability
- Remove unnecessary ${.OBJDIR} prefixing for oid.h and use ${.TARGET} instead
of spelling out oid.h
- Add a missing DPADD for ${LIBCRYPTO} when compiled MK_BSNMP == yes and
MK_OPENSSL == yes and not compiling for /rescue/rescue

sbin/atm/atmconfig/main.c:
Change #ifndef RESCUE to #ifdef WITH_BSNMP in main.c to make it
clear that we're compiling bsnmp support into atmconfig

Approved by: jmmv (mentor)
Phabric: D579
PR: 143830
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# 37fbf898 08-Aug-2014 Rui Paulo <rpaulo@FreeBSD.org>

Run dtrace in 32-bit mode when compiling 32-bit libraries.

MFC after: 3 days

# 51fa06dd 07-Aug-2014 Ian Lepore <ian@FreeBSD.org>

m4 now requires libohash, ensure it gets built when bootstrapping.

# 4504fbd3 07-Aug-2014 Ollivier Robert <roberto@FreeBSD.org>

10 has a new flex (2.5.37) and the config.h for unbound has been updated to
take this into account. Alas it breaks source upgrade from any version of
9 because flex is not built as a bootstrap-tools (it would be for older
versions).

That means "libunbound/configlexer.c" is built with the old flex but using
config.h for the new one. Build is thus broken going from 9.* to 10.

Make flex a bootstrap-tools entry if host is less than 1000033 to take into
account the flex update in 10.

Tested on both 9.2-RC3 and 9.3 by myself and dim@. Running buildworld in
head but as both 10 and 11 has the new flex, it will not matter.

Reviewed by: imp
Approved by: des, imp
MFC after: 1 week
Phabric: D554

# 92dbec66 04-Aug-2014 Brooks Davis <brooks@FreeBSD.org>

Merge from CheriBSD:

Make the sysinit tool a build tool rather than building in with
/usr/bin/cc and running it from OBJDIR. (It will be moved to usr.bin
once a manpage is written and a few style cleanups are done.)

Split the makefile bits for Hans' kernel shim layer into their own
includable kshim.mk.

Move USB support into a .mk file so loaders can include it.

# 22cbbf9d 23-Jul-2014 Sean Bruno <sbruno@FreeBSD.org>

Deprecate the use of XDEV and XDEV_ARCH and just use TARGET/TARGET_ARCH
for the xdev build target, which is awesome and totally works.

Reapply svn R268377 with correct name of libsupc++ here as this does
resolve one dependancy race when building the xdev target.

the xdev target builds for amd64, i386, mips, mips64 and armv6 with this commit,
must be built as root, must be built from /usr/src, must not have a /usr/obj and
places the xdev tools in /usr/$TARGET_ARCH-freebsd

the xdev target still leaves some assorted files strewn about your /usr/src when
this is done and needs to be investigated further.

Phabric: https://phabric.freebsd.org/D385
Submitted by: bsdimp

# 1782c649 21-Jul-2014 Dimitry Andric <dim@FreeBSD.org>

Run mtree for BSD.tests.dist during make xdev-install, if the tests are
enabled (which they are in the default configuration). Otherwise, it
will fail because ${XDDESTDIR}/usr/include/atf-c does not exist.

MFC after: 3 days

# 9e88096e 10-Jul-2014 Warner Losh <imp@FreeBSD.org>

Make MK_GNUCXX mean "build the libstdc++ and libsupc++ libraries" and
nothing more. Force it to be "no" when MK_CXX is "no" to simplify
usage. It no longer also means "build g++" since we no longer have a
platform where that's interesting now that pc98 no longer needs clang
and gcc, but not g++. pc98 now just uses clang after boot2 changes.

# 9e488366 10-Jul-2014 Warner Losh <imp@FreeBSD.org>

Separate out the links creation from the other targets. This was
supposed to have been done for the original commit, but somebody
forgot.

Pointy-hat-to: imp@

# 9016d25f 07-Jul-2014 Warner Losh <imp@FreeBSD.org>

Typo means that this couldn't have possibly fixed anything, so revert
r268377.

# 8bc01eb6 07-Jul-2014 Warner Losh <imp@FreeBSD.org>

xdev builds libsupc++ and libstdc++ in a slightly strange way. This
cause a race to be exposed between the two. Compensate for this race
by serializing the build/install of libstdc++ before libsupc++.

# 50f73640 02-Jul-2014 Marcel Moolenaar <marcel@FreeBSD.org>

Remove ia64 from the list of known architectures and add an entry to
UPDATING. This is the first step towards the removal of ia64 from
head. A buildworld for ia64 will now yield:

% make buildworld
make[1]: "/usr/src/Makefile.inc1" line 151: Unknown target ia64:ia64.

While here, trim the ia64-specific additions from ObsoleteFiles.inc

Discussed at: BSDcan

# ffc6fb79 01-Jul-2014 Glen Barber <gjb@FreeBSD.org>

Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:

r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.

Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.

r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)

Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.

r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution

This also follows other naming conventions seen in the
wild.

r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.

This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.

r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.

MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation

# 824a9093 29-Jun-2014 Ed Maste <emaste@FreeBSD.org>

Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT

The _SUPPORT knobs have a consistent meaning which differs from the
behaviour controlled by this knob. As the knob is opt-out and has not
appeared in a release the impact should be low.

Suggested by: imp, wblock
MFC after: 1 week

# a0e6a013 17-Jun-2014 Bryan Drewery <bdrewery@FreeBSD.org>

- Add a LOCAL_ITOOLS to allow adding additional tools required for the
installworld and distributeworld targets

PR: 179562
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
MFC after: 1 week

# cce0f182 12-Jun-2014 Ed Maste <emaste@FreeBSD.org>

Build vt(4) fonts during buildworld

vtfontcvt(8) is now built during buildworld, so can be used as a
bootstrap tool to create vt(4) fonts from source .hex or .bdf font
files, rather than having uuencoded binary fonts in the tree.

Sponsored by: The FreeBSD Foundation

# e8a34402 10-Jun-2014 Julio Merino <jmmv@FreeBSD.org>

Put the test suite in its own tests.txz distribution file.

Force all the contents of /usr/tests to go into a separate distribution
file so that users of binary releases can easily choose to not install it.

To make this possible, we need two fixes:
- bsd.subdir.mk needs to properly honor NO_SUBDIR in all cases so that we
do not recurse into 'tests' subdirectories when we needn't. Otherwise,
we end up with some Kyuafiles in base.txz.
- etc/Makefile needs to skip installing tests in its 'distribute' target
so that a Kyuafile doesn't leak into base.txz.

Approved by: gjb

# 864c53ea 08-Jun-2014 Bryan Drewery <bdrewery@FreeBSD.org>

In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.

This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by: Shawn Webb <lattera@gmail.com>
Discussed between: des@ and Shawn Webb [2]

# 403ec796 22-May-2014 Warner Losh <imp@FreeBSD.org>

When libelf and libdwarf were updated, we didn't bump the minimal
version needed for CTF tools, so sometimes we'd use the host's CTF
tools that didn't work. Be sure to bootstrap in that case.

# e00e69ab 21-May-2014 Xin LI <delphij@FreeBSD.org>

Fix build: Build libavl as prebuild-lib.

X-MFC-With: 266520

# 7273339d 10-May-2014 Warner Losh <imp@FreeBSD.org>

Eliminate EARLY_BUILD flag. It is redundant and means MK_CLANG_FULL=no
and MK_LLDB=no, so set those explicitly (now that we can do
that). Simplify tests for these variables as well, since we know they
will always be defined regardless of the phase of the build.

# ab72ce6b 10-May-2014 Warner Losh <imp@FreeBSD.org>

Migrate NO_WARN to MK_WARN. Support legacy NO_WARN usage. Remove a
check for EARLY_BUILD because it isn't necessary (MK_WARN=no will
always be defined for that).

# a46954e2 05-May-2014 Warner Losh <imp@FreeBSD.org>

Document src.opts.mk changes and the decoupling of /etc/src.conf from
anything but the source tree.

# c6063d0d 05-May-2014 Warner Losh <imp@FreeBSD.org>

Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.

# cf35c685 03-May-2014 Thomas Quinot <thomas@FreeBSD.org>

Add appropriate quoting to allow building with a KERNCONFDIR containing
spaces.

PR: kern/162736
MFC after: 1 week

# 56d78e82 30-Apr-2014 Warner Losh <imp@FreeBSD.org>

Turns out this .if evaluated not in the context of the makedtb target
sometimes due to Makefile expansion rules. Make the test for things
being NULL elsewhere...

# 0edb7351 30-Apr-2014 Warner Losh <imp@FreeBSD.org>

Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a
kernel config file. If you also want to have a static DTB compiled
into your kernel, however, it cannot be a list. We have no mechanism
in the kernel for picking one, so that doesn't make sense and will
result in a compile-time error.

# 52cb8b8f 28-Apr-2014 Warner Losh <imp@FreeBSD.org>

Add dependency for libm to libstdc++. This fixes high -j value builds
when not building with clang.

Submitted by: ian@

# 845b7c7b 26-Apr-2014 Warner Losh <imp@FreeBSD.org>

make_dtb.sh is designed to be used in a kernel build environment where
MACHINE is defined to the target's value, not the host's
value. However, in Makefile.inc1, it is still defined to be the host's
value. Make the makedtb target work by expanding TARGET in the
existance test, and passing MACHINE=$TARGET in the call to make_dtb.sh

# 347c9de0 25-Apr-2014 Warner Losh <imp@FreeBSD.org>

Eliminate NO_INCS. It is used one place, and MK_TOOLCHAIN=no will
handle the job just as well. Opt for simplicity rather than one more
option.

# 98407b8b 25-Apr-2014 Warner Losh <imp@FreeBSD.org>

Spell NO_PROFILE= as MK_PROFILE=no.

# 96267df3 25-Apr-2014 Warner Losh <imp@FreeBSD.org>

Remove NO_CTF, exccept as an undocumented compatibility
option. Convert all other uses to MK_CTF=no. Set MK_CTF=no rather than
the indirect WITHOUT_CDDL in filemon regression. It is expected that
NO_CTF will be removed in FreeBSD 12 entirely.

# 2bf36e7e 18-Apr-2014 Warner Losh <imp@FreeBSD.org>

Separate out enabling building clang and/or gcc for the system and
building clang and/or gcc as the bootstrap compiler. Normally, the
default compiler is used. WITH_CLANG_BOOTSTRAP and/or
WITH_GCC_BOOTSTRAP will enable building these compilers as part
bootstrap phase. WITH/WITHOUT_CLANG_IS_CC controls which compiler is
used by default for the bootstrap phase, as well as which compiler is
installed as cc. buildworld now successfully completes building the
cross compiler with WITHOUT_CLANG=t and WITHOUT_GCC=t and produces a
built system with neither of these included.

Similarlly, MK_BINUTILS_BOOTSTRAP controls whether binutils is built
during this phase.

WITHOUT_CROSS_COMPILER will now force MK_BINUTILS_BOOTSTRAP=no,
MK_CLANG_BOOTSTRAP=no and MK_GCC_BOOTSTRAP=no.

BOOTSTRAP_COMPILER was considered, but rejected, since pc98 needs both
clang and gcc to bootstrap still. It should be revisisted in the
future if this requirement goes away. Values should be gcc, clang or
none. It could also be a list.

The odd interaction with Xfoo cross/external tools needs work, but
is beyond the scope of this change as well.

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

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

Determine whether to build clang and its bootstrap tools the same
way. This allows a clang bootstrap to happen, even when WITHOUT_CLANG
is defined. This is a minimal version of a more extensive change which
can be MFC'd more easily. However, we have to also test to see if
we're building clang as not cc, since the bootstrap for that needs
these cross tools and it is easier to build them in just one place.

MFC after: 1 week

# 62c4a462 04-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Prevent XDTP from being a relative path
XDTP is used as the default SYSROOT for clang and thus should be an absolute path.

PR: arm/188249
Submitted by: Edgar Martinez <wink15987@gmail.com>
Reviewed by: imp

# e4dbff8a 03-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

XDDESTDIR should not be set by the user, instead the user might want to tweak
XDTP and let the standard DESTDIR decide where to install.

Discussed with: imp

# cf44c89b 03-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Some xdev fixes:

- if TARGET_ARCH is not defined and XDEV_ARCH is defined then early define
TARGET_ARCH to the valud of XDEV_ARCH: This allow the xdev-build target
to be able to correctly chose the compiler it needs to build
- Allow overwriting XDTP to allow a user to not chose where the xdev env will
live in
- Fix build for gcc only xdev (like ia64) by providing the proper -B to the
toolchain and not relying on gcc being installed already in base
- Fix TOOLS_PREFIX so the generated toolchain has the right default sysroot when
installed intead of getting the DESTDIR one
- Fix supporting DESTDIR
- Also overwrite CXX (needed for cross building c++ libraries with clang) and
CPP (needed to cross build some libraries when gcc is the target default
compiler but gcc is not installed on the building host)

Discussed with: imp

# c77d0c98 01-Apr-2014 Warner Losh <imp@FreeBSD.org>

It is possible that MK_GNUCXX is "yes" but MK_CXX is "no" so make sure
MK_CXX isn't "no" before building these libraries.

# ae85a489 01-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Ensure make xdev respect which compiler is CC
and which compilers should be built according to standard build options

# 63e4d6f7 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

There's no need to guess at the COMPILER_TYPE to pass it down. We
guess wrong for buildkernel when CC=gcc49, say. Eliminate all the
guessing. COMPILER_TYPE propigates properly on its own, if specified,
and we guess it correctly otherwise lower in the build. Also, fix
conditionals for armv6hf when using an external compiler chain. They
were broken before, but unused. Also, prefer checking the compiler
type over CLANG_IS_CC since the latter is only supposed to be used to
determine what symlinks to install (more fixes to follow).

# bfbada6e 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

Move stray targets out of the xdev section.

# 15eee895 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

Kill NO_TESTS and use MK_TESTS=no when we want to skip them.

# e091d985 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

Allow the build system to safely set MK_FOO to avoid the ambiguity
when both WITH_FOO and WITHOUT_FOO are set. Use this where
possible. Only disallow setting of MK_FOO on the command line. This
was preferable to inventing a new mechanism or fixing the undef bug
(bin/183762) which precludes users from turning off anything we turn
off for parts of the build with WITHOUT_FOO prior to this.

# 53eff78a 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

When building g++, we need to build libsupc earlier to avoid a race
with libproc. Not sure why people didn't see this before now, but I
get it often for higher (20-30) -j builds, but never for -j1 builds.

# bd633799 28-Mar-2014 Warner Losh <imp@FreeBSD.org>

Only set XDDESTDIR if it wasn't already set to allow people to
override it.

# 73279d41 22-Mar-2014 Andrew Turner <andrew@FreeBSD.org>

Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.

This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit.
This is an optional coprocessors may not be present in all devices, however
it appears to be in all current SoCs we support.

armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too
old to support this. Because of this there are a number of WITH/WITHOUT
options that are unsupported and must be left as the default value. The
options and their required value are:
* WITH_ARM_EABI
* WITHOUT_GCC
* WITHOUT_GNUCXX

In addition, without an external toolchain, the following need to be left
as their default:
* WITH_CLANG
* WITH_CLANG_IS_CC

As there is a different method of passing float and double values to
functions the ABI is incompatible with existing armv6 binaries. To use
this a full rebuild of world is required. Because no floating point values
are passed into the kernel an armv6 kernel with VFP enabled will work with
an armv6hf userland and vice versa.

# ae094461 20-Mar-2014 Alan Somers <asomers@FreeBSD.org>

Fix kern/187712: config(8) does not respect KERNCONFDIR.
The impact of this bug is that you cannot build a kernel if both of the
following are true:
1) The kernel config file is in a non-default location
2) The kernel config file uses the "include" statement from config(5).

usr.sbin/config/main.c
usr.sbin/config/config.8
usr.sbin/config/config.h
usr.sbin/config/lang.l
Added a "-I path" option to config(8). By analogy to cc(1), it adds
an extra path in which the "include" statement will search for
files.

Makefile.inc1
Pass "-I ${KERNCONFDIR}" to config(8).

PR: kern/187712
Reviewed by: will, imp (previous version)
MFC after: 3 weeks
Sponsored by: Spectra Logic Corporation

# 02701f04 14-Mar-2014 Warner Losh <imp@FreeBSD.org>

With the more generous footprints today, it makes little sense to use
UFS1 by default any more. Switch to UFS2.

# 2c284d93 13-Mar-2014 Gleb Smirnoff <glebius@FreeBSD.org>

Remove IPX support.

IPX was a network transport protocol in Novell's NetWare network operating
system from late 80s and then 90s. The NetWare itself switched to TCP/IP
as default transport in 1998. Later, in this century the Novell Open
Enterprise Server became successor of Novell NetWare. The last release
that claimed to still support IPX was OES 2 in 2007. Routing equipment
vendors (e.g. Cisco) discontinued support for IPX in 2011.

Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.

# 3b8f61cb 01-Mar-2014 Marcel Moolenaar <marcel@FreeBSD.org>

Use ${MAKE} so that we always use the same version/implementation
of make.

# eeb913c9 28-Feb-2014 Warner Losh <imp@FreeBSD.org>

Integrate device-tree upstream files into the build process:
(1) Invoke cpp to bring in files via #include (although the old
/include/ stuff is supported still).
(2) bring in files from either vendor tree or freebsd-custom files
when building.
(3) move all dts* files from sys/boot/fdt/dts to
sys/boot/fdt/dts/${MACHINE} as appropriate.
(4) encode all the magic to do the build in sys/tools/fdt/make_dtb.sh
so that the different places in the tree use the exact same logic.
(5) switch back to gpl dtc by default. the bsdl one in the tree has
significant issues not easily addressed by those unfamiliar with
the code.

# d2ed6da0 30-Jan-2014 Brooks Davis <brooks@FreeBSD.org>

Merge from CheriBSD:
commit 1b41f6de7ca09e04fdc6f66bc478ea6c981a41b9
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date: Mon Jan 27 22:59:02 2014 +0000

Now that mtree is always nmtree use it as mtree

Tested on: ref9-amd64
X-MFC after: never
Sponsored by: DARPA, AFRL

# 2b29a85c 24-Jan-2014 Alan Somers <asomers@FreeBSD.org>

Fix the build so -DNO_TESTS is passed in various phases that don't
require tests in order to build or install. Crucially, don't try to
install tests during the lib32 install phase. This commit supersedes
r261081, which fixed the lib32 install phase problem, but didn't fix
other phases.

Submitted by: Garrett Cooper
Reviewed by: sjg
MFC after: 13 days

# a8eb96d5 23-Jan-2014 Alan Somers <asomers@FreeBSD.org>

Replace the old unix_seqpacket and unix_seqpacket_exercise tests, which
were a little broken and not automatable, with unix_seqpacket_test.
It's coverage is a superset of the old tests and it uses ATF. It
includes test cases for bugs kern/185813 and kern/185812.

PR: kern/185812
PR: kern/185813
Sponsored by: Spectra Logic
MFC after: 2 weeks

# 385d6d47 22-Jan-2014 John Baldwin <jhb@FreeBSD.org>

Generate /var/db/services.db during 'make distribution' so that it is
present during new installs. Update etcupdate and mergemaster to
ignore the generated file.

Tested by: gjb (release build)
MFC after: 1 month

# 50b464aa 07-Jan-2014 Scott Long <scottl@FreeBSD.org>

Remove aicasm as a build dependency. It made sense when the ahc and ahd
drivers and their firmware were under active development, but those days
have passed. The firmware now exists in pre-compiled form, no longer
dependent on it's sources or on aicasm. If you wish to rebuild the
firmware from source, the glue still exists under the 'make firmware'
target in sys/modules/aic7xxx.

This also fixes the problem introduced with r257777 et al with building
kernels the old fashioned way in sys/$arch/compile/$CONFIG when the
ahc/ahd drivers were included.

# 42a85952 02-Dec-2013 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Please welcome casperd daemon. It (and its services) will be responsible for
giving access to functionality that is not available in capability mode
sandbox. The functionality can be precisely restricted.

Start with the following services:
- system.dns - provides API compatible to:
- gethostbyname(3),
- gethostbyname2(3),
- gethostbyaddr(3),
- getaddrinfo(3),
- getnameinfo(3),
- system.grp - provides getgrent(3)-compatible API,
- system.pwd - provides getpwent(3)-compatible API,
- system.random - allows to obtain entropy from /dev/random,
- system.sysctl - provides sysctlbyname(3-compatible API.

Sponsored by: The FreeBSD Foundation

# 2f02600a 01-Dec-2013 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Move my simple logging API to a separate library. It is now already used
by hastctl(8), hastd(8) and auditdistd(8) and will soon be also used
by casperd(8) and its services. There is no documentation and pjdlog.h
header file is not installed in /usr/include/ to keep it private.
Unfortunately we don't have /lib/private/ at this point, only
/usr/lib/private/, so the library is installed in /lib/.

Sponsored by: The FreeBSD Foundation

# 091b8336 17-Nov-2013 Peter Wemm <peter@FreeBSD.org>

Attempt to move the POSIX iconv* symbols out of runtime linker space.
FreeBSD systems usually implemented this as a third party module and
our implementation hasn't played as nicely with the old way as it could
have.

To that end:
* Rename the iconv* symbols in libc.so.7 to have a __bsd_ prefix.
* Provide .symver compatability with existing 10.x+ binaries that
referenced the iconv symbols. All existing binaries should work.
* Like on Linux/glibc systems, add a libc_nonshared.a to the ldscript
at /usr/lib/libc.so.
* Move the "iconv*" wrapper symbols to libc_nonshared.a

This should solve the runtime ambiguity about which symbols resolve
to where. If you compile against the iconv in libc, your runtime
dependencies will be unambiguous.

Old 9.x libraries and binaries will always resolve against their
libiconv.so.3 like they did on 9.x. They won't resolve against libc.

Old 10.x binaries will be satisified by the .symver helpers.

This should allow ports to selectively compile against the libiconv
port if needed and it should behave without ambiguity now.

Discussed with: kib

# 5efcd27a 16-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Move all atf directories to the tests mtree.

This is to ensure that test-related directories don't get needlessly
created (and later deleted) when MK_TESTS=no.

Problem found by jhb@.

Approved by: rpaulo (mentor)

# d8efce39 13-Nov-2013 Colin Percival <cperciva@FreeBSD.org>

Strip the -pN patch level from the VERSION string which gets encoded into
CTF data. Otherwise FreeBSD Update builds think every kernel file has
changed every time there's a security advisory, since the FreeBSD Update
build code isn't smart enough to look inside CTF data to ignore those
changes.

Pointy hat to: cperciva
MFC after: 1 day, or before the next BETA

# d3109d39 08-Nov-2013 Ian Lepore <ian@FreeBSD.org>

This change builds kernel tools based on the same assumption as building
the kernel itself: If building for the same architecture as the build host,
the kernel build assumes that the host toolchain is capable of building the
kernel. If it's not, "make kernel-toolchain" will bootstrap a new set of
tools that will work.

With this change the same assumptions are made for building kernel tools,
and the existing host toolchain is used to do the build (notably, the build
doesn't link the tools with the legacy libraries, which may not even exist).
If ever for some reason the host toolchain isn't capable of building the
kernel tools, then doing a "make kernel-toolchain" will bootstrap newer
tools to get the job done.

So when built as part of buildworld or kernel-toolchain, the kernel tools
are built using the XMAKE (via BMAKE) commands and environment. When built
as part of building just the kernel on a same-target host, the tools are
built using the new KTMAKE commands and environment. What doesn't jump
out at you in the diffs is that the difference between BMAKE and KTMAKE
is that BMAKE contains this magic line which changes how the build is done
because it changes what files get included for .include <bsd.prog.mk> and
other standard includes:

MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"

and KTMAKE doesn't, and contains this instead:

TOOLS_PREFIX=${WORLDTMP}

Hopefully this brings the "how to build aicasm with the right toolchain"
saga to a conclusion that works in all usage scenarios that have
historically been supported.

# e01d128a 08-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Subsume the functionality of MK_ATF into MK_TESTS.

There is no reason to keep the two knobs separate: if tests are
enabled, the ATF libraries are required; and if tests are disabled,
the ATF libraries are not necessary. Keeping the two just serves
to complicate the build.

Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)

# ee695f67 08-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Add libatf-c++ to the prebuild libs.

Some tests may require C++ so we must ensure this library exists as part
of the bootstrap process or else they will fail to build. Do this by
just depending on lib/atf as part of the bootstrap libraries instead of
using lib/atf/libatf-c.

Submitted by: Garrett Cooper <yaneurabeya at gmail dot com>
Approved by: rpaulo (mentor)

# 57028ca4 08-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Fix buildworld when WITH_TESTS is enabled.

The addition of the TESTS knob and its enabling of the build of tests in
lib/libcrypt/tests/ broke the build. The reason is that we cannot descend
into tests/ subdirectories until all prerequisites have been built, which
in the case of tests may be "a lot of things" (libatf-c in this case).

Ensure that we do not walk tests/ directories during the bootstrapping of
the libraries as part of buildworld.

Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)

# 6abd71b0 07-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Build kernel tools along with other tools during world build, as well as
during kernel build (if they didn't get done with world). This will make
-DMODULES_WITH_WORLD work, and it ensures the kernel tools are built
as part of 'make kernel-toolchain'.

# ed39dd91 07-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Instead of modeling the kernel-tools build after the bootstrap tools, build
kernel tools the way cross-tools get built. This seems to result in the
tool getting installed in the right place. It also seems more correct in
retrospect, because if a tool emitted code or binary data as part of
building the kernel, it should do so in target-specific ways (endianess,
architecture, whatever). That issue is moot for aicasm, our only current
tool, but it still seems to be more correct in principle.

# f382c38e 06-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Do not build aicasm with the cross-tools/kernel-toolchain, instead add a
proper kernel-tools step/target modeled after the world build-tools stuff.

This is a re-do of r257730 which was backed out in r257734, but this time
it's one byte smaller... a leftover trailing backslash resulted in a .for
loop with no rules, so no compiler stuff got built and later steps built
with the wrong toolset.

# 74832336 05-Nov-2013 Glen Barber <gjb@FreeBSD.org>

Revert r257730:
Make head/ buildable again, instead of spewing garbage like:
/src/gnu/lib/csu/../../../contrib/gcc/config/rs6000/crtsavres.asm:280:
Error: no such instruction: `lwz 28,-16(11)'

# 5da6cd47 05-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Do not build aicasm with the cross-tools/kernel-toolchain, instead add a
proper kernel-tools step/target modeled after the world build-tools stuff.

# f827d58e 04-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Rework the aicasm build machinery so that it gets built along with toolchain
components instead of with the kernel and/or modules. This ensures that it
gets built with the host compiler, not the compiler in obj/... used to build
the target components (which may be a cross-compiler outputting code for a
different architecture and using header files with types and options set up
for the wrong architecture).

Reviewed by: imp

# 8b78b15b 29-Oct-2013 Xin LI <delphij@FreeBSD.org>

In r257079, SRCDIR is pointed to ${.CURDIR} when not set. However,
Makefile.inc1 is being called in sub-make's where make(1) would,
by default, implicitly chdir(2) to ${.OBJDIR} before executing any
targets. This would make some targets, like delete-old, when trying
to derive various variables introduced by change r256921 using
``make -f Makefile.inc1'' that also rely on SRCDIR to fail.

This changeset adds an explicit cd ${.CURDIR} before these unwrapped
make calls, making them in line with the other ones that are already
being wrapped with the explicit chdir's.

Tested by: gjb
MFC after: 5 days

# 3d2fb95a 28-Oct-2013 Yoshihiro Takahashi <nyan@FreeBSD.org>

Fix build. Both clang and gcc are required on pc98.

X-MFC with: r256915

# e2197f80 24-Oct-2013 Rui Paulo <rpaulo@FreeBSD.org>

Set up the /usr/tests hierarchy.

Populate /usr/tests with the only test programs that currently live
in the tree (those in lib/libcrypt/tests/) and add all the build
machinery to accompany this change.

In particular:

- Add a WITHOUT_TESTS variable that users can define to request that
no tests be put in /usr/tests.
- Add a top-level Kyuafile for /usr/tests and a way to create similar
Kyuafiles in top-level subdirectories.
- Add a BSD.tests.dist file to define the directory layout of
/usr/tests.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks

# 57bd24ce 24-Oct-2013 Glen Barber <gjb@FreeBSD.org>

Fix build host pollution by avoiding calling 'uname -srp' to
determine values for 'VERSION'.

Looked at by: cperciva

# 44c38c2c 24-Oct-2013 Glen Barber <gjb@FreeBSD.org>

Revert r256921 to prevent error output when in the wrong directory.
This should have been reverted with the stable/10/Makefile.inc1
revert, but apparently my commit did not go through.

Discussed with: cperciva (originally)

# a0c65623 22-Oct-2013 Colin Percival <cperciva@FreeBSD.org>

Thou shalt not leak build host state into the system being compiled.

The VERSION variable is encoded into the SUNW_ctf sections of the kernel
and every kernel module when dtrace is enabled; starting with 9.2-RELEASE
(when dtrace was turned on in GENERIC) this means that different host kernels
will result in very different kernel binaries being generated. This tripped
up freebsd-update builds after the build boxes were updated from 9.x to 10.x.

MFC after: 3 days (stable/9)
X-MFC after: 0 days (stable/10)
Security: Rendered two members of so@ temporarily insane

# f936a2e5 22-Oct-2013 Brooks Davis <brooks@FreeBSD.org>

Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC. This allows
bootstrapping a copy of clang without building clang for the base system
which is useful for nanobsd and similar setups. It's still probably
wrong to conflate what is installed as /usr/bin/cc with the selection
of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another
day.

MFC after: 1 week
Sponsored by: DARPA/AFRL

# e45e2255 21-Oct-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make delete-old-libs' and 'make check-libs' to delete .debug
files created by WITH_DEBUG_FILES. Also cleanup .symbols files from
the period between r244236 when .symbols were supported and r251512
when they were renamed to .debug.

Only propose to delete a .debug file if the corresponding library
itself was deleted already.

Reported by: des
Reviewed by: emaste (earlier version)
Approved by: bapt
MFC after: 3 days

# 923cfb89 16-Oct-2013 Ian Lepore <ian@FreeBSD.org>

Allow 'make xdev' to work when DESTDIR is set.

Submitted by: Patrick Kelsey <kelsey@ieee.org>

# c60c0372 10-Oct-2013 Dimitry Andric <dim@FreeBSD.org>

Bump OS versions in the toolchain triples to 11.0, and bump the
__FreeBSD_cc_version predefined macros in clang and gcc.

Approved by: re (gjb)

# 5bab7367 01-Oct-2013 Xin LI <delphij@FreeBSD.org>

Revert-and-redo r255955: the sort -r should be added to delete-old-dirs.

Approved by: re (gjb)

# 5cf4a427 30-Sep-2013 Xin LI <delphij@FreeBSD.org>

Reverse directories order when doing 'make delete-old-dir'. This
ensures subdirectories gets removed before their parents when doing
make delete-old.

Approved by: re (gjb)
MFC after: 2 weeks

# 56b72efe 30-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove BIND.

Approved by: re (gjb)

# 865f7779 24-Sep-2013 John Baldwin <jhb@FreeBSD.org>

Don't parse NO_ROOT metadata for extra kernels if NO_ROOT isn't defined.

Approved by: re (gjb)
MFC after: 1 week

# e8192c89 22-Sep-2013 Andrew Turner <andrew@FreeBSD.org>

Remove the armv6eb architecture as it is unused, and almost certainly
broken. None of our kernels can boot armv6eb. The little-endian kernels do
not have the required code to be able to switch endian when running a
big-endian executable.

Approved by: re (gjb)

# 31caf4c8 17-Sep-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make installcheck' to check for missing UID/GID as well, broken
since r249893, by adding a separate _installcheck_world and
_installcheck_kernel so the destination targets can be more explicit
on which they are needed for.

installcheck will call both, while installworld only calls
_installcheck_world and installkernel only calls _installcheck_kernel

While here, mark the internal targets as starting with _.

Reported by: des
Reviewed by: des
Pointyhat to: bdrewery
Approved by: re (delphij)

# 91270ec5 16-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Add unbound to the list of UIDs / GIDs to check fore before installing.

Approved by: re (blanket)

# 9cfa8b3f 10-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Clean up the OpenSSH build. It is now possible to build most components
as static binaries, if desired. The one exception is sshd, which runs
into trouble due to libpam.a's includion of pam_ssh.

Make OpenSSH use LDNS if available. This allows it to verify signed
SSHFP records.

Approved by: re (blanket)

# 2442cc58 08-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Create a private library directory (LIBPRIVATEDIR) for libraries which
we don't want to expose but which can't or shouldn't be static.

To mark a library as private, define PRIVATELIB in its Makefile. It
will be installed in LIBPRIVATEDIR, which is normally /usr/lib/private
(or /usr/lib32/private for 32-bit libraries on 64-bit platforms).

To indicate that a program or library depends on a private library,
define USEPRIVATELIB in its Makefile. The correct version of
LIBPRIVATEDIR will be added to its run-time library search path.

Approved by: re (blanket)

# 06362369 29-Aug-2013 Bryan Drewery <bdrewery@FreeBSD.org>

- Fix LOCAL_MTREE so it properly handles multiple files and quotes
its value into submakes

PR: conf/179466
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
Approved by: bapt
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

# f0957cca 11-Aug-2013 Peter Wemm <peter@FreeBSD.org>

Update nvi-1.79 to 2.1.1-4334a8297f

This is the gsoc-2011 project to clean up and backport multibyte support
from other nvi forks in a form we can use.

USE_WIDECHAR is on unless building for the rescue crunchgen. This should
allow editing in the native locale encoding.

USE_ICONV depends on make.conf having 'WITH_ICONV=YES' for now. This
adds the ability to do things like edit a KOI8-R file while having $LANG
set to (say) en_US.UTF-8. iconv is used to transcode the characters for
display.

Other points:
* It uses gencat and catopen/etc instead of homegrown msg catalog stuff.
* A lot of stuff has been trimmed out, eg: the perl and tcl bindings which
we could never use in base anyway.
* It uses ncursesw when in widechar mode. This could be interesting.

GSoC info: http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/zy/1
Repo at: https://github.com/lichray/nvi2

Obtained from: Zhihao Yuan <lichray@gmail.com>


# 2d0bcb76 23-Jul-2013 Ed Maste <emaste@FreeBSD.org>

Generate debug data release dist sets

If WITH_DEBUG_FILES is set the standalone debug data will be excluded
from each ${dist}.txz and placed in a ${dist}.debug.txz.

Submitted by: gjb
Reviewed by: brooks

# bb6d7d0e 05-Jul-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Sprinkle some .MAKE magic

# 03630b54 30-Jun-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Use && rather than ; when success of previous job matters.

# c872793d 14-Jun-2013 Brooks Davis <brooks@FreeBSD.org>

Simplify the hierarchy target's logic. [0]

Run hierarchy with WORLDTMP in the path so it works when it is invoked
directly. Such use is nearly alwasy wrong but appears to be common.[1]

PR: conf/178209 [0], conf/178547 [1]
Submitted by: Garrett Cooper <yaneurabeya@gmail.com> [0]
MFC after: 5 days

# d3187057 14-Jun-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Flag recursive make targets with .MAKE
so that job token pipe is passed to them.
To avoid surprising anyone, only add .MAKE to ${TGTS} when -n
has not been specified (at least for Makefile).

Reviewed by: obrien

# aa5084e4 13-Jun-2013 Brooks Davis <brooks@FreeBSD.org>

Be more agressive about bootstrapping ctfmerge and ctfconvert so
builds from existing releases have a chance of working properly.

Sponsored by: DARPA, AFRL
MFC after: 3 days

# 42f8c5b5 07-Jun-2013 Ed Maste <emaste@FreeBSD.org>

Add a new knob WITH_DEBUG_FILES to control the building of standalone
debug files for userland programs and libraries. The "-g" debug flag
is automatically applied when WITH_DEBUG_FILES is set.

The debug files are now named ${prog}.debug and ${shlib}.debug for
consistency with other systems and documentation. In addition they are
installed under /usr/lib/debug, to simplify the process of installing
them if needed after a crash. Users of bsd.{prog,lib}.mk outside of the
base system place the standalone debug files in a .debug subdirectory.
GDB automatically searches both of these directories for standalone
debug files.

Thanks to everyone who contributed changes, review, and testing during
development.

# b9bcca07 05-Jun-2013 Jilles Tjoelker <jilles@FreeBSD.org>

release: Allow empty extra distributions.

For example, WITHOUT_SHAREDOCS= in src.conf creates an empty doc
distribution.

Submitted by: Kurt Lidl
Tested by: Kurt Lidl
Discussed with: gjb
MFC after: 1 week

# 80ba5ec8 30-May-2013 Brooks Davis <brooks@FreeBSD.org>

Restore (at least temporarily) SHARED=symlinks in the build includes
stage of buildworld. This was accidentally included in r251140.

Reported by: jhb

# 6c461479 30-May-2013 Brooks Davis <brooks@FreeBSD.org>

Always define INSTALL_DDIR and define it such that it contains no extra
/ characters rather than removing them later on. This should fix
release builds.

PR: conf/178963
Reviewed by: gjb, hrs

# 4e02fd95 28-May-2013 Glen Barber <gjb@FreeBSD.org>

r245757 introduced warning output if update method is set to CVS_UPDATE
or SUP_UPDATE.

CVS exporter for head/ is turned off for nearly one month now.

It is finally time to swing the ax at these update methods.

Reviewed by: eadler
MFC after: 1 month

# 527f7dc3 28-May-2013 Glen Barber <gjb@FreeBSD.org>

Update comments to reflect use of svn/svnup to keep the src/ tree up
to date.

MFC after: 3 days

# 25fbccdc 28-May-2013 Peter Wemm <peter@FreeBSD.org>

Temporarily revert r251058 - it breaks documented use of makeoptions
including the tinderbox.

http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-i386-i386.full
make: don't know how to make modules-all. Stop
make: stopped in /obj/i386.i386/src/sys/PAE
*** Error code 2

# 13b85cea 28-May-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

During buildkernel, print a banner before building modules.

# 6cf6aae2 26-May-2013 Eitan Adler <eadler@FreeBSD.org>

Remove backwards compat layer which was added in r71419 (in 2001).

This change is not intended for MFC.

Reviewed by: peter

# 936d0074 24-May-2013 Marcel Moolenaar <marcel@FreeBSD.org>

Fix building on slightly older -current and stable systems after
the switch to bmake. The rescue bits are built via crunchgen,
which didn't respect the MAKE environment variable until r237574
(i.e. ~11 months ago). This resulted in a failure due to bmake's
internal -J flag being passed around and not being understood by
the standard (i.e. host's) make.
Note that the failure is conditional upon having the jobServer
feature enabled within bmake.

# ab76bc97 21-May-2013 Jung-uk Kim <jkim@FreeBSD.org>

Connect flex 2.5.37 to the build and bump __FreeBSD_version.

# 96cd1f74 21-May-2013 Brooks Davis <brooks@FreeBSD.org>

Restore the ability to build on systems with 32-bit compat when
the system compiler is not clang. clang and gcc appear to differ
signficantly in their interpretation of -isystem and --sysroot. Further
work is likely required to support an external gcc.

Reported by: andreast, fidaj@ukr.net, sergey.dyatko@gmail.com

# 54cf6141 20-May-2013 Brooks Davis <brooks@FreeBSD.org>

Fix distributekernel in the non NO_ROOT case.

PR: conf/178775
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>

# 39da820b 16-May-2013 Brooks Davis <brooks@FreeBSD.org>

Implement NO_ROOT support for distributekernel and packagekernel.

# a09aff83 15-May-2013 Brooks Davis <brooks@FreeBSD.org>

Add support for an external cross compiler. The cross compiler is
specified by passing the XCC, XCXX, and XCPP variables (corresponding to
CC, CXX, and CPP) to buildworld/buildkernel. The compiler must be clang
or be configured to target the appropriate architecture.

To speed build times, if XCC is an absolute path or
WITHOUT_CROSS_COMPILER is defined then no cross compiler will be built
during the cross-tools stage.

Limited documentation of this feature can currently be found at:

https://wiki.freebsd.org/ExternalToolchain

This functionality should be considered experimental and is subject to
change without notice.

Sponsored by: DARPA, AFRL
Discussed with: imp, sjg

# 6b5b16be 11-May-2013 Antoine Brodin <antoine@FreeBSD.org>

Add compile_et to kerberos bootstrap tools.
This makes it possible to build a regular world on a host without kerberos.

PR: conf/178421
Submitted by: Garrett Cooper
MFC after: 1 month

# f26a777c 01-May-2013 Benno Rice <benno@FreeBSD.org>

Optimize SUBDIR_OVERRIDE such that SUBDIR isn't automatically defined if
SUBDIR_OVERRIDE is defined.

PR: conf/174071
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
Sponsored by: EMC / Isilon Storage Division

# ec6bcfa1 29-Apr-2013 Eitan Adler <eadler@FreeBSD.org>

A transition period of more than two years is more than enough:
Remove the compatibility code added in 2011-02-10.

This change is not intended for MFC

Reviewed by: imp

# 55d1493a 24-Apr-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix installworld with DB_FROM_SRC after r249807

Approved by: bapt
Reported by: Tom Everett

# 61f75c49 23-Apr-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix installkernel requiring users/groups defined in CHECK_UIDS
and CHECK_GIDS to exist since r152680. This is only needed for
installworld. The documented procedure of running mergemaster -p
to check for missing users is only needed for installworld, not
for installkernel. This fixes auditdistd incorrectly being
required for installkernel.

PR: misc/174405
Approved by: bapt

# b18ddb2a 20-Apr-2013 Mikolaj Golub <trociny@FreeBSD.org>

This should have been committed in r249666.

MFC after: 1 month

# 139f7f9b 12-Apr-2013 Dimitry Andric <dim@FreeBSD.org>

Upgrade our copy of llvm/clang to trunk r178860, in preparation of the
upcoming 3.3 release (branching and freezing expected in a few weeks).

Preliminary release notes can be found at the usual location:
<http://llvm.org/docs/ReleaseNotes.html>

An MFC is planned once the actual 3.3 release is finished.


# 862c0d36 31-Mar-2013 Andrew Turner <andrew@FreeBSD.org>

Fix xdev-install when installing to a location other than /

# 45fab5d8 31-Mar-2013 Andrew Turner <andrew@FreeBSD.org>

Fix xdev. Clang and libc were not building correctly on older worlds, for
example, on 9.1.
* To fix clang add an _xb-bootstrap-tools target that mirrors the existing
bootstrap-tools target in the full world.
* For libc have the compiler use the newly installed includes, and, while
here, tell the compiler about the xdev library path as some other
libraries will link against the installed libraries.

# 829e39ff 27-Mar-2013 Rene Ladan <rene@FreeBSD.org>

Fix a typo, 'xdev-build' should be spelled with a 'd' at the end.

Approved by: cognet

# ac66f4a9 05-Mar-2013 Xin LI <delphij@FreeBSD.org>

libzfs_core depends on libnvpair, explicitly say this in Makefile.inc1.

This fixes build with make -j.

# dce1a726 05-Mar-2013 Martin Matuska <mm@FreeBSD.org>

WiP merge of libzfs_core (MFV r238590, r238592)
not yet working, ioctl handling needs to be changed


# 776a9ddc 25-Feb-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

In all situations where we need to bootstrap yacc, we also need to
bootstrap liby. This was not readily apparent, because a normal 'make
buildworld' or 'make toolchain' builds liby before building anything
that uses yacc. However, 'make kernel-toolchain' does not build
headers or libraries, so it was not possible to build a kernel from
head on, say, stable/9 without first building the complete toolchain.

MFC after: 1 week

# 0af99eef 14-Feb-2013 Hiroki Sato <hrs@FreeBSD.org>

- Fix libmd dependency. It is needed in the bootstrap library list because
usr.bin/xinstall depends on it.
- Remove libutil from usr.bin/xinstall/Makefile. No symbol was actually used.

Reviewed by: brooks

# 3e381257 09-Feb-2013 Brooks Davis <brooks@FreeBSD.org>

Add nmtree to ITOOLS if it is installed on the host instead of keying off
the BOOTSTRAPPING variable. The previous test was wrong because
BOOTSTRAPPING is 0 in most cases.

Tested by: db

# 1dc56acd 04-Feb-2013 Andrew Turner <andrew@FreeBSD.org>

Fix xdev by using the install shell script as it knows about the -l
argument thile the local version install may not.

# de17cbcc 03-Feb-2013 Hiroki Sato <hrs@FreeBSD.org>

- Add CHECKSUM.* support in Makefile[1].
- Use ln -fs to create a symlink.
- Remove pkgadd for docports.
- Use WITHOUT_JADETEX=yes instead of WITH_JADETEX=no.
- Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.
- Use makefs(8) and gpart(8) for sparc64 ISO image[2].
- Add publisher option to makefs(8)[2].

Based on work by: gjb[1]
Discussed with: marius, nwhitehorn[2]

# 64dc091f 29-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Log the addition of login.conf.db, passwd, pwd.db, and spwd.db via cat -l.

Make cat a bootstrap tool to facilitate this.

# beb7ecad 29-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Fix installworld when nmtree is not on the host by only adding it to
ITOOLS when we will be using the host copy.

Fix installkernel when -DNO_ROOT is set.

# 1113cd31 29-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Fix installworld when the host does not need to bootstrap nmtree.

Reported by: lev, jmg

# 6784ea85 25-Jan-2013 Glen Barber <gjb@FreeBSD.org>

Fix update method (s/SUP/CVS) warning.

Submitted by: Ryan Stone
MFC after: 1 day

# 40f0cb19 24-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Strip any trailing slash off of the -D argument to install to support the
rather fragile destdir stripping in the metalog.

# 4a63ae11 22-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Introduce a new option -DNO_ROOT that allows install and distribution
targets to be run without root privilege.

Information about ownership, group, flags, and suid bits are stored in
the file specified by METALOG which defaults to ${DESTDIR}/METALOG.
This file can be used in conjunction with bsdtar or makefs to generate
archives or file system images with correct permissions.

The packageworld target has been altered to use this metadata allowing
non-root releases (subject to further changes in release/Makefile.)

Sponsored by: DARPA, AFRL
Reviewed by: ian, ray

# c3b739c7 22-Jan-2013 David Chisnall <theraven@FreeBSD.org>

Fix spurious leading / on dtc path in Makefile.inc1. Spotted by jhb.

# af0dd31f 22-Jan-2013 David Chisnall <theraven@FreeBSD.org>

Import new (BSDL) device tree compiler. Now built by default, so that it can't
be used on the host system (and not installed on the device, if required). The
GPL'd one is still available if there are any devices that need it (make
universe passes with it, including kernels that use fdt, but there may be some
out-of-tree ones). WITH_GPL_DTC can be used to select the old one, for now.

Probably won't be MFC'd, but we'll remove the GPL'd version in head after the
new one has had a lot more testing and ship it in 10.0.

# 6a473a7d 21-Jan-2013 Glen Barber <gjb@FreeBSD.org>

Chase r245756 of make.conf(5):

- If update method is SUP_UPDATE or CVS, warn that those
update methods are deprecated.

- While here, remove bogus NO_WWWUPDATE.

MFC after: 3 days
X-MFC-with: r245756

# 706b1b65 21-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Always bootstrap nmtree if it is not available on the host. It is fairly
small and it is quite annoying to get all the way through buildworld
only to discover that you forgot the DB_FROM_SRC (or soon NO_ROOT)
option.

# 00f793f8 18-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Remove a harmless (somewhat to my surprise) bogon that crept into r245440.

# 75534bda 17-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Rework the mtree portion of etc/Makefile's distrib-dirs target to run
mtree in a shell loop so there is only one mtree commandline. Move the
implementation of LOCAL_MTREE into etc/Makefile.

Sponsored by: DARPA, AFRL
Reviewed by: mtree :)

# c109162f 17-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Correct the distrib-dirs target in the -DDB_FROM_SRC case.

# afd9b463 17-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Add a new LIBRARIES_ONLY make variable to disable the build and install
of files other than the actual libraries.

Use LIBRARIES_ONLY to supress the inclusion of files in the lib32
distribution that are duplicates of files in base.

Sponsored by: DARPA, AFRL
Reviewed by: emaste

# 41a8e223 14-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Add an option DB_FROM_SRC to use src/etc's user/group databases when
installing. This allows things like running installworld for 10-CURRENT
on a 9.0-RELEASE system without adding extra users and groups to the
passwd and group files.

To prevent potentially risky uid/gid mismatches on systems with
non-standard local values, require that DESTDIR be set if DB_FROM_SRC is
set.

Sponsored by: DARPA, AFRL
Reviewed by: peter

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

Revert r245316. Systems with non-standard uids/gids are more prevalent
that I'd feared. Discussion is ongoing about the scope of a safer
solution.

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

Use the -N option to install and nmtree to eliminate the need for the
checks for missing users and groups.

Sponsored by: DARPA, AFRL

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

Use find -exec to install zoneinfo instead of requiring xargs to be an
install tool.

Suggested by: delphij

# 3da2132e 10-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Add xargs to the set of install tools when zoneinfo is not disabled.
This fixes installworld which I had broken in r245265.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>

# 248da532 02-Dec-2012 Peter Wemm <peter@FreeBSD.org>

Add auditdistd to the pre-install required uid check list.

# ddcc951f 30-Nov-2012 Simon J. Gerraty <sjg@FreeBSD.org>

The build-tools step during build32 also needs the -legacy magic.

Approved by: marcel (mentor)

# cff4243d 19-Nov-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Unbreak amd64 cross-build where amd64 is the target. While clang
may be installed as cc and we don't need to build gcc as a
cross-tools, we still build gcc and thus need cc_tools built
as a build tool. Not doing this results in building gengenrtl with
the target compiler while we need to run it on the build machine.

# 0c704c35 10-Nov-2012 Dimitry Andric <dim@FreeBSD.org>

Work around pc98 tinderbox failures in sys/boot/pc98, by making sure a
cross gcc gets built during the cross-tools stage.

MFC after: 1 week
X-MFC-With: 242706

# c175365c 21-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Add ATF to the build. This is may be a bit rought around the egdes,
but committing it helps to get everyone on the same page and makes
sure we make progress.

Tinderbox breakages that are the result of this commit are entirely
the committer's fault -- in other words: buildworld testing on amd64
only.

Credits follow:

Submitted by: Garrett Cooper <yanegomi@gmail.com>
Sponsored by: Isilon Systems
Based on work by: keramida@
Thanks to: gnn@, mdf@, mlaier@, sjg@
Special thanks to: keramida@

# 29f5a35c 17-Oct-2012 Brooks Davis <brooks@FreeBSD.org>

Allow LOCAL_(DIRS,LIBS) to install files in directories not found in the
system mtree files via a LOCAL_MTREE variable which contains a list of
mtree files to be applyed along with the base mtree files to the tmp root
and DESTDIR.

# aae8db90 07-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Fix the showconfig target. bmake sends debug output to stderr.

Submitted by: Simon Garrety <sjg@juniper.net>

# 8d6871f4 07-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Fix 32-bit library builds after the removal of adding -E to make for AS,
CC, CXX and LD. This fix implements the intended as it should have been
implemented all along: by passing AS, CC, CXX and LD on the commandline
of the sub-make instead of in the environment of the sub-make.

Breakage pointed-out by: dim@

# 0815243c 06-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Add support for bmake. This includes:
1. Don't do upgrade_checks when using bmake. As long as we have WITH_BMAKE,
there's a bootstrap complication in ths respect. Avoid it. Make the
necessary changes to have upgrade_checks work wth bmake anyway.
2. Remove the use of -E. It's not needed in our build because we use ?= for
the respective variables, which means that we'll take the environment
value (if any) anyway.
3. Properly declare phony targets as phony as bmake is a lot smarter (and
thus agressive) about build avoidance.
4. Make sure CLEANFILES is complete and use it on .NOPATH. bmake is a lot
smarter about build avoidance and should not find files we generate in
the source tree. We should not have files in the repository we want to
generate, but this is an easier way to cross this hurdle.
5. Have behavior under bmake the same as it is under make with respect to
halting when sub-commands fail. Add "set -e" to compound commands so
that bmake is informed when sub-commands fail.
6. Make sure crunchgen uses the same make as the rest of the build. This
is important when the make utility isn't called make (but bmake for
example).
7. While here, add support for using MAKEOBJDIR to set the object tree
location. It's the second alternative bmake looks for when determining
the actual object directory (= .OBJDIR).

Submitted by: Simon Gerraty <sjg@juniper.net>
Submitted by: John Van Horne <jvanhorne@juniper.net>

# 9215d178 13-Sep-2012 Brooks Davis <brooks@FreeBSD.org>

Introduce a new make variable COMPILER_TYPE that specifies what
type of compiler is being used (currently clang or gcc). COMPILER_TYPE
is set in the new bsd.compiler.mk file based on the value of the CC
variable or, should it prove informative, by running ${CC} --version
and examining the output.

To avoid negative performance impacts in the default case and correct
value for COMPILER_TYPE type is determined and passed in the environment
of submake instances while building world.

Replace adhoc attempts at determining the compiler type by examining
CC or MK_CLANG_IS_CC with checks of COMPILER_TYPE. This eliminates
bootstrapping complications when first setting WITH_CLANG_IS_CC.

Sponsored by: DARPA, AFRL
Reviewed by: Yamaya Takashi <yamayan@kbh.biglobe.ne.jp>, imp, linimon
(with some modifications post review)
MFC after: 2 weeks

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

Not all Pmake derivatives silently handle empty shell output, so ensure there
is something for make(1) to consume. Bmake gives output such as:
"warning: Couldn't read shell's output for "/bin/sh -c true"
Note we parted from traditional Pmake behavior in r18864 / r18255.

# 10d2255f 03-Sep-2012 Glen Barber <gjb@FreeBSD.org>

Fix 'distributeworld' target when WITHOUT_GAMES is set.

Reviewed by: des
Approved by: des
MFC after: 3 days
X-MFC-To: 9-only

# 4da573d9 14-Aug-2012 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Merging of projects/armv6, part 3

r238211:
Support TARGET_ARCH=armv6 and TARGET_ARCH=armv6eb

This adds a new TARGET_ARCH for building on ARM
processors that support the ARMv6K multiprocessor
extensions. In particular, these processors have
better support for TLS and mutex operations.

This mostly touches a lot of Makefiles to extend
existing patterns for inferring CPUARCH from ARCH.
It also configures:
* GCC to default to arm1176jz-s
* GCC to predefine __FreeBSD_ARCH_armv6__
* gas to default to ARM_ARCH_V6K
* uname -p to return 'armv6'
* make so that MACHINE_ARCH defaults to 'armv6'
It also changes a number of headers to use
the compiler __ARM_ARCH_XXX__ macros to configure
processor-specific support routines.

Submitted by: Tim Kientzle <kientzle@freebsd.org>

# e9832bb1 30-Jul-2012 Martin Matuska <mm@FreeBSD.org>

Partial MFV (illumos-gate 13753:2aba784c276b)
2762 zpool command should have better support for feature flags

References:
https://www.illumos.org/issues/2762

MFC after: 2 weeks


# e324b4bc 03-Jul-2012 David E. O'Brien <obrien@FreeBSD.org>

Add "hier" as an alternate spelling of "hierarchy" to match hier(9).

# 5814131a 15-Jun-2012 Brooks Davis <brooks@FreeBSD.org>

Minor wording change. The previous commit message should have included:

Sponsored by: DARPA, AFRL

# 6e4ee6dd 15-Jun-2012 Brooks Davis <brooks@FreeBSD.org>

MFP4: 212854, 212854

Add a LOCAL_LIB_DIRS variable to complement the existing LOCAL_DIRS
and LOCAL_TOOL_DIRS variables. Directories in LOCAL_LIB_DIRS are
built at the end of the _generic_libs target.

Reviewed by: imp (212854)

# 883e0f87 03-Jun-2012 Dimitry Andric <dim@FreeBSD.org>

During buildworld and buildkernel, define EARLY_BUILD in the earlier
stages (build-tools, cross-tools, etc) of the build, so we can detect in
bsd.*.mk whether to pass compiler-specific flags to ${CC}.

In particular, this commit will allow using WITH_CLANG_IS_CC when the
base compiler is still gcc, and when ${CC}, ${CXX} and ${CPP} are left
at their defaults. The early stages will then be built using gcc, and
no clang-specific flags will be passed to it. The later stages will be
built as usual.

The EARLY_BUILD define can also serve other uses, such as building the
world stage C++ executables with libc++ instead of libstdc++: during the
early build stages, we cannot assume libc++ is already available, so we
must still build with libstdc++ at that time.

MFC after: 1 week

# 5bfe3851 22-May-2012 Dag-Erling Smørgrav <des@FreeBSD.org>

Bump __FreeBSD_version for the byacc import, and update _bootstrap_tools.

# 727d8c81 18-May-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Fix bootstrapping from FreeBSD 7.x: we also need to build ar.

# 9e460a98 15-May-2012 Warner Losh <imp@FreeBSD.org>

By request, add back support from 7.0 and newer, since the changes for
that are so minimal.

# 0446f881 10-May-2012 Warner Losh <imp@FreeBSD.org>

Do a bit of house cleaning and remove the old, obsolete upgrade from
6.0 support and bump the minimum version to 8.0. These versions have
not been tested and are believed to be broken.

# 51a65f35 07-May-2012 Jeremie Le Hen <jlh@FreeBSD.org>

Introduce the ${SHLIB_LDSCRIPT} variable to have an ld(1) script
instead of a symlink for .so files.

Reviewed by: kib, kan (previous version), dim
Approved by: kib (mentor)
Silence from: -hackers@
MFC after: 1 week

# ae8662c7 26-Apr-2012 Warner Losh <imp@FreeBSD.org>

Fix ordering issue. 'make xdev' can fail with -jN because it tries to run the
xdev-install step while xdev-build is still running.

Submitted by: Ian Lepore

# f8e8c8fa 28-Mar-2012 Juli Mallett <jmallett@FreeBSD.org>

o) Fix mips/mips -> mips for Makefile.inc1.
o) Rebuild src.conf.5.

# 84db023e 28-Mar-2012 Juli Mallett <jmallett@FreeBSD.org>

Assume a big-endian default on MIPS and drop the "eb" suffix from MACHINE_ARCH.
This makes our naming scheme more closely match other systems and the
expectations of much third-party software. MIPS builds which are little-endian
should require and exhibit no changes. Big-endian TARGET_ARCHes must be
changed:
From: To:
mipseb mips
mipsn32eb mipsn32
mips64eb mips64

An entry has been added to UPDATING and some foot-shooting protection (complete
with warnings which should become errors in the near future) to the top-level
base system Makefile.

# 634f9253 23-Mar-2012 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Build CTF tools as a part of toolchain for cross-compilation case

# 0e46933c 22-Mar-2012 Stanislav Sedov <stas@FreeBSD.org>

- Do not build libcom_err and compile_et when kerberos is disabled. They
depends on several heimdal libraries and not used by anything but kerberos
tools.

# ae771770 22-Mar-2012 Stanislav Sedov <stas@FreeBSD.org>

- Update FreeBSD Heimdal distribution to version 1.5.1. This also brings
several new kerberos related libraries and applications to FreeBSD:
o kgetcred(1) allows one to manually get a ticket for a particular service.
o kf(1) securily forwards ticket to another host through an authenticated
and encrypted stream.
o kcc(1) is an umbrella program around klist(1), kswitch(1), kgetcred(1)
and other user kerberos operations. klist and kswitch are just symlinks
to kcc(1) now.
o kswitch(1) allows you to easily switch between kerberos credentials if
you're running KCM.
o hxtool(1) is a certificate management tool to use with PKINIT.
o string2key(1) maps a password into key.
o kdigest(8) is a userland tool to access the KDC's digest interface.
o kimpersonate(8) creates a "fake" ticket for a service.

We also now install manpages for some lirbaries that were not installed
before, libheimntlm and libhx509.

- The new HEIMDAL version no longer supports Kerberos 4. All users are
recommended to switch to Kerberos 5.

- Weak ciphers are now disabled by default. To enable DES support (used
by telnet(8)), use "allow_weak_crypto" option in krb5.conf.

- libtelnet, pam_ksu and pam_krb5 are now compiled with error on warnings
disabled due to the function they use (krb5_get_err_text(3)) being
deprecated. I plan to work on this next.

- Heimdal's KDC now require sqlite to operate. We use the bundled version
and install it as libheimsqlite. If some other FreeBSD components will
require it in the future we can rename it to libbsdsqlite and use for these
components as well.

- This is not a latest Heimdal version, the new one was released while I was
working on the update. I will update it to 1.5.2 soon, as it fixes some
important bugs and security issues.


# 15d321c5 17-Mar-2012 Peter Wemm <peter@FreeBSD.org>

Make sure libgcc_s is finished building in _startup_libs before
building libcxxrt with high -j levels. The workaround in
libc++/Makefile isn't necessary once that race is solved.

Reviewed by: theravin

# 5e07d031 04-Mar-2012 Dimitry Andric <dim@FreeBSD.org>

Fix a thinko in r232322, where gcc (and its tools) are not built during
the cross-tools stage, if CC=clang and WITH_CLANG_IS_CC is not set.

This causes no 'cc' to be installed in the temporary cross-tools tree,
making lint fall over later in the build, because it ignores ${CC} and
attempts to run 'cc' anyway.

To fix this, only skip building gcc during cross-tools, if WITHOUT_GCC
is set, or if WITH_CLANG_IS_CC is set.

Pointy hat to: dim
MFC after: 2 weeks

# dfbaea83 29-Feb-2012 Dimitry Andric <dim@FreeBSD.org>

Add a WITH_CLANG_IS_CC option for src.conf(5), disabled by default, that
installs clang as /usr/bin/cc, /usr/bin/c++ and /usr/bin/cpp.

Note this does *not* disable building and installing gcc, which will
still be available as /usr/bin/gcc, /usr/bin/g++ and /usr/bin/gcpp. If
you want to disable gcc completely, you must use WITHOUT_GCC.

MFC after: 2 weeks

# 5db254ad 30-Jan-2012 Warner Losh <imp@FreeBSD.org>

Allow specification of build shell for the buildenv target.

Submitted by: ian lepore

# 7fa955cd 27-Jan-2012 Dimitry Andric <dim@FreeBSD.org>

When the buildkernel stage 2.3 (build tools) runs, the PATH is still set
to the default from the top-level Makefile. Therefore, invocations of
lex and yacc (used during building of aicasm) will use the executables
in /usr/bin, not those optionally built during the previous buildworld
or kernel-toolchain. This makes kernel builds from older FreeBSD
releases more difficult than necessary.

Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the
bootstrap tools directories are searched before the regular ones.

Silence from: svn-src-{all,head}
MFC after: 1 week

# d6ba7d93 15-Jan-2012 Gleb Smirnoff <glebius@FreeBSD.org>

Restore functionality to pack several kernels into release. All
kernels specified by KERNCONF are built and packed into release.
The first one is packed into kernel.txz, all others to
kernel.CONFIG.txz.

The first one is installed on bootables in /boot.

# 0d9f40f2 05-Jan-2012 Adrian Chadd <adrian@FreeBSD.org>

Fix the broken non-cross compile build. Oops!

Another pointy hat to: adrian, for stirring up more trouble.

# 9b428cfa 05-Jan-2012 Adrian Chadd <adrian@FreeBSD.org>

Allow extra directories to be added to the build-tools target.

Things such as "sh" require local tools to be built before
cross-compiling. This allows for extra software (that's
built via LOCAL_DIRS) to also have a build-tools target where
required.

# 411246d3 22-Dec-2011 Dimitry Andric <dim@FreeBSD.org>

Remove -mfancy-math from LIB32CPUFLAGS for amd64. It has been default
for our gcc since more than three years (see r181534, which is also in
stable/9 and stable/8). This flag used to be for the benefit of the old
in-kernel math emulator, which was removed more than eight years ago.

Pointed out by: arundel
MFC after: 1 week

# 83cb5bae 30-Nov-2011 Max Khon <fjoe@FreeBSD.org>

- CTF knob is now implemented using common scheme: MK_CTF=yes/no is
defined based on WITH/WITHOUT_CTF settings, default is WITHOUT_CTF,
NO_CTF overrides WITH_CTF (used by Makefile.inc1)
- CTFCONVERT_CMD/NORMAL_CTFCONVERT are now defined to empty string
if make(1) can handle empty commands

# d0ed1ea4 29-Nov-2011 Max Khon <fjoe@FreeBSD.org>

Turn off profiled libs build by default.
Can be enabled back using WITH_PROFILE=yes in /etc/src.conf

# 49c8e5e7 25-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Fix breakage after r227983; lib/libcxxrt still got built, because it was
not disabled in the usual way (by adding it to __DEFAULT_NO_OPTIONS in
share/mk/bsd.own.mk), and because the test for MK_LIBCPLUSPLUS in
Makefile.inc1 was incorrect.

Pointy hat to: dim

# bb61ba08 25-Nov-2011 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Provide proper error message when trying to build xdev, xdev-build or
xdev-install targets without either XDEV or XDEV_ARCH defined.

# 7a984708 25-Nov-2011 David Chisnall <theraven@FreeBSD.org>

Import libc++ / libcxxrt into base. Not build by default yet (use
MK_LIBCPLUSPLUS=yes to enable). This is a work-in-progress. It works for
me, but is not guaranteed to work for anyone else and may eat your dog.

To build C++ using libc++, add -stdlib=libc++ to your CXX and LD flags.

Bug reports welcome, bug fixes even more welcome...

Approved by: dim (mentor)


# dcf83bf7 24-Nov-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Revert r227841 and part of r227798. We still build libpam in two passes,
but we use STATIC_CFLAGS instead of our own private .c.o rule.

MFC after: 3 weeks

# 8e2a5aa1 22-Nov-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove libpam from _prebuild_libs. This should unbreak the -jX build.

MFC after: 3 weeks

# e03e3b69 21-Nov-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Simplify the libpam build by removing the shared modules' dependency
on the shared library. The modules are loaded by the library, so we
know it'll be there when we need it.

MFC after: 3 weeks

# 6bac4c3e 19-Nov-2011 Andreas Tobler <andreast@FreeBSD.org>

Rename the linker emulation name for powerpc and powerc64. This is needed that
we can also use the upstream binutils linker where we have to have a unique
name for the FreeBSD emulation.

# 907eed1f 10-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Revert r227403 for now. Since the cross-tools stage purposefully
doesn't have ${WORLDTMP}/usr/bin in its PATH, if you build world with
CC=clang, tblgen tools from /usr/bin will be used instead of the ones
built under ${WORLDTMP}. This can lead to various errors, especially if
you upgrade from an older clang.

Note that building world with gcc would not experience these problems,
because it only uses the tblgen tools in the world stage, where PATH
does contain ${WORLDTMP}/usr/bin.

Pointy hat to: dim

# 338f97fe 09-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Move building of clang's tblgen tools (and required libraries) from the
bootstrap-tools stage to the cross-tools stage. These tools are only
needed for generating llvm/clang include files, and are not necessary
for bootstrapping the build itself.

This shaves off some build time, because the required libraries are now
just built twice (during the cross-tools and world stages), instead of
three times.

Also, if you build world using WITHOUT_CLANG= in src.conf(5), no llvm or
clang code will be compiled at all anymore.

MFC after: 1 week

# 8dcbd431 05-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Make it possible to set CC and CXX (and optionally, AS and LD) in
make.conf(5), while allowing the build32 stage on 64-bit architectures
to still override them, so that stage can successfully build 32-bit
compatibility libraries.

Explanation:
1) The build32 stage sets environment variables CC, CXX, AS and LD for
its sub-make, to add 32-bit specific flags (-m32 and such).
2) The sub-make reads sys.mk, encounters CC?= and CXX?= assignments, so
does not alter them.
3) After some other stuff, sys.mk reads /etc/make.conf. When you have
"CC=xxx" and "CXX=yyy" statements in there, they will *override* the
build32-supplied CC/CXX values, nullifying the 32-bit specific flags.
4) Thus all objects get built as 64-bit anyway, and since LD is usually
not set in make.conf, it still has the 32-bit flags!
5) Now, whenever something is linked, you will get a "ld: Relocatable
linking with relocations from format elf64-x86-64-freebsd (foo.o) to
format elf32-i386-freebsd (bar.o) is not supported" error.

Fix this by adding "-ECC -ECXX -EAS -ELD" to the build32 sub-make
invocation, which forces those environment variables to always override
any assignment in makefiles. Thus making it possible to simply set:

CC=my-cc
CXX=my-c++

in your make.conf, or specify a path, even:

CC=/usr/local/bin/other-cc
CXX=/usr/local/bin/other-c++

Note this was never a problem on i386, since it has no build32 stage.

Silence from: current@
MFC after: 1 week

# 653eeb7f 26-Oct-2011 Ed Schouten <ed@FreeBSD.org>

Attempt to fix build logic for gensnmptree.

There are two problems with the existing logic. It builds gensnmptree
on <700018, even if WITHOUT_BSNMP is set, but more importantly, we must
not forget to build gensnmptree on systems that have originally been
built without. This causes a buildworld on those systems to fail.

MFC after: 1 week

# 6122f3e6 22-Oct-2011 Dimitry Andric <dim@FreeBSD.org>

Upgrade our copy of llvm/clang to r142614, from upstream's release_30
branch. This brings us very close to the 3.0 release, which is expected
in a week or two.

MFC after: 1 week


# e59e2d8e 03-Oct-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Farewall, sysinstall! You served us well for many years, but 10.0 is one
digit beyond your time.

Various sysinstall dependencies (e.g. libftpio, libdisk, libodialog, etc.)
will be cleaned up in coming days. Some will take longer than others due to
a few other consumers (tzsetup and sade).

# 611ff617 27-Sep-2011 Stanislav Sedov <stas@FreeBSD.org>

- Add missing interdependencies to kerberos libraries. Some of the
kerberos libraries were not linked properly (missing dependencies),
which causes 3rd party applications linking to fail when --as-needed
ld flag is used. I also added the --no-undefined ld(1) flag to make
sure that there're no missing dependencies.

MFC after: 3 days

# aa0da2e4 11-Aug-2011 Ruslan Ermilov <ru@FreeBSD.org>

- Merged awk upstream that includes a fix for a bug exposed by kmod_syms.mk.
- Provide a build aid for those who already have a buggy awk(1) installed.

Approved by: re (kib)


# 69c488cd 15-Jun-2011 Ruslan Ermilov <ru@FreeBSD.org>

It's a bit odd, but "make update" in src/ can also update the ports/,
doc/, and now www/ trees, but only using the "cvsup" transport.

When "make update" is run using a tree's makefile, it can also use
"cvs" (except for www/) and "svn" (only src/).

Clean up documentation and code regarding "make update":

- Increase oddness by adding support for WWWSUPFILE and NO_WWWUPDATE to
Makefile.inc1 (analogous to PORTSSUPFILE/NO_PORTSUPDATE and
DOCSUPFILE/NO_DOCUPDATE; WWWSUPFILE already supported by www/Makefile).

- Document all trees that support CVS_UPDATE.

- Document all trees that support SUP_UPDATE.

- Document SVN_UPDATE.

- Document NO_WWWUPDATE.

- make.conf(5) mistakenly said that *SUPFILE* had defaults.

- Add an example entry for WWWSUPFILE.

# 0163af23 18-May-2011 Warner Losh <imp@FreeBSD.org>

Implement WITH{,OUT}_{GCC,BINUTILS} to provide finer-grained control
over building gcc and binutils. They default to true, unless
MK_TOOLCHAIN is no.

Reviewed by: ru@

# 4b7e6116 18-May-2011 Warner Losh <imp@FreeBSD.org>

Clean up a loose end from the conversion from gnu ar/ranlib to the BSD
one. Without this, we don't have ar or randlib in the tool path,
leading to much pain for some users. This pain is exposed by the
external toolchain enhancements that I'm working on.

Submitted by: John Hein (ages ago, and dropped on the floor by me: sorry)

# 2eb4b00c 17-May-2011 Florent Thoumie <flz@FreeBSD.org>

Backout libinstall.a -> libpkg commit.

Discussed with: erwin, brooks, bapt

# 4b547324 13-May-2011 Attilio Rao <attilio@FreeBSD.org>

Disconnect sun4v architecture from the three.

Some files keep the SUN4V tags as a code reference, for the future,
if any rewamped sun4v support wants to be added again.

Reviewed by: marius
Tested by: sbruno
Approved by: re

# c79f2d97 11-May-2011 David E. O'Brien <obrien@FreeBSD.org>

+ DTrace as a bootstrap tool is only needed on certain older systems.
+ Be more consistent between BMAKE and TMAKE.
+ Add NO_CTF to crosstools as is done for bootstrap and build tools.

Reviewed by: marcel

# cb10fc9d 04-May-2011 David E. O'Brien <obrien@FreeBSD.org>

Correct the kernel config name printed out during install.

PR: 156579
Submitted by: dhw

# 3afb5177 22-Apr-2011 David E. O'Brien <obrien@FreeBSD.org>

Note which of the built kernels is being installed.

PR: 156579
Submitted by: dhw

# 6d67f694 17-Apr-2011 Dimitry Andric <dim@FreeBSD.org>

Remove libobjc and other Objective-C related components, as these are
extremely outdated, and not used by anything in the base system.

Silence from: current@

# b3eb927f 06-Apr-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Complete WITHOUT_CXX support. It implies WITHOUT_GROFF and
WITHOUT_CLANG.

Don't build clang bootstrap/build-tools depending on this flag. We also
keep gperf, devd and libstdc++ around to prevent foot-shooting and to
make this a two-way street.

# 1b595919 05-Apr-2011 Warner Losh <imp@FreeBSD.org>

Make clang default on x86 and powerpc, but not on other architectures.
Make fdt default on arm and powerpc.

This now includes cross compiled targets, where before we tried to
make it host-based.

Also, move the lists of default yes and no options to a variable.

In general, only build tools should get this treatment in bsd.own.mk.
Also, the use of TARGET* in the bsd.*mk files is discouraged, but
necessary here due to the ordering of things in buildworld. We make
the native case work by testing MACHINE_ARCH after TARGET_ARCH.

# 86be7546 01-Apr-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Fix the delete-old/check-old targets to work with arbitrarily long
OLD_FILES/OLD_DIRS/OLD_LIBS lists.

If you specify enough WITHOUT_FOO flags, the argument list passed to the
shell will be too long. Using .for/.endfor make(1) "loop" will make the
parser of the Makefile explode. Hack around this with good old pipes.

No objections: netchild
Reported by: b.f.

# aa0a1e58 21-Mar-2011 Jeff Roberson <jeff@FreeBSD.org>

- Merge in OFED 1.5.3 from projects/ofed/head

# 99ad39c8 02-Mar-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Improve the distributeworld target in Makefile.inc1 and update the release
infrastructure to use it. make distributeworld can now be used without
preparing its environment first and installs games into its distribution
using the regular make distribute logic instead of post-processing with
a script.

Also add two new targets, packageworld and packagekernel, that tar up the
results of distributeworld and distributekernel (also new), respectively.

# 9c216a50 01-Mar-2011 John Baldwin <jhb@FreeBSD.org>

Use a suitable DIRPRFX for each invocation of make in the build32 and
install32 targets so that the full path to each program or library is
displayed in the make output.

MFC after: 1 week

# 6be04ba6 27-Feb-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Commit two more files missed in r219089.

MFC after: 1 month

# ad30f8e7 24-Feb-2011 Gabor Kovesdan <gabor@FreeBSD.org>

Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.

This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:

- Some utilities have been added. There is a conversion table generator,
which can compare conversion tables to reference data generated by
GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
and cleaned up, now it is easy to read and it is also easier to add
support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
GNU version, i.e. sources should build with base iconv.h and
GNU libiconv. It also includes a macro magic to deal with the
char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
encoding in use
- Various cleanups and style(9) fixes.

Approved by: delphij (mentor)
Obtained from: The NetBSD Project
Sponsored by: Google Summer of Code 2009

# 423102c6 22-Feb-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Flesh out WITHOUT_GROFF support to DTRT.

A full featured groff is required during buildworld, so build it always
and don't rely on it being present on the host system.

vgrind(1) is tightly coupled to a roff processor and will not be
built/installed when groff is disabled. Also much of the roff'ed
documentation under share/doc will not be built/installed when
WITHOUT_GROFF is defined.

Reviewed by: ru (partial)

# d51726b0 21-Feb-2011 Warner Losh <imp@FreeBSD.org>

Back out 218933 and 281934. The easy cases still worked, but some
hard cases broke in worse ways than the status quo. Back them out
until that can be resolved.

# acd26693 21-Feb-2011 Warner Losh <imp@FreeBSD.org>

Select building CLANG based on ${TARGET_ARCH} and existence of
WITH{,OUT}_CLANG. We default to yes on some archs, no on others,
unless WITHOUT_CLANG or WITH_CLANG is defined respectively.

# 2754fe60 20-Feb-2011 Dimitry Andric <dim@FreeBSD.org>

Upgrade our copy of llvm/clang to r126079, from upstream's trunk.

This contains many improvements, primarily better C++ support, an
integrated assembler for x86 and support for -pg.


# 9b3d9914 10-Feb-2011 Warner Losh <imp@FreeBSD.org>

Hmmm, specifying TARGET and TARGET_ARCH in the environment doesn't
seem to work when building xdev anymore (most likely my changes lately
moving the TARGET guessing stuff to Makefile from Makefile.inc1, but I
really don't grok why). Fix make xdev by putting them on the command
line. This will work either way while I try to figure it out.

# f263e792 10-Feb-2011 Warner Losh <imp@FreeBSD.org>

CPUTYPE is now a required define for calling Makefile.inc1 diretly, so
make sure we define it for the xdev stuff.

Move xdev stuff to be last again in this file.

# xdev-build works now, but xdev-install appears to be broken though.

# fbd0c280 10-Feb-2011 Warner Losh <imp@FreeBSD.org>

You are now *REQUIRED* to pass both TARGET and TARGET_ARCH to any
invocations of Makefile.inc1 (since that's supposed to be an internal
interface for world and related targets). Document this with a .error
message. For a transition period, support passing in just TARGET, but
give a .warning for that case: I plan on removing it in 9.0...

# fda074e4 31-Jan-2011 Warner Losh <imp@FreeBSD.org>

Move the architecture guessing from Makefile.inc1 to Makefile. We
need to do this because variables specified on the command line
override those specified in the Makefile. This is why we also moved
from TARGET to _TARGET in Makefile, and then set TARGET on the command
line when we fork a submake with Makefile.inc1.

This makes mips/mips work again, even without the workaround committed to
lib/libc/Makefile.

# cd2ae253 07-Jan-2011 Warner Losh <imp@FreeBSD.org>

Retire TARGET_ABI.

Implement MACHINE_ARCH=mips64e[lb] to build N64 images. This replaces
MACHINE_ARCH=mipse[lb] TARGET_ABI=n64.

MACHINE_ARCH=mipsn32e[lb] has been added, but currently requires
WITHOUT_CDDL due to atomic issues in libzfs. I've not investigated
this much, but implemented this to preserve as much of the TARGET_ABI
functionality that I could. Since its presence doesn't affect the
working cases, I've kept it in for now.

Added mips64e[lb] to make universe, so more kernels build.

And I think this (finally) closes the curtain on the tbemd tree.

# f0a0ad3b 18-Nov-2010 Mark Murray <markm@FreeBSD.org>

Do not lint code beyond necessity (with apologies to Wiliam of Ockham).

Don't lint externally maintained CDDL code, or relint the 32-bit libraries
in amd64 mode.

# 80595f8a 13-Nov-2010 Warner Losh <imp@FreeBSD.org>

add / to the translation of TARGET_ARCH to TARGET

# 6451dd5e 13-Nov-2010 Warner Losh <imp@FreeBSD.org>

The fixes for mips/mips arm/arm compat hacks broke if TARGET or
TARGET_ARCH wasn't defined. Fix it for that case.

Submitted by: Garrett Cooper

# f10ff4ab 13-Nov-2010 Warner Losh <imp@FreeBSD.org>

Add legacy names for mips:mips and arm with TARGET_BIG_ENDIAN, for the moment.

# 39cd938c 11-Nov-2010 Ed Schouten <ed@FreeBSD.org>

Replace libgcc.a by libcompiler_rt.a.

libcompiler_rt.a is a BSD licensed C language runtime, which implements
many routines which are linked into binaries on architectures where
certain functionality is missing (e.g. 64 bits mul/div on i386).

Unfortunately, libcompiler_rt cannot replace libgcc entirely. Certain
features, such as an unwinder for exception handling, are missing.
That's why only libgcc.a is replaced for now, because this one does seem
to be complete.

Tested by: rene (amd64), nwhitehorn (powerpc), droso (i386 exprun)
and many others. Thanks!
Obtained from: user/ed/compiler-rt

# bf4724fa 09-Nov-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd:
o TARGET=mips --> little endian 32-bit mips build
o mipsel and mipseb TARGET_ARCH are both mips TARGETs
o Add some more architecture combinations

# 87ff4bce 08-Sep-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Check TARGET_ARCH as well as TARGET to determine if we are doing a cross
build. This is necessary to be able to cross-build 32-bit PowerPC from
a 64-bit PowerPC host.

Reviewed by: imp

# b12277d1 28-Aug-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Repair some build breakage introduced in r211725 and garbage collect some
code made obsolete in the same commit.

# dda89c73 24-Aug-2010 Warner Losh <imp@FreeBSD.org>

The order was correct before. I'd talked to Nathan about this before,
so this must have been mismerged into tbemd before I merged it back to
head. This unbreaks this on powerpc64

Submitted by: nathanw@

# 25faff34 23-Aug-2010 Warner Losh <imp@FreeBSD.org>

MFtbemd:

Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.

# 767bb849 22-Aug-2010 Warner Losh <imp@FreeBSD.org>

Minor tweak from tbemd

# 029a7373 21-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

Don't link drti.o with libelf_pic.a. This means that all software with
userland SDT probes must be linked with libelf explicitly.

Requested by: kib
Sponsored by: The FreeBSD Foundation

# ad8a0e42 21-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

Add clang to the cross-tools build stage.

Submitted by: Dimitry Andric <dimitry at andric.com>

# 9510083e 21-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

Add libelf to the prebuild libs.

This is needed for the DTrace instrumentation object.

Sponsored by: The FreeBSD Foundation

# 50e2303d 18-Aug-2010 Dag-Erling Smørgrav <des@FreeBSD.org>

Revert r211436; it was a good idea, but not fully thought out.

# d350d2cd 17-Aug-2010 Dag-Erling Smørgrav <des@FreeBSD.org>

Split kernel stage 3.2 (build everything) into 3.2 (build the kernel)
and 3.3 (build the modules). IMHO, this makes it a little easier to
track the progress of a kernel build using whereintheworld et al.

MFC after: 3 weeks

# c606b778 15-Jul-2010 Rafal Jaworowski <raj@FreeBSD.org>

Relax FDT_DTS_FILE validation (and unbreak world build).

Pointed out by: kib

# 24c00a90 15-Jul-2010 Rafal Jaworowski <raj@FreeBSD.org>

Fix FDT_DTS_FILE parsing to properly retrieve its value. This unbreaks the
'builddtb' target.

Make the processing more robust against non-existent kernel config files
(pointed out by imp@).

# 8bb23971 13-Jul-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Connect powerpc64 to the build. It is not presently part of make universe,
which will be added soon.

Reviewed by: imp

# d5872601 24-Jun-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd:

use MACHINE_CPUARCH instead of MACHINE_CPU since the sources for the
CSU is based on MACHINE_CPUARCH

Reviewed by: arch@ (twice)

# 4a5faa67 24-Jun-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd:

change the name of the object tree from ${TARGET} to
${TARGET}.${TARGET_ARCH} so we can do both big and little endian
builds in the same tree.

Reviewed by: arch@ (twice)

# 9998d0c0 24-Jun-2010 Warner Losh <imp@FreeBSD.org>

Merge from TBEMD:

Rather than having arch specific code in Makefile.inc1, generalize so
that we can control the settings of different options on a per
architecutre basis.

Reviewed by: arch@ (twice)

# df06a575 16-Jun-2010 Rafal Jaworowski <raj@FreeBSD.org>

Use awk alone for extracting FDT_DTS_FILE instead of grep/cut, which is
simpler and more robust.

Submitted by: Andrzej Tobola

# 3c5326bf 13-Jun-2010 Rafal Jaworowski <raj@FreeBSD.org>

Connect FDT infrastructure to the build system.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

# 6513cfc8 09-Jun-2010 Roman Divacky <rdivacky@FreeBSD.org>

Hook clang into the build on i386/amd64/powerpc.

Approved by: ed (mentor)

# 5ba4657c 20-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

Revert r208353. It did not work as I expected because WITHOUT_MAN is set
for bootstrap-tools target and WITHOUT_MAN_UTILS was implied by default.

Pointy hat: jkim

# 8a4b934b 20-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

We do not have to build makewhatis as a bootstrap tool when it is disabled
by WITHOUT_MAN_UTILS.

# b05756ac 20-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

Revert r208324. We still need it for installworld as $PATH is overriden.

# 727b4933 19-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

Remove makewhatis(1) from bootstrap tools. We no longer support source
upgrades from versions prior to 6.0 on head.

# 7fbeb03e 10-May-2010 Martin Matuska <mm@FreeBSD.org>

Enable liblzma support in libarchive
Adjust dependencies for programs using libarchive
Add xz and linkage against liblzma to rescue system

Approved by: kientzle, delphij (mentor)
MFC after: 2 weeks

# 762c7db2 23-Apr-2010 Florent Thoumie <flz@FreeBSD.org>

- Take libinstall.a out of pkg_install and make it a proper shared library.
- Rework the wrapper support to check libpkg version as well as pkg_install
version.
- Add libfetch to _prebuild_libs.
- There are no new features introduced.

Notes: the API is not stable, so basically, do not use libpkg in your
projects for now. Also there's no manpage for libpkg yet, because the API
will change drastically. I repeat, do not use libpkg for now.

# 096924c9 22-Apr-2010 Alexander Leidinger <netchild@FreeBSD.org>

Remove explicit setting of NO_CTF in WMAKEENV and in the make call for
the buildkernel. This way makeoptions WITH_CTF=yes not only works when
compiling the tradtitional way, but also when using buildkernel. This
does not enable the CTF part of the world, it still defaults to without
CTF info.

The cross/build-tools/bootstrap targets are not affected by this, they
still have and should keep the explicit NO_CTF.

Notified by: np

# f672e5fb 14-Apr-2010 Warner Losh <imp@FreeBSD.org>

Add note about TARGET_ARCH

# e56900fc 24-Mar-2010 Xin LI <delphij@FreeBSD.org>

Expose MACHINE_CPU while building lib32 target.

# 460f173d 07-Mar-2010 Antoine Brodin <antoine@FreeBSD.org>

Remove old documents when they are not compressed.
(NO_INFOCOMPRESS, NO_DOCCOMPRESS or NO_MANCOMPRESS)

MFC after: 1 month

# 0f49f7eb 26-Jan-2010 Ruslan Ermilov <ru@FreeBSD.org>

Regen the list of prebuild libraries using tools/make_libdeps.sh.

# c1f5e730 23-Jan-2010 Antoine Brodin <antoine@FreeBSD.org>

Unbreak world:
- WITHOUT_OPENSSH (and WITH_KERBEROS)
- WITHOUT_KERBEROS and WITH_GSSAPI

PR: 137483
Submitted by: bf
MFC after: 2 weeks

Note: this breaks harder world WITHOUT_GSSAPI (and WITH_KERBEROS), but well

# 84bee0d7 21-Jan-2010 Ed Schouten <ed@FreeBSD.org>

Remove libulog from the bootstrap again.

libulog now only provides functions that are used by various packages
from the ports tree, namely the libutempter ones. There is no reason to
link it into the crunch/fixit binaries anymore.

# 6f7be14a 14-Jan-2010 Jilles Tjoelker <jilles@FreeBSD.org>

In 'make delete-old', use 'exec' to redirect an fd persistently.

That is, write 'exec 3<&0' instead of '3<&0'. Due to an sh(1) bug fixed in
r199953, the latter also persisted, provided that fd 3 was not open before.
With newer sh or fd 3 open, it would not delete orphaned catpages.

MFC after: 2 weeks

# 03bc68ca 30-Dec-2009 Ed Schouten <ed@FreeBSD.org>

Disable K&R style function definitions for WARNS=6.

Unfortunately there are two slight problems with that:

- Yacc and lex might generate code that generates warnings because of
this. Require yacc and lex to be rebuilt during bootstrap. I'm not
incrementing __FreeBSD_version here, because I assume someone else
will do this eventually.

- When running `make buildkernel', it uses share/mk from the source
treeo to build aicasm. Because aicasm also depends on lex, this would
break. Lower WARNS to 5 for now. We should just increment it to 6
again somewhere in the very far future.

# 62012822 15-Dec-2009 Warner Losh <imp@FreeBSD.org>

Add NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN},
which disables doing a make obj. Use it when you know it will work
only. KERNFAST now implies NO_KERNELOBJ, since you don't need to keep
doing obj when doing incremental kernel builds.

# 17c79ad0 11-Dec-2009 Ed Schouten <ed@FreeBSD.org>

Convert pam_lastlog(8) to libulog.

The information used by the "Last login:"-line is obtained by using
ulog_setutxfile(3) to switch to the lastlog database. Login and logout
are performed using the utility functions ulog_login(3) and
ulog_logout(3).

This also means we must build libulog during bootstrap.

Approved by: des

# 98c98d78 01-Nov-2009 Roman Divacky <rdivacky@FreeBSD.org>

Replace -iprefix with -isystem. We only need alternative header
files search path and thus -isystem is sufficient. -iprefix is
meant to do something entirely different.

Approved by: ed (mentor)
OKed by: ru, kan
Tested by: make universe

# 8d5ed6e7 28-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

Now that the zoneinfo data is automatically updated when a new world
is installed, we should at least have the tzsetup tool available!

Suggested by: Andriy Gapon <avg@freebsd.org>
Noticed by: Ben Kaduk <minimarmot@gmail.com>
MFC after: 1 week

# e5367da3 21-Oct-2009 Ruslan Ermilov <ru@FreeBSD.org>

Move sed(1) from cross-tools to bootstrap-tools.

# b6d632e4 12-Oct-2009 Alexander Nedotsukov <bland@FreeBSD.org>

Chase dependency changes in libgssapi_krb5 module introruced by
revision r197995.

# 767a0b2d 10-Sep-2009 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix comment about KERNFAST.

# 2286fe76 14-Jul-2009 Alexander Kabaev <kan@FreeBSD.org>

Second attempt at eliminating .text relocations in shared libraries
compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC
generates local calls to this function which result in absolute
relocations put into position-independent code segment, making dynamic
loader do extra work every time given shared library is being relocated
and making affected text pages non-shareable.

Reviewed by: kib
Approved by: re (kib)

# d48890cf 28-Jun-2009 Alexander Kabaev <kan@FreeBSD.org>

Back out previous revision until better tested fix is ready.

Approved by: re (impliciti, by approving previos check-in)

# a162c9ae 28-Jun-2009 Alexander Kabaev <kan@FreeBSD.org>

Eliminate .text relocations in shared libraries compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC generates
local calls to this function which result in absolute relocations put into
position-independent code segment, making dynamic loader do extra work everys
time given shared library is being relocated and making affected text pages
non-shareable.

Reviewed by: kib
Approved by: re (kensmith)

# 51a8ff0c 14-Jun-2009 Mark Murray <markm@FreeBSD.org>

Allow "make update" work with SVN, if you take the time to set up your
/etc/make.conf properly.

Only one SCM?
I do not think this is right.
Now I have fixed it.

# d0c7c272 04-Apr-2009 Warner Losh <imp@FreeBSD.org>

Revert c190007 at the request of Ruslan. It was not correct because
ar had been moved from cross tools to bootstrap tools when bsd ar was
introduced.

Submitted by: ru@

# 5c2ca8d0 18-Mar-2009 Warner Losh <imp@FreeBSD.org>

Add usr.bin/ar to the list of cross tools. Before, when we had gnu
ar, it was built in the gnu/usr.bin/binutils tree. Now it isn't.

Submitted by: John Hein

# badf7d25 15-Mar-2009 Warner Losh <imp@FreeBSD.org>

Restore missing OSREL definition that accidetnally dropped from an
earlier version of this patch.

# 8a6a076c 15-Mar-2009 Gabor Kovesdan <gabor@FreeBSD.org>

- Create the buildworld object directories with mtree instead of various
mkdir calls
- Remove the ugly workaroung from libc NLS, which was to create some of
these directories

# fe73c506 13-Mar-2009 Gabor Kovesdan <gabor@FreeBSD.org>

- Reenable Native Language Support in libc. This feature was disabled due
to possible breakages in the catalog handling code. Since then, that
code has been replaced by the secure code from NetBSD but NLS in libc
remained turned off. Tests have shown that the feature is stable and
working so we can now turn it on again.

- Add several new catalog files:
- ca_ES.ISO8859-1
- de_DE.ISO8859-1
- el_GR.ISO8859-7 (by manolis@ and keramida@)
- es_ES.ISO8859-1 (kern/123179, by carvay@)
- fi_FI.ISO8859-1
- fr_FR.ISO8859-1 (kern/78756, by thierry@)
- hu_HU.ISO8859-2 (by gabor@)
- it_IT.ISO8859-15
- nl_NL.ISO8859-1 (corrections by rene@)
- no_NO.ISO8859-1
- mn_MN.UTF-8 (by ganbold@)
- sk_SK.ISO8859-2
- sv_SE.ISO8859-1
(The catalogs without explicit source has been obtained from NetBSD.)

Approved by: attilio

# 555aaddf 13-Mar-2009 Ruslan Ermilov <ru@FreeBSD.org>

Don't put "install-info" to the list of install-tools if we're
installing with -DWITHOUT_INFO, otherwise one can experience a
failure trying to installworld on a system that is built with
-DWITHOUT_INFO (i.e., without /usr/bin/install-info).

Reported by: bland
MFC after: 3 days

# 25bacc78 13-Mar-2009 Warner Losh <imp@FreeBSD.org>

Implement the xdev target. When you define XDEV=arch XDEV_ARCH=arch,
you can build the cross development tools and install them as
$XDEV-freebsd-xxx for each tool. This allows one to use autoconf to
find the tools for cross building scenarios.

# d9ca85fc 21-Feb-2009 Ruslan Ermilov <ru@FreeBSD.org>

Fix build when WITH_SSP is set explicitly.

Submitted by: Jeremie Le Hen

# b61a9dcf 23-Jan-2009 Warner Losh <imp@FreeBSD.org>

Implement an idea from Sam Leffler:
make KERNFAST=blah buildkernel
is now a short cut for
make KERNCONF=blah -DKERNFAST buildkernel

This change works for all kernel config files not named "1". I did
that to make sure that
make -DKERNFAST buildkernel
remains the same as
make -DKERNFAST KERNCONF=GENERIC buildkernel
rather than trying to build and configure "1". I've never seen a
kernel config file named "1," so I think this is a good compromise.

# 79177775 14-Jan-2009 Warner Losh <imp@FreeBSD.org>

Add KERNFAST define. When defined, it skips all the config, depends
and clean steps. KERNFAST was selected to complement KERNCONF which
is typically used in these scenarios (especially with cross building).

Reviewed by: arch@

# 85cb1ccb 11-Nov-2008 David E. O'Brien <obrien@FreeBSD.org>

Add the kerberos5 libs to the install32 target.
(we've been building the all along, but never installing them)

# a9bff23c 23-Oct-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Back out testing aid that was inadvertantly committed as part of r184205.

Noticed by: rdivacky

# 1ede983c 23-Oct-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Retire the MALLOC and FREE macros. They are an abomination unto style(9).

MFC after: 3 months

# bcffa935 19-Sep-2008 David E. O'Brien <obrien@FreeBSD.org>

Rescue is "not yet" for MIPS.

# c7f23b87 19-Aug-2008 John Baldwin <jhb@FreeBSD.org>

If a CPUTYPE isn't specified, then don't use -march=k8 when compiling
32-bit compat libs on amd64 since -march=k8 may generate instructions
that are not implemented on Intel EM64T processors. Instead, use
a simpler set of default flags that should work on all amd64-capable
CPUs.

PR: amd64/113111
Submitted by: NIIMI Satoshi sa2c of sa2c.net
MFC after: 1 week

# 03d013bc 01-Aug-2008 John Baldwin <jhb@FreeBSD.org>

Various style fixes in the build32 rules.

Submitted by: bde (mostly)

# e68ed793 01-Aug-2008 John Baldwin <jhb@FreeBSD.org>

Tweak the support for using ldd on 32-bit objects a bit further.
Specifically, build a 32-bit /usr/bin/ldd32 on amd64 which handles 32-bit
objects. Since it is a 32-bit binary, it can fork a child process which
can dlopen() a 32-bit shared library. The current 32-bit support in ldd
can't do this because it does the dlopen() from a 64-bit process. In order
to preserve an intuitive interface for users, the ldd binary automatically
execs /usr/bin/ldd32 for 32-bit objects. The end result is that ldd on
amd64 now transparently handles 32-bit shared libraries in addition to
32-bit binaries.

Submitted by: ps (indirectly)

# 042df2e2 25-Jun-2008 Ruslan Ermilov <ru@FreeBSD.org>

Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
turned opt-in for stable branches depending on the consensus. You
can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
It is harmless to steal the knob as SSP symbols have been provided
by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
(sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
libc will be automatically downgraded to -fstack-protector because it
breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by: Jeremie Le Hen <jeremie@le-hen.org>

# 643d58f9 18-Jun-2008 David E. O'Brien <obrien@FreeBSD.org>

Add MIPS to the list of known arches.

# 51062e59 22-May-2008 John Birrell <jb@FreeBSD.org>

Add the DTrace build tools to the list of tools and pass NO_CTF to all
the stages of the build which don't require CTF conversion.

# 33f12199 07-May-2008 Doug Rabson <dfr@FreeBSD.org>

Fix conflicts after heimdal-1.1 import and add build infrastructure. Import
all non-style changes made by heimdal to our own libgssapi.

# 3d42ee26 14-Apr-2008 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap the build of btxld.

# dbdb679c 29-Mar-2008 Ruslan Ermilov <ru@FreeBSD.org>

Remove options MK_LIBKSE and DEFAULT_THREAD_LIB now that we no longer
build libkse. This should fix WITHOUT_LIBTHR builds as a side effect.

# b18c84b4 02-Mar-2008 Ruslan Ermilov <ru@FreeBSD.org>

Set AR=gnu-ar and RANLIB=gnu-ranlib on systems where we are forced
to use GNU tools. Remove the _WITH_GNUAR knob.

Prodded by: obrien

# 0be8836d 25-Feb-2008 Ruslan Ermilov <ru@FreeBSD.org>

Sort.

Prodded by: obrien

# d0ca9999 25-Feb-2008 Ruslan Ermilov <ru@FreeBSD.org>

Make again BSD ar(1) the default system ar(1), now properly handling
source upgrades by falling back to GNU ar(1) as necessary. Option
WITH_BSDAR is gone. Option _WITH_GNUAR to aid in upgrades is *not*
supposed to be set by the user.

Stop bootstrapping BSD ar(1) on the next __FreeBSD_version bump, as
there are no known bugs in it. Bump __FreeBSD_version to anticipate
this and to flag the switch to BSD ar(1), should it be needed for
something.

Input from: obrien, des, kaiw

# 646df953 05-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Satisfy a particularly obstinate nit-picker :)

# bcb20d7b 05-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Give usr.bin/kdump/kdump_subr.c the same treatment as usr.bin/kdump/ioctl.c
and usr.bin/truss/ioctl.c. This is the correct way to address the problem
that arises when doing an incremental build after a header used by kdump
has been removed (cf. i4b disconnect a while ago)

Explained by: ru
MFC after: 2 weeks

# 51dc1e12 23-Jan-2008 Ruslan Ermilov <ru@FreeBSD.org>

Support source upgrades from at least 6.0-RELEASE.

Reviewed by: imp, obrien

# 50df6ee3 22-Jan-2008 Andrey A. Chernov <ache@FreeBSD.org>

Conditionally add mklocale to bootstrap-tools

# 68c5515f 22-Jan-2008 Ruslan Ermilov <ru@FreeBSD.org>

Cleanup after last commit (remove undefined variables).

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

# 9074b900 16-Jan-2008 Christian Brueffer <brueffer@FreeBSD.org>

Remove WITHOUT_FORTRAN from the XMAKE target, it doesn't exist anymore.

Reviewed by: imp, kan
Approved by: rwatson (mentor)
MFC after: 3 days

# c93073c2 03-Dec-2007 Yaroslav Tykhiy <ytykhiy@gmail.com>

- Explicitly verify if all needed libs were found by ldd(1). Do so
through scanning its output as ldd(1) returns a non-zero status only
for really abnormal conditions such as an improper file format.
Now cp(1) won't get bogus "not" and "found" arguments if a lib
is missing. [1]

- Don't guess if an element of a complex pipeline is assigned to the main
shell or a sub-shell. Namely use stdio, not vars, to pass lists out from
loops. If using vars, there's the risk that a loop will run in a sub-shell
and the list won't make it to the main shell. It appears that braces and
parens give only limited control over the issue while stdio always works
as intended. Apply this solution to both $progs and $libs for consistency,
although I've failed to go without it only in the $libs part.

Requested by: emaste [1]

# 519bc416 31-Oct-2007 Yaroslav Tykhiy <ytykhiy@gmail.com>

Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:

1) ABI breakages should no longer affect installworld over the live system.

2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.

3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.

The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.

Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)

# 1602894e 15-Oct-2007 Ed Maste <emaste@FreeBSD.org>

If a required install tool is missing, provide a more friendly error
message (instead of cp's usage info).

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

# 2d797419 01-Oct-2007 Ruslan Ermilov <ru@FreeBSD.org>

Revise the list of directories we manually create under
${WORLDTMP} and ${LIB32TMP}; some of them are no longer
needed, and some were never needed.

Approved by: re (kensmith)

# 152f2a4a 01-Oct-2007 Ruslan Ermilov <ru@FreeBSD.org>

Always install libpthread.* symlinks if at least one of
the threading libraries is built. This simplifies the
logic in makefiles that need to check if the pthreads
support is present. It also fixes a bug where we would
build a threading library that we shouldn't have built:
for example, building with WITHOUT_LIBTHR and the default
value of DEFAULT_THREADING_LIB (libthr) would mistakenly
build the libthr library, but not install it.

Approved by: re (kensmith)

# 5224b41a 10-Jul-2007 Xin LI <delphij@FreeBSD.org>

Add sed(1) to cross tools. We do want newly built version during
buildworld.

Approved by: re (rwatson)

# a1cdbf32 26-May-2007 Ruslan Ermilov <ru@FreeBSD.org>

lex(1) no longer installs headers into GCC-internal dirs
(since src/usr.bin/lex/Makefile,v 1.20).

# 98a0900a 19-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Revision 1.576 removed too much. I didn't notice because my /usr is on
ZFS, which doesn't support flags...

# 25a362d7 18-May-2007 Alexander Kabaev <kan@FreeBSD.org>

GCC will now properly link libc with all shared objects in order to record
their dependency on libc and its versioned symbols. For that to work,
libc needs to be built before any other shared library that might depend
on it. Add necessary glue to make that happen.

# f27f8258 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Don't use a subshell where it isn't needed.

Noticed by: John E Hein <jhein@timing.com>

# 32cd239b 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Expose all of {check,delete}-old{,-dirs,-files,-libs}.

MFC after: 3 weeks

# 84478d58 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove stray comment which broke delete-old-dirs.

# d1e75b81 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Partially revert the check-old / delete-old modifications to clarify the
logic.

Apply similar modifications to {check,delete}-old-dirs, which I had
overlooked.

# ca224410 14-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Restore previous behaviour of aborting delete-old* if rm failed.

Pointed out by: netchild
MFC after: 3 weeks

# 61305271 13-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Greatly speed up {check,delete}-old* by replacing make loops with sh loops.

MFC after: 3 weeks

# 00fb440c 13-May-2007 Daniel Eischen <deischen@FreeBSD.org>

Enable symbol versioning by default. Use WITHOUT_SYMVER to disable it.
Warning, after symbol versioning is enabled, going back is not easy
(use WITHOUT_SYMVER at your own risk).

Change the default thread library to libthr.

There most likely still needs to be a version bump for at least the
thread libraries. If necessary, this will happen later.

# 1c22c47c 17-Apr-2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Link libzpool, ztest and zdb against libpthread.

Requested by: ru

# ceef0c31 05-Apr-2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Connect ZFS to the build.

# 31b4134f 08-Mar-2007 Rong-En Fan <rafan@FreeBSD.org>

Enable ncurses wide character support

Approved by: delphij (mentor)
Tested by: kris on pointyhat (early version), current@

# 857be7a4 01-Mar-2007 Ruslan Ermilov <ru@FreeBSD.org>

Bump the bootstrapping requirements for gensnmptree(1) and remove
a note in UPDATING that tried to work around the build breakage.

Tested by: jhb
OK'ed by: njl

# 51804c79 28-Feb-2007 Ruslan Ermilov <ru@FreeBSD.org>

Resurrect one of the patches from attic and refine the
lib32 build somewhat. Specifically, instead of spamming
${CC} et al with -I${LIB32TMP}/usr/include which can be
harmful (as has been demonstrated by the ncursesw WIP),
use slightly different approach to achieve the same goal.
This also simplifies things a bit.

Prodded by: rafan

# 9c827cec 27-Feb-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Clean the lib32 object directory with cleandir rather than rm -rf.

Discussed with: ru
MFC after: 2 weeks

# af5b5a0f 20-Jan-2007 Rong-En Fan <rafan@FreeBSD.org>

Switch to new ncurses build glue

Approved by: delphij

# 638b0a3e 27-Nov-2006 Ruslan Ermilov <ru@FreeBSD.org>

There was a timeframe where crunchgen(1) was broken; force
an upgrade during the build so those who are affected can
build world again.

# 87b8c12d 12-Nov-2006 Ruslan Ermilov <ru@FreeBSD.org>

There doesn't seem to be a real reason for include/ to be installed
so early.

# 61517751 16-Oct-2006 John Birrell <jb@FreeBSD.org>

Add sun4v to the TARGET_ARCH when just TARGET is set (like pc98 is done).

This is required for 'make universe'.

# ddd53429 08-Oct-2006 Kip Macy <kmacy@FreeBSD.org>

buildworld fixes for sun4v
not sure why pmap.c is included as it is unchanged

Approved by: rwatson (mentor)
Reviewed by: jmg

# 49e62f1c 07-Oct-2006 Ruslan Ermilov <ru@FreeBSD.org>

Shuffle _*_libs assigments (no functional changes).

# b1935562 07-Oct-2006 Ruslan Ermilov <ru@FreeBSD.org>

- Prebuild libgssapi only if building with Kerberos support.

- Remove libnetgraph from the list of prebuilt libraries as
no other library depends on it (snmp_netgraph.so does not
count as we don't build it in the "libraries" target).

- Restore libssh dependencies when compiling with Kerberos
support.

# 89edd7e5 08-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Previous revision wasn't enough for "make TARGET=<machine> build*"
to work. Some build-tools that are part of cross-tools (cc_tools)
also need to know the proper values of TARGET_ARCH and TARGET, so
tell them.

# 0f31538c 07-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

While experimenting with cross-building by specifying just TARGET,
I found one bug. Pass our idea of TARGET_ARCH and TARGET down to
XMAKE, the cross-tools make. Previously it worked because usually
TARGET_ARCH was specified on the initial make's command line.
This should also allow us to simplify the "universe" target, which
I'm currently testing.

# d2f03ebb 07-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Added timestamping to buildworld, similar to buildkernel.

# e6cb78fb 07-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

- Rewrite logic to guess TARGET_ARCH/TARGET to be more readable,
but without changes in behavior.

- Add sanity checking for TARGET_ARCH/TARGET.

# ffbebdce 07-Sep-2006 Warner Losh <imp@FreeBSD.org>

make "make TARGET=foo" work correctly. Before, it would fail to set
TARGET_ARCH correctly. Now it does, even for pc98. We should suggest
TARGET=foo in preference to TARGET_ARCH because the former is
unambiguous and the latter isn't, so update the docs.

This means that a long standing gripe I've had with this comes to a
close. I can build pc98 w/o specify both things. make TARGET=arm
works (rather than trying to build a arm:amd64 image and dying badly
in the attempt).

If you specify only TARGET_ARCH, then you get the old behavior.

# we can likely simplify the UNIVERSE target now to use this, but I'm not
# up for breaking that tonight :-).

# We should consider adding some kind of sanity check for TARGET_ARCH
# and TARGET.

# 1bb2049e 24-Aug-2006 Warner Losh <imp@FreeBSD.org>

Always make obj when building the libraries. This never hurts, and
helps some cross-architecture building tool installation patches that
I'm developing.

# 2b46c64c 22-Aug-2006 Ruslan Ermilov <ru@FreeBSD.org>

Remove alpha left-overs.

# c49d3a7d 09-Aug-2006 Alexander Leidinger <netchild@FreeBSD.org>

Remove sade from build-tools, the tinderbox problem should be fixed now.

# 2d0fba05 08-Aug-2006 Yoshihiro Takahashi <nyan@FreeBSD.org>

Add the sade to build-tools list. This fixes a tinderbox.

# dad90513 02-Aug-2006 Alexander Leidinger <netchild@FreeBSD.org>

Fix doxygen target.

Submitted by: "Alexander Mogilny" <sg@astral.ntu-kpi.kiev.ua>
Pointy hat to: netchild

# 6f13c7ad 06-Jun-2006 Warner Losh <imp@FreeBSD.org>

Also need to quote values so they can be passed on correctly.

# 621e4ae1 06-Jun-2006 Warner Losh <imp@FreeBSD.org>

Create a new target 'buildenvvars'. This target reports the build
environment for cross building (the same one you'd get interactively
in make buildenv). This cannot be a simple

make -f Makefile.inc1 -V WMAKEENV

because in PATH is not set correctly unless one takes a trip through
the Makefile/Makefile.inc1 indirection, the logic of which is too
large to reproduce outside of Makefiles.

# becc5c62 26-May-2006 Alexander Leidinger <netchild@FreeBSD.org>

Connect the kernel subsystem API documentation generation framework to
the build infrastructure: "make doxygen"

Changes to the man pages will be made when some defaults are revisited.

Requested by: gnn

# f6ce2a64 17-May-2006 Poul-Henning Kamp <phk@FreeBSD.org>

Send the pcvt(4) driver off to retirement.

# d6acfaf5 31-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Sort bootstrap-tools entries.

# 03e21a94 30-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Rebuild gensnmptree(1) on 700014 systems too. While 700014 corresponds
to post January 26 systems where gensnmptree(1) code was already fixed,
there was a timeframe between February 14 and February 27 when
usr.sbin/bsnmpd/ including gensnmptree was disconnected from build, so
if you upgraded in this timeframe, you ended up with the 700014 system
but still with a buggy gensnmptree binary. This also means not being
able to buildworld now.

Reported by: jhb
Attention: harti, keramida

# cea557ad 20-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Extend coverage of the MK_IPX build option to the following:

- <netipx> headers [1]
- IPX library (libipx)
- IPX support in ifconfig(8)
- IPXrouted(8)
- new MK_NCP option

New MK_NCP build option controls:

- <netncp> and <fs/nwfs> headers
- NCP library (libncp)
- ncplist(1) and ncplogin(1)
- mount_nwfs(8)
- ncp and nwfs kernel modules

User knobs: WITHOUT_IPX, WITHOUT_IPX_SUPPORT, WITHOUT_NCP.

[1] <netsmb/netbios.h> unconditionally uses <netipx> headers
so they are still installed. This needs to be dealt with.

# ca404c7d 19-Mar-2006 Maxime Henrion <mux@FreeBSD.org>

Change the default SUP command to use csup instead of CVSup for
"make update" when SUP_UPDATE is defined.

# 5740a2b6 18-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Convert NO_PROFILE and NO_LIB32 to new style.

# c3ed02cf 18-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Add the new "showconfig" target that displays build configuration.

Suggested by: phk

# e1fe3dba 17-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Reimplementation of world/kernel build options. For details, see:

http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by: imp, jhb, kris, phk, ru (all bugs are mine)

# 6cb9d90a 16-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

When building for pc98, don't create stray objects in the
usr.sbin/pcvt/keycap source directory.

Found by: phk
MFC after: 3 days

# 00602d09 08-Mar-2006 Giorgos Keramidas <keramida@FreeBSD.org>

After revision 1.4 of `src/usr.sbin/bsnmpd/bsnmpd/Makefile' the
gensnmptree utility is required at "make depend" time, because it
is used to generate `oid.h' for bsnmpd.

This means that all versions of HEAD before 2004/01/23 16:22:49 need
gensnmptree as a bootstrap util when it's not already installed as
part of the base system. The first __FreeBSD_version that we can
assume this can work is 700014 which happened after the gensnmptree
change (in -r 1.263 of `src/sys/sys/param.h', at 2006/02/17 14:14:15).

For __FreeBSD_version values before 700014 add gensnmptree to the
bootstrap tools, to allow upgrades from versions of FreeBSD before
that date.

Approved by: ru, harti

# e8a71dcc 27-Feb-2006 Ruslan Ermilov <ru@FreeBSD.org>

Detect that the "audit" group is missing earlier during install.

# 8a32134c 18-Feb-2006 Alexander Leidinger <netchild@FreeBSD.org>

A file can also be a link, so check not only for a file, but also for a link
in the delete-old and check-old targets.

We don't install a lib (libXY.so.Z) as a link, but an user may have created
something like this. This is dangerous if this link points to a different
version of the lib. So check for a link also in the *-lib targets (an
annoyed user which absolutely wants this redirection of a lib should use
libmap.conf instead of a link).

A directory can also be a link, but in this case just echo a message to
remove it by hand.

# 38311499 02-Jan-2006 Doug Rabson <dfr@FreeBSD.org>

Revert the previous change - the lib32 build should work now.

# 29af427b 02-Jan-2006 Doug Rabson <dfr@FreeBSD.org>

Temporarily disable the kerberos5 lib32 build while I try to fix it
properly.

# c0b9f4fe 29-Dec-2005 Doug Rabson <dfr@FreeBSD.org>

Add a new extensible GSS-API layer which can support GSS-API plugins,
similar the the Solaris implementation. Repackage the krb5 GSS mechanism
as a plugin library for the new implementation. This also includes a
comprehensive set of manpages for the GSS-API functions with text mostly
taken from the RFC.

Reviewed by: Love Hörnquist Åstrand <lha@it.su.se>, ru (build system), des (openssh parts)

# 667d8d10 07-Dec-2005 David E. O'Brien <obrien@FreeBSD.org>

Use cross-compile friendly spelling of CPUTYPE.

Submitted by: ru

# 620b3a0c 07-Dec-2005 Ruslan Ermilov <ru@FreeBSD.org>

Style, no functional changes.

# 21c4855e 07-Dec-2005 David E. O'Brien <obrien@FreeBSD.org>

SSE2 comes thru the users choice of CPUTYPE.

# fef891f7 07-Dec-2005 David E. O'Brien <obrien@FreeBSD.org>

Default to producing 'k8' COMPAT_32BIT bits, but allow override.

# 637750b9 06-Dec-2005 Warner Losh <imp@FreeBSD.org>

Back out my sh -> ${SHELL} change, since it will be a few days before
I can fix it better.

Requested by: ru@

# c26efd48 02-Dec-2005 Doug Ambrisko <ambrisko@FreeBSD.org>

Switch BUILD_ARCH in Makefile to use uname -p suggested by ru.
Switch strncpy to strlcpy suggested by gad and issue found by pjd.
Add to uname(3) man page describing:
UNAME_s
UNAME_r
UNAME_v
UNAME_m
Add to getosreldate(3) man page describing:
OSVERSION

Submitted by: ru, pjd/gad
Reviewed by: ru (man pages)

# d630a05f 01-Dec-2005 Doug Ambrisko <ambrisko@FreeBSD.org>

Add support to easily build FreeBSD unpacked in a chroot of another
FreeBSD machine. To do this add the man 1 uname changes to __xuname.c
so we can override the settings it reports. Add OSVERSION override
to getosreldate. Finally which Makefile.inc1 to use uname -m instead
of sysctl -n hw.machine_arch to get the arch. type.

With these change you can put a complete FreeBSD OS image into a
chroot set:
UNAME_s=FreeBSD
UNAME_r=4.7-RELEASE
UNAME_v="FreeBSD $UNAME_r #1: Fri Jul 22 20:32:52 PDT 2005 fake@fake:/usr/obj/usr/src/sys/FAKE"
UNAME_m=i386
UNAME_p=i386
OSVERSION=470000
on an amd64 or i386 and it just work including building ports and using
pkg_add -r etc. The caveat for this example is that these patches
have to be applied to FreeBSD 4.7 and the uname(1) changes need to
be merged. This also addresses issue with libtool.

This is usefull for when a build machine has been trashed for an
old release and we want to do a build on a new machine that FreeBSD
4.7 won't run on ...

# d53cdc6c 01-Dec-2005 Warner Losh <imp@FreeBSD.org>

In make buildenv, spell sh as ${SHELL}. In this case, we don't want
to hard code /bin/sh since we're forking it for the user to type
commands into. As such, ${SHELL} is the preferred thing users type
commands into.

# 4b2095e8 25-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Revert revision 1.416 and don't create a hierarchy before installing
a kernel. It's slower and is generally only applicable to RELENG_4.

# 1580b6c3 22-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak installworld.

# 0da07b29 21-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Get rid of SPECIAL_INSTALLCHECKS variable that isn't settable
by a user. Instead, add individual checks as dependencies to
the main "installcheck" target. Make sure that installkernel
etc. depend on it (including the UID/GID checks).

# 05359b9b 22-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Fold some common stuff into a macro ${KMAKE}.

# be174d0c 18-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add the NO_INCS knob to bsd.prog.mk and bsd.lib.mk to not include
bsd.incs.mk, and use it when installing 32-bit compat libraries
on amd64. This causes it to *not* overwrite native headers with
i386 versions, which was the case with <fenv.h> and <vgl.h>.

PR: amd64/83806
Prodded by: bde
MFC after: 1 week

# 006846f7 12-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Speed up stale catpages hunting by not running sed(1) for every catpage.

# 0f8bb094 12-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Don't check DESTDIR when making distributeworld; the latter expects
DISTDIR.

Reported by: nyan

# e4a93f1e 10-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add missing shared library interdependencies.

# e576df39 07-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Require DESTDIR to be set when installing for a different architecture.

# 6660f1d7 03-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Serialize access to the info/dir file; needed for parallel installs.

Reported by: scottl

I'm not very fond of using the non-standard lockf(1) here, but I
have no better idea at the moment. NetBSD uses ln(1) to create a
lock file, but this approach can result in a deadlock if make is
interrupted, leaving an orphaned lock file.

# 338953fb 20-Oct-2005 Ruslan Ermilov <ru@FreeBSD.org>

Force an upgrade to Groff 1.19.2.

# 188a72ee 23-Aug-2005 Brian Somers <brian@FreeBSD.org>

Fix a couple of typos

# a332ab6c 20-Aug-2005 Alexander Leidinger <netchild@FreeBSD.org>

Fix the "unexpected operator" bug some people are seeing.

First noticed by: kris

# edd04c6f 07-Aug-2005 Alexander Leidinger <netchild@FreeBSD.org>

Remove cat-pages without corresponding man-pages.

# 8dee0414 05-Aug-2005 Ruslan Ermilov <ru@FreeBSD.org>

- clean ${LIB32TMP} in _worldtmp
- clean ${OBJTREE}/lib32 in _cleanobj
- ensure that ${WORLDTMP} exists in build32

# 467610da 03-Aug-2005 Ruslan Ermilov <ru@FreeBSD.org>

- Remove duplicate setting from LIB32MAKE definition.
- Install lib32 bits using the real install(1) program.

# c8ef0ed5 03-Aug-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make delete-old* and friends useable for cross-builds.

# 1b24254b 30-Jul-2005 Alexander Leidinger <netchild@FreeBSD.org>

- Only make the delete-old related parts visible if one of the 3 targets
are called (wrapped in ".if make(...)"). This may reduce the amount of
memory needed for all other targets (the file lists are already large
and they will grow further).
- Be verbose in the batch case of the delete-old part too.

# 77d2ce5d 30-Jul-2005 Dag-Erling Smørgrav <des@FreeBSD.org>

Enforce the native environment requirement for {check,delete}-old-* at
run time, not parse time. This unbreaks cross-builds.

Pointy hat to: netchild

# af3e19a6 29-Jul-2005 Alexander Leidinger <netchild@FreeBSD.org>

- Move recently added dir into the correct section.
- Add a note about the organisation of the sections.
- Expand shell globs (they worked in a previous version of the delete-old
target, but not in this one).
- Use the correct way of checking for a native environment. [1]
- Add some more obsolete files.
- Fix some bad english. [1]

Suggested by: ru [1]
Approved by: mentor (joerg)

# c9275efa 25-Jul-2005 Dag-Erling Smørgrav <des@FreeBSD.org>

Disable thread support in BIND. It appears to reduce performance rather
than increase it, and seems to be the cause of the memory leaks which some
users have reported.

Requested by: dougb
MFC after: 5 days

# e2a36081 23-Jul-2005 Alexander Leidinger <netchild@FreeBSD.org>

Add delete-old and delete-old-libs targets:
- removes obsolete files/dirs or libraries.
- works in interactive (default) and batch mode
- respects DISTDIR
- documented in UPDATING and build(7)

The head of the file ObsoleteFiles.inc contains instructions how to add
obsolete files/dirs/libs to the list. Obviously one should add obsolete
files to this list, when he removes a file/dir/lib from the basesystem.

Additionally add check-old target:
- allows re@ to check if a file on the obsolete list resurfaces

Design goals:
- allows full control by the user (default interactive mode)
- possibility of scripted removal of obsolete files (batch mode)
- opt-in removal of files (explicit list of files)
- seperate removal of libs (2 delete targets)

Important design decissions:
- structured list of files to remove instead of a plain text file:
* allows to remove additional files if a NO_foo knob is specified
without the need to change the targets (no NO_foo knob is respected
yet)
- not using mtree like NetBSD does:
* mtree doesn't has an interactive mode

Discussed on: arch (long ago), current (this year)
Additional input from: re (hrs)
Approved by: mentor (joerg)

# a59f6433 15-Jul-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make the `distrib-dirs' target official and working properly
when cross-building (installing). (This is useful for NFS
installing world/kernel to another architecture machine.)

# 2b9fc5e6 06-Jul-2005 Alexander Kabaev <kan@FreeBSD.org>

Exclude build32 target from the list of toolchain and kernel-toolchain
dependencies. We do not need to build 32bit compat tools to compile
a kernel.

Approved by: re (scottl)
Reported by: jhb

# ece6831d 16-Jun-2005 Ruslan Ermilov <ru@FreeBSD.org>

Provide 32-bit runtime support on amd64 as a separate distribution, lib32.

Prodded by: obrien
Nodded by: peter
Approved by: re

# cb1e3c19 06-Jun-2005 Ruslan Ermilov <ru@FreeBSD.org>

Allow to override the compiler, linker, and assembler used to build 32-bit
shim libraries on amd64.

# c0913e73 30-May-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add install-info to the list of install tools now that we don't
always bootstrap texinfo.

Reported by: scottl

# 49bf419d 23-May-2005 Ruslan Ermilov <ru@FreeBSD.org>

Stop redundantly rebuilding texinfo on the next __FreeBSD_version bump.

# 7d23fba2 01-May-2005 Warner Losh <imp@FreeBSD.org>

Remove lame and ineffectual attempt to fix ipf breakage of tenderbox.

# a4f4bae7 30-Apr-2005 Warner Losh <imp@FreeBSD.org>

Add some subversive code to cleandir: remove the sbin/ipf tree
entirely to fix the tinderbox machine. This change will be reverted
once the tinderboxen are tindering again.

# 39d2cd6f 05-Apr-2005 Peter Wemm <peter@FreeBSD.org>

Merge from RELENG_5: invert WITH_LIB32 into NO_LIB32 so that we build the
32 bit libraries by default. Define NO_LIB32 in make.conf if you do not
want this.

# 6459b7da 05-Apr-2005 Peter Wemm <peter@FreeBSD.org>

Fix the lib32 build for amd64 after v1.238 of src/include/Makefile (imp).
That change exposed the fact that I'd forgotten to set $MACHINE here.

# 6eb46c30 27-Mar-2005 Ruslan Ermilov <ru@FreeBSD.org>

Fix AMD64 cross-builds when WITH_LIB32 is defined.

(Initially spotted by kris@ on RELENG_5.)

# 9d11d2b6 22-Mar-2005 Ruslan Ermilov <ru@FreeBSD.org>

Protect against DESTDIR being set during the build of build32.

Reported by: pav

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

# 0c5397aa 28-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap pwd_mkdb(8) and use its new feature during "make distribute".

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

# 6067dba1 28-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak buildworld.

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

Make the format of LC_COLLATE files architecture independent.

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

Bootstrap gencat(1).

OK'ed by: phantom

# 9bdd3e84 26-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Added the convenience "distribution" target which calls the
target of the same name from src/etc/Makefile with a proper
environment, suitable to be used during upgrades and cross-
builds.

# 88e7c7a4 27-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make it clear we no longer support source upgrades from
versions prior to 5.3.

# 552b98b9 27-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add missing continuation.

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

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

Inspired by: obrien

# 20bfae84 26-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Added the "buildenv" target, for developers only!

CAVEAT: if you run tcsh(1) from within this target, this will
reset your PATH making this target mostly useless. Careful!

Submitted by: jmg, ru

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

# 6fe37d13 22-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add endianness support to cap_mkdb(1), useful for cross builds.

# eac161ef 19-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add lorder(1) to the list of bootstrap-tools.

# fb64060c 19-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Allow to cross-build amd64 on non-i386.

# 951e4d1c 20-Jan-2005 Ruslan Ermilov <ru@FreeBSD.org>

In crunchgen(1), when calling make(1), don't redirect stderr to stdout,
just rely on the exit status to detect an error. This makes crunchgen(1)
safe to use with certain make(1) debugging flags.

MFC after: 1 week

# 4e6242df 29-Dec-2004 David E. O'Brien <obrien@FreeBSD.org>

Remove the special sparc64 time_t support.
If someone isn't running with a 64-bit time_t by now, they don't
track -CURRENT and would probably go to RELENG_5 vs. 6-CURRENT.

# 0f399181 22-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

Further fix the case mentioned in rev. 1.302. The
intent was (and still is) that if a user has say
CPUTYPE=i686 set in /etc/make.conf, we don't print
the assignment type warning unless TARGET_CPUTYPE
is overridden.

Unfortunately, the implementation was buggy, and
only recent changes to bsd.cpu.mk that swapped
canonical and alias values of some CPU types made
the bug apparent.

Here's what happens here.

- CPUTYPE=i686 is set in /etc/make.conf,
- bsd.cpu.mk reset it to "pentiumpro",
- Makefile.inc1 compares this canonical value
with the result of the following test,

make -f /dev/null CPUTYPE=pentiumpro -V CPUTYPE

and expects the result to be "pentiumpro" too,
but "i686" is returned, here's why. We have two
CPUTYPE variables, global, set to "i686" in
/etc/make.conf, and command-line (of a higher
precedence), set to "pentiumpro".

The following part of bsd.cpu.mk,

. elif ${CPUTYPE} == "i686"
CPUTYPE = pentiumpro

which is responsible for converting aliases to
canonical values, sees the value of the CPUTYPE
command-line variable first, "pentiumpro", and
no conversion is done -- the net effect is that
CPUTYPE global stays with its old value "i686",
and "make -V CPUTYPE" (which prints variables
in the global context) returns "i686".

The fix was to pass the CPUTYPE in the test above
as an environment variable instead of as a command
line variable, i.e.,

CPUTYPE=pentiumpro make -f /dev/null -V CPUTYPE

This time, CPUTYPE global is still set to "i686"
initially (by /etc/make.conf), and an envieronment
variable CPUTYPE (of a lower precedence) is set
to "pentiumpro". The .elif sees it's set to
"i686" and resets it to "pentiumpro", and so
"make -V" returns "pentiumpro".

NB: these various types of make(1) variables can
be very painful, especially when combined with
"make -V".

# 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

# 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

# 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

# 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

# 3a35b5b9 17-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

Minor tweaks in "make update" comments.

# 0228d5b6 01-Dec-2004 Peter Wemm <peter@FreeBSD.org>

Do not leave build droppings in /usr/src for usr.sbin/pcvt/keycap and
usr.bin/lex/lib for the 32 bit libraries on amd64. Add an explicit
obj for these two directories that are built in for the "libraries" target.

# d938e8d6 23-Nov-2004 Ruslan Ermilov <ru@FreeBSD.org>

Hopefully fix the "aicasm" build-tool issue when using ${KERNSRCDIR}
different from ${.CURDIR}.

Reported by: jhb

# 63d76a5f 20-Nov-2004 Peter Wemm <peter@FreeBSD.org>

In the amd64 hybrid libraries case, move the kerberos5 tools to before
building the kerberos5 includes. This is not the same patch that
Bjoern A. Zeeb came up with, but the credit still goes to him for finding
the problem. Thanks!

# 9291686f 14-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Oops, all my test boxes have NO_KERBEROS set, so I didn't hit the kerberos5
build tools problem. I'd missed the kerberos5/tools stuff entirely. Add
the missing bits.

# 6c58990d 13-Nov-2004 Bjoern A. Zeeb <bz@FreeBSD.org>

Add knob NO_NIS (fka NO_YP_LIBC) and make world compileable when set.
If turned on no NIS support and related programs will be built.

Lost parts rediscovered by: Danny Braniss <danny at cs.huji.ac.il>
PR: bin/68303
No objections: des, gshapiro, nectar
Reviewed by: ru
Approved by: rwatson (mentor)
MFC after: 2 weeks

# 0931d0a9 12-Nov-2004 Ruslan Ermilov <ru@FreeBSD.org>

Show stray files during "cvs update".

# f9faa1eb 10-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Ruslan told me I should have quoted the arch strings when comparing to
MACHINE_ARCH. Belatedly get around to doing it.

# fae9d999 10-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Change WANT_LIB32 to WITH_LIB32. Sorry for the whiplash folks.
It was pointed out to me that the convention we have is to use WITH_
elsewhere in the system, eg: ports etc. This is all temporary anyway
and presumably will be inverted to a NO_LIB32 or something like it in
the future.

# 1d9468ee 05-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Convert tools/lib32/build.sh into world connectable hooks. This still
rates pretty high on the "hack!" scale, but it works for me. Adding
-DWANT_LIB32 to the world build command line, or 'WANT_LIB32=yes' to
/etc/make.conf will include the 32 bit libraries with the build.

I have not made this default behavior. Cross compiling this stuff is an
adventure I have not investigated.

This is still a WIP. We needed this at work so that we could install from
a readonly obj tree - lib32/build.sh wasn't up to that.

# a35d8893 24-Oct-2004 Ruslan Ermilov <ru@FreeBSD.org>

For variables that are only checked with defined(), don't provide
any fake value.

# c5ebbe8f 11-Oct-2004 Peter Wemm <peter@FreeBSD.org>

Catch another gcc-3.3 c++ include path reference and update it to 3.4.

# 2a614447 27-Sep-2004 Doug Barton <dougb@FreeBSD.org>

1. Add much finer granularity to the NO_BIND knobs with the addition of:
NO_BIND_DNSSEC, NO_BIND_ETC, NO_BIND_NAMED, and NO_BIND_UTILS.

2. Make creation of directories in /usr/include that are only needed
in the WITH_BIND_LIBS case conditional.

Reviewed by: ru, des

# e19f6f27 21-Sep-2004 Ruslan Ermilov <ru@FreeBSD.org>

Hopefully fix alpha and sparc64 builds: on these architectures,
libpthread is provided by src/lib/libc_r.

Also, removed lib/bind from _generic_libs, "lib" will suffice.
Also, removed redundant lib/bind dependency on lib/libpthread
(as lib/bind is not in the _prebuild_libs, it's not needed).

Prodded by: trhodes@ reporting that des@ is on the flight

# cd3ee173 21-Sep-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

Switch from BIND 8 to BIND 9.

Submitted by: (in part) dougb@, trhodes@
Reviewed by: dougb@, trhodes@, re@
MFC after: 5 days

# d0beb853 07-Sep-2004 Warner Losh <imp@FreeBSD.org>

Although 'Unanimous Consent' appears to be a well defined and used in
the US Senate, Canadian Parliament and Australian Senate, it was
causing some confusion. After some consultation with Mark Murray,
change this to 'without objection' since often times a plain-speaking
term is preferable to a regionally used term.

Also, clarify that this procedure is to be used when for more mundane
matters that need a sanity check, but don't need the whole, ponderous
voting proceedure that more difficult issues require. Core members
that read email in any given 48 hour period are trusted enough to know
the difference and to provide the sanity check as necessary.

Reviewed by: markm

# db68d2a6 26-Aug-2004 Paul Richards <paul@FreeBSD.org>

Backout the CVSTAG variable, it could potentially be dangerous if
you track multiple releases in different trees.

Leave the CVSOPTIONS variable there since it could be useful.

# e5d264a3 25-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

Fix "make world DESTDIR=/mnt" to work again. A recent change
to make(1) that causes command-line variables to be passed as
command-line variables to sub-processes that make(1) executes
broke it. By changing the type of all DESTDIR variables used
internally in Makefile.inc1, from environment to command-line
variables of the highest priority, I was able to "make world"
with success, with the command-line variable DESTDIR set.

# e8826115 24-Aug-2004 Paul Richards <paul@FreeBSD.org>

Add a CVSTAG makefile variable that can be set in /etc/make.conf that
determines which CVS tag to track when running make update. This makes
it easier to configure a box to track a particular release if it does
automated updates from a cvs repository.

# 7c996c4a 18-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

A fix from rev. 1.52 of gnu/usr.bin/cc/cc_tools/Makefile was lost
in rev. 1.57. Fix this regression by making cc_tools a new-style
build-tool in Makefile.inc1. For details of what has been fixed,
please see the gnu/usr.bin/cc/cc_tools/Makefile,v 1.52 commit log.

Caught this by accidentally touching param.h while in the process
of cross-buildworld for amd64.

# 0ec443a0 18-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

Moved the MAKEOBJDIRPREFIX check from Makefile.inc1 to Makefile,
to suppress warnings with installworld and distributeworld when
env(1) cannot be found in the PATH.

# bf90c6ee 16-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

sys/boot seems to compile fine on Alpha; unbreak ``make release''.

Prodded by: re-alpha (wilko)

# 88e29990 11-Aug-2004 Hartmut Brandt <harti@FreeBSD.org>

Ensure that a new gensnmptree is built. This should fix the problems
with the snmp_atm module.

# 72e3b039 11-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

Enforce the check that MAKEOBJDIRPREFIX (if set) is set in environment
only, and not as a global (in /etc/make.conf) or command-line variable.

MAKEOBJDIRPREFIX has never been a global or command-line variable, and
the fact that it works in some scenarios for "make buildworld" doesn't
make it any more correct. Using it as a global or command-line variable
is error prone, discouraged, costs us lot of false build reports, etc.

This commit is aimed to fix it once and for all.

Anyone potentially objecting to this change is encouraged to read the
make(1) and make.conf(5) manpages, and the comments regarding the use
of the MAKEOBJDIRPREFIX variable in /usr/share/mk/bsd.obj.mk and
/usr/share/examples/etc/make.conf.

# de5b5e45 10-Aug-2004 Hartmut Brandt <harti@FreeBSD.org>

Fix recent breakage in rescue. We need to build a new crunchgen
that will not emit the bad MAKE=make line that caused the breakage.

Submitted by: ru

# 088cf0fb 09-Aug-2004 Hartmut Brandt <harti@FreeBSD.org>

Make make recurse into sub-directories and sub-makes when given
two -n flags. If only one -n flag is given the old behaviour
is retained (POLA). In order to make this working for installworld
change the IMAKEENV in this case so that the tools are found
(we have no temporary installation environment in this case).

Submitted by: ru (IMAKEENV part)

# e62200e7 09-Aug-2004 David E. O'Brien <obrien@FreeBSD.org>

The file(1) related build-tool moved to libmagic.

# 81efba8c 27-Jul-2004 Alexander Kabaev <kan@FreeBSD.org>

Bmake glue for GCC 3.4.2-prerelease.

# be628d28 08-Jul-2004 Hartmut Brandt <harti@FreeBSD.org>

Get rid of the THISHOST variable when building on sparc64. The problem
with it is that it is set by calling hostname and hostname isn't normally
in the path at that point.

# 2c67a07f 17-Jun-2004 David E. O'Brien <obrien@FreeBSD.org>

Third time's a charm?? (the logic was reversed from desired)
Time for sleep...

Submitted by: ru

# 6e009069 16-Jun-2004 David E. O'Brien <obrien@FreeBSD.org>

Grrr, use the userland spelling not the kernel tree spelling.

# f1e3e1c7 16-Jun-2004 David E. O'Brien <obrien@FreeBSD.org>

Fall out from Binutils 2.15: disable building the Alpha loader.

# b4c3fa62 17-May-2004 Ruslan Ermilov <ru@FreeBSD.org>

Allow buildworld and friends to complete when make(1) is called
with some debug flags (-d).

Noticed by: Gleb Smirnoff

# 11167919 13-May-2004 Ruslan Ermilov <ru@FreeBSD.org>

Record the libssl.so dependency on libcrypto.so. This should
help some ports that depend on libradius that recently gained
the dependency on libssl. This is also how the stock OpenSSL
build would link libssl.so on FreeBSD.

Prompted by: kris
OK'ed by: markm, nectar

# 466b960f 12-May-2004 Ruslan Ermilov <ru@FreeBSD.org>

Catch up with the current output of tools/make_libdeps.sh:

- Removed the stale dependency of libypclnt on librpcsvc.
- Fixed the dependency graph of libssh.

# b4b831ef 27-Apr-2004 Ruslan Ermilov <ru@FreeBSD.org>

- Added rad_demangle() for demangling user-passwords (needed for
MS-CHAPv1 MPPE-keys).
- Added rad_demangle_mppe_key() for demangling mppe-keys (needed
for MPPE-keys).
- Added some typecasts for avoiding compiler warnings.
- Fix: better handle wrong usage of the lib (if the programmer
has not called rad_create_request() but rad_put_*(), then a
weird error message was returned).
- Added a new function for putting the Message-Authenticator.
- Verify the Message-Authenticator, if it was found inside a
response packet and silently drop the packet, if the validation
failed.
- Implicitly put the Message-Authenticator, if the EAP-Message
attribute was added.
- Added some missing defines.

Submitted by: Michael Bretterklieber
PR: 46555

# 9de3b350 14-Apr-2004 Hartmut Brandt <harti@FreeBSD.org>

Move the SNMP MIBs and tree definitions from /usr/share/bsnmp to
/usr/share/snmp. This mirrors the use of /usr/local/share/snmp and
makes also more sense when non-bsnmp-specific MIBs go in.

# 43fc6762 13-Apr-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

Add a kernel-toolchain target which only builds the bits required to build
a kernel. This is essentially the same as the toolchain target, except
that it does not build headers and libraries.

Submitted by: ru

# 839274c7 24-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Added the `toolchain' top-level target, which builds enough of
buildworld, up to and including libraries, except for actually
building the world.

Requested by: many

# e5b369af 19-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Removed 3x2 dots I don't like. ;)

# 0aacff4d 19-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Create /usr/sbin in ${WORLDTMP}. I've accidentally removed it in
revision 1.343, but it's needed for btxld(8), and this fix (along
with the --enable-64-bit-bfd configured BFD on i386) allows other
architectures to successfully cross-build the i386 world.

Tested on: alpha

# ba3ae554 18-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Comment various stages of buildkernel, symmetrical to buildworld.

# 125499e5 14-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Don't scare non-root users attempting to build world.

# 2f00651d 13-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Create hierarchy before installing a new kernel. This is needed
because we require that a new kernel be installed prior to a new
world, and we may need some new directories to succeed.

Once MFCed, this will also help those poor souls who redundantly
``mv /modules /modules.old'' in RELENG_4 before an installkernel.

Requested by: many
MFC after: 3 days

# e436e60b 12-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Hide internal implementation details of UID/GID checks from the user.

# 2ff05f90 12-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Use find(1) instead of ``pw groupshow'' to detect missing groups.
Restore checks for recently added PF groups.

Reviewed by: mlaier

# 7698f25a 11-Mar-2004 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

Use 'pw groupshow' instead of 'id -g' to see if a group exists.

PR: 64073
Submitted by: jhb
MFC after: 5 days

# e12b910d 10-Mar-2004 Max Laier <mlaier@FreeBSD.org>

Back out id -g checks as they are wrong (sendmail group untouched).

Requested by: dwhite
Approve by: dwhite

# 0ab11e65 10-Mar-2004 Max Laier <mlaier@FreeBSD.org>

Add installcheck for proxy:proxy and authpf.

Suggested by: ru
Approved by: bms(mentor)

# 171ae50e 05-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Reword two more lines to avoid wrapping.

# b7d44576 04-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Minor stylistic improvements in the SPECIAL_INSTALLCHECKS section, mainly
to reduce the number of wrapped lines.

Suggested by: bde

# 9565bbf3 04-Mar-2004 Bruce Evans <bde@FreeBSD.org>

Improved the description of the installkernel targets.

Don't hide what we do to force failures for the installkernel targets
or other targets.

# afc6f086 03-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Commit the first set of files for changing time_t on freebsd/sparc64
from a 32-bit value to a 64-bit value. This commit does not actually
change anything. It merely provides instructions, scripts, and a safety
measure in Makefile.inc1 for people who want to make the change.

The real change to 64-bit time_t's on sparc64 is scheduled to happen
on March 10th, assuming that so major problems are found between now
and then by early-adopters.

Reviewed by: freebsd-sparc64

# 1e405604 13-Feb-2004 Ruslan Ermilov <ru@FreeBSD.org>

Drop directory existence checks.

OK'ed by: bde

# 11bf3600 31-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

Overhaul of kerberos5/ makefiles. Most significant changes are:

- Dropped support for standalone builds, this was only partially
supported anyway, and required so much magic in makefiles that
made life dangerous (e.g., by using the custom yacc rules).

- Got rid of .OBJDIR in makefiles -- makes building of individual
files possible again.

- Made the .x.c transformations -j safe.

- Reprogrammed LDADD to fix static build of some utilities that
was broken.

- Fixed LDFLAGS and DPADD in the WITH_OPENLDAP case -- positively
affects the contents of .depend files.

- Removed redundant .h's from SRCS, only kept those that are
generated.

- libkrb5/ INCS were bogusly installed again with libgssapi/.

- Made build-tools real tools with their own makefiles in
separate directories. This allows us to properly track
their dependencies, etc.

- Faster build, 21% less of makefile code!

Approved by: nectar
Reviewed by: markm
Silence on: arch

# b6a6dd18 23-Jan-2004 Hartmut Brandt <harti@FreeBSD.org>

Create the OID and tree files while building the modules and the daemon
instead of creating them by hand and storing them in the CVS tree. Add
gensnmptree to the bootstrap tools (it is used to generated these files).
This simplifies the update procedure.

Submitted by: ru

# bbe8270c 22-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

- Run makewhatis(1) in etc/Makefile at the end of "install".
- Removed redundant and undocumented NO_MAKEDB_RUN knob.

# 5151e722 16-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

Create ${WORLDTMP}/legacy/usr/include/c++/3.3 for usr.bin/lex.

# 33b53e37 16-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

lex(1) prior to flex.skl,v 1.8 and gen.c,v 1.7 requires bootstrapping.

Prodded by: nectar

# 897ca6eb 15-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

Alongside revision 1.382, don't build profiled libraries so early
in the build -- it's OK to keep this for the "make all" phase.

# 5091e3df 08-Dec-2003 Garance A Drosehn <gad@FreeBSD.org>

Fix a problem where 'make installworld' will fail and leave the
system in a messy state *if* the user is upgrading from a system
which has no /libexec to a system which builds a DYNAMICROOT, and
if that user has set DISTDIR (as documented for ports, but it turns
out that the same variable name is used for a completely unrelated
purpose in 'make release').

There are other possible fixes for this issue, and ru@ may later
decide to commit one of those fixes. I just wanted some fix in
ASAP, and this is the fix that I have tested.

Reviewed by: bde, imp, and ru

# 5257abea 16-Nov-2003 Gordon Tetlow <gordon@FreeBSD.org>

Invert the condition that installs the dynamic linker early, since
DYNAMICROOT is now the default. Also document -DNO_DYNAMICROOT since
that is going to be a documented feature.

Submitted by: matusita, rushani

# 360b288f 12-Nov-2003 Hartmut Brandt <harti@FreeBSD.org>

The snmp_netgraph module depends on libnetgraph. So add a dependency and
add libnetgraph to the list of prebuilt libraries in the main Makefile.

Reviewed by: ru

# cd7b6c1e 10-Nov-2003 Hartmut Brandt <harti@FreeBSD.org>

Make two directories under usr/share/bsnmp that are needed during
library build to install tree definition files and MIBS.

Okay'ed by: ru

# c54d7e02 03-Nov-2003 Ruslan Ermilov <ru@FreeBSD.org>

Don't be so chatty about building includes.

# 829340b1 04-Oct-2003 Ruslan Ermilov <ru@FreeBSD.org>

Retired the "most" and "installmost" targets -- they just
do not have a chance to work nowadays as we have a lot of
internal libraries in lib/.

Discussed with: marcel, wollman

# 9ed60552 15-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

Help those attempting to upgrade from static to dynamic root.

# 3d0d5c76 15-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

Catch up with libpthread/support/Makefile.inc,v 1.6 and revert
Makefile.inc1 revisions 1.365 and 1.367: libc_pic.a is no longer
necessary to build libpthread.so (ie: libkse.so).

# be01c222 07-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

- No need to create libfoo.so -> libfoo.so.X symlinks in /lib,
as it was decided that our toolchain will revert to looking
for libraries in /usr/lib only.

- Make /usr/lib/libfoo.so -> /lib/libfoo.so.X symlinks absolute
so that they still work if /usr is symlinked.

- Remove stale /usr/lib/libfoo.so.X libraries during install.

Discussed with: gordon, obrien, peter

# d61a976b 01-Sep-2003 Scott Long <scottl@FreeBSD.org>

Clarify the numbering of some of the build stages.

# e95130d9 30-Aug-2003 Ruslan Ermilov <ru@FreeBSD.org>

Revert rev. 1.378, and restore the correct arithmetic expression
syntax. The

make buildworld
mv /usr/include /usr/include.old
make installworld

issue has been fixed a month ago in Makefile,v 1.285, and there
is no valid reason to continue to keep the wrong syntax here --
buildworld takes care of upgrading a make for you if necessary.
But if you find yourself in an environment with an old make(1)
binary that breaks on this, and this is because you attempted
to run a target other than buildworld, don't whine but try again
with -DALWAYS_CHECK_MAKE defined -- it should do the trick.
Otherwise, if you still have a problem, please report it as a
bug and attach the ``make -dl ...'' output.

Reviewed by: marcel

# bb66285c 28-Aug-2003 Marcel Moolenaar <marcel@FreeBSD.org>

Remove the AFM (Anti-Footshooting Measure) added when we split the
5.x signal code from the 4.x signal code. The split happened in
Oct 2002 and we have had 2 releases since then. A kernel older than
5.0-R cannot reasonably be called a -current kernel anymore.

This does not break upgrading from an 10 month older kernel. It just
makes it more exiting.

# c3754771 26-Aug-2003 Warner Losh <imp@FreeBSD.org>

OSRELDATE should fallback to 'unknown' rather than the kernel that's
booted on this machine. This is a slightly better default to use.

Requested by: ru

# e4df6a7d 25-Aug-2003 Warner Losh <imp@FreeBSD.org>

Add @ before the shell invocation for the testing of sufficiently new sh.
No need to see this message twice.

# b21d83f1 25-Aug-2003 Warner Losh <imp@FreeBSD.org>

Fall back to using the kernel version for the OSRELDATE when
/usr/include/osreldate.h doesn't exist on the system. While this
could be worked around by saying something like 'make includes
OSLRELDATE=0' when this file doesn't exist, it is just as easy to
provide a fallback when the file we know we depend on doesn't exist.
While this doesn't make all targets work w/o a
/usr/include/osreldate.h, because some of the FreeBSD bootstrap tools
use this file. 'make includes' however does work.

Noticed by: peter, obrien (and likely others)
Pointy hat to: imp (for suggesting a method that depended on /usr/include)

# 0b0c9474 17-Aug-2003 Gordon Tetlow <gordon@FreeBSD.org>

In preparation for libraries being installed in /lib, add lib to the
list of build directories during the tool creation phase of the build.

# 234f7acb 24-Jul-2003 Mark Murray <markm@FreeBSD.org>

Don't lint(1) so early in the build. Its OK to keep this for the
"make all" phase.

# 234a6529 14-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Apparently we prefer underscores in new options. Sorry for the churn folks.

Requested by: obrien

# a20c015c 11-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Forgot that the rescue subdir needs to be a conditional for the
build-tools bit.

# 4d938af0 11-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Turn rescue back on, conditional to NORESCUE. We seem to be split on
using underscores or not, so I just randomly picked a style. I think
I have the logic correct, but if someone wants to give it a once over
that would be good.

Tim submitted a patch to fix the cross-building issues which I tested
with a tinderbox run for sparc64.

Submitted by: Tim Kientzle <kientzle@acm.org>

# dda36143 09-Jul-2003 Kris Kennaway <kris@FreeBSD.org>

Correct makefile syntax error in r1.375.

# 67599f45 07-Jul-2003 David E. O'Brien <obrien@FreeBSD.org>

Style nit.

# d0c749d3 06-Jul-2003 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

Use 'id' instead of 'grep' to detect the presence of the smmsp user/group.
This fixes the check for users with smmsp in NIS instead of their local
files.

Suggested by: peter
MFC after: 5 days

# 5dc63117 04-Jul-2003 Ruslan Ermilov <ru@FreeBSD.org>

Fixed style bugs related to parentheses in Makefile.inc1.

Submitted by: bde

Fixed nearby bug: propagate the root Makefile's idea of
the appropriate "make" binary down to release/Makefile.

# 18ecbedd 02-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

More NO_RESCUE to RESCUE transitions.

Submitted by: ru

# e9693da9 01-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Switch the logic on the /rescue bits from NO_RESCUE to RESCUE, at least
until there is a fix for cross building available.

# 3cc95654 30-Jun-2003 Ruslan Ermilov <ru@FreeBSD.org>

Put rescue/ into a correct slot in the SUBDIR list. Sort bootstrap-,
build-, and cross-tools lists, reformat lists for easier maintenance.

Submitted by: bde, ru

# a3d6b3e7 30-Jun-2003 Ruslan Ermilov <ru@FreeBSD.org>

Only bootstrap crunchide(1) and build crunchgen(1) when necessary.
The latter needs to be built either if it's used as a cross-tool
(${TARGET_ARCH} != ${MACHINE_ARCH}) or if it has backward compat
issues, like e.g. lack of the AMD64 support.

# 4e650399 29-Jun-2003 Gordon Tetlow <gordon@FreeBSD.org>

Do the deed and hookup /rescue to the build. As a result, always build
crunchgen and crunchide as cross-tools.

Submitted by: Tim Kientzle <kientzle@acm.org>

# e3724050 27-Jun-2003 Sean Kelly <smkelly@FreeBSD.org>

- Fix a typo.

PR: bin/53864
Submitted by: Lukas Ertl <l.ertl@univie.ac.at>
Approved by: jeff (mentor)

# 0147d2aa 22-Jun-2003 Hidetoshi Shimokawa <simokawa@FreeBSD.org>

Allow installkernel.debug and reinstallkernel.debug.

# c4529532 14-Jun-2003 Warner Losh <imp@FreeBSD.org>

Minor tweaks to the build process so that we can build 5.1-current on
4.8-stable:

Must build lib/libc before libpthread. Fix how we do this to be more
consistant with how lists are handled in the file. Also, don't bother
to prebuild libc if we're not building libpthread.

Submitted by: ru@
Reviewed by: bde@ (before ru@ submitted it)

# f212249a 14-Jun-2003 Dag-Erling Smørgrav <des@FreeBSD.org>

Do not bogusly set CSTD to the empty string.

# 21e24af3 07-Jun-2003 Warner Losh <imp@FreeBSD.org>

Add lib/libc to list of _prebuild_libs because we need the target
built libc_pic.a for libkse.

# This should finally fix the build on 4.x

Submitted by: kan

# 59d855a0 07-Jun-2003 Warner Losh <imp@FreeBSD.org>

When boot strapping from older systems, don't specify a C standard in
the bootstrap process. This allows one to more completely build from
a -stable box.

Reviewed by: ru@ (briefly)

# 652b5a75 31-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Wrap gperf & groff wth NO_CXX.

# a0218a2a 21-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak world build if NO_OPENSSL is defined but NO_KERBEROS is not.

Submitted by: Marius Strobl <marius@alchemy.franken.de>
Approved by: re (jhb)

# 7691f66a 19-May-2003 Dag-Erling Smørgrav <des@FreeBSD.org>

Retire the useless NOSECURE knob.

Approved by: re (scottl)

# 8ec00e70 18-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak parallel make of _includes after revision 1.356 changes.

Spotted by: bde
Approved by: re (scottl)

# 5d296100 17-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

-lbsdxml lives in lib/libexpat. *Blush*

Submitted by: tmm (Makefile.inc1)

# 81d5f438 17-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak world: record libgeom dependency on libbsdxml here too.

Forgotten by: ru
Submitted by: des
Verified by: tools/make_libdeps.sh
Approved by: re (scottl) (related change)

# 50da533c 15-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Use the installed world's idea of OSRELDATE rather than the kernel.
This was the initial intent anyway, and it became clear that it is
really necessary to treat it this way, as many people happen to run
with kernel newer than the installed world.

Submitted by: imp, ru
Approved by: re (scottl)

# a270eca5 04-May-2003 Bruce Evans <bde@FreeBSD.org>

Install symlinks to individual headers instead of symlinks to directories
in the SHARED=symlinks case. Symlinks to directories only work if all the
the necessary headers are in 1 directory, but the necessary headers are
scattered for at least ipfilter headers in <netinet>. This change also
avoids polluting /usr/include with non-headers; the /usr/include hierarchy
is now independent of the setting of SHARED.

Submitted by: ru (edited to fix netgraph/bluetooth/include and machine/pc)
PR: 44148

# 4ee05d29 05-May-2003 Mark Murray <markm@FreeBSD.org>

Negate the logic of MAKE_KERBEROS5, and replace it with NO_KERBEROS.

# 22bd4d16 03-May-2003 Warner Losh <imp@FreeBSD.org>

Many developers run with userland != to kernel. While this isn't
supported, it usually works for months at a time. Allow these people
to override the OSRELDATE of their installed world when things don't
match and the exact OSRELDATE matters and is different than the
kernel. Now that Makefile.inc1 depends more and more about which date
you have to optimize the pieces it builds, it may be necessary to
pessimize things if its guesses are wrong.

If OSRELDATE is already set, we won't fork the sysctl to find out what
the kernel's date is.

Developers on IRC suggested that they run mismatches all the time as
well.

Reviewed by: obrien

# dd2aac02 01-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

For the time being, upgrade the whole Groff (to version 1.19),
but stop doing so again on the next __FreeBSD_version bump.

# 01b63a10 29-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Restore the ordering of NO's and remove one redundant NOLINT.

Reviewed by: markm

# 945e0cea 30-Apr-2003 Mark Murray <markm@FreeBSD.org>

Fix "make world" for the WANT_LINT case. The various build tools
must not try to lint(1) stuff at *-tools time; keep the linting
for the actual build (which comes later).

# 007bf12e 30-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Groff after 2002/10/15 has no known backward compatibility issues,
but we always want the latest macro files.

# 69e74195 16-Apr-2003 John Baldwin <jhb@FreeBSD.org>

Rename KRNLSRCDIR to KERNSRCDIR and allow it to be overridden. The name
change was to be consistent with other overridable variables such as
KERNCONFDIR and KERNCONF.

# c2400c8e 14-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

kbdcontrol.c rev. 1.35 and onwards support the KEYMAP_PATH
environment variable, and don't need to be bootstrapped.

# 692ebfe9 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

yacc(1) with skeleton.c rev. 1.29 in HEAD and rev. 1.28.2.1 in RELENG_4,
and onwards, are believed to not require bootstrapping.

# da54b929 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

xargs.c rev. 1.10 in HEAD and rev. 1.9.2.1 in RELENG_4,
and onwards, have support for the -J option we need.

# 47c95a33 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

elf2aout.c,v 1.6 and onwards have no known backward compatibility issues.

# 710b5ef8 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

uudecode.c rev. 1.23 in HEAD and rev. 1.13.2.3 in RELENG_4,
and onwards, have no known backwards compatibility issues.

# 7a9bf940 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Only create directories that are really needed.

# ad1520bd 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Install bootstrap-tools into a separate subtree of ${WORLDTMP}.
This allows us to use them as early as possible while building
bootstrap-, build-, and cross-tools. Some cleanups to follow.

This change resolves the gperf(1) bootstrapping issue (missing
-E option) in gnu/usr.bin/cc/cc1plus while in the cross-tools
stage when upgrading from 4.0-RELEASE.

# cb66f4dd 12-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Make sure legacy stuff comes last. Some tools that use
legacy stuff (binutils) depend on this order.

For this to work, provide (and use) specialized versions
of bsd.prog.mk and bsd.lib.mk that include the standard
versions first, then augment CFLAGS, DPADD, LDADD, and
LDFLAGS as necessary, with the legacy stuff.

Tested on: 4.0-RELEASE

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

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

# c0006b49 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Put back the undocumented change from rev. 1.334 too: no
need to create ${WORLDTMP}/legacy/usr/include explicitly.

# 5675749e 06-Apr-2003 Warner Losh <imp@FreeBSD.org>

Put back parts of 1.335 and 1.336 that 1.337 accidentally backed out.

Submitted by: ru

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

# 5ceb21ff 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Always remove ${WORLDTMP}/build/usr/include, even in the NOCLEAN
case. This way, we won't have stale compatibility headers there.

# cfc236e8 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Moved libbuild target to where it belongs. Added a comment.

# 32054bbb 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Fixed buildworld stages names in comments.

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

We can't use ${WORLDTMP}/usr/{include,lib} for the compat layer. This
is because we populate these directories later, and a subsequent
-DNOCLEAN build may fail. So, we put them in
${WORLDTMP}/build/usr/{include,lib} instead and adjust Makefile.boot.

Again, this works on -stable and -current, but might break older
versions.

Submitted by: ru@

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

# 756ec6a4 04-Apr-2003 Warner Losh <imp@FreeBSD.org>

Diff reduction with my p4 changes:

Add @ before ${ECHODIR} where appropriate because we don't need to echo
the echo command... This gets rid of extra echo ===> in log files...

# cdcdfd87 01-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Parallelize (on the top-level SUBDIR list) the "all" stage of
buildworld. This gives 5-11% percent gain in real buildworld
times on various UP and SMP systems here. I used 4 * hw.ncpu
as an argument to "make -j" in my tests.

# b9040d98 01-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Pass NO_WARNS to the build-tool stage too; -Wsystem-headers
isn't known to the 4.x system compiler.

# effd19ed 31-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Enable cpp(1) warnings in system headers. GCC is oriented on
glibc which is externally maintained, so GCC ships with these
warnings turned off by default. This is also consistent with
the src/contrib/gcc/c-lex.c,v 1.2 change.

# fcdc2713 30-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Slightly improve buildworld times by excluding crunchide(1)
and kgzip(8) from the list of cross-tools during the normal,
non-"make release" buildworld.

Also, don't gratuitously build them, btxld(8) and elf2aout(1)
for native architecture builds, since they have no known
boostrapping issues along the supported upgrade path.

Prodded by: peter

# 8eb1c4ca 11-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Convert kgzip(8) to be an i386 cross-tool. This is needed for
cross-releasing i386 on different architectures. This version
provides an i386 version of <a.out.h>, and handles endianness.

Tested on: alpha, sparc64

# 4d9e5ead 08-Mar-2003 Mark Murray <markm@FreeBSD.org>

KerberosIV de-orbit burn continues. Disconnect from "make world".

# f93bdc08 06-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

With CVS_UPDATE, use read-only repository mode by default.

# f617fa52 04-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Doh, committed to the wrong branch.

Spotted by: johan

# 7adf0ebb 04-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

MFC: Ship with /etc/login.conf hashed.

Approved by: re

# 6192b1df 03-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Make sure the default install comes with /etc/login.conf hashed.

# 73ba057c 03-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Catch up with sys/conf/kern.post.mk,v 1.39 -- we can now use
plain ${CLEANDIR} to clean kernel and modules. This has an
additional nicety of respecting NOCLEANDIR.

# 2ff31e0d 24-Feb-2003 Ruslan Ermilov <ru@FreeBSD.org>

Ensure that build-tools end up in the object directory different
from the source directory. (This mostly affects the RELENG_4's
``make release'' release.5 target, where "rtermcap" build-tool
for release/sysinstall ends up in the source directory and later
steps of release.5 wipe it out.)

Spotted by: jhay

# 9a9c78bd 21-Feb-2003 Ruslan Ermilov <ru@FreeBSD.org>

Respect ``makeoptions NO_MODULES'' specified in the kernel config file.

# 24cc1d58 11-Feb-2003 Tom Rhodes <trhodes@FreeBSD.org>

Add -DNOMAN to the list.

# 07e5ffba 07-Feb-2003 Joseph Koshy <jkoshy@FreeBSD.org>

Catch typos in the kernel name specified for an "installkernel" invocation
early on, rather than failing later with an obscure error message.

Make error messages appear consistent.

# d0cfa43f 04-Feb-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Don't attempt buildworld if the path to the source-tree contains a comma.

Can be removed if the underlying issue is fixed.

Submitted by: Flemming Jacobsen <fj@batmule.dk>

# cbb66355 30-Dec-2002 David E. O'Brien <obrien@FreeBSD.org>

Move elf2aout back to /usr/bin -- it is a general development tool, not
a sysadmin tool.

# fc599016 02-Dec-2002 Ruslan Ermilov <ru@FreeBSD.org>

For installkernel, use the fresh tools (if we've built them with
buildworld).

Reviewed by: imp, marcel
Approved by: re (rwatson)

# 3f66c888 14-Nov-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make dynamic PAM modules depend on dynamic PAM library.

Requested by: des, markm

# 40c6b893 13-Nov-2002 Ruslan Ermilov <ru@FreeBSD.org>

Take __FreeBSD_version into account when BOOTSTRAPPING.

# fb404d6f 03-Nov-2002 Scott Long <scottl@FreeBSD.org>

Hook the aic7xxx modules up. This requires some extra care since aicasm
is a compiler tool and needs to be compiled by the host compiler. I've
tested this in i386->sparc cross-build, 4.7->current upgrade, normal
buildkernel target, and normal /sys/i386/compile/GENERIC configurations.

Submitted by: ru

# 60e155d9 28-Oct-2002 Ruslan Ermilov <ru@FreeBSD.org>

Emptify.

# 6ef0c770 26-Oct-2002 Peter Wemm <peter@FreeBSD.org>

DISTDIR is used by 'make release', lets see if this is enough to turn
off the execution test.

# 13f571a3 25-Oct-2002 Peter Wemm <peter@FreeBSD.org>

Provide a bit of anti-foot-shooting protection. Make sure that in the
non-cross cases without DESTDIR, that the bin/sh that we're about to
install works. Otherwise, a 'make installworld' without having already
rebooted with a post-signal-fix kernel is a rather big disaster when
important things like /bin/sh coredump.

# 017b462e 22-Oct-2002 Ruslan Ermilov <ru@FreeBSD.org>

_games is gone in rev. 1.305.

# dc2f663b 20-Oct-2002 Mark Murray <markm@FreeBSD.org>

Do not build the majority of the games. Remaining are the
"utility-like" games and everyone's favourite, fortune(6).

# 66422f5b 16-Sep-2002 Peter Wemm <peter@FreeBSD.org>

Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports. As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL. It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha

# c065f5b2 22-Aug-2002 Johan Karlsson <johan@FreeBSD.org>

Similar to bsd.subdir.mk, echo the name of the dir before
doing the cd. This is done for bootstrap-tools,
build-tools, cross-tools, and the libraries loop.

Reviewed by: ru
Approved by: sheldonh (mentor)
MFC after: 1 week

# d4f7b113 08-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

The intent in rev. 1.299 was to make the CPUTYPE assignment type check
bother "only those who attempts to set it to a different value". This
got broken in rev. 1.300 (that fixed another race).

Reported by: ache

# 10a6b1ff 07-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

Makefile.inc1 may eventually be merged with Makefile, so fix an
endless recursion bug similar to the one that has been fixed in
release/Makefile,v 1.698, in advance. A related fix to make(1)
has been committed in make/main.c,v 1.68.

Requested by: bde (who has them merged already)

# 9f3089ac 05-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

An empty CPUTYPE now means ``the default CPUTYPE'' in bsd.cpu.mk.
If there was no CPUTYPE assignment in /etc/make.conf, this would
cause the ``CPUTYPE assignment type'' check to falsely fail.

Reported by: johan

Fixed this by making sure we always pass the non-empty CPUTYPE.
Also make sure we use the correct set of share/mk files in our
test.

# 32f8ca45 02-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

TARGET_CPUTYPE should exist solely in Makefile.inc1, similar to
TARGET_ARCH and TARGET. This is problematic when one has the =
(unconditional) type of assigment for CPUTYPE in /etc/make.conf.
(This would override what was set on the command line to "make
buildworld".)

Add a (horrible) kludge to Makefile.inc1 to check the type of
assignment for CPUTYPE (only for those who attempts to set it to
a different value). Fix an example make.conf. Fix the kernel's
build-tools target (aicasm only at the moment) to catch up with
bsd.cpu.mk,v 1.15 (BOOTSTRAPPING replaced with NO_CPU_CFLAGS in
Makefile.inc1's BMAKE).

Reviewed by: jhb

# 22e256fd 30-Jul-2002 John Baldwin <jhb@FreeBSD.org>

- Define NO_CPU_CFLAGS during BMAKE and TMAKE (and thus XMAKE) so that
bsd.cpu.mk doesn't have to worry about compilers other than the current
version.
- Allow TARGET_CPUTYPE to override CPUTYPE in bsd.cpu.mk.
- Treat an empty CPUTYPE the same as an undefined CPUTYPE.
- For buildworld, buildkernel, etc., define TARGET_CPUTYPE to CPUTYPE for
native builds and define it to be empty for cross-builds.
TARGET_CPUTYPE is only defined if it is not already defined via the
commandline or environment.

# 609b7b31 24-Jul-2002 Ruslan Ermilov <ru@FreeBSD.org>

Inline ${_cxx_consumers}.

# 6b308680 24-Jul-2002 Peter Wemm <peter@FreeBSD.org>

We're done with 1.287 and 1.288 now.

Submitted by: ru

# 6faeb369 11-Jul-2002 Ruslan Ermilov <ru@FreeBSD.org>

Pass -DBOOTSTRAPPING to the kernel's build tool (sys/dev/aic7xxx/aicasm).
This way, it has a chance to be built with gcc 2.95.x (using the bandaid
in share/mk/bsd.cpu.mk,v 1.11).

Feedback timeout from: gordon

# b0346d34 01-Jul-2002 Juli Mallett <jmallett@FreeBSD.org>

libufs does not need built before most things, after all.

Submitted by: bde, ru

# a306cfd1 30-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Add libufs to prebuild_libs, since lots of things will want it, in time.

# 072f6798 21-Jun-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make NO_OPENSSL actually imply NO_OPENSSH, as documented in make.conf(5).

# f9382a3c 16-Jun-2002 Maxim Sobolev <sobomax@FreeBSD.org>

Don't try to build libssh if NO_OPENSSL is defined because NO_OPENSSL implies
NO_OPENSSH.

# 4093807d 06-Jun-2002 Ruslan Ermilov <ru@FreeBSD.org>

libfetch now depends on libcrypto and libssl.

# 99b73fff 31-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

On behalf of lib/compat/compat4x.i386/libusb.so.0.bz2.uu,v 1.1,
added uudecode(1) to bootstrap-tools.

# 3c67aa80 30-May-2002 Peter Wemm <peter@FreeBSD.org>

Ignore a c++ that is version other than 3.1 if it does not also match
cc's version. libgcc.a will have been clobbered and will no longer have
the old c++ support.

Submitted by: jhb

# f119dc7c 28-May-2002 Peter Wemm <peter@FreeBSD.org>

Bandaid for helping people who have a broken /usr/bin/c++ installation.

This only affects the -current early adopters and developers who have
done a 'make world' in the last few weeks and as a result installed a
gcc-3.1 version of /usr/bin/c++ but without the corresponding library
support that this now requires. This is a temporary hack that should be
deleted within a few weeks. In this case we will use the existing
gperf/groff one last time around for the early stage1 bootstrap. (This
isn't so bad, because we were unconditionally using the host one before)

# 0367ff75 28-May-2002 Peter Wemm <peter@FreeBSD.org>

Put on peril sensitive sunglasses and turn C++ stuff back on.

# 6af587dc 28-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed the world breakage caused by my last commit.
NOMAN is defined when building bootstrap-tools.

Submitted by: jhay

# a6290aac 27-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap makewhatis(1).

# 02c0301f 25-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Move elf2aout to usr.sbin/.

Approved by: jake

# b501b9b5 20-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap elf2aout(1) for sparc64; used to build sys/boot/sparc64/boot1.

# d246873e 18-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Back out rev 1.278. Seems we grew a getconf(1) that requires it.

# 17dbb179 18-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Remove local patch that crept in.

# ef446fb2 17-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Don't build gperf.

# 10b2978e 16-May-2002 Mark Murray <markm@FreeBSD.org>

Remove the perl bits from the build.

# 83f56d9a 15-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make sure to not yet build the GNU C++, but still allow
for the C++ progs to be built with e.g. an old compiler,
CXX=/usr/bin/c++, for the time being.

# 5d862037 15-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Rename `includes' to `buildincludes'.
Rename `incsinstall' to `installincludes'.
Make `includes' a -j safe shortcut for `buildincludes' + `installincludes'.
`buildincludes' and `installincludes' are SUBDIR friendly, if run directly.

# 1fbb6ab5 14-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Restore comment that got lost in revision 1.265.

# 1b690a48 14-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Do not run `includes' and `incsinstall' in parallel.

Spotted by: jhay

Parallel worlds and releases should be working again.

# c7b111cb 12-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Added new bsd.incs.mk which handles installing of header files
via INCS. Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files. Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.

Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1. Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):

kerberos5/lib/libtelnet/Makefile
lib/libbz2/Makefile
lib/libdevinfo/Makefile
lib/libform/Makefile
lib/libisc/Makefile
lib/libmenu/Makefile
lib/libmilter/Makefile
lib/libpanel/Makefile

Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.

Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD. Similarly for INCOWN, INCGRP,
and INCMODE.

Consistently use INCLUDEDIR instead of /usr/include.

gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.

These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".

# 42801998 12-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Quiet the peanut gallary and back out magical "breakage".

# bd7ce31c 09-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Turn off groff and gperf -- they will not compile with the in-tree Gcc 3.1.

# c3bb8639 09-May-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Add rpcgen to the bootstrap tools.

# fdc6a23f 09-May-2002 David E. O'Brien <obrien@FreeBSD.org>

`beforeinstall' w/the csu bits is a nop.

# 1b860b61 08-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Build our native CSU bits before the compiler-specific ones.
This helps in the compiler build.

# ce7c5cc8 07-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Make NO_CXX, really mean NO_CXX.

# 61e86e72 30-Apr-2002 Bruce Evans <bde@FreeBSD.org>

Sorted the directories in the rule for the includes target as much as
possible.

# 8f1f55e9 30-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Milestone #2 in cross-arch make releases. They now work!

You need to set TARGET_ARCH and possibly TARGET, the same
way you normally do it for a cross build(7).

Renamed `distribworld' to a more natutal `distributeworld'.

Put pwd_mkdb(8) under ${INSTALLTMP}; for `distributeworld'.

# d6e61d98 30-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Back out part of the revision 1.261: "etc" indeed needs to be
last for "distribute" to succeed -- the "make makedb" part of
the etc/Makefile:distribution target should be the last thing
made.

# 64b06e78 30-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make crunchide(1) a cross-tool; needed for cross-arch "make release".
Note that a.out is only supported for the non-cross i386 case.

# d672a609 29-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Parallel "make release" fixes.

# 6bde859f 26-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Milestone #1 in cross-arch make releases.

Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.

Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.

Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).

Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).

In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.

Moved the creation of the "crypto" dist from release.5 to
release.2.

In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.

Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.

Inline createBOOTMFS target.

Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.

Assorted fixes:

Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".

Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.

gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.

release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.

Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.

XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)

Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.

Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>

# b56f8802 20-Apr-2002 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

Despite the fact that it is documented in the handbook, the release notes,
and UPDATING and has been posted to both freebsd-current and
freebsd-stable, users are still not adding the required smmsp user and
group before doing an installworld. Therefore, don't let users do an
installworld unless they have followed directions.

Add a new installcheck Makefile target which installworld runs before
actually starting the installation. This target can be used by other parts
of userland as well. The first addition to the target is to check for the
smmsp user and group if NO_SENDMAIL isn't defined.

Others may add checks to this target as they see fit.

MFC after: 1 week

# 92815c0c 16-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Sort _startup_libs, _prebuild_libs, and _generic_libs lists alphabetically.

Submitted by: bde, ru

# dc173bd8 16-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Keep up with lib/Makefile,v 1.64 (uhh).

# 5de7148c 15-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix incorrect ordering in previous commit.

# 004e6863 15-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Add libypclnt to the prebuild library list, and record its dependency on
librpcsvc.

# 761139b1 13-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Add libypclnt to the includes target.

# 4d8bba46 12-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Add a tool (and the first application of it) that could be used
to automate building of libraries.

Prodded by: bde

# b2490f91 11-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

I now don't seem to be able to reproduce the -DNOCLEAN buildworld
breakage with ioctl.c. The .depend file should track dependencies
just fine, and the worst we can have is to miss new ioctls.

But I still think it's a good idea to have -DNOCLEAN build produce
the same ioctl.c as it would without -DNOCLEAN.

Prodded for a long time by: bde

# 04454986 11-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Don't special case i386/pc98, replace it with the smarter logic
of setting ${TARGET} -- make it default to ${MACHINE} if we are
not cross-building, and ${TARGET_ARCH} otherwise.

Set MAKEOBJDIREPREFIX based on ${TARGET}, not on ${TARGET_ARCH}.
This is useful if you want to cross-build pc98 worlds on i386.

# 66002be3 08-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Avoid cleaning modules twice in `buildkernel'.

# e69e7778 08-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap xargs(1) -- sys/conf/kmod.mk uses the new -J option.

PR: bin/36747

# 56f2a75b 03-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak buildworld after include/Makefile,v 1.167 commit.

# 1b88dfbd 01-Apr-2002 Josef Karthauser <joe@FreeBSD.org>

Back out lots of the last commit that was committed by accident.
(It's my test rig for some CVSUP,SUP code).

Spotted by: Michael G. Petry <petry@NetMasters.Com>

# 388f4c1d 01-Apr-2002 Josef Karthauser <joe@FreeBSD.org>

Install libusbhid.h during 'make includes'.

Requested by: jhb
MFC after: 3 days

# 9f1207d5 26-Mar-2002 Ruslan Ermilov <ru@FreeBSD.org>

Install sys/security/lomac/*.h to /usr/include/security/lomac/.

Install sys/<arch>/include/pc/*.h to /usr/include/machine/pc/.

PR: docs/29534

Install sys/netatm/*/*.h to /usr/include/netatm/*/.

Don't install compatibility symlinks for <machine/soundcard.h>
and <machine/joystick.h>. Three years is enough to be aware of
the change, and these weren't visible in the SHARED=symlinks
case.

Back out include/Makefile,v 1.160 that was a null change anyway
due to the bug in the path, and we now don't want to install
these headers because they would otherwise be invisible in the
SHARED=symlinks case.

Don't install IPFILTER headers. Userland utilities fetch them
directly, and they were not visible in the SHARED=symlinks case.

Resurrect SHARED=symlinks in Makefile.inc1.

PR: bin/28002

Prodded by: bde
MFC after: 2 weeks

# bd42830f 20-Mar-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make lint(1) a cross-tool.

(See commit log for usr.bin/xlint/Makefile,v 1.11 for what was wrong
with enabling build of lint libraries in rev. 1.12.)

This fixes cross-arch compiles (running binaries for a different arch
when generating lint.7 and lint libraries) and cross-branch compiles
(4.x -> 5.0 buildworld should be working again).

# 7b7aae42 20-Mar-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed the NO_PERL braino.

# 5ad400ab 16-Mar-2002 Mark Murray <markm@FreeBSD.org>

Update for Perl 5.6.1

# 9365c8a3 16-Mar-2002 Mark Murray <markm@FreeBSD.org>

Allow the use of NO_PERL as well as NOPERL. The latter is going to
be removed.

# 9c15e38a 06-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

1-true-AWK has a build-tool target.

# ea5c0da9 21-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

Obviate the need to set the COMPILER_PATH and LIBRARY_PATH in Makefile.inc1
to pick up the correct cross-tools (the compiler executables and binutils)
and special linker files (crt*.o). This is now controlled by a single knob,
TOOLS_PREFIX, when building cross-tools.

Fixed regression in Makefile.inc1,v 1.203 (-nostdinc). This clobbered target
architecture's CFLAGS with building host's CPUTYPE setting in /etc/make.conf,
and had a nice but nasty side effect of exposing some (normally hidden) bugs
in system headers.

(Attempt to move the "-nostdinc -I..." part of CFLAGS into the new CINCLUDES
(modeled after a similar CXXINCLUDES) eventually failed because hard-coding
${WORLDTMP}/usr/include to be the first in the include list does not always
work, e.g. lib/libbind.)

Compensate the -nostdinc removal by making cpp(1) built in the cross-tools
stage to not look for <> header files in the building host's /usr/include
(already committed as gnu/usr.bin/cc/cc_tools/freebsd-native.h, revisions
1.10-1.12, STANDARD_INCLUDE_DIR).

: $ /usr/obj/usr/src/i386/usr/bin/cpp -v /dev/null
:
: Before:
:
: #include <...> search starts here:
: /usr/obj/usr/src/i386/usr/include
: /usr/include
: End of search list.
:
: After:
:
: #include <...> search starts here:
: /usr/obj/usr/src/i386/usr/include
: /usr/obj/usr/src/i386/usr/include

(Disabling the use of GCC_INCLUDE_DIR in the FREEBSD_NATIVE case would fix
the duplicate above.)

Get rid of the (now unneeded) -I${DESTDIR}/usr/include magic in bsd.prog.mk
and bsd.lib.mk. Finish the removal of LDDESTDIR in bsd.lib.mk,v 1.55 -- we
no longer have users of it.

The required changes to gcc were already committed as contrib/gcc.295/gcc.c,
revisions 1.23 and 1.24.

Basically, this allows for the changes above plus makes gcc(1) persistent
about path configuration, whether it's configured as a native or a cross
compiler:

: $ /usr/obj/usr/src/i386/usr/bin/cc -print-search-dirs
: install: /usr/obj/usr/src/i386/usr/libexec/(null)
: programs: /usr/obj/usr/src/i386/usr/libexec/elf/:/usr/obj/usr/src/i386/usr/libexec/
: libraries: /usr/obj/usr/src/i386/usr/lib/
:
: $ /usr/obj/alpha/usr/src/i386/usr/bin/cc -print-search-dirs
: install: /usr/obj/alpha/usr/src/i386/usr/libexec/(null)
: programs: /usr/obj/alpha/usr/src/i386/usr/libexec/elf/:/usr/obj/alpha/usr/src/i386/usr/libexec/
: libraries: /usr/obj/alpha/usr/src/i386/usr/lib/

Reviewed by: bde, obrien

# 7a6051e8 14-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

The previous fix for broken -DMAKE_KERBEROS5 world was incomplete.
Finish it by adding kerberos5/lib/libvers to the build-tools list.

(I didn't notice it before because I tested my fix in a -DNOCLEAN
environment, and static libc.a was already in ${WORLDTMP}/usr/lib,
and libvers's make-print-version build tool used it for linking.)

Spotted by: John Indra <maverick@office.naver.co.id>

# 19f56da9 11-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed -DMAKE_KERBEROS5 world breakage in kerberos5/lib/libroken
(make-roken is a build tool). This bug was hiding itself after
a just fixed bug in cross-linker (binutuils/ld/Makefile,v 1.20).

The bug was fatal for cross builds; for example, an alpha binary
(make-roken) was attempted to be run on i386.

Added make-roken to the list of build-tools in libasn1. It only
worked because another build tool needs make-roken implicitly:

(build-tools: asn1_compile: print_version.o: roken.h: make-roken).

Spotted by: nectar

# e47a40e7 08-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

Now that cross-tools ld(1) has been fixed to look for dynamic
dependencies in the correct place, record the fact that -lssh
depends on -lcrypto and -lz.

Removed false dependencies on -lz (except ssh(1) and sshd(8)).
Removed false dependencies on -lcrypto and -lutil for scp(1).

Reviewed by: markm

# fac6ec1f 08-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

FreeBSD 4.1 bootstrapping aid (setproctitle(3) is in -lutil).

This backs out (sort of) delta 1.18 to perl/miniperl/Makefile.
Update to the ld(1) comment by peter in this revision:

ld(1) built as part of the cross-tools stage of buildworld has
been fixed to look for dynamic dependencies in the right place,
${WORLDTMP}/usr/lib, effective binutils/ld/Makefile,v 1.20.

Approved by: markm

# 0f958c27 28-Dec-2001 Paul Richards <paul@FreeBSD.org>

gnu/libexec has gone so remove it from the most targets.

# d235a1a0 23-Dec-2001 Chris D. Faulhaber <jedgar@FreeBSD.org>

Specify the full path to mktemp

# 0525c7ea 20-Dec-2001 Chris D. Faulhaber <jedgar@FreeBSD.org>

Use a more secure method of creating the temporary
install directory.

# 2694e8c7 13-Dec-2001 Warner Losh <imp@FreeBSD.org>

Move NO_WERROR from CROSSENV to BMAKE. In CROSSENV it disables it for
the entire build. We only want it for the bootstrap process.

Submitted by: ru

# 68f04dad 12-Dec-2001 Warner Losh <imp@FreeBSD.org>

Add NO_WERROR to the cross building environment so that we do not bail on
warnings generated by earlier versions of the compilers when bootstrapping.

Also a minor formatting nit in the tools list.

Reviewed by: markm

# 5f4a79e5 11-Dec-2001 Alexey Zelkin <phantom@FreeBSD.org>

Get rid of unsed since rev 1.109 of lib/Makefile WANT_CSRG_LIBM define.
Also replace internal make variable _libm with hardcoded path to lib/msun

Reviewed by: bde

# b69cb634 06-Dec-2001 John Baldwin <jhb@FreeBSD.org>

Just to be pedantic and more aesthetically pleasing, move the secure/
top-level subdirectory prior to share/ so that the top-level directories
are processed in alphabetical order.

# 09b50a98 19-Nov-2001 David E. O'Brien <obrien@FreeBSD.org>

Add the CVS knob so it may be overridden (or have options added).

Submitted by: Andrea Campi <andrea@webcom.it>

# b721f69c 15-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Don't cleandir also if MODULES_WITH_WORLD.

MFC after: 3 days

# acd9c8a8 15-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Typo fix (my test version doesn't have this...)

# 6a798cfa 15-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Run "make cleandir" if NO_MODULES are set, or there is no sys/modules
directory. Previous commit breaks buildkernel if NO_MODULES was set.
Sorry...

Noticed by: mike

# 4271dfbc 14-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

"make cleandir" before building a kernel and modules.

This will hopefully fix the recent 'I cannot compile linux module with
buildworld' problem. MFC will come shortly.

Submitted by: imura@ryu16.org

# 2ec22946 13-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Set full-path of cvsup.

In src/Makefile rev 1.232, environment variable PATH is set explicitly
to /sbin:/bin:/usr/sbin:/usr/bin. As a result, binaries located on
non-standard path cannot be executed without full-path (it's the change
of this revision).

However, cvsup is not in our base system -- you lose if you try to
"make update" without setting SUP in make.conf or command line argument.
I think it is safe to assume that cvsup is located at /usr/local/bin,
and it would help other people who first try to do "make update".

PR: 31932
MFC after: 1 day

# 2335a3d7 02-Nov-2001 David E. O'Brien <obrien@FreeBSD.org>

Bring Gawk back. There just isn't any other POSIX compliant AWK out there.
The biggest thing missing from Bell-Labs AWK is the character class regexes.

# 491beb71 31-Oct-2001 David E. O'Brien <obrien@FreeBSD.org>

Add 'awk' to the build-tools, so that the small utility used to build
one of the source files is made for the host, not target.

# 444ff633 25-Oct-2001 Ruslan Ermilov <ru@FreeBSD.org>

Fix cross-building further.

Introduce ${TARGET} defaulting to ${MACHINE} which should be set to
whatever your target ${MACHINE} is, and use that with world-related
stages. That is, to build pc98 on alpha, one now needs to set both
TARGET_ARCH=i386 and TARGET=pc98.

The scope of ${TARGET} is limited to Makefile.inc1 and cross-tools.

In particular, this change was tested to fix:

1. Cross building of "alpha" on i386. The breakage was introduced
by rev. 1.10 to sbin/i386/Makefile (missing <machine/cronyx.h>).

2. Descending into machine-specific subdirs for a different arch.
Previously, sbin/i386 and usr.sbin/boot0cfg were descended into
when cross-building "alpha" or pc98 on i386.

3. Fixes pc98 cross-building which was horribly broken, caused by
not setting MACHINE correctly (most ${MACHINE} == pc98 checking
Makefiles put -DPC98 to CFLAGS).

# 4448c79e 29-Sep-2001 Ruslan Ermilov <ru@FreeBSD.org>

Fix cross-building, etc:

1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!

2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.

We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.

Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.

That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.

3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.

There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:

1) They use (and depend on) the host environment.

2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.

In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.

4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.

5. Fixed "includes" to install secure/lib/libtelnet headers if
required.

Reviewed by: bde

# b4e13f7b 24-Sep-2001 Ruslan Ermilov <ru@FreeBSD.org>

Removed touch(1) from the list of installworld tools that
was added in previous revision for no apparent reason.

Submitted by: bde

# 9356546b 19-Sep-2001 Mark Murray <markm@FreeBSD.org>

Add which(1) the stuff that we need early on. The perl build needs it
to find miniperl.

# a1e0e968 17-Sep-2001 Ruslan Ermilov <ru@FreeBSD.org>

Run the `bootstrap-tools' and `cross-tools' stages with BOOTSTRAPPING
flag defined. This replaces the WORLD flag that got lost in revision
1.96.

# 02d4de15 29-Aug-2001 Bruce Evans <bde@FreeBSD.org>

Fixed world breakage. mkdir was not copied to ${INSTALLTMP}, but it is
used by src/include/Makefile in the SHARED=symlinks case.

# 934372e2 26-Aug-2001 Paul Richards <paul@FreeBSD.org>

Change the name of KRNLDEFDIR to KERNCONFDIR.

Suggested by Bruce, since the latter is more acceptable for a variable
that is externally visible.

Fix a style nit with a long line.

# f981dd25 26-Aug-2001 Paul Richards <paul@FreeBSD.org>

Add a variable KRNLDEFDIR that specifies where to find the kernel
config files.

It defaults to KRNLCONFDIR.

# a1a21b0e 26-Aug-2001 Mark Murray <markm@FreeBSD.org>

More libss removal.

# e2e0201c 26-Aug-2001 Mark Murray <markm@FreeBSD.org>

Adjust dependancies; now that a PAM module (pam_unix) can change
NIS passwords, libpam needs rpc dependancies.

# 4870a3d3 19-Aug-2001 Kris Kennaway <kris@FreeBSD.org>

Say goodbye to libss, which somehow managed to crouch hidden in the tree
for long after it was used.

# 1687fcd3 17-Aug-2001 David E. O'Brien <obrien@FreeBSD.org>

Use a build-tool to create the .mgc files.

Submitted by: ru (partial)
Obtained from: NetBSD (basic idea)
Reviewed by: bde, ru

# c4a5ef6e 04-Aug-2001 Thomas Moestl <tmm@FreeBSD.org>

Add some features to libdevstat, and overhaul the interface a bit:

1.) prefix all functions in the library with devstat_ (compatability
functions are available for all functions that were chaned in an
incompatible way, but are deprecated).
2.) Add a pointer to a kvm_t as the first argument to functions that
used to get their information via sysctl; they behave the same
as before when NULL is passed as this argument, otherwise, the
information is obtained via libkvm using the supplied handle.
3.) Add a new function, devstat_compute_statistics(), that is intended
to replace the old compute_stats() function. It offers more
statistics data, and has a more flexible interface.

libdevstat does now require libkvm; a library depedency is added, so
that libkvm only needs to be explicitely specified for statically linked
programs.
The library major version number is bumped.

Submitted by: Sergey A. Osokin <osa@freebsd.org.ru>, ken (3)
Reviewed by: ken

# 7bd0b867 29-Jul-2001 Dima Dorfman <dd@FreeBSD.org>

Enable the new libmp in the build, and disable libgmp and its
henchmen.

# 132463ca 09-Jul-2001 Mark Murray <markm@FreeBSD.org>

Axe S/Key. OPIE is the true and faithful successor.

# 9488e5f3 13-Jun-2001 Peter Wemm <peter@FreeBSD.org>

Part 2 of gensetdefs de-orbit burn. linker sets are now self contained
for ELF, see src/sys/linker_set.h log.

# d531238a 13-Jun-2001 Ruslan Ermilov <ru@FreeBSD.org>

WARNS= is fully functional again.

# 8411c946 11-Jun-2001 Ruslan Ermilov <ru@FreeBSD.org>

- Restore -nostdinc that got lost in rev.1.105; we don't
want host headers during `buildworld'.

- During `buildworld', install headers in a "copy" mode
until we decide what to do with the (currently broken)
SHARED=symlinks.

- Temporarily run `buildworld' with -DNO_WERROR, which
effectively disabled the -Werror bit of recently added
WARNS=X feature. This is required because adding the
-nostdinc bit back revealed bugs in some header files
that were hiding after not using -nostdinc.
It is unclear currently how exactly (and why) -nostdinc
affects gcc(1) warnings.

# 3f628ce1 28-May-2001 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap install(1).

# a24874dc 14-May-2001 Ruslan Ermilov <ru@FreeBSD.org>

Add kbdcontrol(1) to bootstrap-tools.
This fixes the upgrade path breakage in usr.sbin/sysinstall.

# 19a27152 26-Apr-2001 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Remove xlint from build-tools. This needs to be fixed in a different way.

# 1048d3c9 24-Apr-2001 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Add usr.bin/xlint to build-tools.

# 0a51d0d9 23-Apr-2001 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

${MAKEOBJDIRPREFIX}/usr/src/i386/usr/include/isc was being created as a plain
file during the bootstrapping process of a buildworld and contained the
last isc include file to be installed. It was meant to be a directory for
the isc include files.

# d8d4bc9a 17-Apr-2001 Ruslan Ermilov <ru@FreeBSD.org>

Add groff to bootstrap-tools.

# 3393f8da 26-Mar-2001 Kenneth D. Merry <ken@FreeBSD.org>

Rewrite of the CAM error recovery code.

Some of the major changes include:

- The SCSI error handling portion of cam_periph_error() has
been broken out into a number of subfunctions to better
modularize the code that handles the hierarchy of SCSI errors.
As a result, the code is now much easier to read.

- String handling and error printing has been significantly
revamped. We now use sbufs to do string formatting instead
of using printfs (for the kernel) and snprintf/strncat (for
userland) as before.

There is a new catchall error printing routine,
cam_error_print() and its string-based counterpart,
cam_error_string() that allow the kernel and userland
applications to pass in a CCB and have errors printed out
properly, whether or not they're SCSI errors. Among other
things, this helped eliminate a fair amount of duplicate code
in camcontrol.

We now print out more information than before, including
the CAM status and SCSI status and the error recovery action
taken to remedy the problem.

- sbufs are now available in userland, via libsbuf. This
change was necessary since most of the error printing code
is shared between libcam and the kernel.

- A new transfer settings interface is included in this checkin.
This code is #ifdef'ed out, and is primarily intended to aid
discussion with HBA driver authors on the final form the
interface should take. There is example code in the ahc(4)
driver that implements the HBA driver side of the new
interface. The new transfer settings code won't be enabled
until we're ready to switch all HBA drivers over to the new
interface.

src/Makefile.inc1,
lib/Makefile: Add libsbuf. It must be built before libcam,
since libcam uses sbuf routines.

libcam/Makefile: libcam now depends on libsbuf.

libsbuf/Makefile: Add a makefile for libsbuf. This pulls in the
sbuf sources from sys/kern.

bsd.libnames.mk: Add LIBSBUF.

camcontrol/Makefile: Add -lsbuf. Since camcontrol is statically
linked, we can't depend on the dynamic linker
to pull in libsbuf.

camcontrol.c: Use cam_error_print() instead of checking for
CAM_SCSI_STATUS_ERROR on every failed CCB.

sbuf.9: Change the prototypes for sbuf_cat() and
sbuf_cpy() so that the source string is now a
const char *. This is more in line wth the
standard system string functions, and helps
eliminate warnings when dealing with a const
source buffer.

Fix a typo.

cam.c: Add description strings for the various CAM
error status values, as well as routines to
look up those strings.

Add new cam_error_string() and
cam_error_print() routines for userland and
the kernel.

cam.h: Add a new CAM flag, CAM_RETRY_SELTO.

Add enumerated types for the various options
available with cam_error_print() and
cam_error_string().

cam_ccb.h: Add new transfer negotiation structures/types.

Change inq_len in the ccb_getdev structure to
be "reserved". This field has never been
filled in, and will be removed when we next
bump the CAM version.

cam_debug.h: Fix typo.

cam_periph.c: Modularize cam_periph_error(). The SCSI error
handling part of cam_periph_error() is now
in camperiphscsistatuserror() and
camperiphscsisenseerror().

In cam_periph_lock(), increase the reference
count on the periph while we wait for our lock
attempt to succeed so that the periph won't go
away while we're sleeping.

cam_xpt.c: Add new transfer negotiation code. (ifdefed
out)

Add a new function, xpt_path_string(). This
is a string/sbuf analog to xpt_print_path().

scsi_all.c: Revamp string handing and error printing code.
We now use sbufs for much of the string
formatting code. More of that code is shared
between userland the kernel.

scsi_all.h: Get rid of SS_TURSTART, it wasn't terribly
useful in the first place.

Add a new error action, SS_REQSENSE. (Send a
request sense and then retry the command.)
This is useful when the controller hasn't
performed autosense for some reason.

Change the default actions around a bit.

scsi_cd.c,
scsi_da.c,
scsi_pt.c,
scsi_ses.c: SF_RETRY_SELTO -> CAM_RETRY_SELTO. Selection
timeouts shouldn't be covered by a sense flag.

scsi_pass.[ch]: SF_RETRY_SELTO -> CAM_RETRY_SELTO.

Get rid of the last vestiges of a read/write
interface.

libkern/bsearch.c,
sys/libkern.h,
conf/files: Add bsearch.c, which is needed for some of the
new table lookup routines.

aic7xxx_freebsd.c: Define AHC_NEW_TRAN_SETTINGS if
CAM_NEW_TRAN_CODE is defined.

sbuf.h,
subr_sbuf.c: Add the appropriate #ifdefs so sbufs can
compile and run in userland.

Change sbuf_printf() to use vsnprintf()
instead of kvprintf(), which is only available
in the kernel.

Change the source string for sbuf_cpy() and
sbuf_cat() to be a const char *.

Add __BEGIN_DECLS and __END_DECLS around
function prototypes since they're now exported
to userland.

kdump/mkioctls: Include stdio.h before cam.h since cam.h now
includes a function with a FILE * argument.

Submitted by: gibbs (mostly)
Reviewed by: jdp, marcel (libsbuf makefile changes)
Reviewed by: des (sbuf changes)
Reviewed by: ken

# aeebb4e7 25-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

Add missing NOSECURE check for `includes' target.

Reviewed by: markm

# d9d1a7bb 22-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

Enhancement to 1.99 -> 1.100.
Avoid EPERM from ln(1) in a different (proper) way.

# afcf05e4 02-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

setlocale(3) has been fixed to match POSIX standard:
LC_ALL takes precedence over other LC_* envariables.

# 7de7569f 22-Feb-2001 John Baldwin <jhb@FreeBSD.org>

MACHINE_ARCH is the target arch to crossbuild to, not TARGET_ARCH.

Requested by: marcel

# 682d4db4 22-Feb-2001 John Baldwin <jhb@FreeBSD.org>

Document TARGET_ARCH.

# 58445af0 16-Feb-2001 Bruce Evans <bde@FreeBSD.org>

Removed some garbage (genassym(8) and its infrastructure).

# c1f3d847 14-Feb-2001 Mark Murray <markm@FreeBSD.org>

Fix make world.

# 2f74661c 23-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Provide backwards compatable recognition of ${KERNEL}. You should be
able to use KERNEL= again with buildkernel, but it will point you at
KERNCONF= and press on regardless.

# 6d84d742 22-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Sigh, I thought we still had the rm -rf objdir stuff in make world, which
would have taken care of the possibility of buildkernel crossing over
from one binutils set to another. Back out the part about turning off
'make clean' if the 'make depend' is still active, but add a NO_KERNELCLEAN
target instead that works like NOCLEAN but just for the kernel.

# 51dfb947 22-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Use 'make clean' instead of 'config -r', and only if the 'depend' step has
been skipped. We went to a lot of trouble to make the 'blow away' stage
unneeded, and it has not been needed for quite some time.

# 5963db0f 22-Jan-2001 Warner Losh <imp@FreeBSD.org>

As threatened in hackers@ on Friday, obviate the need for a buildworld
to preceed a buildkernel.

The buildworld is still required when upgrading across major releases,
across binutil upgrades and when config changes version. If
buildkernel breaks, and you haven't done a buildworld, then do not
complain unless you do a buildworld and it still breaks.

# c1ae5e3d 22-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Using "KERNEL" for buildkernel was a very very bad mistake. $KERNEL is
already used by the kernel makefiles themselves, and this leads to a lot
of trouble when people put "KERNEL=MYKERNEL" in make.conf. Bite the bullet
and change it to KERNCONF instead, before it gets too far entrenched.

The kernel Makefiles use ${KERNEL} as the name of what to install the
kernel as, eg: /boot/${KERNEL}/kernel or /${KERNEL}. This leads to much
unhappiness with things like /LOCAL instead of /kernel. buildkernel is
severely limited as it is only useful directly after a buildworld.

Reviewed by: jhb

# c80a5c4c 21-Jan-2001 Jordan K. Hubbard <jkh@FreeBSD.org>

Also add some timing information for kernel builds so that it's
easy to do "make world kernel |grep -e '^>>>'" and get a complete
event log.

# 26379603 19-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Create a build-tools target for sysinstall and rtermcap. This is still
not right because rtermcap would be reading the *host* termcap, not
from the termcap in the src tree. Besides, /usr/sbin/sysinstall
(not the crunched one in /stand) should use the runtime termcap
not the precompiled set.

# 3e530495 24-Dec-2000 KATO Takenori <kato@FreeBSD.org>

Removed pc98-hack of aout tools.

# d6deedef 03-Dec-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix cross-building once again.

Forgotten by: ache

# 0a0743b5 20-Nov-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix release, broken by the perl cross-build fixes.

The distribute target is basicly the same as an install. For
perl, this means that miniperl is needed. Since miniperl is
only present in the object directory, we need to make sure
the path is set correctly. To do this, we have make release
use a new distribworld target that sets the path before doing
a make distribute.

# ad879ce9 19-Nov-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix cross-building.

o Move building libperl and miniperl from build-tools to
cross-tools. libperl uses MACHINE_ARCH to determine the
right configuration, which doesn't match the build
machine when cross-building if they are built as build-
tools.
o Since miniperl needs to be built as a cross-tool, it
needs to be installed under /usr/obj so that it can be
used (cross-tools have a special object directory to
avoid build conflicts. As a downside, you can't easily
run cross-tools from their object directory). Remove
the install and distribute override targets. To avoid
having miniperl installed by installworld, remove it
from SUBDIR.
o We can't pickup miniperl from the object directory but
since it's installed, depend on PATH. This is save,
because the makefiles are run with a known path.
o Build libperl again as part of the library target. A
_libperl variable existed, but it was never defined.
o Add chmod to the list of saved tools, because perl
conditionally uses it during install.

The bootstrap-tools and cross-tools targets are modified to
avoid building profiled and shared libraries. While here,
have these targets build static binaries instead of shared
binaries.

Approved by: markm

# cb6f6857 10-Nov-2000 David E. O'Brien <obrien@FreeBSD.org>

libgcc now needs to be built earlier in the build.

Submitted by: jdp

# ae7c8a2b 28-Oct-2000 David E. O'Brien <obrien@FreeBSD.org>

* Bring back the guts of crt{i,n}.S. This allows C++ exceptions to work
when using the egcs and gcc-devel ports, along with GCC built from stock
public FSF sources. With out this change, FreeBSD will be removed from
the list of systems GCC 3.0 must be evaluated on before release. With
the effort some of us put into getting FreeBSD on this list, we should
not turn this effort into a waste, else we might not be worth fighting
for in the future. (note that Alpha and IA-64 versions of crt{i,n}.S
are needed)

* Switch from our own crt{begin,in} to those created from GCC's crtstuff.c.
This will allow us to switch to DWARF2 exceptions in the future, along with
staying in sync with any future GCC requirements.

* Break out our ELF branding bits into a seperate file. Currently this
is now included by our crt1.c files (since this functionality was part of
our native crtbegin.c). Later crtbrand.o will be merged in the creation
of crti.o.

# a62264fb 24-Oct-2000 Joseph Koshy <jkoshy@FreeBSD.org>

Fail the 'buildkernel' target if not even one of the specified kernel configuration
files was found.

Reviewed by: obrien

# 13387c45 12-Oct-2000 David E. O'Brien <obrien@FreeBSD.org>

Number the stages in the documentation to match what is printed out when
running.

# 18ebc2ea 17-Sep-2000 Justin T. Gibbs <gibbs@FreeBSD.org>

This is really gross.

If a user decides to forego a make depend during "make buildkernel",
they should get what they deserve if no previous make depend has
been run for that kernel. Instead, the build process includes
special instructions to unconditionally rebuild aicasm. When aicasm
moved to its own directory, this hack broke.

Correct the hack until a get buy off on killing it.

# 66bea2a0 17-Sep-2000 Warner Losh <imp@FreeBSD.org>

Add reinstallkernel target. Does same thing as installkernel, but
executes the reinstall target rather than the install target that
installkernel does.

# a3f02cc0 09-Sep-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Include libfetch in the includes target.

# 1b73d196 08-Sep-2000 Peter Wemm <peter@FreeBSD.org>

USA_RESIDENT is no longer required for buildworld, do not force it.

# ae78d52f 02-Sep-2000 David E. O'Brien <obrien@FreeBSD.org>

Allow one to specify what the installed kernel's name is by setting
"INSTKERNNAME".

Reviewed by: marcel

# 6fd0f272 12-Aug-2000 Josef Karthauser <joe@FreeBSD.org>

Define SUPHOST. If this is set a '-h ${SUPHOST}' is added to the
SUPFLAGS when a 'make update' is run. This means that the supfile
doesn't need to be edited because the -h will override the
CHANGE_THIS.FreeBSD.org host.

# ef102276 07-Aug-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Make the update target consistent; both ports and doc are updated
if their SUPFILE variables are defined _and_ NO_PORTSUPDATE and
NO_DOCUPDATE respectively are not defined.

Previously, only ports was updated and there was no way to prevent
this without undefining its SUPFILE variable.

PR: 17514
Reported by: Udo Erdelhoff <ue@nathan.ruhr.de>

# f7ff24ef 02-Aug-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix buildkernel and installkernel when KERNEL is defined in
/etc/make.conf.

PR: 20325
Submitted by: Johan Karlsson <k@numeri.campus.luth.se>

# a5061fba 23-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Argh... mtree has been removed from the bootstrap-tools. In that
case we need to save it in installworld. That latter I forgot...

Pointy hat: me

# dce97721 23-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Name all kernels 'kernel'. This fixes the incompatible behaviour
of the buildkernel and installkernel targets where the kernel
was called after the config name.

While here, fix the brokenness of the installkernel target. It
used to use ${IMAKEENV}, but since that has a very restricted
PATH, it couldn't find make(1). Use ${CROSSENV} instead.

# fa90cca2 23-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Remove mtree for bootstrap-tools. The -L switch change has been
backed out.

# a0982e93 22-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Don't save cp(1) in installworld. Its use has been replaced by
a use of install.

# eb263e04 19-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add awk and wc to the list of copied binaries for the installworld
target. These are needed by liloldr.

Found by: make release

# 39b909da 19-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add cp(1) to the list of binaries we need to save. The cp(1) command
is used by the installation of ld-elf.so when an existing version
exists.

# 2e826432 19-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Don't save install-info. We already have that built. We'll use
the one we built anyway.

# 767ab900 18-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Save any binaries we use by installworld, so that we won't use the
binaries we just installed. This allows a future upgrade target to
install a new system without intermediate reboots and also
prevents conflicts for parallel make runs where we might exec a
binary that's being installed at the same time.

# 7d66a72a 17-Jul-2000 Andrey A. Chernov <ache@FreeBSD.org>

Move mtree to bootstrap-tools and add PATH=${TMPPATH} to IMAKEENV to pick it

# 199b3e83 17-Jul-2000 Andrey A. Chernov <ache@FreeBSD.org>

Add mtree to cross-tools to make it updated for new -L option
It must solve make world breakage

# 58804eac 02-Jul-2000 Mark Murray <markm@FreeBSD.org>

Perl's version number needs to change.

# f307c8a7 25-Jun-2000 Mark Murray <markm@FreeBSD.org>

Rearrange Perl's build priority; it needs to get made earlier.

# 59bb1d9c 15-Jun-2000 Brian Somers <brian@FreeBSD.org>

Add -DNO_KERNELDEPEND and -DNO_KERNELCONFIG

Not reviewed by: sheldonh

# 625de7fe 09-Jun-2000 Brian Somers <brian@FreeBSD.org>

Set KERNEL=${INSTALLKERNEL} doing a make install in /sys/conf

# a82162d4 05-May-2000 Yoshihiro Takahashi <nyan@FreeBSD.org>

GENERIC98 is removed.

# fc5361f9 27-Apr-2000 Garrett Wollman <wollman@FreeBSD.org>

Make gperf be a bootstrap-tool, since we now depend on features of
the specific version in -current.

Approved in principle by: marcel

# 095a235e 27-Apr-2000 Garrett Wollman <wollman@FreeBSD.org>

Revert my changes to make gperf a build-tool; that was the wrong thing.
All builds had been broken; now just upgrade builds are until I or
someone else can figure out the Right Thing.

# 85a00bb0 27-Apr-2000 Garrett Wollman <wollman@FreeBSD.org>

Add gperf(1) to build tools. It should have been one before, but
gcc does not depend on version-specific gperf behavior (yet).

# 68924308 27-Apr-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Create ${KRNLOBJDIR} before running config(8), since config(8) does
not create required parent directories of the kernel compile
directory specified with its -d option.

# 9ad4708e 16-Apr-2000 Kris Kennaway <kris@FreeBSD.org>

Unbreak make world (libpam depends on libopie)

# f67ecfeb 30-Mar-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Fix the buildkernel and installkernel targets for the case where
KERNEL specifies multiple kernels.

PR: 17536
Submitted by: Johan Karlsson <k@numeri.campus.luth.se>

# 8d76bd01 29-Mar-2000 Ruslan Ermilov <ru@FreeBSD.org>

Get rid of "sticky" files when updating sources with cvs(1).

Approved by: peter

# bb49f794 08-Mar-2000 Kris Kennaway <kris@FreeBSD.org>

Buildworld fixes for NO_OPENSSH and NO_OPENSSL

Approved by: jkh

# 5bf514a3 28-Feb-2000 Mark Murray <markm@FreeBSD.org>

A lot of tools need to be built before compilation proper can happen.

# 84a9e747 24-Feb-2000 Mark Murray <markm@FreeBSD.org>

We have a new world order in libraries.

Goodbye libdes; Welcome libcrypto.

# 3da5eca4 20-Feb-2000 Jordan K. Hubbard <jkh@FreeBSD.org>

Docfix: Note krb5 flags.

PR: 16818
Submitted by: martti.kuparinen@nomadiclab.com

# 858b4471 03-Feb-2000 Ruslan Ermilov <ru@FreeBSD.org>

Now that bsd.lib.mk has PRECIOUSLIB feature back (rev 1.91),
we need -DNOFSCHG at stage 4 (building libraries) to support
non-root buildworlds.

Reviewed by: <buildworld@current.freebsd.org>

# 6f96b351 30-Jan-2000 David E. O'Brien <obrien@FreeBSD.org>

The readline includes handling was moved down a level in
src/gnu/libreadline -- reflect that change here.

Ok'ed by: JKH

# f0d6a665 29-Jan-2000 Warner Losh <imp@FreeBSD.org>

Back out 1.134. It works from 3.3R, but breaks cross compilation for too
little gain. I'll work out the issues after 4.0R is out.

# e208d108 28-Jan-2000 Warner Losh <imp@FreeBSD.org>

Remove Fortran from build tools. It isn't needed to build the system
and costs us an extra 2% to build it for no reason. It may break
building cross compilation environments for fortran, but that isn't
officially supported at this time anyway (also, the % of our user base
that would use that is < .001% imho). This does't break fortran (it
is built again later anyway).

Reviewed by: obrien
Tested by: make buildworld and make buildworld -DNOCLEAN

# d092560c 24-Jan-2000 Mark Murray <markm@FreeBSD.org>

Build Kerberos5 if the correct macro is set. This is not for the
faint_hearted; serious hackers only!

# f8c52b7c 18-Jan-2000 Kris Kennaway <kris@FreeBSD.org>

Require USA_RESIDENT to be 'NO' or 'YES' if building secure/

Reviewed by: marcel

# 85dd55e4 18-Jan-2000 Ruslan Ermilov <ru@FreeBSD.org>

Finally resolve the texinfo issue by moving it
from the cross-tools to the bootstrap-tools.

Requested by: bde, marcel

# 7e3e88c6 18-Jan-2000 Ruslan Ermilov <ru@FreeBSD.org>

For some reason compiler should be the last in the list of cross-tools.
Unbroke the world by moving gnu/usr.bin/texinfo before gnu/usr.bin/cc.

Submitted by: Jim Bloom <bloom@acm.org>

# 4928e3ce 17-Jan-2000 Ruslan Ermilov <ru@FreeBSD.org>

Add gnu/usr.bin/texinfo to the list of cross-tools.
We need an up-to-date `makeinfo' and `install-info'
at `world' and `install' stages.

Pointed out by: bde

# d8180fbd 12-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add gross hack to work around bogus dependency information created
by gnu/usr.bin/cc/cc_tools/Makefile. This bug is painfully visible
when making buildworld with -DNOCLEAN. This work around is beyond
dirty...

# 2a7a0de6 12-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix broken installkernel target. Don't use the WMAKE context to
install; use the IMAKE context.

Reported by: sheldonh

# 15e1a306 11-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Revert gratuitous change in rev. 1.123 which broke building world
as non-root.

Breakage caused by: green

# ae41b16c 11-Jan-2000 David E. O'Brien <obrien@FreeBSD.org>

Remove Bison from "bootstrap-tools" as we don't use it to build anything
in /usr/src/ anymore.

# 55904856 10-Jan-2000 Brian Feldman <green@FreeBSD.org>

This is the second half of unbreaking the world build. Add a -DNOHTML
corollary for -DNOINFO and -DNOMAN. I'll fix this properly (add
specific HTML doc magic) in the .mk files later; right now, just
unbreak the world.

# d4ab519b 11-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add the -r flag to CONFIGARGS instead of assigning to it so that
it's more easy to build a kernel with debugging information.

Suggested by: sheldonh

# f3bb8dbd 09-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add a buildkernel and an installkernel target. With these targets
users can more easily upgrade.

buildworld now makes usr.sbin/config in bootstrap-tools so that
when you first make buildworld, buildkernel will use config(8)
from the temp. world tree (and of course also the compiler).

Which kernel to built is determined by the KERNEL variable. You
can have as many kernels listed as you like. When a config file
exists for the given MACHINE it will be built. When KERNEL has
not been defined it will be set to "GENERIC GENERIC98".

The first valid kernel named in the list will be used by the
installkernel target.

When NOCLEAN is defined the kernel object directory is *not*
removed by config first. This is in line with normal buildworld
behaviour.

The buildkernel target makes aicasm in sys/dev/aic7xxx first and
unconditionally. This hack allows us to cross-build kernels and
can go away when the problem is solved in a structural way.

# 1d19afde 04-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add btxld to the list of cross-tools on machines that don't have it
natively (ie non-i386 architectures).

# 37379a44 30-Dec-1999 Mark Murray <markm@FreeBSD.org>

Grrrr... This was supoosed to go with the commit to kerberosIV/.../libroken's
Makefile.

Fix make world by building appropriate build-tools.

Submitted by: marcel

# a886640d 29-Dec-1999 David E. O'Brien <obrien@FreeBSD.org>

Restore changes I spammed.

# 253745e1 29-Dec-1999 David E. O'Brien <obrien@FreeBSD.org>

Allow the specification of a prefix for gcc to find all the various bits.
If one wishes to anchor the compiler toolchain tree somewhere other than /,
all one needs to do is set "TOOLS_PREFIX" to a different rooting.

Submitted by: marcel (in a different format and reworked by me)

# 4712894e 29-Dec-1999 Kris Kennaway <kris@FreeBSD.org>

Only make beforeinstall in libcrypto/libssl if they actually exist. I haven't
imported these on Freefall yet for the reasons previously explained.

Noticed by: asami

# 1a75f3dd 29-Dec-1999 Satoshi Asami <asami@FreeBSD.org>

Oops, the previous commit was bogus. I shouldn't commit something without
reading all my mail.

I still don't understand why this was was committed on freefall before
the libcrypto and libssl subdirectories were imported on freefall though.

# 019d7e0f 29-Dec-1999 Satoshi Asami <asami@FreeBSD.org>

Typo (libcrypto -> libcrypt).

# 47dbe12f 28-Dec-1999 Kris Kennaway <kris@FreeBSD.org>

Build openssl properly during make world.

# 7377751f 23-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't build caesar as a tool. fortune(6) doesn't depend on it
anymore. Update comments and variable names as well to wipe out any
traces that may confuse people in the future.

# 3eafbc1a 23-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Revert previous commit, and

o Add genassym to the list of cross-tools
o Remove sh hashing work-around, we don't need it anymore
o Clean more directories in WORLDTMP when NOCLEAN is specified

The sh hashing work-around is not needed anymore, because we don't
trigger the bug anymore.

When NOCLEAN is not defined, we wipe out the complete WORLDTMP,
including the object directories of the tools we have built. When
NOCLEAN is defined, we remove anything that we install anyway, which
is usr/bin, usr/games, usr/include, usr/lib and usr/sbin.

# 02fdddce 22-Dec-1999 Andrey A. Chernov <ache@FreeBSD.org>

Add ${WORLDTMP}/sbin to ${STRICTTMPPATH} - sysctl not found otherwise

# 76762624 20-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o make SHARED=symlinks a caller defined instead of a callee defined
property. This fixes the includes target when DESTDIR is empty.
o Do not make build-tools for f771 when NO_FORTRAN is defined.
o Add new build stage. See below.
o Change banners so that staging information is displayed.

The addition of the build-tools target broke the upgrade path because
we couldn't make use of previously built tools that were made for
compatibility reasons. Doing so would also result in the cross-compiler
being used and that is exactly what had to be avoided.

This is solved by designating the bootstrap-tools stage for building
anything that is needed for compatibility only and to create a new
stage (started after the build-tools stage) that handles cross-tools
building. We now have the following stages:
1. bootstrap-tools (for compatibility issues only)
2. build-tools
3. cross-tools (what it says)
4. world
5. install

Stages 1-4 (inclusive) are handled by buildworld.
Stage 5 is handled by installworld.

Any more stages and I'll join Nik in his quest for the
holy grail^W^Wworld :-)

# 5233a96c 17-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't build usr.sbin/pcvt/keycap on anything other than i386 when
building the libraries target. pcvt is i386 specific.

# bfc59eb8 16-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.

The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.

This is the last major update towards cross-building.

# f647fd15 15-Dec-1999 Bill Fumerola <billf@FreeBSD.org>

It is possible for someone to want to 'make update' wht SUPFILE not defined
while SUPFILE1 or PORTSSUPFILE are defined.

# 4ac29d1e 12-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Add colldef to the list of tools. It's needed on older systems.

# 0dd0e829 12-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Add gensetdefs to the list of tools.
o Don't set CFLAGS in the bootstrap env. It is very likely to be
overridden my any CFLAGS setting in /etc/make.conf. Setting it
here is almost useless. So far, it doesn't seem necessary.

# 845eb537 11-Dec-1999 Yoshihiro Takahashi <nyan@FreeBSD.org>

Build a.out tools if MACHINE_ARCH == i386 and MACHINE == pc98.
The boot2 for pc98 is still a.out program.

I made the original patch, and many problems were fixed by Marcel Moolenaar.

# 3f2aa30a 11-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't add MACHINE_ARCH to MAKEOBJDIRPREFIX when not cross-building.
This should fix make release.

Reported by: jhay, phk

# f80df2fa 10-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Don't make games/fortune/strfile if games does not exist or NOGAMES
has been defined.
o Make libraries before making depend.

# 08265f35 10-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Remove installworld related settings that I had as a safety-net and
for development. :-/

# 0ea234de 10-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

More cross-building related changes:
o Build tools before doing anything in or with the object tree.
o Tools don't use the object tree any more, but have there object
tree located in the temp. world.
o Use the proper make env. for cleaning and building the object tree.
o Don't create kernel include subdirectories in the temp. world. These
are removed later on and replaced by symlinks.
o Change the layout of the object tree:

The temp. world now is /usr/obj/${MACHINE_ARCH}${.CURDIR}/${BUILD_ARCH}.
/usr/obj can be set/changed by using MAKEOBJDIRPREFIX, and {.CURDIR}
obviously depends on where the source tree is located. MACHINE_ARCH
is the arch. for which the world is to be build and BUILD_ARCH is the
arch. on which we are building.

The object tree now is /usr/obj/${MACHINE_ARCH}${.CURDIR}.

This allows concurrent cross-builds and allows the object tree to be
shared on different archs., each doing the same cross-build. This of
course assumes that the output on Alpha (for example) is the same as
the output of an Alpha cross-build on i386 (for example).

The use of NOCLEAN is is still dangerous, but should be usable in many
more situations than before. It should now be possible to safely
restart an interrupted build with NOCLEAN without side-effects. Because
the tools don't share the object tree with the normal (cross-build), no
tools have to be rebuild.

# 7466caf4 09-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't make gdb, objc and f77 when building tools.

# aae5d688 09-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Make sure the links to the source tree end up in the source tree.

# db10927b 09-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Add usr/lib/compat/aout to the temp world. This is needed by release.
o If you can't beat them, join them: use symlinks to populate the obj
tree. This avoids using mtree.

# 894157f5 08-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Restore the upgrade path from -stable to -current and prepare for
non-root cross-building.

o Makefile.inc0 is not used anymore.
o The legacy aout build has been removed.
o Selectively build tools *before* building includes/libraries.
o Avoid using mtree to populate the obj tree.

# e13b3c78 25-Nov-1999 Julian Elischer <julian@FreeBSD.org>

Place netgraph entry into alphabetical position
along with the misplaced entries that it was next to.

# 30fdccdc 23-Nov-1999 David E. O'Brien <obrien@FreeBSD.org>

Revert to rev 1.91. Revs 1.9{2,3} were causing problems for people with
pre-Aug 4.0-CURRENT worlds and those with pre-GCC 2.95.2 worlds.

The problem with pre-Aug worlds is the installed Byacc and Bison doesn't
have necessary changes to compile either GCC 2.95 or EGCS 1.1.x.

The problem with pre-GCC 2.95 worlds is libgcc is built with the wrong
compiler. See rev 1.17 of src/gnu/lib/libgcc/Makefile (which used to live
in src/gnu/usr.bin/cc/libgcc) + commit messge for details of the requirements.

# 6de9679e 23-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Fix some bugs and make some policy changes.

o Send libmytinfo back to the afterlife. It was revived by mistake,
o Make gnu/lib/libgcc before making lib/libpam. This dependency has
been overlooked in constructing the list,
o make depend before make all. It's by using make depend that the
dependency was found in the first place and we need it to prevent
cleaning everything up before we start,
o Don't specify -DNOINFO -DNOMAN for the libraries target. Let the
target handle it. We can do away with a single run over the libs
if we make everything while we're there and only install the
libraries in the object tree.

# be4512ec 21-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Build tools against the host's includes and libraries. Also, don't
build make(1) twice and merge the bootstrap-libraries and libraries
targets.

This change solves the bug where build-tools, compiled against the
includes and libraries built from the sources failed to run on the
host, as was the case with the sigset_t change. With this update, a
buildworld will fail if the tools won't compile on the host. This
is solved in further commits where backward compatibility of the
tools is enlarged.

The libraries target has been fixed. The libraries are now build in
the proper order, satisfying the dependencies. The comment is updated
to reflect this.

The linux module and netboot have been removed from the list of tools.
More to follow.

Reviewed by: bde, imp

# f5c0c6ab 15-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Remove CROSS_MAKE_FLAGS.

# 0917704b 14-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

${MACHINE} -> ${MACHINE_ARCH}

All Makefiles now use MACHINE_ARCH for the target architecture.
Unification is required for cross-building.

Tags added to:
sys/boot/Makefile
sys/boot/arc/loader/Makefile
sys/kern/Makefile
usr.bin/cpp/Makefile
usr.bin/gcore/Makefile
usr.bin/truss/Makefile

usr.bin/gcore/Makefile:
fixed typo: MACHINDE -> MACHINE_ARCH

# 5dd05de9 25-Oct-1999 Julian Elischer <julian@FreeBSD.org>

install netgraph.h a bit earlier.

Submitted by: Boris Popov <bp@butya.kz>

# f24bb3a4 14-Oct-1999 Boris Popov <bp@FreeBSD.org>

Make libncp actually compiled.

Reviewed by: mdodd

# 6d77c2de 04-Oct-1999 Peter Wemm <peter@FreeBSD.org>

Add libkvm to the includes target.

# 1f687ff1 20-Sep-1999 Mark Murray <markm@FreeBSD.org>

Minor (but important) comment change.

# 7dd5e27c 04-Sep-1999 Bruce Evans <bde@FreeBSD.org>

FIxed disorder in the comments about library build order.

# da52b932 31-Aug-1999 Mark Murray <markm@FreeBSD.org>

Further preparation for tn3270's demise.

# 4c2a26e3 30-Aug-1999 Peter Wemm <peter@FreeBSD.org>

Update for ncurses5 aftermath..

# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$

# 4f1b474e 08-Aug-1999 John Polstra <jdp@FreeBSD.org>

Remove f2c-related stuff from the "includes" target and from a
comment. Fixes broken make world.

# d72e8db8 05-Aug-1999 John Polstra <jdp@FreeBSD.org>

Add usr.sbin/elf2exe to the build-tools target on the Alpha. This
fixes the make buildworld breakage in sys/boot/arc/loader.

# 17139066 06-Jul-1999 Warner Losh <imp@FreeBSD.org>

Per requests from the community, commit rudimentary cross compilation
support. I've been building world with these changes for months w/o
ill effect. I've also managed to build the cross tool chain for MIPS
with these patches.

Please note that the extent to which these patches work is largely
dictated by how well our tool chains support the cross compilation.
Building alpha binaries on i386 doesn't work. Supposedly building
i386 binaries on alpha does work, but I've not verified it with these
patches, however.

# 55496537 04-Jun-1999 Bill Fumerola <billf@FreeBSD.org>

${.CURDIR} doesn't have to be /usr/src, especially in a cvs checkout. Make
sure what is reported to the user is accurate.

Stolen From: mharo

# 03a6bd91 31-May-1999 Bill Fumerola <billf@FreeBSD.org>

'make update' in the ports directory.

# 7c2a64c4 03-May-1999 David E. O'Brien <obrien@FreeBSD.org>

Document NO_FORTRAN.

# 5a528acb 02-May-1999 Mark Murray <markm@FreeBSD.org>

Perl is moving up a maintenance version.

While I'm here - reorder crypto directories to better support
dependancies. Perl and others like it better that way.

# 7725a6c9 19-Apr-1999 Joseph Koshy <jkoshy@FreeBSD.org>

Change 'exists()' constructs to refer to directories in ${.CURDIR}.
Tested with a make world.

PR: misc/4395
Submitted by: J Wunsch
Reviewed by: bde

# db0343ca 11-Apr-1999 Dag-Erling Smørgrav <des@FreeBSD.org>

Don't build man page indices if NOMAN is defined.

PR: bin/11035
Submitted by: Chris Costello <chris@holly.dyndns.org>

# 5999400e 05-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

Clean up "lib-tools:", folding libgcc into the rest.

# a295bf4e 04-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

Remove a lingering reference to libg++.

# 68b7e6e7 03-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

Missed a gnu/usr.bin/cc/libgcc.

# 871b1fd2 03-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

EGCS will have some new includes that need to be installed.

# 15b7d605 02-Apr-1999 Peter Wemm <peter@FreeBSD.org>

Add libwrap to includes target, otherwise <tcpd.h> doesn't get installed
in time to build inetd. (If you already have /usr/include/tcpd.h, the
build doesn't fail. This mainly affects upgrades and 'make world' from
systems more than a few weeks old)

# 094f0393 30-Mar-1999 David E. O'Brien <obrien@FreeBSD.org>

An earlier version of Rev 1.66 was reviewed by bde and the issues were
hashed out with his gracious help.

# 5bcba11b 30-Mar-1999 David E. O'Brien <obrien@FreeBSD.org>

* Deal with libgcc's move from gnu/usr.bin/cc to gnu/lib.
Move was necessary as libgcc should be built with the freshly built
compiler and thus we must wait until the freshly built bits have been
installed somewhere so we can use them. libgcc presence in gnu/usr.bin/cc/
gets in the way of building the new compiler. We could have either
cd'ed to specific directories w/in gnu/usr.bin/cc/ and built and installed
individual bits, or move libgcc out of the way and let our normal subdir
building process work.

* Don't build libgcc in "bootstrap-libraries:" target it should not be
assumed the currently installed compiler can correctly build libgcc.
(as is the case for g++ 2.7.2 and EGCS' libgcc)

# af59b932 28-Feb-1999 Warner Losh <imp@FreeBSD.org>

The legacy boot stuff is available only on i386, not all architectures
which aren't the alpha. Test for MACHINE_ARCH == i386 rather than
MACHINE_ARCH != alpha.

# 2d932f16 26-Feb-1999 Jordan K. Hubbard <jkh@FreeBSD.org>

Add a new flag, "WORLD", for telling certain tools that they're
being build as part of a bootstrap.

# ad5ebf3f 14-Feb-1999 Dag-Erling Smørgrav <des@FreeBSD.org>

Ignore errors from chflags. This makes it possible to make installworld
with DESTDIR set to an NFS-mounted file system.

# 9c2bbd3b 27-Jan-1999 Jordan K. Hubbard <jkh@FreeBSD.org>

further refine the upgrade process.

# 08275689 23-Jan-1999 Mark Murray <markm@FreeBSD.org>

More broken crypt(3) backout.

# 2ccdfd96 22-Jan-1999 Brandon Gillespie <brandon@FreeBSD.org>

One more fix to remove secure/lib/libcrypt from the build (both
cases are now handled in lib/libcrypt, depending upon if
secure/lib/libcrypt/crypt-des.c exists)

Reviewed by: Mark Murray

# 3b5d5dca 19-Jan-1999 Mark Murray <markm@FreeBSD.org>

Help for Perl5 to make in cross-build environments.
Submitted by: Eivind Eklund

# b8c993ec 07-Jan-1999 Eivind Eklund <eivind@FreeBSD.org>

Don't do the ldconfig rescan if DESTDIR is set.

# c9ef6e40 06-Jan-1999 Peter Wemm <peter@FreeBSD.org>

``Disable'' a.out 'make world', as per flag day notification on current and
committers. A 'make aout-to-elf' is strongly encouraged. This isn't quite
the end of the line for people who have a real problem with updating yet,
but we've got to get this over and done with. Yes, it's bound to be a
couple of bumpy couple of days.

# fad499d2 06-Jan-1999 Bruce Evans <bde@FreeBSD.org>

Removed the weak spam of ${DESTDIR}/usr/include in the bootstrap
target (see the previous log message). This works for bootstrapping
from 2.2.7. It won't work for bootstrapping from 2.1.x, but that
fails due to include problems earlier.

# 1ff0f342 03-Jan-1999 Bruce Evans <bde@FreeBSD.org>

Backed out rev.1.49. It broke bootstrapping from 2.1.5 2.2.7 and
probably other versions by spamming ${DESTDIR}/usr/include in much
the same way as `make includes'.

Details for 2.2.7: the bootstrap target has always done a weak spam
of ${DESTDIR}/usr/include; we depend on it not installing any
significant anachronisms (it probably shouldn't touch the headers
at all; however, we may be depending on it for things like the
renaming of ts_nsec to ts_sec in <sys/time.h>). Rev.1.49 strengthens
the spam to everything in src/include. For 2.2.7, this is not
immediately fatal. However, the `make all' step in src/includes
is not followed by a `make clean' step, so new rpc headers are not
generated after we've bootstrapped rpcgen. This causes a fatal
error much later when the old (generated) rpc headers are used with
the current headers (sys/types.h and/or the non-generated rpc
headers).

Details for 2.1.x: the bug is immediately fatal. It gives definition
of errno that is not supported by 2.1.x's libc. The weak spam in the
restored version avoids this problem by not installing errno.h.
(Bootstrapping from 2.1.5 actually breaks much earlier.)

I think the header problems supposedly fixed by rev.1.49 were caused
by using NOCLEAN and having the build fall over when the weakly
spammed headers are active. Minor differences in the layout will
then cause the .depend files to point to nonexistent headers. It
is a feature for symlinks like errno.h -> sys/errno.h to not exist
early.

The other change in rev.1.49 breaks building obj directories if NOCLEAN
is set. It is only safe for _re_building with NOCLEAN set.

# cc854440 01-Jan-1999 Peter Wemm <peter@FreeBSD.org>

Reconnect pcvt hooks..

Reviewed by: core

# 40b84391 29-Dec-1998 Bruce Evans <bde@FreeBSD.org>

Backed out previous commit. It depends on a.out utilities and libraries
somehow being available even on pure elf systems.

# 621be745 30-Dec-1998 Bruce Evans <bde@FreeBSD.org>

Fixed bootstrapping of /usr/mdec/boot[12].

# 41da0323 28-Dec-1998 Peter Wemm <peter@FreeBSD.org>

Dip my toes into the fire and zap the leftover lkm hooks.. It seems they
try and recurse if the lkm dir exists for some reason but there isn't any
Makefile there. (eg: stray files prevented cvs update -P from removing the
empty dirs)

# 306f93f5 27-Dec-1998 Poul-Henning Kamp <phk@FreeBSD.org>

follow up to:
Pre 3.0 branch cleanup casualty #4: pcvt

# df00a036 21-Dec-1998 Matthew Dillon <dillon@FreeBSD.org>

Elf (and a.out?) rebuild of bootstrap tools appeared to be broken due to
some tools requiring header files, such as errno.h, that are softlinks.
The mini installation of include files in Makefile.inc1 wasn't doing
the job, so it has been ripped out and replaced with a true make of the
/usr/src/include/ directory (make all and make beforeinstall). I think
the original idea was to save time by not installing unnecessary header
files, but it doesn't really save all that much time.

Also, I have moved a NOCLEAN conditional to cover rebuilding the object
tree 'Rebuilding the ${OBJFORMAT} obj tree' section. This may or may not
be correct but it appears to function properly. If it is not correct we
need to find another way to avoid scanning every single file in the
entire source hierarchy for make restarts.

# 70152088 12-Dec-1998 Matthew Dillon <dillon@FreeBSD.org>

Grr. removed. backed-out. sorry!

# fed7770a 12-Dec-1998 Matthew Dillon <dillon@FreeBSD.org>

This needs to be commited now to fix usbd for make world

# 23284b17 28-Nov-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Revert previous commit; write idea, wrong way.

# f8303e79 28-Nov-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Remove netboot from build order; it's not ready for the limelight
and probably doesn't belong there anyway.

# 127a2cfa 19-Nov-1998 John Polstra <jdp@FreeBSD.org>

Make sure libskey is built before libpam. It is required for one of
the PAM modules.

Fix the comments describing the PAM dependencies to be consistent
with other related comments.

# 3da08d4a 17-Nov-1998 John Polstra <jdp@FreeBSD.org>

Add libpam to the "includes" and "libraries" targets.

Build the ordered list of libraries in a variable "_libs" before
building any of them. This eliminates a little bit of duplicated
code. More importantly, it makes it easier to include or exclude
libraries with .if constructs, because the list can be built in
multiple steps using "+=".

# c271ea0e 17-Nov-1998 John Polstra <jdp@FreeBSD.org>

Note the requirement that libcrypt be built before libkrb.

# d5f87f1a 15-Nov-1998 John Birrell <jb@FreeBSD.org>

Remove share/info from build tools because it breaks the build when
INFODIR is set.

# 5a51bc8e 12-Nov-1998 John Polstra <jdp@FreeBSD.org>

Add libradius and libtacplus to the includes target. Note their
dependence on libmd.

# 0eda097a 05-Nov-1998 Mike Smith <msmith@FreeBSD.org>

Typo , -> .

Submitted by: Shaun Courtney <shaun@emma.eng.uct.ac.za>

# fafe9c62 04-Nov-1998 Peter Wemm <peter@FreeBSD.org>

sys/modules/linux has a build-tools target

# 2bb39627 03-Nov-1998 Peter Wemm <peter@FreeBSD.org>

Add usr.bin/gensetdefs to build-tools; it is used for src/sys/modules and
maybe for other things that use linker sets under ELF.

# 2a6c45c9 17-Oct-1998 Bruce Evans <bde@FreeBSD.org>

Don't add /usr/games to $PATH. Adding it here can only work for the
`make world' case, and only made a difference for the evil NOTOOLS case
of `make world' since games tools are installed in ${TOOLROOT}/usr/bin
if they are built, but the PR was for normal builds. This is fixed
in rev.1.14 of src/games/fortune/datfiles/Makefile.

PR: 7936

# 59bec036 16-Oct-1998 Bruce Evans <bde@FreeBSD.org>

Fixed missing directories in the libraries target:
- in the elf case, csu must be built and installed before any shared
libraries. It wasn't, but we usually used a stale version that
happened to work. E.g., in the !NOTOOLS case we used the version
built and installed by the bootstrap-libraries target. Only cross
building was completely broken.
- the shared libmd must be built and installed before any shared
libraries that link to it. It wasn't, but we sometimes used a stale
version that happened to work, as above. For elf, this caused
bogus linkage of the target shared libatm and libopie with the host
static libmd. It isn't clear what this actually breaks, except for
cross compiling. For aout, the shared libmd is not built at all, so
all shared libraries linked to libmd may be broken. The linker
reports them by spewing RRS warnings.

Note that building src/lib early and building subdirs of src/lib in
the correct order in src/lib/Makefile doesn't help, since the subdirs
are all built before any are installed.

Fixed bitrot in the comments about the ordering requirements.

# 24f6ecd4 13-Oct-1998 Robert Nordier <rnordier@FreeBSD.org>

Include btxld in build-tools only for i386.

# daf326ce 13-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Conditionalise boot block building on i386.

# 14b49748 11-Oct-1998 Robert Nordier <rnordier@FreeBSD.org>

Remove sys/boot from the install as well.

# 1b9112ea 11-Oct-1998 Robert Nordier <rnordier@FreeBSD.org>

In src/Makefile.inc1:
Remove /sys/boot from legacy-build.
Add btxld to build-tools.
In src/sys/Makefile:
Add /sys/boot for i386 ELF.

I'm still not sure why the new boot code was being built along with the
legacy stuff, which meant a completely wrong default environment for it.

This may well still be the wrong way to go about this, but it can't work
all that much worse than it has been.

# 04e2ebf5 11-Oct-1998 Peter Wemm <peter@FreeBSD.org>

Comment about libm and libmd being needed for some libraries.
Prompted by: bde

Also. Don't build & install legacy lkm's when NOLKM has been set.
Otherwise it gets built in the src tree rather than obj, because the
previous 'make obj' at the start of legacy-build does respect NOLKM.

# 2de520a5 10-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Move OBJFORMAT hack to the correct line; what can I say, it was very
late. :)

# e313ef33 10-Oct-1998 KATO Takenori <kato@FreeBSD.org>

PC-98 uses different boot code from IBM-PC. So, MACHINE is used
instead of MACHINE_ARCH.

Submitted by: Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>

# 07bf7f4a 10-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Quick commit to see if I can't fix Robert's i386/boot problem in one line.
If this doesn't work, we'll try something else.

# 322a4708 10-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Don't chain makes with &&; apparently this is evil for parallelism.
According to: bde

# 87ee69f0 09-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Clean up the boot targets a bit.
Suggested by: jdp

# e2d56569 08-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Make both types of boot targets.

# 400b2cc5 05-Oct-1998 Mike Smith <msmith@FreeBSD.org>

Add libstand to the includes target.

# 5ca77c07 25-Sep-1998 Søren Schmidt <sos@FreeBSD.org>

Backout my last commit.
Find another way to get the LKM's rebuild.

# db8b174e 25-Sep-1998 Søren Schmidt <sos@FreeBSD.org>

Build the LKM's both on aout & ELF systems.

Reviewed by: jkh

# bc767300 23-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

Add printf(1) to the list of early-build tools.
(needed to build Amd, and causing the -jN crowd problems w/o being here)
((I will revisit the usage of printf(1) in building Amd at a later time))

# 51a6b2cb 23-Sep-1998 Mark Murray <markm@FreeBSD.org>

Complete the Perl NOSHARED repair. I had not ensured that the shared library
was constructed early enough, so perl was linking against the static lib.
This was breaking perl under ELF, as perl could not load shared objects
(in fact would dump core).

# b510e4c2 21-Sep-1998 John Birrell <jb@FreeBSD.org>

Remove the bootstrap-rtld target which wasn't needed.

Install the rest of the legacy libraries (like libgcc.a, libl.a).

Add games to the user's path to avoid the temptation for people to
hack paths to unsuitable tools.

# 52984c04 17-Sep-1998 Andreas Klemm <andreas@FreeBSD.org>

Purely cosmetic but useful change.
Make output of make world more readable for grep. Now a
grep '>>>' world.log
shows you the single stages through which the bootstrap
process went as discussed on -current. Could be used to
debug the bootstrap mechanism in case of trouble more
easily. Would be fine if any further @echo "..." messages
containing a description, what's going on, could use the
new format: @echo ">>> ..."

# d8004495 17-Sep-1998 Poul-Henning Kamp <phk@FreeBSD.org>

Two patches from the HARP people:

Various Makefile related fixes.

-Wformat fixes.

Submitted by: Mike Spengler <mks@networkcs.com>

# c3deaba9 16-Sep-1998 Justin T. Gibbs <gibbs@FreeBSD.org>

libscsi is obsoleted by CAM.

# 3f8c4506 15-Sep-1998 Poul-Henning Kamp <phk@FreeBSD.org>

(this is an extract from src/share/examples/atm/README)

===================================
HARP | Host ATM Research Platform
===================================

HARP 3

What is this stuff?
-------------------
The Advanced Networking Group (ANG) at the Minnesota Supercomputer Center,
Inc. (MSCI), as part of its work on the MAGIC Gigabit Testbed, developed
the Host ATM Research Platform (HARP) software, which allows IP hosts to
communicate over ATM networks using standard protocols. It is intended to
be a high-quality platform for IP/ATM research.

HARP provides a way for IP hosts to connect to ATM networks. It supports
standard methods of communication using IP over ATM. A host's standard IP
software sends and receives datagrams via a HARP ATM interface. HARP provides
functionality similar to (and typically replaces) vendor-provided ATM device
driver software.

HARP includes full source code, making it possible for researchers to
experiment with different approaches to running IP over ATM. HARP is
self-contained; it requires no other licenses or commercial software packages.

HARP implements support for the IETF Classical IP model for using IP over ATM
networks, including:

o IETF ATMARP address resolution client
o IETF ATMARP address resolution server
o IETF SCSP/ATMARP server
o UNI 3.1 and 3.0 signalling protocols
o Fore Systems's SPANS signalling protocol

What's supported
----------------
The following are supported by HARP 3:

o ATM Host Interfaces
- FORE Systems, Inc. SBA-200 and SBA-200E ATM SBus Adapters
- FORE Systems, Inc. PCA-200E ATM PCI Adapters
- Efficient Networks, Inc. ENI-155p ATM PCI Adapters

o ATM Signalling Protocols
- The ATM Forum UNI 3.1 signalling protocol
- The ATM Forum UNI 3.0 signalling protocol
- The ATM Forum ILMI address registration
- FORE Systems's proprietary SPANS signalling protocol
- Permanent Virtual Channels (PVCs)

o IETF "Classical IP and ARP over ATM" model
- RFC 1483, "Multiprotocol Encapsulation over ATM Adaptation Layer 5"
- RFC 1577, "Classical IP and ARP over ATM"
- RFC 1626, "Default IP MTU for use over ATM AAL5"
- RFC 1755, "ATM Signaling Support for IP over ATM"
- RFC 2225, "Classical IP and ARP over ATM"
- RFC 2334, "Server Cache Synchronization Protocol (SCSP)"
- Internet Draft draft-ietf-ion-scsp-atmarp-00.txt,
"A Distributed ATMARP Service Using SCSP"

o ATM Sockets interface
- The file atm-sockets.txt contains further information

What's not supported
--------------------
The following major features of the above list are not currently supported:

o UNI point-to-multipoint support
o Driver support for Traffic Control/Quality of Service
o SPANS multicast and MPP support
o SPANS signalling using Efficient adapters

This software was developed under the sponsorship of the Defense Advanced
Research Projects Agency (DARPA).

Reviewed (lightly) by: phk
Submitted by: Network Computing Services, Inc.

# 7004be9b 15-Sep-1998 Justin T. Gibbs <gibbs@FreeBSD.org>

Hook up beforeinstall targets for libcam and libdevstat

# c4e8b7e4 09-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

I don't want to be the only one to use ``cut''. Use ``sed'' instead.

# 8f748848 09-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

Add ``usr/bin/cut'' to "build-tools" target.
Used in usr.sbin/amd/include/newvers.sh.

# ddf0071c 09-Sep-1998 Mark Murray <markm@FreeBSD.org>

Remove the NOPERL block to building Perl5.

Perl 5 will rebuild/bootstrap itself next time a make world is done
with this in effect.

# fad8371b 09-Sep-1998 Mark Murray <markm@FreeBSD.org>

Add the Perl5 bootstrap tools.

# 62dfd75a 09-Sep-1998 Mark Murray <markm@FreeBSD.org>

Another place to set NOPERL.

# ff5fcc93 04-Sep-1998 Satoshi Asami <asami@FreeBSD.org>

Remove tcl from /usr/src, according to prior agreement. BTW, tcl-8.0 *is*
a port so there is nothing to be done on that side now.

Approved by: jkh
===
To: "Jordan K. Hubbard" <jkh@time.cdrom.com>
cc: Andreas Klemm <andreas@klemm.gtn.com>, current@freebsd.org
Subject: Re: Make this a relese coordinator decision (was Re: ports-current/packages-current discontinued)
From: David Greenman <dg@root.com>
Date: Sun, 03 Aug 1997 20:23:31 -0700

>decision is, I'll respect it.

Another chance to architect people's principles...I can hardly wait. Seems
quite appropriate for a Sunday - I just need to get one of those collection
plates (and money envelopes) so I can profit, too. :-)
Tcl stays in /usr/src for now, but it needs to be kept up to date; same
for perl. If Jordan doesn't have "setup" (written in tcl) ready for 3.0,
then tcl will be yanked prior to the 3.0 release (and made into a port).
As for the ports tree only supporting the last FreeBSD release, this seems
sensible to me. The "ports" have always been a moving target between releases
and the problem is only going to get worse when we expand to supporting other
processor architectures. In any case, Satoshi is and always has been in charge
of the ports tree and whatever he wants to do with it (within reason :-)) is
his decision.
Does this cover the issue completely? I admit to deleting messages in this
thread with unusual fervor (people have FAR too much time on their hands!).
There's a fair bit of reasoning behind the above, but since everyone is sick
of arguing about this, I'll spare you the analysis.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project

# d64c14ce 05-Sep-1998 John Birrell <jb@FreeBSD.org>

Change i386 in a few paths to ${MACHINE} to support MACHINE=pc98.

# 146cbe7e 03-Sep-1998 John Birrell <jb@FreeBSD.org>

Only run ldconfig if the OBJFORMAT is aout.

# 741d299c 01-Sep-1998 John Birrell <jb@FreeBSD.org>

Force NOMAN and NOINFO on legacy-install as well as legacy build.

# ff1284f6 31-Aug-1998 John Birrell <jb@FreeBSD.org>

Add a target to check the consistency of the make OBJFORMAT variable
with the object format determined by objformat. This prevents foot
shooting (a form of boot scooting for hackers?) where local changes
to /etc/make.conf or /etc/make.conf.local try to override OBJFORMAT
in an incomplete way.

# f471c448 31-Aug-1998 John Birrell <jb@FreeBSD.org>

MACHINE -> MACHINE_ARCH to allow PC98 to define MACHINE=pc98.

Submitted by: Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>

# 11fb97da 30-Aug-1998 John Birrell <jb@FreeBSD.org>

E-day build system changes.

- Moved most of the guts of Makefile to Makefile.inc1 to become the
backend for the build system.
- The new Makefile doesn't suffer from problems including the wrong
sys.mk because it doesn't use anything in there or bsd.own.mk. So,
from now on, the proper build command is just `make world' (or
buildworld).
- The intermediate makefiles called Makefile.inc0 and Makefile.upgrade
fiddle with the OBJFORMAT and MAKEOBJDIRPREFIX variables so that
both aout and elf object trees can coexist. Makefile.upgrade contains
the aout->elf transition build.
- A cross build environment is now very close to reality. Specifying
TOOLDIR, setting OBJFORMAT and MAKEOBJDIRPREFIX allow that.

See the comments in Makefile for more info.

# 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


# 47bcbde9 17-Apr-2022 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

bintrans: move files to a new directory

And reflect the change in various places.


# 4cd4841a 05-Apr-2022 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

Modularize uuencode and uudecode by wrapping them in bintrans.c

The program will be installed as bintrans, uuencode, uudecode,
b64encode, and b64decode and will be responsible for running the coders
according to their historical behavior.

Additionally, bintrans will be able to take a parameter designating
the coder and accept all its options in this form:
bintrans <coder> [options]
and the behavior should be the same as if
<coder> [options]
was invoked.
This has the advantage that adding coders won't require installing them
as binaries.

Move uudecode files to uuencode since the latter is the one that
provides the manual page.

Reviewed by: delphij (previous version)
Differential Revision: https://reviews.freebsd.org/D32943


# a8267ecc 01-Apr-2022 Ed Maste <emaste@FreeBSD.org>

Speed up *-old-* make targets by using sed instead of xargs

Targets like 'list-old-files' used "xargs -n1" to produce a list with
one file per line. Using xargs resulted in one fork+exec for each
Argument, resulting in rather long runtime. Instead, use sed to split
the list. On one machine `make list-old-files` took 30s wall clock time
with xargs and less than 1s with sed.

Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34741


# b3b46222 01-Apr-2022 Ed Maste <emaste@FreeBSD.org>

installworld: handle ldd including preloaded objects

The installworld target makes a temporary copy of binaries to be used
during the install. Libraries that they depend on are also included,
found by using `ldd`.

After commit 0913953c9ed0 ldd started listing preloaded objects,
including [vdso], under a [preloaded] header. Skip ldd output that is
enclosed in square brackets.

Reviewed by: cy, kib [earlier version]
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34734


# 3b17e19f 01-Mar-2022 Warner Losh <imp@FreeBSD.org>

bootstrap: bump minimum supported version

Bump the minimum supported version to build -current from to 11.3R in
preparation of removing support for older systems. 11.4R was selected
as the most recent version to go out of support.

Sponsored by: Netflix
Reviewed by: delphij, emaste
Differential Revision: https://reviews.freebsd.org/D32444


# 33550b47 01-Mar-2022 Warner Losh <imp@FreeBSD.org>

bootstrap: No need for kbdcontrol bootstrap anymore

We only need kbdcontrol when bootstrapping from FreeBSD 10 or
pre-FreeBSD 11.0 current. Since we can no longer build from these
versions of FreeBSD, remove the support for bootstrapping them.

Sponsored by: Netflix


# 3e65b7d9 11-Feb-2022 Warner Losh <imp@FreeBSD.org>

cleankernel: A target to delete the kernel compile file

With the meta-build, it's always a NO_CLEAN build. Provide a way to
remove so one can rebuild from scratch. 'cleankernel' will delete the
kernel and modules object directories. Document this in build(7).

Sponsored by: Netflix
Reviewed by: debdrup, markj
Differential Revision: https://reviews.freebsd.org/D32978


# ea9a92d2 10-Feb-2022 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: synthesize PKG_ABI from newvers.sh variables

Previously we inspected ${WSTAGEDIR}/usr/bin/uname to determine PKG_ABI,
but the file will not exist in some cases - for example, if building
only kernel packages. We can instead synthesize the PKG_ABI from
information already provided by newvers.sh.

Reviewed by: kevans, manu (both earlier rev)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34249


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

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

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D34175


# 0a902e42 25-Jan-2022 John Baldwin <jhb@FreeBSD.org>

Stop trimming 'hf' suffixes from MACHINE_ARCH.

This was only used for MIPS hard-float architectures.

Reviewed by: imp
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D34018


# 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


# 77da558c 20-Jan-2022 John Baldwin <jhb@FreeBSD.org>

check/delete-old: Auto-generate lib32 entries for libraries.

- Add usr/lib32/libfoo.so.N for lib/libfoo.so.N.

- Add usr/lib32/foo for usr/lib/foo.

- Treat casper libraries special since they are installed to
/usr/lib32 instead of /usr/lib32/casper and thus map
usr/lib/casper/foo to usr/lib32/foo.

Note that OLD_DIRS and MOVED_LIBS entries are not duplicated, only
OLD_FILES and OLD_LIBS.

Reviewed by: imp, emaste
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33324


# 57ba3f00 20-Jan-2022 John Baldwin <jhb@FreeBSD.org>

Use MOVED_LIBS for libraries moved between /usr/lib and /lib.

Add a MOVED_LIBS variable similar to OLD_LIBS except that MOVED_LIBS
is used for the cases that a library's name doesn't change, but it
just moves between /usr/lib and /lib. This will be used by a future
change to auto-generate lib32 old files entries for which these cases
need to be ignored (a moved library remains in /usr/lib32).

Suggested by: emaste
Reviewed by: emaste
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33848


# 21baf42c 11-Jan-2022 John Baldwin <jhb@FreeBSD.org>

Add list-old-{dirs,files,libs} targets.

These targets generate a raw list of the candidate old files roughly
corresponding to the values of OLD_DIRS, OLD_FILES, and OLD_LIBS.
Currently list-old-files also includes uncompressed manpages in
addition to compressed manpages.

Use these targets in the implementation of check-old-* and
delete-old-* to replace duplicated logic.

Reviewed by: imp, emaste
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33327


# adc88b9c 07-Jan-2022 Ed Maste <emaste@FreeBSD.org>

Build libclang also if LLDB is enabled

LLDB depends on libclang as it uses Clang as the expression parser.
Previously setting WITHOUT_CLANG but leaving LLDB enabled (as default)
resulted in a build failure.

Users who set WITHOUT_CLANG in order to reduce build time or size
might want to set WITHOUT_LLDB in addition to WITHOUT_CLANG, or use
WITHOUT_TOOLCHAIN instead.

PR: 260993
Reported by: eugen
Reviewed by: dim
MFC after: 3 days
Sponsored by: The FreeBSD Foundation


# 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


# 7a171e30 15-Dec-2021 Warner Losh <imp@FreeBSD.org>

test-includes: Build a library instead of a binary

We need to build the .o's, but don't need to link. Build a static
library instead of a binary to accmoplish this. This removes the need to
have all the libc and crt stuff built, which is required for a
binary. In addition, trying to build a non-standard binary runs into
trouble with undefined symbols on arm related to EABI, even when using a
simplified startup with -nostdlib -e start.

Turn back on testing includes, now that it works.

Sponsored by: Netflix
Reviewed by: brooks, markj (prior version)
Differential Revision: https://reviews.freebsd.org/D33452


# 6a2b72bf 14-Dec-2021 Warner Losh <imp@FreeBSD.org>

Remove test-includes build

This is making the CI red. I believe this is because we do a clean build
w/o metamode in the tinderbox, so none of the artifacts needed to build
a binary are present. However, I've not recreated the problem locally
yet to confirm. Remove this while I investigate. This partially reverts
dd55767b86bc. The rest of the commit causes no harm w/o the explicit
test here.

Sponsored by: Netflix


# dd55767b 14-Dec-2021 Warner Losh <imp@FreeBSD.org>

Test various header files to ensure they can be included by themselves.

A number of header files in sys/* have, going back to 7th Edition Unix
in 1979, reqiured other files (like sys/types.h) to compile. Likewise
the 4BSD networking code has had prerequisites. However, going back to
around the turn of the 21st century, other systems have made them be
independently include-able (wide-spread header include protection
post-dates 7th edition Unix by maybe 3 or so years judging from USENET
source postings). Start down the path of making them all independently
include-able by creating this test that fails buildworld when they are
not.

The file 'badfiles.inc' contains a list of the currently broken files
that cannot be included w/o any prerequisites. As files are fixed, 'make
badfiles.inc' should be re-run to remove them from the list. Note: All
files that start with an underscore are considered internal and not
tested.

Please note: once a file is removed from badfiles.inc, it must pass on
all architectures. Buildworld through at least the _includes target is
needed to ensure its working (though a buildkernel should also be done
on all architectures as well).

Sponsored by: Netflix
Reviewed by: brooks, markj
Differential Revision: https://reviews.freebsd.org/D32498


# b8cacb38 09-Dec-2021 Warner Losh <imp@FreeBSD.org>

mips: Remove mips as a recognized build target.

Remove mips as a recognized build target in advance of its removal from
the tree.

Sponsored by: Netflix


# 59f4abfa 07-Dec-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Allow to specify PKG_ABI on the command line

This is useful for creating kernel package without having to buildworld
before as we use uname from the world stage dir to get the ABI.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D33323
Sponsored by: Beckhoff Automation GmbH & Co. KG


# 8f7eb330 06-Dec-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Bootstrap libcrypt on non-FreeBSD for libroken

After f0a6ab51e6da, we need libroken's dependencies to be present; in
particular, libcrypt is not present on macOS, and so needs to be
bootstrapped. We include this on Linux too for consistency and to avoid
future compatibility issues, even if strictly unnecessary currently.

Fixes: f0a6ab51e6da ("src.libnames.mk: Include dependencies when bootstrapping from non-FreeBSD"
MFC after: 1 week


# 8d5d3295 06-Dec-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Bootstrap libz when cross-building from non-FreeBSD

This is needed now libdwarf depends on libz.

Fixes: dbf05458e3bd ("libdwarf: Support consumption of compressed ELF sections")
MFC after: 1 week


# 9b135747 30-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

kern.pre.mk: allow to use and customize elfdump during kernel build

Reviewed by: emaste
Discussed with: jrtc27
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32960


# aaa4cd7f 28-Nov-2021 Juraj Lutter <otis@FreeBSD.org>

Makefile.inc1: Silence an error in make packages

Silence an error in "packages" target, like:

eval: /usr/src: Permission denied

on systems without subversion present.

Reviewed by: emaste
Approved by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33153


# 7b3642da 26-Nov-2021 Mark Johnston <markj@FreeBSD.org>

Hoist cddl prebuild lib dependency definitions out of a MK_ZFS block

The compilation of several libraries under cddl/lib is not conditional
on MK_ZFS = "yes", so their dependency on libspl is not conditional
either. Unbreak buildworld when WITHOUT_ZFS is set.

Reported by: bz
Fixes: 9e9c651caceb ("cddl: fix missing ZFS library dependencies")
MFC after: 1 week


# 483a2262 24-Nov-2021 Ed Maste <emaste@FreeBSD.org>

Add ncurses/form to _prebuild_libs to fix build

Reported by: bz


# 8502220d 19-Nov-2021 Warner Losh <imp@FreeBSD.org>

Revert "Bootstrap: Prune building from pre-FreeBSD 11 support"

This reverts commit a420a672bc53bd3928626aa5d0ec5b41c0471356.

kevans pointed out some potential problems here, so reverting until
I can fix them.


# a420a672 10-Oct-2021 Warner Losh <imp@FreeBSD.org>

Bootstrap: Prune building from pre-FreeBSD 11 support

We don't need to bootstrap lex or md4 anymore.
Cat doesn't need to be bootstrapped (but is needed for buildkernel)
cruncgen doesn't need to be bootstrapped at all.
kbdcontrol isn't needed

Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/554


# 27a04f59 18-Nov-2021 Warner Losh <imp@FreeBSD.org>

Add warning that MIPS is being removed in FreeBSD 14.0

MFC After: 3 days
Sponsored by: Netflix
Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D32853


# 9e9c651c 16-Oct-2021 Greg V <greg@unrelenting.technology>

cddl: fix missing ZFS library dependencies

In 9fae47666 zfsd got a libspl dependency to avoid undefined references.
However that workaround did not help external consumers of libzfs_core.

Fix all missing dependencies lld 13 and the rtld complain about.

Reviewed by: freqlabs, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D32521


# e5adb145 10-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

Remove arm/linux from sysent toplevel target

Sponsored by: The FreeBSD Foundation
Fixes: 65e485014b0dcf53e0


# eab5358b 24-Oct-2021 Mateusz Piotrowski <0mp@FreeBSD.org>

Makefile.inc1: Remove mentions of removed target "update"

This is follow-up to commits e290182bcf38 and 1f7d11e636ab.


# 1a724aa9 18-Oct-2021 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove lorder from build/cross tools

As lorder is not used by the base system build there is no need to
include it in bootstrap-tools or NXBDIRS.

Fixes: 0e1e341b486c ("Stop using lorder and ranlib when...")
Sponsored by: The FreeBSD Foundation


# e2e2c622 13-Oct-2021 Kyle Evans <kevans@FreeBSD.org>

native-xtools: avoid libllvm while populating the sysroot

Prior to 021385aba562, MK_CLANG=no was sufficient to avoid descending
into lib/clang, but the referenced change added a couple of other
enabling knobs. Turn those off, too, to continue avoiding libllvm.

With this change, we no longer end up with a libllvm using the wrong
default target triple; `poudriere jail -cx` works once again.

Reported by: bhughes, imp, probably others
Fixes: 021385aba562 ("Add WITH_LLVM_BINUTILS to install LLVM ...")


# c05b382e 11-Oct-2021 Warner Losh <imp@FreeBSD.org>

Revert "bootstrap: No need to disable shared libraries for bootstrap tools"

This reverts commit e8f26e5dc859a8fbc663e108421f657325ca3054.

Although the change worked locally, it's breaking something in the CI
build for the riscv64 build (which makes no sense it would only break
that since we're building host tools to bootstrap at that point).

Sponsored by: Netflix


# e8f26e5d 11-Oct-2021 Warner Losh <imp@FreeBSD.org>

bootstrap: No need to disable shared libraries for bootstrap tools

There's no need to disable shared libraries when building the bootstrap
tools. This was added on 2000 (commit ad879ce9552c) when the perl
bootstrap was added (libperl and miniperl) and saved a fair amount of
time (perl took a long time to build on 2000-era hardware).

For many years now, however, we rarely build any libraries when
bootstrapping. Even when we do, the optimization saves at most a few
seconds when upgrading since the libraries built have been small. Shared
libraries are more robust accross versions that static libraries due to
creaping dependencies (we aren't crossing versions of share libraries,
though, just using what's on the host). In addition, linux and macos
have been building like this for some time because static binaries on
those systems are difficult to impossible.

Sponsored by: Netflix
Reviewed by: arichardson, bapt
Differential Revision: https://reviews.freebsd.org/D32443


# 4d7876aa 06-Oct-2021 Kyle Evans <kevans@FreeBSD.org>

build: slap a libtinfo dependency on libncurses

This mirrors the SUBDIR_DEPEND in lib/ncurses/Makefile.

Reported by: jenkins (e.g., riscv64 build #23984)
Fixes: 396851c20aeb ("ncurses: split libtinfo from libncurses")


# cbc83e37 22-Sep-2021 Baptiste Daroussin <bapt@FreeBSD.org>

ncurses: chase dependency changes in the source tree

Differential Revision: https://reviews.freebsd.org/D32098


# cf0ee873 12-Sep-2021 Konstantin Belousov <kib@FreeBSD.org>

Drop cloudabi

According to https://github.com/NuxiNL/cloudlibc:
CloudABI is no longer being maintained. It was an awesome experiment,
but it never got enough traction to be sustainable.

There is no reason to keep it in FreeBSD.

Approved by: ed (private mail)
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D31923


# 895545d0 11-Sep-2021 Doug Rabson <dfr@FreeBSD.org>

Fix spelling of BUILDENV_SHELL


# 021385ab 06-Sep-2021 Alex Richardson <arichardson@FreeBSD.org>

Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain

When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as
ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones.
Having the LLVM binutils instead of the elftoolchain ones allows us to use
features such as LTO that depend on binutils that understand LLVM IR.
Another benefit will be an improved user-experience when compiling with
AddressSanitizer, since ASAN does not symbolize backtraces correctly if
addr2line is elftoolchain addr2line instead of llvm-symbolizer.
See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html
for more details.

This is currently off by default but will be turned on by default at some
point in the near future.

Reviewed By: emaste

Differential Revision: https://reviews.freebsd.org/D31060


# 1e4c8029 24-Aug-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Fix bootstrapping to actually build lldb-tblgen for later use

Because MK_LLDB=no is in BSARGS, the bootstrap-tools recursive make does
not add lldb-tblgen to _clang_tblgen, causing it to not be built. This
means that the build currently always uses the host's lldb-tblgen
(which, whilst currently it appears to work, could in future break if
TableGen backends are added or altered) and, if it doesn't exist (either
because the current FreeBSD system was built with it disabled, or you're
building on macOS/Linux), fails. Linux and macOS cross-builds used to
work simply because LLDB was previously in BROKEN_OPTIONS when building
on non-FreeBSD.

Instead, move MK_LLDB=no from BSARGS to XMAKE. This ensures that the
lib/clang build in cross-tools continues to not build LLDB parts for the
bootstrap toolchain (both to save time/space on FreeBSD, and because our
vendored LLDB does not include the macOS and Linux host files so those
would fail to build).

The DIRDEPS target is updated to move MK_LLDB=no from the BSARGS block
that mirrors Makefile.inc1 to the line that disables additional
toolchain components. The DIRDEPS build likely suffers from the same
issue currently, but having never used it and not being familiar with
how it works I am leaving that as-is. If it does suffer from the same
issue it should be easily reproducible by renaming /usr/bin/lldb-tblgen
or moving it to a directory not in PATH.

Fixes: 31ba4ce8898f ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after: 1 week
Reviewed by: dim, emaste, imp
Differential Revision: https://reviews.freebsd.org/D31531


# ab3a1809 24-Aug-2021 Jessica Clarke <jrtc27@FreeBSD.org>

Makefile.inc1: Make sure sub-makes see MK_CLANG_BOOTSTRAP=no when XCC is a path

Currently we override MK_CLANG_BOOTSTRAP to no so we don't build a
bootstrap compiler, but subdirectories don't see that and so the hack in
bsd.sys.mk to prefer our includes over Clang's resource dir for external
toolchains is not enabled unless you use -DWITHOUT_CLANG_BOOTSTRAP
explicitly on top of XCC (which tools/build/make.py does not do),
causing duplicate definition errors when building rtld-elf due to the
use of -ffreestanding (Clang's stdint.h will use the system one when
hosted, but its own when freestanding, and only has glibc's preprocessor
guards, not FreeBSD's).

This broke when dropping CLANG_BOOTSTRAP from BROKEN_OPTIONS.

Fixes: 31ba4ce8898f ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after: 1 week
Reviewed by: imp, arichardson
Differential Revision: https://reviews.freebsd.org/D31529


# 298ee47e 18-Aug-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

localedef: unbreak WITHOUT_LOCALES

After 0fa5403d493b ("pkgbase: move locales into their own package") we
need usr.bin/localedef as a bootstrap tool independent on where
WITHOUT_LOCALE was specified as we ALWAYS process C.UTF-8.

At the same time LOCALES= in the local Makefile is empty but
C.UTF-8 with WITHOUT_LOCALES. C.UTF-8 is excluded from FILES, and thus
after the replacement FILES= is set to only .LC_CTYPE which results in
a build failure not knowing how to build that. Tweak the substitution to
replace only non-empty words so that FILES remains harmlessly empty.

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


# 4b7bf842 17-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

bootstrap-tools: Don't copy host tools with make -n


# a3ddd7c9 17-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

_worldtmp: Fix some sub-makes not working with make -n


# cc134505 16-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Add missing lex/yacc dependency for mkesdb/mkcsmapper bootstrap

This causes build failures on macOS where the build can end up invoking
an incompatible m4 binary.

Fxies: 2de949cf85d0 ("Remove mkcsmapper_static and mkesdb_static from build-tools")


# 54247ce1 07-Aug-2021 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: Avoid hanging if pkg is not installed

For `pkg --version`, Redirect stdin from /dev/null to avoid waiting on
/usr/sbin/pkg's bootstrap prompt if the pkg package is not installed.
Also redirect stderr to /dev/null to discard the warning message in
this case.

Reported by: mjg
Fixes: 4e224e4be7c3 ("pkgbase: accommodate pkg < 1.17")
Sponsored by: The FreeBSD Foundation


# 61ed578e 04-Aug-2021 Mitchell Horne <mhorne@FreeBSD.org>

Prefer MK_SSP=no to SSP_CFLAGS=

It is more idiomatic. CFLAGS is only augmented with $SSP_CFLAGS when
$MK_SSP != "no".

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31401


# bcd2f41f 04-Aug-2021 Mitchell Horne <mhorne@FreeBSD.org>

mk: format some option lists

Alphabetize and give each option its own line, ahead of making another
change to these lists. This makes future diffs easier to read.

Reviewed by: imp, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31399


# b60770fc 03-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native-xtools build

Fixes https://github.com/freebsd/poudriere/issues/894
Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line")
X-MFC-With: d0c737e18


# 2482ea42 03-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

Revert "Fix native-xtools build"

This reverts commit 36269b82318280ef184c953b90674f5905e0f53f.

This had an unintended change included.


# 36269b82 03-Aug-2021 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native-xtools build

Fixes https://github.com/freebsd/poudriere/issues/894
Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line")
X-MFC-With: d0c737e18


# 2de949cf 02-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Remove mkcsmapper_static and mkesdb_static from build-tools

Build them as part of the bootstrap-tools phase instead.

Reviewed by: emaste (no objections)
Differential Revision: https://reviews.freebsd.org/D28181


# 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


# bbd16236 01-Aug-2021 Wolfram Schneider <wosch@FreeBSD.org>

add the time(1) command to the list of install tools

Reported by: dhw
Approved by: dhw
Differential Revision: https://reviews.freebsd.org/D31373


# 99feb137 01-Aug-2021 Wolfram Schneider <wosch@FreeBSD.org>

`make buildworld' with time logging for each stage

PR: 257141
Reviewed by: sjg,emaste
Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D31154


# 4dbac528 28-Jul-2021 Ed Maste <emaste@FreeBSD.org>

pkgbase: improve pkg --version parsing

In some cases `pkg --version` might produce unexpected or additional
output. Use a regex /^[0-9.]+$/ to match only the line containing the
version number.

Reported by: Michael Butler on freebsd-current@
Fixes: 4e224e4be7c3 ("pkgbase: accommodate pkg < 1.17")
Sponsored by: The FreeBSD Foundation


# 4e224e4b 26-Jul-2021 Ed Maste <emaste@FreeBSD.org>

pkgbase: accommodate pkg < 1.17

6cafdee71d2b adapted the pkgbase build for 1.17, but broke Cirrus-CI's
use of PKG_FORMAT=tar (the quarterly package set still has pkg 1.16).
Because of this I disabled the pkgbase build and test in 2bfba2a04b05.

Now, check `pkg --version` and use the old logic for < 1.17.

To be reverted once we no longer encounter pkg 1.16 in Cirrus-CI (i.e.,
via GCP cloud images) to avoid keeping this extra complexity around.

PR: 257422
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31324


# 6cafdee7 04-May-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Track pkg 1.17

With pkg 1.17 the extention is always .pkg, packing_format is also now deprecated.


# c5d1d88a 05-Jul-2021 Alex Richardson <arichardson@FreeBSD.org>

Don't build lldb-tablegen if MK_LLDB=no

Split out from D31060.

Reviewed by: emaste


# 0333fad1 11-Jun-2021 John Baldwin <jhb@FreeBSD.org>

Remove svnlite.

Reviewed by: bcr, imp, emaste
Differential Revision: https://reviews.freebsd.org/D30737


# e290182b 11-Jun-2021 John Baldwin <jhb@FreeBSD.org>

Remove 'make update'.

In the CVS days this used be a wrapper around either CVS or CVSup and
used to support updating src, doc, and ports checkouts. With the move
to subversion this only supported updating src and was itself a
wrapper around 'svn update'. With Git, users are probably better off
using appropriate Git commands directly to update without needing an
explicit make target as a wrapper.

Reviewed by: bcr, imp, emaste
Differential Revision: https://reviews.freebsd.org/D30736


# 689c7e79 31-May-2021 Mitchell Horne <mhorne@FreeBSD.org>

libpmc: always generate libpmc_events.c

The jevents build tool will create an empty table if it doesn't find any
events, so we can remove the extra $MACHINE_CPUARCH checks.

Reviewed by: gnn, ray, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30531


# c6081dea 21-May-2021 Marcin Wojtas <mw@FreeBSD.org>

Add elfctl to toolchain.

Add elfctl program to toolchain to allow modifying ELF feature flags
during system build.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D29552


# 50179c5ec 23-Mar-2021 Glen Barber <gjb@FreeBSD.org>

Makefile.inc1: unbreak bootstrap when kbdcontrol does not exist

Reviewed by: arichardson
MFC after: 12 hours
MFC target: stable/13, releng/13.0
Differential Review: https://reviews.freebsd.org/D29200
Sponsored by: Rubicon Communications, LLC ("Netgate")


# 4a847a6c 18-Mar-2021 Baptiste Daroussin <bapt@FreeBSD.org>

Revert "bootstrap: add tic to the bootstrap tools"
Since we don't build and install the terminfo db anymore this is not
needed

This reverts commit b6a51d39e3a2e2f75d5b42a8c17a531063258a15.
This reverts commit e5e4845959ac60110677df302a68c220dff75abe.
This reverts commit 0af562d7e1850bbef230d30805c101b26588a3ed.


# e5e48459 01-Mar-2021 Alex Richardson <arichardson@FreeBSD.org>

Makefile.inc1 "Avoid duplicate script for target" warning

This happens if -DBOOTSTRAP_ALL_TOOLS or when building on non-FreeBSD.


# b6a51d39 25-Feb-2021 Baptiste Daroussin <bapt@FreeBSD.org>

bootstrap: fix a last edit typo

Reported by: cy


# 0af562d7 22-Feb-2021 Baptiste Daroussin <bapt@FreeBSD.org>

bootstrap: add tic to the bootstrap tools

tic is necessary early in the build to be able to build the terminfo
database later on.

Tested by: manu, jbeich


# 5cf6f1c4 30-Jan-2021 Alex Richardson <arichardson@FreeBSD.org>

Remove the MK_LIBCPLUSPLUS option

This option has been equivalent to any form of C++ support since libstdc++
was removed. Therefore, replace all MK_LIBCPLUSPLUS uses with MK_CXX.

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


# 123ae304 20-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

build: remove LIBPTHREAD/LIBTHR build options

WITHOUT_LIBTHR has been broken for a little over five years now, since the
xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building
a useful system without threading support is becoming increasingly more
difficult.

Additionally, in the five plus years that it's been broken more reverse
dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among
others) that make it more and more difficult to reconcile the effort needed
to fix these options.

Remove the broken options.

PR: 252760
Reviewed by: brooks, emaste, kib
Differential Revision: https://reviews.freebsd.org/D28263


# 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")


# 26490d9b 18-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: allow update-packages for first-run of packaging

If ${REPODIR}/${PKG_ABI} does not exist when we begin real-update-packages,
skip the comparison with the non-existent previous repository and just
finish the repo off. This allows external scripts to just assume they can
run `update-packages` rather than figuring out if they'd previously run
`packages` for this Version/Arch combo.

PKG_VERSION_FROM_DIR was added so that we could perhaps detect the three
distinct cases:

1.) If the repo has not yet been created, PKG_VERSION_FROM_DIR will be
empty.
2.) If the repo is in some intermediate state between created and fully
initialized, PKG_VERSION_FROM_DIR may point to the ABI directory.
3.) If the repo is fully initialized, then PKG_VERSION_FROM_DIR points to
the latest build to compare to.

Option #2 is explicitly unhandled at the moment, but this is no different
than it was before.

Reviewed-by: manu
Differential-Revision: https://reviews.freebsd.org/D28229


# 613fe532 14-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases

The current postfix conversions are:

CURRENT / STABLE / PRERELEASE, 12.x-CURRENT becomes 12.snapYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1.YYYYMMDDhhmmss
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2.YYYYMMDDhhmmss
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3.YYYYMMDDhhmmss
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1
RELEASE-pX -> pX, so 12.1-RELEASE-p1 becomes 12.1p1

Note that for development branches we will start to drop the minor version
component entirely, which more closely matches how these branches are
physically named (stable/NN).

snap is a new prefix that was added to pkg in [0], which is simply a more
verbose version of the current ".s" used.

As noted, build timestamps are also added to ALPHA/BETA/RC versions. This
is largely irrelevant for re@ snapshots because they will only produce one
set of snapshots for each alpha/beta/rc, but external folks may produce
multiple in that timeframe -- at least for alpha. For them, it is
imperative that the builds have a differentiating characteristic like this
rather than multiple builds across multiple revisions being versioned
identically.

[0] https://github.com/freebsd/pkg/pull/1929

Reviewed by: gjb, manu
Submitted by: rene (original, original version)
Differential Revision: https://reviews.freebsd.org/D28167


# 95ae95d4 18-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: limit PKG_VERSION_FROM calculation to real-update-packages

PKG_ABI is defined in some other targets that do not need to shell out and
calculate PKG_VERSION_FROM. Moreover, it produces extra errors when
bootstrapping an initial pkgbase repo, as the /latest link doesn't exist
yet.


# da8cc827 13-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: collapse -PRERELEASE into STABLE/CURRENT case for version suffix

-PRERELEASE exists as a given stable/X branch while the next minor version
release is in progress. From a functional standpoint, it should be treated
as -STABLE since it'll typically be a superset of what's included in the
concurrent releng branch.

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D28166


# 9af9e7c5 15-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

pkgbase: default to installing all specified kernels

These only get staged off to the side, not installed into the system. Let's
change the default for packages/update-packages to be less surprising.

MFC after: 1 week
Reviewed by: manu, meena <me igalic co>
Differential Revision: https://reviews.freebsd.org/D28190


# 03cab14e 14-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

Revert "pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases"

This reverts commit aef769614f921660cb0262412426034cf5395ae5.

While the package names are a bit prettier this confuse pkg about upgrading :
$ pkg version -t 13.0.s2021011313063 13.0.a1
>
$ pkg version -t 13.0.s2021011313063 13.0_ALPHA1
<

Note that the current scheme isn't good when bumping from ALPHA to BETA or
even BETA to RC:
$ pkg version -t 13.0_ALPHA1 13.0_BETA1
=
$ pkg version -t 13.0_BETA1 13.0_RC1
=

But more thoughts have to be put into this renaming.


# aef76961 14-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases

The current postfix conversions are:

CURRENT / STABLE -> .sYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3
PRERELEASE -> .p, so 11.3-PRERELEASE becomes 11.3.p
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1

Submitted by: rene (original version)
Differential Revision: https://reviews.freebsd.org/D20734


# 44b8b2a0 16-Dec-2020 Bryan Drewery <bdrewery@FreeBSD.org>

Makefile.inc1: Avoid using release/Makefile for VERSION.

release/Makefile.inc1 has git executions that were being ran for each of
these lookups. The results were not needed so just lookup what we want
directly instead.

Reviewed by: gjb, rlibby, emaste (maybe)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27643


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

Rename NO_WERROR -> MK_WERROR=no

As suggested in D27598. This also supports MK_WERROR.clang=no and
MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses.

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


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

Stop passing MK_WARNS=no for bootstrap tools

I got annoyed by the number of warnings that the CheriBSD build was
emitting. It turns out that we are emitting lots of warnings during
bootstrap because bootstrap tools are built with the default compiler
flags and ignore the warnings flags that are set in bsd.sys.mk.

Looking at git blame, it appears that MK_WARNS=no has been passed since
rS112869, replacing the -DNO_WERROR option that was added in rS87775.

This commit changes MK_WARNS=no back to -DNO_WERROR. We need to pass
-DNO_WERROR, since the system compiler might have new warnings that we
don't know about yet, and we shouldn't fail the build in that case.

Reviewed By: imp, brooks
Differential Revision: https://reviews.freebsd.org/D27598


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

Add mkimg to the list of bootstrap tools

Having this as part of the bootstrap tools is useful to build disk images
to boot in QEMU (especially when building on a Linux/macOS host where
mkimg is not available). We have been bootstrapping mkimg in CheriBSD for
a long time (using LOCAL_XTOOL_DIRS) but I believe this is also useful
upstream.

Reviewed By: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D27602


# f1829643 06-Jan-2021 Toomas Soome <tsoome@FreeBSD.org>

vtfontcvt is part of bootstrap toolset and should always be built

Reported by: Peter Jeremy


# 821aa63a 04-Jan-2021 Baptiste Daroussin <bapt@FreeBSD.org>

ncurses: only keep the version with widechar support

Only keep the widechar version of ncurses as libncursesw.so.9

Keep the old name to avoid breaking the ABI compatibility (the non
widechar version libncurses.so.9 is not binary compatible with
libncursesw.so.9) since all ports and base are already only linking
against the widechar version we can simply remove libncurses.so.9

Since the .9 version only lived in the dev branch and never ended in a
release, it is simply removed and not added to any binary compat
package.

Add symlinks to keep build time compatibility for anyone linking against
-lncurses


# 4401fa9b 04-Jan-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: rename PKGSIGNKEY to PKG_REPO_SIGNING_KEY

this way, it'll be automatically picked up by poudriere
That's quite handy when building pkgbase!

Submitted by: Mina Galić <me@igalic.co>
Reviewed By: bapt, bcr (manpages)
Differential Revision: https://reviews.freebsd.org/D27690


# fe7dff17 15-Dec-2020 Ed Maste <emaste@FreeBSD.org>

Remove additional GDB leftovers missed in r368667


# f7ff7baa 04-Dec-2020 Alex Richardson <arichardson@FreeBSD.org>

crunchgen: fix NULL-deref bug introduced in r364647

While porting over the local changes from CheriBSD for upstreaming, I
accidentally committed a broken version of find_entry_point(): we have to
return NULL if the value is not found instead of a value with
ep->name == NULL, since the checks in main were changed to check ep instead
of ep->name for NULL.

This only matters if the crunched tool cannot be found using normal lookup
and one of the fallback paths is used, so it's unlikely to be triggered
in rescue. However, I noticed that one of our CheriBSD test scripts was
failing to run commands under `su` on minimal disk images where all
binaries are hardlinks to a `cheribsdbox` tool generated with crunchgen.

This also updates the bootstrapping check in Makefile.inc1 to bootstrap
crunchgen up to the next version bump.

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D27474


# 80cedb80 20-Nov-2020 Bryan Drewery <bdrewery@FreeBSD.org>

Add lists for customizing legacy and bootstrap-tools.

Reviewed by: arichardson
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27200


# 4ae78e70 20-Nov-2020 Alfredo Dal'Ava Junior <alfredo@FreeBSD.org>

[POWERPC64LE,POWEPCSPE] set default kernel config for powerpc64le and powerpcspe variants

Default KERNCONF for powerpc64le should be GENERIC64, and powerpcspe should
select MPC85XXSPE

Reviewed by: bdragon,emaste
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D27257


# 0e55bb7b 13-Nov-2020 Alex Richardson <arichardson@FreeBSD.org>

Makefile.inc1: remove no-longer required variable

This variable is unsed since r364760 but I forgot to delete it in that commit.

Reported By: bdrewery


# 8da6fc4d 04-Nov-2020 John-Mark Gurney <jmg@FreeBSD.org>

fix the docs, this was always wrong... In some cases, DISTDIR is set
automatically by tools via /etc/make.conf, so remind people (me) where
to find where it's set..

It would be nice for someone to document what DISTDIR is better than:
where the file for a distribution gets installed


# 0ac8aa55 02-Nov-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add incremental packages

This adds a new target update-packages which will create the new packages
compared to the last run.

This is how to use it:
At this point we cut a release
$ make buildworld ...
$ make buildkernel
$ make packages

There is now a PKG_VERSION directory with latest link pointing to it
Distribute the packages to server

$ something something that update the source tree
$ make buildworld ...
$ make buildkernel
$ make update-packages
You know have a PKG_VERSION directory in the REPODIR and latest link pointing to it.
In PKG_VERSION dir only the packages which differs from the latest run are
named PKG_VERSION, otherwise the old packages are there.

The process is :
Build the new packages in the PKG_VERSION directory
Compare the internal data with the PKG_VERSION_FROM version. The comparison is done
by checking the internal hash of the packages.
By default PKG_VERSION_FROM is set to what the latest link points to.
If the old and new version matches, we rm the new package and cp the old one.

Differential Revision: https://reviews.freebsd.org/D25984


# 73577bf0 24-Oct-2020 Ryan Moeller <freqlabs@FreeBSD.org>

flua: Add a libjail module

libjail is pretty small, so it makes for a good proof of concept demonstrating
how a system library can be wrapped to create a loadable Lua module for flua.

* Introduce 3lua section for man pages
* Add libjail module

Reviewed by: kevans, manpages
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D26080


# 3ac62888 18-Oct-2020 Alex Richardson <arichardson@FreeBSD.org>

Significantly speed up mkimg_test

It turns out that the majority of the test time for the mkimg tests isn't
mkimg itself but rather the use of jot and hexdump which can be quite slow
on emulated platforms such as QEMU.

On QEMU-RISC-V this reduces the time for `kyua test mkimg_test` from 655
seconds to 200. And for CheriBSD on QEMU-CHERI this saves 4-5 hours (25%
of the time for the entire testsuite!) since jot ends up triggering slow
functions inside the QEMU emulation a lot.

Reviewed By: lwhsu
Differential Revision: https://reviews.freebsd.org/D26796


# e5ccad50 12-Oct-2020 Alex Richardson <arichardson@FreeBSD.org>

Fix build with -DBOOTSTRAP_ALL_TOOLS

sbin/sysctl can no longer be bootstrapped on FreeBSD 12 after r366465,
so create a symlink to the host tool instead of trying to build it.


# 55be47b8 29-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

Makefile.inc1: sysent: allow subordinate sysent targets to run in parallel

makesyscalls.lua (and indeed makesyscalls.sh) are both safe to be run in
parallel, so let's do it.

This is a trivial difference because runtime per-target is pretty small, but
I like seeing it run in parallel when my muscle memory types `make -sj4`.

Reviewed by: brooks, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26594


# b75abea4 22-Sep-2020 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC64LE] Set up powerpc.powerpc64le architecture

This is the initial set up for PowerPC64LE.

The current plan is for this arch to remain experimental for FreeBSD 13.

This started as a weekend learning project for me and kinda snowballed from
there.

(More to follow momentarily.)

Reviewed by: imp (earlier version), emaste
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D26399


# 6129f33e 21-Sep-2020 Alex Richardson <arichardson@FreeBSD.org>

Prefer bootstrapped tools when running certctl.sh

Otherwise we get lots of warnings when building on Linux/macOS during
installworld:
Scanning /local/scratch/alr48/cheri/output/freebsd-x86/usr/share/certs/blacklisted for certificates...
install: invalid option -- 'U'
Try 'install --help' for more information.
install: invalid option -- 'U'
....

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D26481


# e307eb94 21-Sep-2020 Toomas Soome <tsoome@FreeBSD.org>

loader: zfs should support bootonce an nextboot

bootonce feature is temporary, one time boot, activated by
"bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.

By default, the bootonce setting is reset on attempt to boot and the next
boot will use previously active BE.

By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will
be set permanently active.

bootonce dataset name is recorded in boot pool labels, bootenv area.

in case of nextboot, the nextboot_enable boolean variable is recorded in
freebsd:nvstore nvlist, also stored in boot pool label bootenv area.
On boot, the loader will process /boot/nextboot.conf if nextboot_enable
is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf
processing on next boot.

bootonce and nextboot features are usable in both UEFI and BIOS boot.

To use bootonce/nextboot features, the boot loader needs to be updated on disk;
if loader.efi is stored on ESP, then ESP needs to be updated and
for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated
(gpart or other tools).

At this time, only lua loader is updated.

Sponsored by: Netflix, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25512


# fe815331 18-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

build: provide a default WARNS for all in-tree builds

The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by: emaste, brooks, ngie (all earlier version)
Reviewed by: emaste, arichardson (depend-cleanup.sh change)
Differential Revision: https://reviews.freebsd.org/D26455


# ca4b73c3 17-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

Promote the installworld `certctl rehash` to distributeworld

Contrary to my belief, installworld is not sufficient for getting certs
installed into VM images. Promote the rehash to both installworld and
distributeworld (notably: not stageworld) and rehash the base distdir so we
end up with /etc/ssl/certs populated in the base dist archive. A future
commit will remove the rehash from bsdinstall, which doesn't really need to
happen if they're installed into base.txz.

While here, fix a minor typo: s/CERTCLTFLAGS/CERTCTLFLAGS/

MFC after: 1 week


# 185e8af0 16-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

installworld: run `certctl rehash` after installation completes

This was originally introduced back in r360833, and subsequently reverted
because it was broken for -DNO_ROOT builds and it may not have been the
correct place for it.

While debatably this may still not be 'the correct place,' it's much cleaner
than scattering rehashes all throughout the tree. brooks has fixed the issue
with -DNO_ROOT by properly writing to the METALOG in r361397.

Do note that this is different than what was originally committed; brooks
had revisions in D24932 that made it actually use the revised unprivileged
mode and write to METALOG, along with being a little more friendly to
foreign crossbuilds and just using the certctl in-tree.

With this change, I believe we should now have a populated /etc/ssl/certs in
the VM images.

MFC after: 1 week


# 073e4094 13-Sep-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove more old stale depend hacks

Current stale dependency hacks are in tools/build/depend-cleanup.sh.
These ones were almost a year old; remove them from Makefile.inc1.


# b7b5bdba 10-Sep-2020 Alex Richardson <arichardson@FreeBSD.org>

Ensure that the makewhatis symlink is added in the bootstrap-tools stage

We currently set MK_MAN=no in $BSARGS so MK_MAN_UTILS will also be false
which means that the makewhatis symlink will not be created.
This change fixes the build when using both -DBUILD_WITH_STRICT_TMPPATH and
-DBOOTSTRAP_ALL_TOOLS.

Tested by: andrew
Differential Revision: https://reviews.freebsd.org/D16761


# 75766799 07-Sep-2020 Ed Maste <emaste@FreeBSD.org>

Add WITH_/WITHOUT_CLEAN option to replace NO_CLEAN

This allows use of the standard src.conf configuration for controlling
whether the tree is cleaned before build or not. The default is still
to clean.

Setting either NOCLEAN or NO_CLEAN will mention the new src.conf option.
NOCLEAN remains a .warning, while for now NO_CLEAN is .info.

Reviewed by: bdrewery (earlier version)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22762


# 30d46e45 31-Aug-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: comment .endif to ease finding matching .if


# cd568e2b 27-Aug-2020 Ryan Moeller <freqlabs@FreeBSD.org>

libzfs: Also add the crypto dependency to Makefile.inc1

Reported by: kevans
Discussed with: kevans
Sponsored by: iXsystems, Inc.


# 3ce13dbc 25-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Use bootstrapped install(1) install of tools/install.sh in world stage

This should be noticeably faster due to fewer processes being forked and
also handles other flags such as -S or writing to METALOG.

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


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

Fix running the builddtb target on a noexec file system

Obtained from: CheriBSD


# 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


# 9e5787d2 24-Aug-2020 Matt Macy <mmacy@FreeBSD.org>

Merge OpenZFS support in to HEAD.

The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.

I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.

Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.

Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.

Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.

Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872


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


# ebae797c 24-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Also print number of available CPUs on Linux

Without this change the buildworld/buildkernel epilogue looks like this:
>>> World built in 249 seconds, sysctl: cannot stat /proc/sys/hw/ncpu: No such file or directory
ncpu: , make -j72.

Reviewed By: emaste, bdrewery
Differential Revision: https://reviews.freebsd.org/D26056


# 0f31fdf2 24-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Pass the installworld install(1) flags to make buildenv

This ensure that running make install inside buildenv correctly includes
the METALOG flags when building with -DNO_ROOT.

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


# 530134d2 21-Aug-2020 Bjoern A. Zeeb <bz@FreeBSD.org>

After the clang/llvm version 11 import LLD_VERSION is no longer used
upstream so Version.inc now only defines LLD_VERSION_STRING.

This breaks the WANT_LINKER_VERSION magic and might lead to us building
more than needed (e.g., for croos-tools).

Change the awk script to parse LLD_VERSION_STRING instead of LLD_VERSION,
which not only unbreaks the current situation but should also be backwards
compatible as dim points out.

PR: 248818
Reviewed by: emaste, dim (seems right and the way to go)
MFC after: 4 weeks
X-MFC before: 364284


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

Fix -DBUILD_WITH_STRICT_TMPPATH dtrace builds

Some of the scripts used for libdtrace invoke nawk instead of awk
(for example cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh).
When bootstrapping all tools, we get the nawk -> awk link while building
usr.bin/awk, but when linking/copying the dependencies from the host we
were only adding awk but not nawk.

This was silently generating invalid files when building libdtrace with
BUILD_WITH_STRICT_TMPPATH=1 since those scripts invoke nawk instead of
awk. In addition to adding the missing link this commit also adds
set -e to those scripts to catch errors like this in the future.

Reviewed By: markj, emaste
Differential Revision: https://reviews.freebsd.org/D26025


# 1a18ab42 11-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Allow overriding the tool used for stripping binaries

Since the make variable STRIP is already used for other purposes, this
uses STRIPBIN (which is also used for the same purpose by install(1).
This allows using LLVM objcopy to strip binaries instead of the in-tree
elftoolchain objcopy. We make use of this in CheriBSD since passing
binaries generated by our toolchain to elftoolchain strip sometimes results
in assertion failures.

This allows working around https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248516
by specifying STRIPBIN=/path/to/llvm-strip

Obtained from: CheriBSD
Reviewed By: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D25988


# a90022d4 11-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Replace / with | for PKG_WWW

PKG_WWW contain / char, replace the delimiter by a '|'.

Reported by: 0mp


# 82087d4b 11-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add PKG_NAME_PREFIX, PKG_MAINTAINER and PKG_WWW

This is useful for downstream users to customize the packages.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D26019


# 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


# 0d834e0f 07-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Fix duplicate assignment of _localedef in Makefile.inc1

The same .if exists a few lines below.


# 70fc0cc3 06-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add the possibility to choose the output dir

The output dir is set to ${REPODIR}/${PKG_ABI}/${PKG_VERSION} now.
Add the possibility to specify the last componant and set it by default
to ${PKG_VERSION} as before.
This is useful for tests and also for building packages with the same
PKG_VERSION provided to check differences.


# d0327929 06-Aug-2020 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add a new variable PKG_TIMESTAMP

libarchive uses the SOURCE_DATE_EPOCH env variable to set the date of file
in an archive, this is useful for reproducibility.
Add a variable name PKG_TIMESTAMP that take a epoch time and set SOURCE_DATE_EPOCH
to this. By default it is the current time so no changes here.


# eb578fec 03-Aug-2020 Kyle Evans <kevans@FreeBSD.org>

Ensure libregex is built in time for googletest

In lib/Makefile, we document the dependency with SUBDIR_DEPEND

For buildworld orchestration, just prebuild libregex if GOOGLETEST is
enabled. googletest will get built in a later pass.


# 40056899 16-Jul-2020 Glen Barber <gjb@FreeBSD.org>

Move GIT_CMD a few lines down, so it is not in between SVN_*
lines.

Sponsored by: Rubicon Communications, LLC (netgate.com)


# ff1031c1 16-Jul-2020 Glen Barber <gjb@FreeBSD.org>

Add GIT_CMD, similar to SVN_CMD.

Sponsored by: Rubicon Communications, LLC (netgate.com)


# 0a9ab9f5 24-Jun-2020 Conrad Meyer <cem@FreeBSD.org>

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT. Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

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


# a19aa4f7 21-Jun-2020 Kyle Evans <kevans@FreeBSD.org>

Squash liblzma build race

As of r362452, liblzma depends on libmd but the buildworld build order
hadn't been amended to document the new dependency.

Reported by: jenkins via freqlabs
X-MFC-With: r362452


# 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


# 74e8d41e 06-Jun-2020 Ed Maste <emaste@FreeBSD.org>

Retire BINUTILS and BINUTILS_BOOTSTRAP options

As of r361857 all BINUTILS options are disabled by default - ports
have been changed to depend on binutils if they require GNU as, and
all base system assembly files have been switched to use Clang's
integrated assembler.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation


# 5843b6e7 05-Jun-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove stale dependency cleanup from 2018


# 694034e2 30-May-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove BINUTILS_BOOTSTRAP linker support

As of r359347 BINUTILS_BOOTSTRAP does not include the bfd linker.


# 697b271d 20-May-2020 Ed Maste <emaste@FreeBSD.org>

pkgbase: use -dev,-dbg instead of -development,-debug

-development is long and awkward, and is also inconsistent with prior art
from the Linux world, which uses -dev (Debian) or -devel (Red Hat). Follow
the Debian convention, and similarly for debug info packages.

Also remove redundant pkgbase development tag from includes. We already tag
include files with package=runtime,dev; there is no need to separately tag
them as dev.

Discussed with: bapt
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24139


# 20076f97 17-May-2020 Kyle Evans <kevans@FreeBSD.org>

Revert r360833, r360882: certctl rehash in installworld

This was solving the correct-ish problem in the wrong place. Noted by
brooks; while he didn't request a prompt revert, doing so now will
facilitate proper testing for the revised version of this.


# a93817e0 10-May-2020 Kyle Evans <kevans@FreeBSD.org>

buildworld: add back in missing semicolon

if foo; then blah else blah; fi has a drastically different meaning than
if foo; then blah; else blah; fi. Fix it.

Reported by: 0mp
X-MFC-With: r360833


# 70868d48 08-May-2020 Kyle Evans <kevans@FreeBSD.org>

installworld: attempt a certctl rehash at the tail end

This can be run as root or normal user with no problem; if they hadn't
twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to
rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL +
WITH_CAROOT with a populated /etc/ssl that they can then use with an
appropriate *ssl from somewhere else.

Cross-builds are fine because this will always use the host certctl, or just
nag if it's missing and it wasn't a WITHOUT_CAROOT build.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24641


# 61fbd61b 25-Apr-2020 Dimitry Andric <dim@FreeBSD.org>

Fix race between prebuilding libsbuf and libgeom

The latter needs the former, but with a multi-job build on a fast
machine, the race is sometimes lost. This leads to "ld: error: unable to
find library -lsbuf", when linking libgeom.so.

Submitted by: kevans
MFC after: 3 days


# 6fe257c7 13-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

Move shm_open dependency cleanup into a new home

r359461 introduced this nifty script to centralize these things, so add
shm_open.c there to remove a total of one (1) bad example from
Makefile.inc1.

Looked over by: emaste


# a8b8edb2 06-Apr-2020 Maxim Sobolev <sobomax@FreeBSD.org>

Normalize deployment tools usage and definitions by putting into one place
instead of sprinkling them out over many disjoint files. This is a follow-up
to achieve the same goal in an incomplete rev.348521.

Approved by: imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20520


# f382bac4 06-Apr-2020 Brooks Davis <brooks@FreeBSD.org>

Fix compilation with upstream clang builtin headers.

By using -nobuiltininc and adding the clang builtin headers resource dir
to the end of the compiler header search path, we can still find headers
such as immintrin.h but find the FreeBSD version of stddef.h/stdarg.h/..
first.

This is a workaround until we are able to settle on and complete a plan
to harmonize guard macros with LLVM. We've mostly worked out this on
FreeBSD systems by removing select headers from the installed set of
devel/llvm*, but that isn't a good solution for cross build.

Submitted by: arichardson
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17002


# e40fa28f 03-Apr-2020 Brooks Davis <brooks@FreeBSD.org>

Pass the real value of MK_TESTS_SUPPORT to distribution.

This allows kyua's config file to actually be installed.

Reported by: arichardson
Reviewed by: arichardson
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24268


# 4dad87a4 30-Mar-2020 Ed Maste <emaste@FreeBSD.org>

add shell script for stale dependency hack

It's rather awkward to debug issues with the dependency cleanup hacks
when implemented via make. Add a cleanup shell script and move the
libomp hack there as an initial example.

Reviewed by: brooks
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24228


# c42a6767 30-Mar-2020 Brooks Davis <brooks@FreeBSD.org>

Relax existence check of ${LOCALBASE}/bin/kyua

After the base kyua import the testsuite can utilize the in-base kyua
just fine.

Submitted by: Dries Michiels
Differential Revision: https://reviews.freebsd.org/D24230


# be2af8fb 27-Mar-2020 Brooks Davis <brooks@FreeBSD.org>

Use the real value of MK_TESTS_SUPPORT in _libraries.

We need to build kyua libraries for kyua. Because we set MK_TESTS=no,
we can't not set MK_TESTS_SUPPORT=${MK_TESTS_SUPPORT} because the latter
defaults MK_TESTS_SUPPORT to no.

This fixes WITHOUT_TESTS + WITH_TESTS_SUPPORT builds.

Reported by: Ruslan Garipov
Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24206


# eb61f7bd 26-Mar-2020 Emmanuel Vadot <manu@FreeBSD.org>

Stop building libl and liby

Those libs aren't needed anymore so stop building them for the bootstrap tools
or the compat libs.

Reviewed by: bapt, emaste
X-Differential Revision: D24171


# 52de22ca 24-Mar-2020 Mitchell Horne <mhorne@FreeBSD.org>

Makefile.inc1: override MACHINE for native-xtools

For the final step of the native-xtools target, "everything" is built
with TARGET and TARGET_ARCH set to the architecture we wish to
cross-build for. However, CROSSENV overwrites the values of MACHINE and
MACHINE_ARCH, setting them to be identical to TARGET and TARGET_ARCH.
For native-xtools this is undesirable since we are building binaries to
run on the host architecture, that can cross compile for the target
architecture.

When building native-xtools for RISC-V, this issue manifests as an invalid
argument for "-march". The compiler is invoked with the target triple of the
host architecture, but the CFLAGS inherited from bsd.cpu.mk are that of the
target architecture.

Reviewed by: imp, bdrewery
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23838


# f1af40b5 24-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: remove old (2018) stale dependency hacks

We handle a number of stale dependency issues on an ad-hoc basis, in
order to support ongoing NO_CLEAN builds. These hacks do not need to
be maintained indefinitely; now remove those for issues that are more
than a year old.

Sponsored by: The FreeBSD Foundation


# c260dbfb 21-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: set DB_FROM_SRC also for stageworld

stageworld, invoked from e.g. `make packages`, shouldn't rely on the
build host's users/groups.

Sponsored by: The FreeBSD Foundation


# dadc342d 18-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Revert r359083, fixed properly by r359088

r359083 introduced a workaround for stale libomp dependencies during a
regular (no -DNO_CLEAN) buildworld. r359088 addressed the reason the
clean step missed libomp, so revert the workaround.

Sponsored by: The FreeBSD Foundation


# 0d02682c 18-Mar-2020 Ed Maste <emaste@FreeBSD.org>

invoke _cleanobj_fast_depend_hack unconditionally

Apparently make ${CLEANDIR} is leaving stale entries in .depend files;
for now invoke the hacky cleanup in both the -DNO_CLEAN and normal
(no -DNO_CLEAN) cases.

In collaboration with: dim
Sponsored by: The FreeBSD Foundation


# 564b9ff2 17-Mar-2020 Brooks Davis <brooks@FreeBSD.org>

Add an internal liblua and use it in flua.

The new liblua will be used in a forthcoming import of kyua.

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


# dfcef1de 17-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: add a note when deleting stale dependencies

We have ad-hoc stale dependency handling in Makefile.inc1 to handle the
cases where file extensions change, but it appears that some cases are
not functional. Add a note when about to clean stale deps to help
when investigating failure reports.

Sponsored by: The FreeBSD Foundation


# 450cc341 12-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: move dependency hack comment to the block it applies to


# 3b1781b4 12-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Extend r358907 to explicitly remove stale lib32 dependency

After r325072 stale lib32 dependencies were not remooved. A more
holistic approach is needed to address this but for the immediate issue
(-DNO_CLEAN builds across r358851) just readd the explicit lib32 path.

Reported by: dim
Sponsored by: The FreeBSD Foundation


# 0efe25f9 12-Mar-2020 Dimitry Andric <dim@FreeBSD.org>

Allow -DNO_CLEAN build across r358851.

The openmp 10.0.0 import renamed one .c file to .cpp, and this is
something our dependency system does not handle correctly. Add another
ad-hoc cleanup to get rid of the stale dependency.

PR: 244251
MFC after: 6 weeks
X-MFC-With: 358851


# 13f7dbe8 09-Mar-2020 Ed Maste <emaste@FreeBSD.org>

retire amd(8)

autofs was introduced with FreeBSD 10.1 and is the supported method for
automounting filesystems. As of r296194 the amd man page claimed that it
is deprecated. Remove it from base now; the sysutils/am-utils port is
still available if necessary.

Discussed with: cy
Relnotes: Yes
Sponsored by: The FreeBSD Foundation


# 134b3783 29-Feb-2020 Ed Maste <emaste@FreeBSD.org>

retire in-tree GPL dtc devicetree compiler

Now that we no longer have GCC 4.2.1 in the tree and can assume FreeBSD
is being built with a C++11 compiler available, we can use BSDL dtc
unconditionally and retire the GPL dtc.

GPL dtc now has FreeBSD CI support via Cirrus-CI to help ensure it
continues to build/work on FreeBSD and is available in the ports tree
if needed.

The copy of (copyfree licensed) libfdt that we actually use is in
sys/contrib/libfdt so the extra copy under contrib/dtc/libfdt can be
removed along with the rest of the GPL dtc.

Reviewed by: kevans, ian, imp, manu, theraven
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23192


# c4501804 28-Feb-2020 Ed Maste <emaste@FreeBSD.org>

retire the LLVM_LIBUNWIND option

LLVM's libunwind is used on all FreeBSD-supported CPU architectures and
is a required component.

Reviewed by: brooks (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23123


# 57f80467 28-Feb-2020 Ed Maste <emaste@FreeBSD.org>

remove GCC 4.2.1 build infrastructure

As described in Warner's email message[1] to the FreeBSD-arch mailing
list we have reached GCC 4.2.1's retirement date. At this time all
supported architectures either use in-tree Clang, or rely on external
toolchain (i.e., a contemporary GCC version from ports).

GCC 4.2.1 was released July 18, 2007 and was imported into FreeBSD later
that year, in r171825. GCC has served us well, but version 4.2.1 is
obsolete and not used by default on any architecture in FreeBSD. It
does not support modern C and does not support arm64 or RISC-V.

Thanks to everyone responsible for maintaining, updating, and testing
GCC in the FreeBSD base system over the years.

So long, and thanks for all the fish.

[1] https://lists.freebsd.org/pipermail/freebsd-arch/2020-January/019823.html

PR: 228919
Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23124


# eb834d9f 19-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Take LINKER_FREEBSD_VERSION from numerical field after dash

Summary:
With COMPILER_FREEBSD_VERSION, we use a numeric value that we bump each
time we make a change that requires re-bootstrapping, but with the
linker variant, we instead take the entire part after "FreeBSD", as in
this example version output:

LLD 9.0.1 (FreeBSD c1a0a213378a458fbea1a5c77b315c7dce08fd05-1300006) (compatible with GNU linkers)

E.g., LINKER_FREEBSD_VERSION is currently being set to
"c1a0a213378a458fbea1a5c77b315c7dce08fd05-1300006". This means that
*any* new upstream lld version will cause re-bootstrapping.

We should only look at the numerical field we append after a dash
instead. This review attempts to make it so.

The only thing I am not happy about is the post-processing of awk output
in Makefile.inc1. I notice that our awk does not have gensub(), so it
can't substitute a numbered sub-regex with \1, \2, etc. Suggestions
welcome. :)

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23691


# c246b393 15-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Tentatively apply D23691, which takes LINKER_FREEBSD_VERSION from the
numerical field after the dash. This avoids re-bootstrapping of the
linker, when only the git commit hash changes.


# 75ababf8 06-Feb-2020 Warner Losh <imp@FreeBSD.org>

Restore missing comment

I was overly agressive about removing the entire comment. It was still
valid, except the part about being only for some architectures.

Reviewed by: emaste
Differenial Revision: https://reviews.freebsd.org/D23523


# 5672c764 02-Feb-2020 Warner Losh <imp@FreeBSD.org>

Per the firm plan, start to remove sparc64

The sparc64 architecture is being removed from FreeBSD 13, starting
now. This removes it from the top level only. It is the only
architecture that didn't see substantial work after the call to get
things working with the external toolchain.


# 43e84039 31-Jan-2020 Ed Maste <emaste@FreeBSD.org>

retire BSD_CRTBEGIN option

BSD crt is currently used on all architectures (other than sparc64).
Remove the option and use BSD crt everywhere as part of the GCC 4.2.1
retirement plan.

https://lists.freebsd.org/pipermail/freebsd-arch/2020-January/019823.html

PR: 239851
Reviewed by: andrew, brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23122


# 7ec5e1c4 22-Jan-2020 John Baldwin <jhb@FreeBSD.org>

Remove support for auto-selecting an external binutils.

All of the in-tree architectures not supported by in-tree binutils are
supported by lld, so the condition is now always false. It also
didn't fully work since the external binutils are installed into a
directory that uses the host's OS version, not the target OS version.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D23294


# 9ccace3f 19-Jan-2020 Ed Maste <emaste@FreeBSD.org>

pkgbase: allow the pkg format to be overridden

Compressing .txz packages can be rather slow, and speed is likely more
important than disk space during development. Allow package format to
be set via PKG_FORMAT make variable.

Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23257


# c530c791 18-Jan-2020 Ed Maste <emaste@FreeBSD.org>

pkgbase: cache pkg ABI for all world/kernel packages

Rather than invoking `pkg config ABI` repeatedly.

Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23255


# 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


# 7c883770 08-Jan-2020 Ed Maste <emaste@FreeBSD.org>

Remove prereq lib support for GNU unwinder

LLVM's libunwind is used for all archs, as of r356514. As GCC 4.2.1
will soon be removed, and with it the GNU unwinder, start simplifying
the prereq/startup lib logic in Makefile.inc1. From here if there are
any unwinder bugs (on any arch) the path foward is to fix LLVM's
libunwind.


# cd0d51ba 04-Jan-2020 Kyle Evans <kevans@FreeBSD.org>

Provide libssp based on libc

For libssp.so, rebuild stack_protector.c with FORTIFY_SOURCE stubs that just
abort built into it.

For libssp_nonshared.a, steal stack_protector_compat.c from
^/lib/libc/secure and massage it to maintain that __stack_chk_fail_local
is a hidden symbol.

libssp is now built unconditionally regardless of {WITH,WITHOUT}_SSP in the
build environment, and the gcclibs version has been disconnected from the
build in favor of this one.

PR: 242950 (exp-run)
Reviewed by: kib, emaste, pfg, Oliver Pinter (earlier version)
Also discussed with: kan
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22943


# 36afd1d2 03-Jan-2020 Kyle Evans <kevans@FreeBSD.org>

Makefile.inc1: remove libcompiler_rt from _startup_libs

libcompiler_rt is already present in _prereq_libs, which will get built just
before _startup_libs and in advance of shared libc. Dedupe.


# 39eb07f1 02-Jan-2020 John Baldwin <jhb@FreeBSD.org>

Look for cross toolchain makefiles in /usr/share/toolchains.

The freebsd-binutils and freebsd-gcc* packages install toolchain
makefiles to /usr/share/toolchains rather than LOCALBASE.

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


# eb4977bd 01-Jan-2020 Warner Losh <imp@FreeBSD.org>

Remove arm/arm as a valid target.

TARGET=arm now defaults to TARGET_ARCH=armv7
TARGET_ARCH=arm is no longer valid.

Bump __FreeBSD_version to 1300073

Tested with make universe. Any stale LINT-V5 config files remaining in the tree
will fail the universe build. However, LINT-V5 was removed in r355119.

This retirement has been planned since last summer. The armv5 port is fragile:
it works OK for some peeople, and fails badly for others. There's a number of
subtle bugs in busdma, pmap and other MD parts of thee system that present
themselves under load or in unusual circumstances (like fsck after a
crash). stable/8, branched 10 years ago, was the last reliable release. Since
the support burden is larger then the benefit, the consensus view is armv5
should be removed from the tree.

Discussed with: arm@ mailing list and arm developer community.


# f6e159c6 13-Dec-2019 Ed Maste <emaste@FreeBSD.org>

revert r355609


# c039e959 11-Dec-2019 Ed Maste <emaste@FreeBSD.org>

libpmc: build json event support also on arm64


# 0ecf09af 11-Dec-2019 Ed Maste <emaste@FreeBSD.org>

connect arm linuxulator to top-level make sysent

Reported by: kevans


# c590fd27 11-Dec-2019 Ed Maste <emaste@FreeBSD.org>

Make NOCLEAN an error instead of a warning

The warning was added in r289728 (over four years ago) and at that time
NO_CLEAN was already the correct spelling for over a decade.

Make NOCLEAN an error as the next step to removing these backward
compatibility shims.


# 3e105562 26-Nov-2019 Ed Maste <emaste@FreeBSD.org>

Update Makefile.inc1 dtc comment

We use the BSDL dtc by default now (as long as we're using a C++11
compiler).


# 97900b44 19-Nov-2019 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_LINKER: Fix rebuilding lld every time.

This is due to LLD_REVISION_STRING being renamed to LLD_REVISION in
r351442 and the value being moved to another location in r351965.

`make test-system-linker` can be used to see the values being used here.

Reported by: ler


# 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


# 9d919726 13-Nov-2019 John Baldwin <jhb@FreeBSD.org>

Refine r354661 to unbreak the GCC_BOOTSTRAP case.

MK_CLANG_IS_CC controls installing links for GCC, not just clang. Set
MK_CLANG_IS_CC to the value of MK_CLANG_BOOTSTRAP. This will leave it
as "no" if no bootstrap compiler is being built or GCC 4.2.1 is being
used as the bootstrap compiler, and "yes" if clang is being used as
the bootstrap compiler.

Submitted by: bdrewery (kind of, he suggested this on IRC while I was
testing the original patch)
Reviewed by: kevans, imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D22350


# a99d99e5 12-Nov-2019 John Baldwin <jhb@FreeBSD.org>

Force MK_CLANG_IS_CC on in XMAKE.

This ensures that a bootstrap clang compiler is always installed as cc
in WORLDTMP. If it is only installed as 'clang' then /usr/bin/cc is
used during the build instead of the bootstrap compiler.

Reviewed by: imp
MFC after: 1 month
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D22332


# c723af11 08-Nov-2019 Ed Maste <emaste@FreeBSD.org>

suggest xtoolchain package if binutils and GCC bootstraps are both broken

Previously we checked for only BINUTILS_BOOTSTRAP as a broken option
and suggested installing the binutils package. This was originally done
for arm64 where we used the in-tree Clang with external binutils package.

Add a case to the warning to suggest instead the full xtoolchain package
if we have no in-tree compiler either.

Differential Revision: https://reviews.freebsd.org/D21851


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

Revert r354518 and commit the intented fix rather than the diagnostic
check.

This fixes the definition of MK_LIB32 in Makefile.inc1.


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

Fix the ARCH check for LIB32 from Makefile.inc1.


# 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


# 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


# 4196949c 23-Oct-2019 John Baldwin <jhb@FreeBSD.org>

Strip "sf" suffix when generating a target triple.

This fixes the target triple used when compiling riscv64sf with clang.

Discussed with: mhorne
MFC after: 2 weeks
Sponsored by: DARPA


# dfe76e95 21-Oct-2019 Ed Maste <emaste@FreeBSD.org>

Additional fix for -DNO_CLEAN build across r353340 and r353381

opensolaris_atomic.S is now only used on i386 with opensolaris_atomic.c
used on other platforms. After r353381 it doesn't exist on those
platforms so the stale dependency would result in a build error.

r353408 addressed this issue for cddl/lib/libzpool, but it persisted
with the opensolaris and zfs modules.


# 01a69565 19-Oct-2019 Andriy Gapon <avg@FreeBSD.org>

buildkernel: always add standard kernel configuration include path

This should change nothing for kernel configurations at the standard
locations in the source tree. However, if KERNCONFDIR is used to
specify a custom location for a kernel configuration file (e.g., out of
tree), then both the custom location and the standard location, in this
order, will be used as include paths for config(8). This will allow the
kernel configuration to include files from both locations.

Reviewed by: bdrewery
MFC after: 16 days
Differential Revision: https://reviews.freebsd.org/D22057


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

Build compat libraries before "everything".

This is required for us to link programs against compat versions of
libraries.

Reviewed by: bdrewery, jhb
Sponsored by: DARPA, AFRL


# 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


# a1ff92a5 10-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Fix -DNO_CLEAN build across r353340 and r353381

opensolaris_atomic.S is now only used on i386 with opensolaris_atomic.c
used on other platforms. After r353381 it doesn't exist on those
platforms so the stale dependency would result in a build error.


# 0ed89481 08-Oct-2019 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN build across r352689.

Split the LIBCOMPAT case because the usual egrep only matches in
LIBCOMPAT on amd64.


# c1d45320 01-Oct-2019 Kyle Evans <kevans@FreeBSD.org>

Add a top-level makeman target

Abstracting away the details of how src.conf(5) is generated is arguably a
good thing; do so with a top-level makeman target.


# f9fd94f5 30-Sep-2019 Brooks Davis <brooks@FreeBSD.org>

Update cloudabi(32|64) sysents with "make sysent".

MFC after: 1 week


# c6b00391 28-Sep-2019 John Baldwin <jhb@FreeBSD.org>

Disable build of LOCAL_MODULES for cross-builds by default.

WITHOUT_LOCAL_MODULES can be set to disable LOCAL_MODULES for native
builds. WITH_LOCAL_MODULES can be set to leave it enabled for cross
builds.

This does not use a knob in kern.opts.mk because the options framework
does not currently support options whose default varies on the build
type. I discussed a few options there with Warner (e.g. maybe having
a tri-state where the default value is "auto" and having Makefile.inc1
apply logic when MK_LOCAL_MODULES is set to "auto"), but Warner ok'd
this approach for now until a better solution is implemented.

Requested by: many
Reviewed by: imp (in person at EuroBSDCon)
Differential Revision: https://reviews.freebsd.org/D21608


# 9ccd2fde 25-Sep-2019 Kyle Evans <kevans@FreeBSD.org>

Adjust Makefile.inc1 syscall sub commit


# 3e25d1fb 25-Sep-2019 Kyle Evans <kevans@FreeBSD.org>

Add linux-compatible memfd_create

memfd_create is effectively a SHM_ANON shm_open(2) mapping with optional
CLOEXEC and file sealing support. This is used by some mesa parts, some
linux libs, and qemu can also take advantage of it and uses the sealing to
prevent resizing the region.

This reimplements shm_open in terms of shm_open2(2) at the same time.

shm_open(2) will be moved to COMPAT12 shortly.

Reviewed by: markj, kib
Differential Revision: https://reviews.freebsd.org/D21393


# af3ccc07 20-Sep-2019 Baptiste Daroussin <bapt@FreeBSD.org>

Ensure libthr is always built before libprivatezstd when building the
startup libs

Reported by: "Galazka, Krzysztof" <krzysztof.galazka@intel.com>


# d567f909 18-Sep-2019 Baptiste Daroussin <bapt@FreeBSD.org>

Add native support for zstd to libarchive

Note that old pkg will failed to build after this. A recent ports tree (one
providing pkg 1.12+) is required to build. Older already built pkg, should
continue working as expected

PR: 238797
Exp run by: antoine
Reviewed by: cem
Approved by: cem
Differential Revision: https://reviews.freebsd.org/D20752


# 84ee6de9 02-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Always build lldb-tblgen, for now, and add a note.


# a32f82c2 26-Aug-2019 Dimitry Andric <dim@FreeBSD.org>

Update build glue for a build of clang plus lldb (enabled via MK_LLDB).


# 13212983 20-Jun-2019 Antoine Brodin <antoine@FreeBSD.org>

Add head(1) to native-xtools so that it can be used in qemu-user jails


# 0026fec5 16-Jun-2019 Rene Ladan <rene@FreeBSD.org>

Differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases.

Currently APLHA packages are treated as CURRENT or STABLE versions,
resulting in e.g. 13.0.s20190615125609. This version number is indeed
different from the next version number but ALPHA2 would be nicer IMO.

For the BETA, PRERELEASE and RC phases the packages are versioned the
same as for releases, so 11.3-BETA1 is 11.3 and so is 11.3-RC1, meaning
that pkg cannot easiliy upgrade from the former the next. This happened
on my Raspberry Pi which runs pkgbase.

Submitted by: rene
Approved by: manu
Event: Berlin hackathon 2019
Differential Revision: https://reviews.freebsd.org/D20651


# cbc493c6 03-Jun-2019 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: clean up stale dependency hacks

Carrying on from r339607, remove ad-hoc dependency cleanup for changes
prior to June 2018.

Sponsored by: The FreeBSD Foundation


# e1216db5 03-Jun-2019 Maxim Sobolev <sobomax@FreeBSD.org>

Rollback the rest of the botched r348521. Re-work would be posted to
reviews. Sorry.

Reported by: Enji Cooper


# 5d280640 03-Jun-2019 Maxim Sobolev <sobomax@FreeBSD.org>

Leave mtree hardcoded for now. Reverting partially 348521 and also
the followup stopgap change, because I don't think it's a correct. I still
need to figure out where to stick it in. In cannot be in Makefile.inc1
and it cannot be in etc/Makefile from the looks of it to avoid
chicken-and-egg problem.


# a88c8ae7 03-Jun-2019 Warner Losh <imp@FreeBSD.org>

Stopgap fix to breakage from r348521.

MTREE is defined, while MTREE_CMD isn't, use it instead.
This may not be 'right' but it fixes the CI and other issues.

Submitted by: Andreas Nilsson


# 5ec57af4 02-Jun-2019 Maxim Sobolev <sobomax@FreeBSD.org>

Fix several places where tool name has been hardcoded:

install -> ${INSTALL}
mtree -> ${MTREE_CMD}
services_mkdb -> ${SERVICES_MKDB_CMD}
cap_mkdb -> ${CAP_MKDB_CMD}
pwd_mkdb -> ${PWD_MKDB_CMD}
kldxref -> ${KLDXREF_CMD}

If you do custom FreeBSD builds you may want to override those
in some cases.

Sponsored by: Sippy Software, Inc.


# 78473c58 28-May-2019 Justin Hibbits <jhibbits@FreeBSD.org>

Update __FreeBSD_version and Makefile check for r348347

libdwarf needs forcibly rebuilt after r348347.


# 7fc5693f 23-May-2019 Baptiste Daroussin <bapt@FreeBSD.org>

Change package the MTREEFLAGS and INSTALLFLAGS missed in r348185

Reported by: lwhsu


# 871b6b10 15-May-2019 Brad Davis <brd@FreeBSD.org>

Move master.passwd and group to lib/libc/gen/

libc was picked as the destination location for these because of the syscalls
that use these files as the lowest level place they are referenced.

Approved by: will (mentor), rgrimes, manu
Differential Revision: https://reviews.freebsd.org/D16728


# 9c8f66cb 08-May-2019 Antoine Brodin <antoine@FreeBSD.org>

Add wc(1) to native-xtools so that it can be used in qemu-user jails


# 8ae9b1fe 27-Mar-2019 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Use uname as ABI_FILE

Add some more missed in r345159

MFC after: 1 week


# 656898ab 19-Mar-2019 Wolfram Schneider <wosch@FreeBSD.org>

Improve english grammar for kernel built time

PR: 224433
Approved by: jhb
Differential Revision: https://reviews.freebsd.org/D19636


# 1d3a067e 16-Mar-2019 Wolfram Schneider <wosch@FreeBSD.org>

`make buildkernel' should display the build time in seconds

PR: 224433
Approved by: cem
Differential Revision: https://reviews.freebsd.org/D13910


# 08df8f82 14-Mar-2019 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Use uname as ABI_FILE

uname is always rebuild on FreeBSD so use this as ABI_FILE for pkg when
building pkg for pkgbase.
pkg uses uname too as default ABI_FILE as of commit d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599
https://github.com/freebsd/pkg/commit/d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599

Discussed with: bapt
MFC after: 1 week


# 328dcc68 12-Mar-2019 Wolfram Schneider <wosch@FreeBSD.org>

`make buildworld' should display the build time in seconds

PR: 224433
Reviewed by: emaste, @bdrewery
Approved by: cem
Differential Revision: https://reviews.freebsd.org/D13911


# 92dec625 19-Dec-2018 Mateusz Guzik <mjg@FreeBSD.org>

Remove iBCS2: plug a wart missed in r342242

Sponsored by: The FreeBSD Foundation


# 466ed83b 12-Dec-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: update stale wpa dependency removal statement

Only stale .depend files are removed; do not mention object files.


# 457e6311 10-Dec-2018 Ed Maste <emaste@FreeBSD.org>

Clean stale wpa dependencies and objects after r341759

The wpa update added some source files with the same name as a file in
another directory (found via .PATH in the previous version). Having a
stale entry in a .depend file means the new file won't be built, so test
for this case and if found remove all of wpa's dependency files.

MFC with: r341759
Sponsored by: The FreeBSD Foundation


# c10d927c 05-Dec-2018 Alex Richardson <arichardson@FreeBSD.org>

Fix newvers.sh with BUILD_WITH_STRICT_TMPPATH=1

newvers.sh runs mkfifo which did not exist before this change.
However, I didn't notice before because it is run from a function
where a missing command does cause a noticeable failure.

Reviewed By: emaste, markj
Differential Revision: https://reviews.freebsd.org/D18377


# 7dc61ac1 04-Dec-2018 Andrew Turner <andrew@FreeBSD.org>

Only gnu/lib/csu when MK_BSD_CRTBEGIN is off.

We were still building it from Makefile.inc1. Disable it there so we don't
try to build the GNU crtbegin/crtend when the BSD version was asked for.

PR: 233733
Reported by: lwhsu
Reviewed by: emaste
MFC with: r339738
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18428


# 6edf2846 18-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Fix -DNO_CLEAN amd64 build after r340463

Without this change I got the following error:
clang-7: error: no such file or directory: '..../lib/libc/amd64/string/bzero.S'

Reviewed By: mjg
Differential Revision: https://reviews.freebsd.org/D18031


# 8643808a 13-Nov-2018 Glen Barber <gjb@FreeBSD.org>

In followup to r340406, remove doc from the EXTRA_DISTRIBUTIONS
list and remaining references from the script used to create the
MANIFEST file used by bsdinstall(8).

No MFC is planned at this time.

Sponsored by: The FreeBSD Foundation


# 0a9fcf32 07-Nov-2018 Brooks Davis <brooks@FreeBSD.org>

Add a top-level make target to rebuild all sysent files.

The sysent target is useful when changing makesyscalls.sh, when
making paired changes to syscalls.master files, or in a future where
freebsd32 sysent entries are built from the default syscalls.master.

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


# cd6b0f0e 06-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Turn off BUILD_WITH_STRICT_TMPPATH by default

Building with a strict $PATH (without inheriting from the parent
environment) still causes build failures in some workflows/environemnts
that I have not yet tested.
I will try to bring this back once these issues have all been resolved
since it is actually extremely useful in tracking broken dependencies
and wrong assumptions about the build environemt.

Discussed With: brooks


# 4805dd68 06-Nov-2018 Alex Richardson <arichardson@FreeBSD.org>

Remove btxld from symlinked host tools

It is only present on amd64/i386 systems which breaks buildworld on
other hosts. In fact there is no need to add it to the bootstrap tools
list since it is already included in the cross-tools phase.
However, for cross-tools it was only built if the host and target
architecture didn't match. After this change it is also built when we
are builtin with a strict $PATH.

Reported By: mmel


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

Keep inheriting $PATH when using system linker/compiler

I missed this case when testing r340157. For now just keep
$PATH when we aren't bootstrapping a compiler so that the build
can find cc/c++/ld without an absolute path.

Reported by: yuripv


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

Build the elftoolchain libraries as part of bootstrap-tools

It is not necessary to build libelf and libdwarf this early. Furthermore,
when building on Linux/MacOS, m4 will only be built during the bootstrap
tools phase and not be available in $PATH before.

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


# 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


# 9117dffc 31-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Avoid binutils test in cleandir/obj stages

Further to r339946 skip the .error case for lack of in-tree binutils
support when we haven't set the toolchain feature variables.

Discussed with: arichardson
Sponsored by: The FreeBSD Foundation


# d6be9fdd 31-Oct-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't run cc --version during cleandir/obj stages

This will no work when there is no cc in $PATH (which is the case before the
cross-tools stage once we no longer inherit $PATH in $WMAKE).
The variables set by bsd.compiler.mk/bsd.linker.mk are not needed in these
stages so this avoids a little bit of makefile parsing.

Reviewed By: emaste
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16814


# f4cbc81d 25-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Update elftoolchain bootstrapping test after r339083

Sponsored by: The FreeBSD Foundation


# 5acedb55 23-Oct-2018 Ed Maste <emaste@FreeBSD.org>

sort {delete,check}-old* output

It is more convenient to review old libraries, files, and directories
in order.

Sort check-* after checking for existence of files for efficiency, and
because /usr/lib/debug entries are added while iterating over the list.

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


# 74f65486 23-Oct-2018 Alex Richardson <arichardson@FreeBSD.org>

Only compute the X_COMPILER_*/X_LINKER_* variables when needed

When building CheriBSD we have to set XLD/XCC/XCFLAGS on the command line.
This triggers the $XCC != $CC case in bsd.compiler.mk (and the same for LD
in bsd.linker.mk) which causes it to call ${XCC} --version and
${XLD} --version (plus various awk+sed+echo calls) in every subdirectory.
For incremental builds and stages that only walk the source tree this is
often the majority of the time spent in that directory.

By only computing the value of the X_COMPILER_*/X_LINKER_* variables if
_WANT_TOOLCHAIN_CROSS_VARS is set we can reduce the number of cc/ld calls
to once per build stage instead of once per recursive make.

With this change (and no changes to the sources) the `make includes` stage
now takes 28 seconds at -j1 instead of 86 seconds.

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


# 730a7ce9 22-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: clean up stale dependency hacks

Our dependency tracking cannot directly cope with certain source tree
changes, particularly with respect to removing or moving source files or
replacing generated files. We have a collection of ad-hoc workarounds
to handle these cases. As there is a (small) build-time cost inherent
in these workarounds, we do not want to keep them indefinitely. Thus,
remove workarounds from 2017.

Sponsored by: The FreeBSD Foundation


# fc191b11 20-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Introduce src.conf knob to build userland with retpoline

WITH_RETPOLINE enables -mretpoline vulnerability mitigation in userland
for CVE-2017-5715.

Reported by: Peter Malcom
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17421


# b9583179 18-Oct-2018 Glen Barber <gjb@FreeBSD.org>

- Update head to 13.0-CURRENT.
- Bump MACHINE_TRIPLE, TARGET_TRIPLE, FBSD_MAJOR, FBSD_CC_VER,
FREEBSD_CC_VERSION, OS_VERSION.
- Update comment in UPDATING regarding debugging options.
- Remove debug.witness.trace=0 from installation media.
- Bump __FreeBSD_version.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# bfe5c1dc 13-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: clean up dependencies after r339348

r339348 switched bcopy from .s to .c. Add ad-hoc dependency cleanup
as done for similar cases.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation


# e4a41be5 12-Oct-2018 Dag-Erling Smørgrav <des@FreeBSD.org>

Replace libldns's bootstrap dependency on libcrypto with one on libssl
(which in turn has a bootstrap dependency on libcrypto).

Submitted by: jkim
Approved by: re (gjb)


# d97bf519 11-Oct-2018 Dag-Erling Smørgrav <des@FreeBSD.org>

Move libssl up in the bootstrap order.

Submitted by: jkim
Approved by: re (gjb)


# 539a27e1 09-Oct-2018 Ed Maste <emaste@FreeBSD.org>

Switch ntp's embedded libevent to 2.1.18

For OpenSSL 1.1.1 compatibility.

In Makefile.inc1 add (to the existing similar cases) a hack to handle
dependencies across the migration.

Reviewed by: jhb
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation.
Differential Revision: https://reviews.freebsd.org/D17481


# 0c0c965a 06-Sep-2018 John Baldwin <jhb@FreeBSD.org>

Re-enable kernel modules for the MALTA64EL kernel configuration.

Update the BOOTSTRAPPING check for libelf to require the fix for
mips64el object files committed in r338478 and re-enable kernel
modules in the MALTA64EL config file.

Reviewed by: emaste
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17054


# 26ffc1ab 28-Aug-2018 Li-Wen Hsu <lwhsu@FreeBSD.org>

Fix 'install: symlink usr/src/sys -> /sys: File exists' in distributeworld

Follow r334617, specify ${DISTDIR} (by ${INSTALL_DDIR}), '/base' and add
${INSTALLFLAGS} while installing the '/sys' symbolic link.

Reviewed by: bapt (earlier version), markj
Approved by: re (gjb), markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16877


# c97e5167 23-Aug-2018 Alex Richardson <arichardson@FreeBSD.org>

Only bootstrap localedef if ${MK_LOCALES} != "no"

During the build it is only used by share/ctypedef and share/colldef
which will not be built if ${MK_LOCALE} == "no". This saves a tiny bit
of time when building without locales.

Approved By: jhb (mentor)


# 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


# 7920ad94 17-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

libbe(3): Move build goop back out of cddl/

Some background: in the GSoC project, libbe/Makefile lived in lib/libbe. I
created projects/bectl branch, maintained the above for all of five
minutes before I misread Makefile.inc1 and decided that it couldn't possibly
build outside of cddl/, so I kicked the Makefile out into the cddl/ build
and all was good. The misreading was of the bit where .WAIT is added to
SUBDIR after lib, libexec but prior to building bin and cddl *only during
the install targets*, which is the critical part.

Fast forward- buildworld was still broken in my branch unbeknownst to me
because I didn't nuke my OBJDIR. Combing through Makefile.inc1 eventually
revealed the necessary magic to make sure that libbe's dependencies are
specified well enough, and it becomes clear what needs done to make a
non-cddl/ build work. This is an interesting prospect, because the build
split is kind of annoying to work with.

IGNORE_PRAGMA is added to avoid dropping WARNS by one more. This was
previously pulled in via cddl/Makefile.inc.


# 49f1692a 17-Aug-2018 Bjoern A. Zeeb <bz@FreeBSD.org>

METALOG, unless manually overwritten, is defined as ${DESTDIR}/${DISTDIR}/METALOG

In the create-world-packages target we manually piece this together (unless
it is undefined), without the DISTDIR. Normally DISTDIR is empty (unset) and
no one notices. Now DISTDIR is a well known long-standing PORTS environment
variable and if that is set in the local environment the path to METALOG
is wrong as it no longer is ${DESTDIR}/METALOG.

Long-term we should start to avoid "publicly well known" names for global
variables, for now just piece ${DISTDIR} in as well. This allows
create-world-packages to continue if DISTDIR is set in the env.


# 2502c66b 17-Aug-2018 Roger Pau Monné <royger@FreeBSD.org>

build: skip the database check when generating install media

There are several scripts and targets solely used to generate install
media, make sure DB_FROM_SRC is used in that case in order to prevent
checking the host database, which is irrelevant when generating
install binaries.

Sponsored by: Citrix Systems R&D
PR: 230459
Reviewed by: gjb
Differential revision: https://reviews.freebsd.org/D16638


# 35d2028f 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

libbe(3)/bectl(8): More SYSROOT/GCC build fixes

- Missing include path
- Fully specify libzfs's dependencies (except for deps pulled in by other
deps) in Makefile.inc1
- Drop WARNS back down to 2 for libbe(3). I do this with much hesitation,
but the libzfs headers are apparently a hot warning-filled mess as far as
GCC 4.2 is concerned.


# f335e41b 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

Add libzfs to prebuild_libs, libbe dependency on libzfs


# 2b720021a 09-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

Makefile.inc1: Add libl to -legacy as well

libl is needed for config(8), which is a bootstrap-tool. It is possible to
build a system WITHOUT_TOOLCHAIN to exclude lex and thus, libl. We still
need to support building from this kind of host, though.

While here, group the config(8) dependencies together and add a small
explanation. These can likely both be scoped more clearly, but this will
need some further investigation.

Reported by: rgrimes (not WITHOUT_TOOLCHAIN, but provoked investigation)
MFC after: immediately


# d0f408fa 08-Aug-2018 Roger Pau Monné <royger@FreeBSD.org>

build: skip the database check for the distributeworld target

distributeworld is used to generate install media, so it makes no
sense to check the host database since the install media can be
generated from any box, regardless of the version of FreeBSD it's
running.

Sponsored by: Citrix Systems R&D
Reviewed by: ian, gjb
Differential revision: https://reviews.freebsd.org/D16507


# 9898e6df 22-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Alpha-sort the list of user/group IDs to check at install time.


# fd46d8a8 22-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Remove the .if ${MK_FOO} wrappers around the user/group ID checks. These
names are referenced in mtree files without any conditional logic, so the
users/groups must exist even if the corresponding tool(s) are disabled.


# 07b95333 19-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Add ntpd to the list of users/groups to check before installing.


# 8b6b96c9 17-Jul-2018 Warner Losh <imp@FreeBSD.org>

As discussed several times on freebsd-arch, start to decommission armeb.

Remove armeb/arm from KNOWN_ARCHS.
Remove armeb from arm universe targets.

Differential Revision: https://reviews.freebsd.org/D16257


# 44a83ae3 16-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

Unconditionally build libnv in legacy

Rather than using a config(8) built from new tree linking libnv built on
host.


# 0d26206d 10-Jul-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix parsing of create-kernel-packages

MFC after: 3 days
Reported by: rene


# 88171893 05-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

config(8): De-dupe hint/env vars within a single file

r335653 flipped the order in which hints/env files are concatenated to match
the order in which vars are processed by the kernel. This is the other
hammer to drop.

Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the
latest value specified for a key. This leaves some duplicates if a variable
is specified in multiple hint/env files or via `envvar` in a kernel config,
but the reversed order of concatenation (from r335653) makes this a
non-issue as the latest-specified version will be seen first.

This change also silently rewrote hint bits to use the same sanitization
process that ian@ wrote for r335642. To the kernel, hints and env vars are
basically the same thing through early boot, then get merged into the
dynamic environment once kmem becomes available and the dynamic environment
is created. They should be subjected to the same restrictions.

libnv has been added to -legacy for the time being to support the build of
config(8) with the new cnvlist API.

Tested with: universe (11 host & 12 host)
MFC after: 1 month


# 417d105f 05-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

Revert r336011,r336012 until I can competently test


# f1e0a986 05-Jul-2018 Kyle Evans <kevans@FreeBSD.org>

Fix build after r336011

Add libnv to bootstrap-tools, use ${SRCTOP}/sys headers.


# d0338de5 01-Jul-2018 Wolfram Schneider <wosch@FreeBSD.org>

`make installworld' should display "completed" message if done

PR: 225159
Reviewed by: bdrewery
Approved by: cem (mentor)
Differential Revision: https://reviews.freebsd.org/D14057


# 2e90942f 30-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Fix clang-tblgen flip-flop building after r335707.

The build of this would have MK_LLVM_TARGET_ALL=yes for bootstrap-tools
but MK_LLVM_TARGET_ALL=no for cross-tools and thus would rebuild between
the two.

MFC after: 2 weeks
X-MFC-with: r335707
Sponsored by: Dell EMC


# 55a5b46a 29-Jun-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't change directory owner to root when building with -DNO_ROOT

Currently the mtree calls in Makefile.inc1 all change the directory owner
to match the spec file. However, we should not be doing this during
distributeworld if -DNO_ROOT is passed. Additionally, when creating the
WORLDTMP directory hierachy there is no need to change the owner to root so
we now always pass the -W flag when populating WORLDTMP.

This is also required for building FreeBSD on Linux/Mac since the required
groups/users will not exist there which is how I discovered this issue.

Reviewed By: emaste, bdrewery, imp
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D14185


# 8706983f 28-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix unknown target check after r335450.

X-MFC-with: r335450
Pointyhat to: bdrewery
Sponsored by: Dell EMC


# 151578dc 28-Jun-2018 John Baldwin <jhb@FreeBSD.org>

Remove the various build flag hacks for GCC cross-compile.

The xtoolchain GCC packages have not required these flags since ports
commits r465416 and r466701. The in-tree GCC 4.2.1 has also been patched
in r335716 and r335717 to correctly honor --sysroot when looking for
includes and libraries.

Reviewed by: bdrewery
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D16055


# 52b7824b 28-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER/LINKER: Fix cross-build support after r335706.

X-MFC-With: r335706
MFC after: 2 weeks
Sponsored by: Dell EMC


# f59e5352 28-Jun-2018 Brad Davis <brd@FreeBSD.org>

Simplify using bsd.endian.mk and have it provide CAP_MKDB_ENDIAN, since it is
the most common usage.

Approved by: bapt (mentor)


# 7c3f17c5 27-Jun-2018 Brad Davis <brd@FreeBSD.org>

Chase the pwd_mkdb endian changes.

Approved by: bapt (mentor)


# 01f124b4 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

tinderbox: Only build clang/lld once if needed.

Need to handle LLD_BOOTSTRAP separately (for archs like i386).
This would be much better off with an off-by-default option like
SHARED_TOOLCHAIN that universe force-enabled. Then a normal buildworld
would store the toolchain there if enabled and otherwise in WORLDTMP
with only the 1 arch selected.

MFC after: 3 weeks
Sponsored by: Dell EMC


# eed6d55d 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Clang: Only build needed target for bootstrap compiler.

This will disable the new LLVM_TARGET_ALL option which will only
enable the required target.

This only impacts the bootstrap compiler in WORLDTMP, not the target compiler
that will be installed.

MFC after: 2 weeks
Reviewed by: sbruno, dim (earlier version)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16021


# 631e709f 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Add LLVM_TARGET_ALL option.

LLVM_TARGET_* will auto be set based on LLVM_TARGET_ALL and MK_CLANG.

If LLVM_TARGET_ALL is disabled, during a cross-build, then SYSTEM_COMPILER
and SYSTEM_LINKER are auto disabled.

This option should be used by users rather than the per-arch LLVM_TARGET
options as it is simpler to maintain for them should the supported
target list change.

MFC after: 2 weeks
Reviewed by: sbruno, dim
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16020


# e4b0a90e 25-Jun-2018 Brooks Davis <brooks@FreeBSD.org>

Normalize the g(eom,cache,part,...) build.

Rather then combining hardlink creation for the geom(8) binary with
shared library build, move libraries to src/lib/geom so they are
built and installed normally. Create a common Makefile.classes
which is included by both lib/geom/Makefile and sbin/geom/Makefile
so the symlink and libraries stay in sync.

The relocation of libraries allows libraries to be build for 32-bit
compat. This also reduces the number of non-standard builds in
the system.

This commit is not sufficent to run a 32-bit /sbin/geom on a 64-bit
system out of the box as it will look in the wrong place for libraries
unless GEOM_LIBRARY_PATH is set appropriatly in the environment.

Reviewed by: bdrewery
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15360


# 9b844631 21-Jun-2018 Ed Maste <emaste@FreeBSD.org>

Rename usr.bin/elfcopy to usr.bin/objcopy

We always install ELF Tool Chain's elfcopy as objcopy, so to avoid
confusion rename the src directory containing our reach-over Makefile
to match.

Requested by: jhb
Sponsored by: The FreeBSD Foundation


# cb623f63 20-Jun-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: rename build metadata file to toolchain-metadata.mk

The metadata file contains more than just compiler metadata.

Discussed with: bdrewery


# 6e6be2bb 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Reduce exec and fstat overhead for non-build targets.

This is mostly targetting 'make showconfig' and 'make test-system-*' for
the benefit of makeman and universe-one-clang work.

Sponsored by: Dell EMC


# a7d84af8 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Add WITH_SYSTEM_LINKER, on by default, that avoids building lld when possible.

This works similar to WITH_SYSTEM_COMPILER added in r300354. It only
supports lld via WITH_LLD_BOOTSTRAP.

When both SYSTEM_COMPILER and SYSTEM_LINKER logic passes then libclang
will not build in cross-tools. If either check fails though then
libclang is built.

The .info is reworked to notify when libclang will be built since if
either clang or lld needs to be rebuilt, but not the other, the
notification can lead to confusion on why "clang is building".

-fuse-ld= is not used with this method so some combinations of compiler
and linker are expected to fail.

A new 'make test-system-linker' target is added to see the logic results.

Makefile.inc1:
CROSS_BINUTILS_PREFIX support had to be moved higher up so that XLD
could be set and MK_LLD_BOOTSTRAP disabled before checking SYSTEM_LINKER
logic as done with SYSTEM_COMPILER. This also required moving where
bsd.linker.mk was read since XLD needs to be set before parsing it. This
creates a situation where src.opts.mk can not test LINKER_FEATURES or
add LLD_BOOTSTAP to BROKEN_OPTIONS.

Reviewed by: emaste (earlier version)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15894


# 78187278 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Rework WITHOUT_LLD/TOOLCHAIN fix from r327892 for cross-tools.

MK_LLD is for the installed lld while MK_LLD_BOOTSTRAP is for the build
tool. For WITH_SYSTEM_LINKER it is necesarry to separate the logic of
these two. When building libllvm TOOLS_PREFIX will be defined and
MK_LLD_BOOTSTRAP should be checked instead.

Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15837


# d74021d6 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Rework how the ld link is handled in WORLDTMP from r322811.

LLD_BOOTSTRAP (build) is independent of LLD_IS_LD (installed) so they
should not be based on each other.

This is related to upcoming WITH_SYSTEM_LINKER work.

Reviewed by: emaste
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15836


# 2d2aba18 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

TARGET_TRIPLE is needed much earlier now for CROSS_BINUTILS_PREFIX check.

This was missed in r335394 since the check became exists(/usr/local) in
my testing.

X-MFC-With: r335394
MFC after: 2 weeks
Sponsored by: Dell EMC


# d18e2bca 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix detection for binutils bootstrap package.

The path was changed recently in the port to be the full target triple.

MFC after: 2 weeks
Sponsored by: Dell EMC


# 4d64cb78 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Let CROSS_BINUTILS_PREFIX work without a trailing slash.

Reported by: jhb
MFC after: 2 weeks
Sponsored by: Dell EMC


# 8a854b36 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER: Should use X_ vars for comparing wanted version.

It is XCC used during the build of target binaries that replaces the
bootstrap compiler.

Also slightly tweak style.

MFC after: 2 weeks
Sponsored by: Dell EMC


# aafc3339 19-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Fix X_COMPILER_* and X_LINKER_* not being passed to installworld environment.

This could lead to 'sh: head: not found' warnings which were a symptom
of running 'ld --version' during installworld. This was only happening
with XCC or XLD set. It is intended that cc and ld do not run during
installworld. The metadata for these are already stored in
compiler-metadata.mk added in r316794.

This also removes redundant CROSSENV additions that were for
WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, and WITHOUT_TOOLCHAIN
which all don't have a cc or ld in their PATH during install.

Reported by: Mark Millard
MFC after: 2 weeks
Sponsored by: Dell EMC


# cf43faaa 18-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Don't bootstrap lld if an external linker is used.

Sponsored by: Dell EMC


# 2a821fd9 17-Jun-2018 Ian Lepore <ian@FreeBSD.org>

Build LOCAL_LIB_DIRS along with system lib dirs, rather than building them
in parallel with LOCAL_DIRS and all the other system post-libs stuff.


# f39bffc6 16-Jun-2018 Konstantin Belousov <kib@FreeBSD.org>

Rework ofed build.

Aligns the build with the FreeBSD traditional approach to not build in
contrib/, and to track inter-dependencies between libraries.

With help from: bdrewery
Reviewed by: bdrewery, hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D15648


# 4e3db1e0 15-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Assert that a build is done before an install.

This should also catch cases where the wrong MAKEOBJDIRPREFIX is used for
install.

MFC after: 2 weeks
Sponsored by: Dell EMC


# 6f1f2b19 15-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Only build jevents if MK_PMC is yes and only for amd64 in libcompat.

Sponsored by: Dell EMC


# 8590505f 09-Jun-2018 Mark Johnston <markj@FreeBSD.org>

Bump __FreeBSD_version after r334881 and force libdwarf to be rebuilt.

Reported by: O. Hartmann <ohartmann@walstatt.org>
Reviewed by: bdrewery


# 521ef556 05-Jun-2018 Ed Maste <emaste@FreeBSD.org>

Handle -DNO_CLEAN builds across brk/sbrk rewrite in r334626

Sponsored by: The FreeBSD Foundation


# 8dc84f09 04-Jun-2018 Brad Davis <brd@FreeBSD.org>

Move /sys symlink creating out of etc/Makefile.

This is prep for etc/Makefile going away.

Approved by: bapt (mentor)


# 7d1c2b74 31-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmc/pmu: enable for i386 as well


# 41e258c4 30-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmc/jevents: fix cross-compile _to_ amd64

Reported by: emaste


# 959826ca 26-May-2018 Matt Macy <mmacy@FreeBSD.org>

pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
vendor provided pmu-events tables and sundry cleanups.

The vendor pmu-events tables provide counter descriptions, default
sample rates, event, umask, and flag values for all the counter
configuration permutations. Using this gives us:

- much simpler kernel code for the MD component
- helpful long and short event descriptions
- simpler user code
- sample rates that won't overload the system

Update man page with newer sample types and remove unused sample type.


# 5506ceb8 26-May-2018 Matt Macy <mmacy@FreeBSD.org>

Revert r334242 "pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the"
because of squash commit messages


# 49281356 26-May-2018 Matt Macy <mmacy@FreeBSD.org>

pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
vendor provided pmu-events tables and sundry cleanups.

The vendor pmu-events tables provide counter descriptions, default
sample rates, event, umask, and flag values for all the counter
configuration permutations. Using this gives us:

- much simpler kernel code for the MD component
- helpful long and short event descriptions
- simpler user code
- sample rates that won't overload the system

Update man page with newer sample types and remove unused sample type.

Squashed commit of the following:

commit 4459d43eff815bec08ccc5533dbe5de846f03128
Author: Matt Macy <mmacy@mattmacy.io>
Date: Sat May 26 00:06:31 2018 -0700

libpmc: fix pmu function signatures for non amd64

commit a2cb8bbc586c65d41f9b291430a2261ec67b59fe
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:38:11 2018 -0700

pmcstat: fix indentation of usage

commit f686954b15ff56a833ac80404898977cb80a265b
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:19:49 2018 -0700

pmclog(3): add callchain and pmcallocatedyn, remove pcsample

commit 73e13a0d2e9498c81c150d14d022050cee7511bb
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:19:00 2018 -0700

pmclog.h: GC pcsample field

commit 3e93ffd65da641fa657539dad3c48e281f8b5798
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:05:57 2018 -0700

hwpmc: make Intel core CPUs use external event tables

commit 634f5fae1e1644ac324003136c66cd9c619d1c93
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 22:00:06 2018 -0700

pmclog: update log record types, bump PMC_MAJOR
- explicitly make log record types a multiple of 8 bytes
- hook in pmu event types for pmc_allocate records
- remove references to no longer PCSAMPLE record

commit 83d84fcd2d65bdf6ddcb2e155a22f0cfa2a9c225
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 21:52:10 2018 -0700

libpmc: add support for having vendor table driven pmc_allocate

commit 9e6ad63c40c2fce8404847ace5078ca6cb33a736
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 19:11:33 2018 -0700

hwpmc_core: add accessors for EVSEL & UMASK, make IAP_UMASK useful to user

commit 859dceb93daa6419a48c794db99b6758e5b041c9
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 19:09:45 2018 -0700

pmcstat: update usage and man page as well as make -L consistent with pmccontrol

commit 79c7d8597e28c2eb13f5f9113e65ec2792ca57b1
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 18:07:03 2018 -0700

pmu_util: add support for all current intel event keywords

commit d8089c7f6a6c8527f38324252b1ffb47004694c6
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 17:45:00 2018 -0700

add description for new arguments

commit 058336740bab53c62ec88a3a026ea848cf3878c6
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 17:38:15 2018 -0700

libpmc: move pmu_events table and pmu_utils out of libpmcstat so that they can be used by pmc_allocate

commit 049b66b382e2f833c3f47bc8df9e750cb265709f
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 16:12:41 2018 -0700

pmcstat: hook pmu_events counter description utility routines in

commit f5e01e7b37a691dc045e1aa16b3ebdd162515de8
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 16:11:59 2018 -0700

pmu_events: add utility routines for listing counters and their descriptions

commit cba4d4f8907f772279f86f18f915e0d74d33ac56
Author: Matt Macy <mmacy@mattmacy.io>
Date: Fri May 25 16:09:50 2018 -0700

pmu-events: expand out skylake regex to simplify string matches


# c2decc35 25-May-2018 Brooks Davis <brooks@FreeBSD.org>

Support -DNO_CLEAN builds across r334223+r334224.


# 77301553 24-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmcstat: Don't build pmu tables on !amd64 until the corresponding
util routines have been written and tested. Currently building them
breaks the build on power64

Reported by: emaste


# 810c4dcd 24-May-2018 Brooks Davis <brooks@FreeBSD.org>

exect() was removed in 2018, not 2017.


# e98bbcf9 23-May-2018 Matt Macy <mmacy@FreeBSD.org>

libpmcstat: compile in events based on json description


# 754a9d6c 27-Apr-2018 Ed Maste <emaste@FreeBSD.org>

Bump min supported release for building HEAD to 10.3

r307825 and r333017 disallow building FreeBSD-HEAD from 9.x or 10.x
versions that have some clang issues. The minimum supported Subversion
revisions and osreldates containing the fix are:

Version Min Rev osreldate
9.x r286035 903509
10.x r286033 1002501

9.3 is the final 9.x release and does not contain the r286035 fix.
10.3 is the first 10.x release with the fix. Thus, in practice 10.3 is
the oldest release that can build HEAD.

Although it may still be possible to build HEAD from an up-to-date
stable/9 it's not worth maintaining the special case when the branch
itself is unsupported and there are no usable releases from that branch.

Old UPDATING entries can be removed and the Clang warning in UPDATING
may be updated, in a future commit.

Approved by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15209


# 27d86a1c 26-Apr-2018 Ed Maste <emaste@FreeBSD.org>

Correct r307825 BOOTSTRAPPING test for unsupported upgrade

__FreeBSD_version has five digits after the major number, but the min
versions in the test had an extra 0 (so the test was always false).


# d3292755 12-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN builds across r332443.


# d9b41671 06-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Support -DNO_CLEAN builds across r332119.


# e4e7a46b 05-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN buildworld after r332080.


# 523bfea2 04-Apr-2018 Ed Maste <emaste@FreeBSD.org>

remove special handling for stale ptrace dependencies

r318957 added special handling for stale ptrace dependency files to
support a -DNO_CLEAN build in a tree last built before r305012. That
revision is now over a year and a half old, so retire the special case.

Sponsored by: The FreeBSD Foundation


# 62d6bc39 04-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Allow -DNO_CLEAN builds over r332048.


# af94761a 20-Mar-2018 Ed Maste <emaste@FreeBSD.org>

Correct comment date in r331255

Reported by: jhb


# aa9ceac4 20-Mar-2018 Ed Maste <emaste@FreeBSD.org>

Remove stale generated assym.s files after r331254

So that -DNO_CLEAN builds work.

This should be reverted after a sufficient transition period (perhaps 3
or 6 months).

Sponsored by: The FreeBSD Foundation


# fb6d3be5 14-Mar-2018 Kyle Evans <kevans@FreeBSD.org>

pkgbase: Fix post-install script for kernel packages

kernel.ucl uses a hardcoded boot/kernel for kldxref, which is the incorrect
directory when we're installing extra kernels that aren't the "default"
kernel (placed at boot/kernel).

Fix this by instead using a new %KERNELDIR% that we now replace in
Makefile.inc1 with "kernel" for the default kernel and "kernel.${_kernel}"
for these extra kernels so that, e.g. /boot/kernel.SHIVA, will get properly
kldxref'd upon update and avoid outdated linker.hints.

Reviewed by: gjb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14689


# 2f513483 26-Feb-2018 Brooks Davis <brooks@FreeBSD.org>

Improve wording of error message when CROSS_TOOLCHAIN is not found.

Reported by: emaste, jhb


# 0df651d7 25-Feb-2018 Brooks Davis <brooks@FreeBSD.org>

Allow CROSS_TOOLCHAIN to be a path to a file.

This allows working with custom cross toolchains without the need to
create files in /usr/local/share/toolchains.

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


# 55927f28 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Properly lookup values if they were empty.

Spotted by: rpokala
X-MFC-With: r329676
MFC after: 2 weeks
Sponsored by: Dell EMC


# 0f8995a9 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Only lookup SVN once and rename to SVN_CMD.

MFC after: 2 weeks
Sponsored by: Dell EMC


# c0d9f07d 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Avoid looking up VCS_REVISION for every sub-make call to Makefile.inc1.

MFC after: 2 weeks
Sponsored by: Dell EMC


# 49a1108a 20-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Move SVNVERSION_CMD into the one place that uses it.

This code, which is basically `svnversion || svnliteversion`, generates
2 fstatat(2) for every directory in PATH for every Makefile parsed that
includes bsd.own.mk. This can add up for things like generating a Ports
index (Poudriere) or building a dependency graph for base.

Sponsored by: Dell EMC
MFC after: 2 weeks


# c1c35c10 09-Feb-2018 Warner Losh <imp@FreeBSD.org>

sort needs to be in ITOOLS since find -s was changed to find | sort.


# 207efdb3 07-Feb-2018 Warner Losh <imp@FreeBSD.org>

Add a note about why we have the conditional before including
bsd.compiler.mk. It's so fmake from older 9.x systems still
works (still a supported build config, and having the note here
will let us know when we can cull it more easily).

Also pull in a related change from include to sinclude from
arichardson@'s cross building work, as well as it's companion in
Makefile.inc1 with a note about why we do the odd thing there.

Submitted by: archardson
Differential Revision: https://reviews.freebsd.org/D14241


# 48164080 07-Feb-2018 Ed Maste <emaste@FreeBSD.org>

add retpoline compiler and linker feature flags

These features indicate that the compiler and linker support the
retpoline speculative execution vulnerability (CVE-2017-5715)
mitigation.

Reviewed by: dim, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14228


# fb1df203 06-Feb-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't hardcode /usr/bin as the path for mktemp in build tools

It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is in
/bin there.

Reviewed By: bdrewery
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D13937


# a564880c 25-Jan-2018 Wolfram Schneider <wosch@FreeBSD.org>

`make installkernel' should display a completed message if done

PR: 225159
Reviewed by: bdrewery
Approved by: cem (mentor)
Differential Revision: https://reviews.freebsd.org/D13940


# 553b3bb8 24-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

test-system-compiler: Display X_ variants for compiler/linker.

Sponsored by: Dell EMC


# 1c0cac23 24-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

X_COMPILER_* may not be defined.

Sponsored by: Dell EMC


# ebe45c64 16-Jan-2018 Alex Richardson <arichardson@FreeBSD.org>

Don't build share/syscons in build-tools stage if MK_SYSCONS == "no"

Reviewed By: emaste, jhb
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12926


# fe8be588 12-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Ensure MK_LDD for bootstrap-tools matches MK_LLD_BOOTSTRAP.

This fixes building libllvmminimal with MK_LLD support when WITHOUT_LLD
or WITHOUT_TOOLCHAIN are set, which are install flags not build tools
flags.

Reported by: sbruno
Tested by: sbruno
Sponsored by: Dell EMC


# d52c29e7 11-Jan-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Cache LINKER_FEATURES to fix the wrong ones being used.

Submitted by: Dan McGregor <dan.mcgregor@usask.ca>


# e93e5bb0 31-Dec-2017 Ian Lepore <ian@FreeBSD.org>

Allow use of .WAIT in the LOCAL_DIRS and LOCAL_LIB_DIRS lists.

A comment in Makefile.inc1 has long stated that LOCAL_DIRS are built last,
after the base system. Incremental improvements in parallel building over
the years have led to LOCAL_DIRS being built in parallel with base system
directories. This change allows the .WAIT directive to appear in LOCAL_DIRS
and LOCAL_LIB_DIRS lists to give the user some control over parallel
building of local additions.

Differential Revision: https://reviews.freebsd.org/D13622


# 3670d4c7 05-Dec-2017 Ed Maste <emaste@FreeBSD.org>

Makefile.inc1: map mips MACHINE_/TARGET_ARCH to triples

This helps Clang MIPS builds.

Reviewed by: bdrewery, jhb (earlier version)
Differential Revision: https://reviews.freebsd.org/D12171


# 9b43e3da 05-Dec-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Ensure GCC files are cleaned up.

Because we force enable MK_GCC when building we need to also force
enable it for the cleaning phase. Otherwise the NXB_TARGET files
are found in the next build's kernel-toolchain phase and cause
an error.

Reported by: sbruno
X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC


# 4a51c708 04-Dec-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Fix build without META_MODE for GCC archs.

The initial kernel-toolchain is built with TARGET=MACHINE but
we want GCC to have files generated for TARGET=NXB_TARGET
instead later on. Just clean the files between building of
the toolchain and nxb binaries which will let it rebuild
when needed.

Reported by: sbruno
X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC


# 388290b8 24-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix for multi-threaded lib32 compat build on amd64.

Sponsored by: Mellanox Technologies


# e8333057 24-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Simplify the build dependencies when building the OFED libraries.

Suggested by: bdrewery@
Sponsored by: Mellanox Technologies


# 3faecc70 18-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make -n' for {reinstall,distribute}kernel.

PR: 201779
Sponsored by: Dell


# 7a310b06 16-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Update list of hardcoded OFED build order dependencies for
the buildworld target.

Sponsored by: Mellanox Technologies


# 92b800cc 15-Nov-2017 Ed Maste <emaste@FreeBSD.org>

Sort pkgbase mtree metadata, for reproducible builds

Packaged base packages are created by running the stageworld and
stagekernel targets with -DNO_ROOT, and converting the resulting mtree
file into a set of pkg plists. If stage* is run with multiple processes
the order of entries in the mtree file may be nondeterministic, and the
resulting package tbz also had nondeterministic file ordering.

The mtree file generated by -DNO_ROOT builds consists of one line per
file, with the filename starting in the first column, so is easily
sorted. There's one exception: the first line of the mtree file is a
comment, but the # character sorts before the filenames anyhow and needs
no special treatment.

PR: 223673
Reviewed by: bapt, gjb
Sponsored by: The Linux Foundation, Core Infrastructure Initiative
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13103


# ca987d46 14-Nov-2017 Warner Losh <imp@FreeBSD.org>

Move sys/boot to stand. Fix all references to new location

Sponsored by: Netflix


# 7202739f 13-Nov-2017 Alex Richardson <arichardson@FreeBSD.org>

Only build the libmagic build-tools if MK_FILE != no

Before this patch libmagic was always built in the build-tools phase
even if -DWITHOUT_FILE was specified.

Reviewed by: emaste, jhb
Approved by: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12925


# f649ab27 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

cleanworld only needs a tree walk if the expected .OBJDIR is .CURDIR.

Sponsored by: Dell EMC Isilon


# 9cde684d 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Fix for GCC archs.

- This also adds in a _cleanobj step as needed.
- This redirects TARGET/TARGET_ARCH to NXB_TARGET/NXB_TARGET_ARCH in
Makefile.inc1 as the main build needs to be for MACHINE rather
than TARGET.

First build the toolchain and then use that as an external toolchain
to build the needed directories and NXB_TARGET-toolchain, all as
MACHINE files though via TARGET_TRIPLE=MACHINE_TRIPLE.

The NXBDIRS is evaluated in the 'everything' submake as it needs to be
based on TARGET's src.opts.mk values, such as MK_GCC=yes when building
on a MK_CLANG=yes MACHINE. This can likely be changed to a specific
_native-xtools-everything target later and the funky late evaluation
of SUBDIR_OVERRIDE removed.

X-MFC-With: r325001
Pointyhat to: bdrewery
MFC after: 2 months
Sponsored by: Dell EMC Isilon


# ae9f7248 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

rescue ipf: Remove hacks and link in libipf directly.

Sponsored by: Dell EMC Isilon


# fa65e3a5 09-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Handle some .OBJDIR == .CURDIR cases.

- If OBJROOT is SRCTOP then don't add on TARGET.TARGET_ARCH. This
only happens at the top-level, and for sub-directories when the
user is clever with MAKEOBJDIRPREFIX=/.
- Don't bother checking 'test -w' on .CURDIR.
- Properly set OBJTOP/OBJROOT to SRCTOP in various needed cases.
- Check if the OBJDIR is writable even for *clean* targets since it
determines which .OBJDIR the user gets; If they cannot write to an
existing eligible .OBJDIR then it needs to clean in .CURDIR instead.
- Add guard to cleanworld/cleanuniverse from removing SRCTOP.
- Ensure OBJTOP is proper for .OBJDIR=.CURDIR which fixes finding
libraries since src.libnames.mk is based on OBJTOP.
- Avoid some chdir(2) for modifying .OBJDIR

Sponsored by: Dell EMC Isilon


# 3fa561a4 07-Nov-2017 Warner Losh <imp@FreeBSD.org>

Note interactive shell errors for make buildenv and add a warning for
people tempted to add back the || true to get rid of them.

Sponsored by: Netflix


# 996e4759 04-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix nested MAKEOBJDIRPREFIX breaking various release/buildworld/toolchain targets.

This problem was caused by r325329 and r325350.

For the release(7) targets, some will run mm-mtree.sh which itself runs make
with a MAKEOBJDIRPREFIX. The execution of that script leaks OBJROOT,
MAKEOBJDIR, and MAKELEVEL=1 in the environment. This causes the mm-mtree makes
to not do some basic setup of OBJROOT and only use this special
MAKEOBJDIRPREFIX case which fails to empty out MAKEOBJDIRPREFIX for further
nested makes, such as a tree walk. If that tree walk sets OBJROOT/OBJTOP such
as r325329 is doing, then the wrong OBJDIRs end up being used due to the
unemptied MAKEOBJDIRPREFIX being preferred over the proper MAKEOBJDIR.

Pointyhat to: bdrewery
Sponsored by: Dell EMC Isilon


# 2abeba9d 03-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r318105: Don't use NO_OBJ at top-level, use NO_OBJWALK.

NO_OBJ has a very specific meaning in sub-directories in that no object
directory will be made. If a user wanted to skip the 'make obj' phase then
passing -DNO_OBJ would break all sub-directories from building properly. Using
NO_OBJ internally also causes issue with NO_OBJ handling being added in
share/mk/bsd.init.mk soon.

Sponsored by: Dell EMC Isilon


# 2c36cefe 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r325329: Store all WORLDTMP objects back in the same directory.

This still keeps the reduced MAKEOBJDIRPREFIX (SRCTOP) redundancy
removed in the OBJDIR, but now keeps all early phase objects
in the same directory rather than split per phase.

The problem of splitting per phase is that later phases want to link in
libraries from earlier phases and base their location on ${OBJTOP}.

Pointyhat to: bdrewery
Reported by: mjoras, Mark Millard
Sponsored by: Dell EMC Isilon


# fe480405 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r325342: Always ensure WORLDTMP exists.

Reported by: Herbert J. Skuhra
Sponsored by: Dell EMC Isilon


# 89bd07e9 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

DIRDEPS_BUILD: Cleanup leftover WORLDTMP files.

This will force any existing objects to rebuild if their .meta
files reference files from WORLDTMP. This is a problem after
the UNIFIED_OBJDIR effort caused buildworld and DIRDEPS_BUILD
to share an OBJDIR. Without cleaning these files the
Makefile.depend files end up with odd tmp/legacy/... entries
since some bootstrap-tools linger from there and otherwise
don't rebuild. Removing the files causes anything having
used WORLDTMP to rebuild.

Sponsored by: Dell EMC Isilon


# 4dc89c4d 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Reduce MAKEOBJDIRPREFIX path spam by specifying a direct objdir to use.

Sponsored by: Dell EMC Isilon


# 3d165b2f 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools/xdev: Store these in a location including both MACHINE/TARGET.

Given MACHINE/MACHINE_ARCH=amd64, TARGET=arm64 and TARGET_ARCH=aarch64,
this change will build them in a location such as:
/usr/obj/usr/src/amd64.amd64/nxb/arm64.aarch64/
and
/usr/obj/usr/src/amd64.amd64/xdev/aarch64-freebsd/

Sponsored by: Dell EMC Isilon


# c10062b9 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add a 'make cleanuniverse'.

This will remove all build files for the source directory
when MK_UNIFIED_OBJDIR is enabled.

Sponsored by: Dell EMC Isilon


# dfa09989 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.

This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for
native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to
a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>. This
new format is used regardless of cross or native build. It allows
easier management of multiple source tree object directories.

The UNIFIED_OBJDIR option will be removed and its feature made permanent
for the 12.0 release.

Relnotes: yes (don't note UNIFIED_OBJDIR option since it will be removed)
Prior work: D3711 D874
Reviewed by: gjb, sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Discussed with: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12840


# f0696740 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Follow-up r325087: Need to build lib/clang before lld.

LLD needs headers generated by the full libllvm.

X-MFC-With: r325087
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 651c6845 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

kernel-toolchain: Fix improper build order after r325244.

Due to removing some targets that the previous .ORDER: ${WMAKE_TGTS}
set, it was no longer being respected; _build_tools was coming
immediately.

Pointyhat to: bdrewery
X-MFC-with: r325244
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 5a4121a8 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

kernel-toolchain: Skip world _obj and _cleanobj phases.

There's no good reason to treewalk the entire tree removing old OBJDIRS
and creating new ones when 'includes', 'libraries', and 'everything' are
all skipped. The only shared directory in the existing toolchain target
and world is build-tools. So handle cleaning in it directly if needed
only for the directories it wants to build.

The extra _obj/_cleanobj walks came in the initial kernel-toolchain
addition in r128189.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 7cd84b56 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

build-tools: De-special-case the gcc tools build.

It merely wanted to use 'all' rather than 'build-tools' so just
add a build-tools target to the Makefile.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 555c6e60 31-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r297998: Remove redundant TOOLS_PREFIX in XMAKE.

Sponsored by: Dell EMC Isilon


# b4d17313 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Fold all of the MK_COVERAGE _prereq_libs logic up. None of the deleted logic works. This seems to work


# fc13dfd2 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

The append to _startup_libs was bogus; remove it


# b94ab34d 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Remove c++ COMPILER_FEATURES check; it's not needed

Add _coverage_libs to _startup_libs for consistency with the other libraries
in _prereq_libs .


# 337698b7 30-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Allow SYSTEM_COMPILER to be used after r325001.

Now that a proper sysroot is used and a separate target list, it should
be safe to skip building the initial cross-compiler.

X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC Isilon


# 601594ed 30-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

cleanworld: No need to cleandir if MK_AUTO_OBJ is enabled.

Sponsored by: Dell EMC Isilon


# 35dcbb5d 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Remove empty else


# a681ab9b 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Remove the WMAKEENV forcing of MK_COVERAGE to no

We'll see if this changes my debugging output any


# 1e3c0321 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Try again


# 200eb8a9 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Let's try enforcing profile_rt's build this way

Still trying to beat tinderbox for !amd64/!i386 into submission


# 6ea5e441 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Just append to WMAKEENV


# d7cd63e6 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Pass down WANT_COMPILER_TYPE for debugging purposes and for sanity purposes


# 0255bc13 29-Oct-2017 Warner Losh <imp@FreeBSD.org>

Return proper status from buildenv.

make buildenv BUILDENV_SHELL=<some command> more useful. Remove '||
true' from the command line so that errors are properly
returned. There appears to be no reason for it, and it dates back to
the original commit by ru@.

Sponsored by: Netflix


# be1ef37b 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Consolidate duplicate cross-tools build/install list into XDEVDIRS.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 86c4ac99 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Remove excess '/' since XDTP is asserted to be an absolute path.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# c16a698b 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Fix build for platforms needing LLD.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 57820ca8 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Add missing 'make obj' treewalk for 'make includes'.

It is possible that building headers requires an OBJDIR.
The other phases of xdev have their own 'make obj' calls
where needed, such as inside 'make libraries' itself.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 5bd47cc5 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Change native-xtools to not install by default; add a native-xtools-install.

Without this the user has to mess with 'make -f Makefile.inc1 ...' to figure
out where the files are installed in the OBJDIR and then they need to copy them
to where they really wanted them. Using DESTDIR may be problematic after
r325001 as well.

The files will be installed to DESTDIR/NXTP where NXTP defaults to /nxb-bin.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 24830684 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix xdev TARGET/TARGET_ARCH assertion and expand to native-xtools.

The top of Makefile.inc1 requires TARGET/TARGET_ARCH be defined. Just
building 'make xdev' would already set them, so this error was never
triggered. Moving it to Makefile fixes the problem.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# bb3f65ea 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Disable AUTO_OBJ as a make argument to ensure it really is disabled.

If the user sets this to yes as a make argument too we still want
to ensure these do not get enabled.

Sponsored by: Dell EMC Isilon


# 0a3c9523 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Remove comment: debug files can be useful for build tools.

Sponsored by: Dell EMC Isilon


# 67d2f51a 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move some LIBCOMPAT tmpdir logic setup to its own build target.

Its own build target was already handling mtree extractions
just as _worldtmp did, so the other cleaning of the
tmpdir makes sense here as well.

Sponsored by: Dell EMC Isilon


# a3d90ddf 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

MK_TESTS is disabled in early phases, no need for TESTBASE extraction here.

Sponsored by: Dell EMC Isilon


# 53f3deb1 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

FAST_DEPEND clean hack: Remove lib32/soft files properly.

Only remove them if the option is enabled and also handle libsoft
by using the proper LIBCOMPAT_OBJTREE. LIBCOMPAT:D will expand
the text after it as a proper glob to the command line if LIBCOMPAT
is defined.

Sponsored by: Dell EMC Isilon


# fb3d959c 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move FAST_DEPEND cleanup hack into its own target and call from _cleanobj.

The _worldtmp target is for setting up WORLDTMP. Nothing between _worldtmp
and _cleanobj will read these files. Move to its own target since it is
so large.

Sponsored by: Dell EMC Isilon


# 354ffd53 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

We don't need LIB32 directories extracted in early phase legacy/WORLDTMP dirs.

This reverts some changes from r289662

Sponsored by: Dell EMC Isilon


# 64ec6792 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Disallow using a colon ':' in source checkout paths.

This leaks into the PATH handling for WORLDTMP and breaks
finding cross-tools. The PATH handling could be fixed to
properly quote but is not worth the effort.

Also allow this sanity check to always run even with 'make -n'.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 5e3b9061 28-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move sendmail special check into a _sanity_check target.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# d3ee5ac5 25-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Remove unnecessary :U when testing COMPILER_FEATURES


# a13a8505 25-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Cleanup pieces missed in r315057 which made mandoc mandatory

Sponsored by: Dell EMC Isilon


# ca95e9dd 25-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native-xtools build to use a proper sysroot.

This takes longer but should reliably produce working binaries.
The old version linked against system libraries and headers
which would be a problem if building a native-xtools against
a newer source than the host system. With a proper sysroot made
first this is not a problem.

This also allows:
- NXBDIRS to be built in parallel
- NXBDIRS to be installed to NXBDESTDIR in parallel
- SYSTEM_COMPILER logic to work again. Note that because this change
is adding a sysroot phase the compiler may be built up to twice now.
The first is the "cross-compiler" even though it is for the native
architecture, but it is still built to ensure the latest compiler
is used to generate the binaries, unless SYSTEM_COMPILER allows
/usr/bin/cc to be used. Then the target compiler is built
which is actually a cross-compiler since it runs on native host
but generates TARGET.TARGET_ARCH binaries.

Note this also changes the path used for the OBJDIR. It used to use
/usr/obj/target.target_arch/nxb/<srcdir> for objects and
/usr/obj/target.target_arch/nxb-bin for installed files, but now uses
/usr/obj/nxb/target.target_arch/<srcdir> for objects and
/usr/obj/nxb/target.target_arch/<srcdir>/nxb-bin for installed files.
- NXBDESTDIR can be specified for where to install or queried with
`make -f Makefile.inc1 TARGET=... TARGET_ARCH=... -V NXBDESTDIR`

This could potentially be improved to reuse an existing sysroot. The
problem is with building the SUBDIR_OVERRIDE list it needs to use a
different OBJDIR since it is building all statically. We don't want to
pollute the existing 'buildworld' OBJDIR and cause confusion on the next
build. Using a separate OBJDIR for the 'everything' phase mostly works
except for some things like linking in INTERNALLIBS that exist in the
other OBJDIR.

MFC after: 1 month
Sponsored by: Dell EMC Isilon


# b1237142 25-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Follow-up r319593: Don't use host headers in a fresh new build.

Sponsored by: Dell EMC Isilon


# e6749a40 24-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Let's try doing this...


# d5772ee2 24-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Try setting MK_COVERAGE in WMAKEENV


# d5f50665 24-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

I guess I have to use COMPILER_FEATURES, not X_COMPILER_FEATURES with _libraries+

*sigh*


# 7af9f42f 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Don't expand _coverage_libs


# 740fd94a 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

More trying to quash the stupidity of gcc 4.2.1


# 991e4517 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Missing .endif FTL


# 5adaeae8 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Diff reduce and try to apply MK_COVERAGE only against c++11 compilers

Hashtag crossesFingersAndHopeThisVoodooWorks


# 33913aa8 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Use MK_CLANG instead -_-


# 802fb6ef 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Trying to get libgcov to work was a stupid, stupid rabbit hole to go down

Just use clang and ports gcc. I will fix the cross-toolchain stuff to actually
work with MK_COVERAGE -- for now the host-only compilers work just fine.


# a4bed459 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

libprofile_rt requires c++-11


# 206d51ae 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Get rid of now unnecessary intermediate variable, _coverage_libs

Use _prereq_libs instead.


# 6b097b81 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Delete MK_COVERAGE=no with gcc. Let's see if this fixes cross-compilation :/


# 9f820b12 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Always compile libgcov and libprofile_rt

I'm not fully grasping the intertwined complexity of how our bootstrap compiler
is working, so just cut-to-the-chase and build/install both with `_prereq_libs`.


# 6a66aab0 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Try unbreaking MK_COVERAGE != no with make tinderbox

Compile libgcov/libprofile_rt when bootstrapping/compiling gcc/clang.

Hopefully this fixes platforms still on host gcc (mips, powerpc, etc). We'll
see after the next tinderbox cycle on universe12a.freebsd.org *eyeroll*.


# 6406a0d3 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Disable MK_COVERAGE in Makefile.inc1 when working with broken gcc packages

It makes more sense to do this in the top-level Makefile, instead of down in
src.opts.mk .

PR: 223174


# 651c18f1 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Tweaks to make libraries and make installworld

- Optimize/fix _prereq_libs and _generic_libs by not installing the .gcno files
with "make install". This cuts down on installing unnecessary files to
WORLDTMP and fixes the build, since BSD.coverage.dist wasn't being splatted
on WORLDTMP.
- Splat BSD.coverage.dist on ${DESTDIR}/usr/lib in distributeworld/installworld
so the files will be installed to the proper places.


# 71a6afa2 10-Oct-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Do not print error when running make check-old on system
without catpages directories

Reported by: dim


# 77e4ea3b 10-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Tweak wording for _coverage_libs.*


# 3a09397a 10-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Fix the typo I accidentally added with _coverage_libs.${MK_GCC}


# ca11bef5 10-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Building libprofile-rt in cross-tools unfortunately doesn't work

When built with cross-tools, it builds for the host architecture. We want the
target architecture instead.

Move the libraries to _prebuild_libs instead so they get built along with
libssp_nonshared, etc (libraries that don't rely on --coverage being baked into
them because NO_PIC is set).


# aafeff5a 09-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

First attempt at adding coverage libraries for gcc-only platforms

gnu/lib/libgcov is needed for gcc --coverage , whereas libprofile-rt is
required for clang --coverage .

Adopt a pattern similar to SUBDIR.yes for handling both the clang and gcc cases.


# 01f06122 08-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Add MK_COVERAGE_SUPPORT

This is being done for reasons parallel to MK_TESTS_SUPPORT's addition in
^/head@r273449

Unlike ^/head@r273449 though, we do want binaries to be built with coverage
support in the libraries phase, but not in the cross-tools phase.


# 0b972ac9 05-Oct-2017 Warner Losh <imp@FreeBSD.org>

Support armv7 builds for userland

Make armv7 as a new MACHINE_ARCH.

Copy all the places we do armv6 and add armv7 as basically an
alias. clang appears to generate code for armv7 by default. armv7 hard
float isn't supported by the the in-tree gcc, so it hasn't been
updated to have a new default.

Support armv7 as a new valid MACHINE_ARCH (and by extension
TARGET_ARCH).

Add armv7 to the universe build.

Differential Revision: https://reviews.freebsd.org/D12010


# 0c059da3 03-Oct-2017 Cy Schubert <cy@FreeBSD.org>

When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

This is the correct patch.

Reviewed by: ngie (previous version, r302865)
MFC after: 2 months
Differential Revision: D7167


# 84f54c4f 03-Oct-2017 Cy Schubert <cy@FreeBSD.org>

Revert r324246. This is not exactly what was intended.


# 74e0e295 03-Oct-2017 Cy Schubert <cy@FreeBSD.org>

When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

Reviewed by: ngie (previous version, r302865)
MFC after: 2 months
Differential Revision: D7167


# 4e22cca7 30-Sep-2017 Enji Cooper <ngie@FreeBSD.org>

MK_COVERAGE should not be no with _libraries -- otherwise they won't have coverage
instrumentation built into them


# f0ba4c18 30-Sep-2017 Enji Cooper <ngie@FreeBSD.org>

Smatter around MK_COVERAGE=no in a few more spots

I wish someone had made this voodoo common ages ago...


# b505dd63 25-Sep-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Do not print error when running make delete-old on system
without catpages directories


# 6d0ab078 05-Sep-2017 Ryan Libby <rlibby@FreeBSD.org>

Makefile.inc1: bump elf tool chain version check after PR 215350 fix

This causes builds to use the in-tree libdwarf with the bug fix instead
of the host library.

Reviewed by: bdrewery, emaste, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12239


# e133ecbb 27-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Respect MK_TCSH with build-tools and native-xtools

This helps reduce the WORLDTMP footprint slightly.

Based on a patch I submitted 5 years ago to GNATS.

PR: 174051
MFC after: 2 weeks
Relnotes: yes (anyone who cross-builds with MK_TCSH=yes will run into
build failures if the host doesn't have tcsh(1))
Reminded by: Fabian Keil <fk@fabiankeil.de>


# 6323f724 22-Aug-2017 Ed Maste <emaste@FreeBSD.org>

Set MK_LLD_IS_LD to MK_LLD_BOOTSTRAP for cross-tools

LLD_BOOTSTRAP is intended to control the linker used to link world and
kernel, while LLD_IS_LD is intended to control the linker installed in
that world.

Force LLD_IS_LD equal to LLD_BOOTSTRAP for the cross-tools build and
install phase, so that lld will be installed as the ld to run on the
host, when LLD_BOOTSTRAP is set.

PR: 221543
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12072


# 53d1eddd 15-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Revert r322327, r322352, r322358:

Disconnect the dependency on the kernel package from the runtime
package. There are a number of problems here:

1) The runtime package installed into a chroot or a jail would
include the kernel package, changing the behavior of how jails
work now [1];

2) As result of (1), it is possible a binary may incorrectly
resolve kernel symbols [2]; in addition, it is possible there
will be unexpected fallout with 32-bit jails on a 64-bit host
kernel [2].

Noticed by: brd [1]
Discussed with: kib [2]
MFC after: 3 days
MFC note: record-only to wipe from the merge tracker
Sponsored by: The FreeBSD Foundation


# ebd2eeb3 11-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Add SVNVERSION_CMD to bsd.own.mk, adding the capability to include
svnversion metadata to the runtime and kernel packages.

Instead of traversing src/sys, as is done by newvers.sh for uname(1),
a full tree walk is done to prevent userland and/or modifications
from not being reflected in a modified tree (M).

MFC after: 5 days
Sponsored by: The FreeBSD Foundation


# 1866d42e 11-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Fix indentation from r322401.

MFC after: 3 days
MFC with: r322401
Sponsored by: The FreeBSD Foundation


# 33f8570d 11-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Avoid creating kernel-dbg.txz distribution sets and kernel-debug
packages when MK_DEBUG_FILES is 'no'.

MFC after: 5 days
Sponsored by: The FreeBSD Foundation


# 15373377 10-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Indent nested conditionals for readability.

Sponsored by: The FreeBSD Foundation


# 16398a11 09-Aug-2017 Glen Barber <gjb@FreeBSD.org>

Add a dependency on the kernel package for the runtime package.

The idea here is that, provided upstream pkg(8) maintainers accept
the proposed change, the kernel.ucl will contain a post-install
script causing pkg(8) to emit a message informing to reboot the
system after the kernel is upgraded using 'pkg upgrade', so the
new userland is installed on the running new kernel. At present,
this functionality does not exist in pkg(8), but will help ensure
the upgrade path follows that from UPDATING. To work around this
for now, evaluate ASSUME_ALWAYS_YES, and prompt the user if they
wish to proceed if not set to true.

Since there is a kernel dependency, and a non-GENERIC kernel may
be in use, update Makefile.inc1 to replace '%KERNCONF%' in the
runtime.ucl with the first-built kernel set either via command line
or in make.conf(5).

MFC after: 5 days
Sponsored by: The FreeBSD Foundation


# 8422e09e 07-Aug-2017 Dimitry Andric <dim@FreeBSD.org>

Follow-up to r321684 (Don't use libc++ when cross-building for gcc
arches), and handle two more cases where libc++ includes could be
incorrectly enabled, in case the host compiler is clang 5.0.0, and the
target (cross) compiler is gcc 4.2.1.

Noted by: bdrewery
MFC after: 3 days
X-MFC-With: 321684


# 91234af7 01-Aug-2017 Bryan Drewery <bdrewery@FreeBSD.org>

CCACHE_BUILD: Follow-up r321880: Fix some PATH issues with buildworld.

- bsd.compiler.mk: Must ensure that the CCACHE_WRAPPER_PATH comes first
in PATH.
- Makefile.inc1: Must prepend the CCACHE_WRAPPER_PATH into BPATH as it
overrides the PATH set in bsd.compiler.mk in sub-makes. The PATH
set in bsd.compiler.mk is not exported and doing so would cause it to
then override the BPATH set from environment. The only sane solution
is to prepend into BPATH as needed.
CCACHE_PATH could possibly be used for some of this as well.

Sponsored by: Dell EMC Isilon


# 5aa73fa2 01-Aug-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_CLEAN: No need to run delete-old if the directories don't exist.

X-MFC-With: r321443
MFC after: 1 month
Sponsored by: Dell EMC Isilon


# dca576be 01-Aug-2017 Ian Lepore <ian@FreeBSD.org>

In xdev-links, when installing symlinks to the cross-compiler pieces that
includes the OS version (armv6-freebsd12.0-cc, etc), use the OS version of
the compiler/world source code, not the version of the build host machine.


# ecb77ea9 31-Jul-2017 Enji Cooper <ngie@FreeBSD.org>

Take a different approach to building with --coverage (WiP)

The .covo binaries didn't really make sense after reviewing some stackoverflow posts
and other related documentation -- in particular, it would complicate matters by having
"coverage-enabled binaries" link to "coverage-enabled libraries" (aka "covo" libraries).
It's best to install the full binaries/libraries to /usr/lib/cov instead.

In order to enable this (and make sure that libprofile_rt is built properly),
libprofile_rt must be built with cross-tools.

Also, don't explicitly disable MK_COVERAGE in _libraries -- coverage support needs to
be baked in to the libraries in order for it to be effective.

Pass through --coverage in the linking phase for shared libraries -- it's necessary
to ensure that libprofile_rt is resolved properly in the _libraries phase with 2nd
order libraries, like libcom_err.so.*.

This change reverses all of r320396 and partially reverses r321758. The first commit
was the WiP approach that was proven to incorrect with the reasoning given in the first
paragraph. The second commit reverses the MK_DEBUG_FILES change because I'll probably
run into friction when trying to merge it back in to head if I leave it in (despite
the fact that I find this behavior completely unnecessary).

TODO: see if libprofile_rt's symbols should be stripped out of debug files; they are
currently duplicated between the fat binaries installed to /usr/lib/cov and the debug
files installed to /usr/lib/debug .


# 8bd0ba0a 30-Jul-2017 Enji Cooper <ngie@FreeBSD.org>

Don't build bootstrap-tools with coverage support or debug files support

Building build tools with coverage and debug files support is wasteful (of
CPU cycles and disk space).


# 1681d1de 28-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Don't use libc++ when cross-building for gcc arches

Since we imported clang 5.0.0, the version check in Makefile.inc1 which
checks whether to use libc++ fires even when the compiler for the target
architecture is gcc 4.2.1. This is because only X_COMPILER_VERSION is
checked. Also check X_COMPILER_TYPE, so it will only use libc++ when an
external gcc toolchain is used.

Reviewed by: emaste, rpokala
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11776


# 18388aa4 25-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_CLEAN: Hide delete-old output.

It is full of distracting noise about UPDATING and may confuse
the user about what is actually being deleted. It is also
possible to have directories removed on every run with
use of WITHOUT_ knobs that the mtree files do not
account for and for which the directories are incorrectly
in OLD_DIRS currently.

X-MFC-With: r321443
MFC after: 1 month
Sponsored by: Dell EMC Isilon


# b7c6a063 25-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Only build libzfs_core in 'make libraries' if needed.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 63c534e7 25-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Remove unneeded dependency for libzfs.

This dependency does nothing since cddl/lib/libzfs is never
added into the 'make libraries' dependency chain
directly.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 1ae1311d 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP.

This prevents situations with -DNO_CLEAN from finding stale headers or
libraries in places that no longer exist or have moved. It avoids
the need to remove all of WORLDTMP by reusing what we already know
is obsolete.

MFC after: 1 month
Sponsored by: Dell EMC Isilon


# dc75d44e 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

The .depend.obj cleanup hacks are only needed with -DNO_CLEAN.

Sponsored by: Dell EMC Isilon


# cd283100 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Move llvm Options.inc hack from r321433 for NO_CLEAN to lib/clang/libllvm.

The files are only ever generated to .OBJDIR, not to WORLDTMP (as a
sysroot) and are only ever included from a compilation. So using
a beforebuild target here removes the file before the compilation
tries to include it.

MFC after: 2 months
X-MFC-With: r321369


# edcc769f 24-Jul-2017 Dimitry Andric <dim@FreeBSD.org>

Cleanup stale Options.inc files from the previous libllvm build for
clang 4.0.0. Otherwise, these can get included before the two newly
generated ones (which are different) for clang 5.0.0.

Reported by: Mark Millard
MFC after: 2 months
X-MFC-With: r321369


# 0f827d7a 08-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

makeman: Don't show META_MODE ABI rebuild warnings.

Reported by: dim
Sponsored by: Dell EMC Isilon


# 9bb3819b 08-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER: Ensure there is not a stale compiler in WORLDTMP.

In a scenario of cross-building it is possible that an OBJDIR's WORLDTMP
contains an older compiler in WORLDTMP/usr/bin/cc that is not rebuilt
if SYSTEM_COMPILER logic is triggered. This compiler was still
incorrectly used. Address this by removing WORLDTMP/usr/bin/cc and all
of the hardlinked files associated with it. Also do this for c++ for
GCC builds.

Sponsored by: Dell EMC Isilon
MFC after: 1 week


# f45c7805 05-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix create-kernel-packages with multiple BUILDKERNELS after r320284

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: ngie


# a28412b0 24-Jun-2017 Ed Maste <emaste@FreeBSD.org>

Clean up stale dependencies after r320278

Our current approach to dependency tracking cannot cope with switching
generated asm syscall stubs into C wrappers. Perpetuate the hack in
Makefile.inc1 to paper over the problem until we can take a holistic
approach to fixing dependency problems.

Differential Revision: https://reviews.freebsd.org/D11344


# 0369270f 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

NO_ROOT: Remove excessive // when DESTDIR/DISTDIR are empty.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 2d5cc538 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

compiler-metadata: Properly handle cross-build OBJDIR.

MFC after: 3 days
Sponsored by: Dell EMC Isilon


# 275219cf 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Expose only the create-packages-* targets since they set needed DEST/DIRDIR.

The other targets just fail confusingly otherwise.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 10c93529 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Parallelize individual kernel packaging.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# f77b03aa 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow actually building individual world packages in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 48c22674 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow creating kernel/world packages in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 00c44825 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow staging world/kernel in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# dd7b4c15 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

packages: Allow stageworld/stagekernel to run with make jobs.

The -B was originally added in projects/release-pkg r289381 as a copy
of what 'make world' did at the time. The -B was removed from
the 'installworld' call in 'world' in r303844 though. The staging
of files is safe to run in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# d20bd9e4 23-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Set compiler metadata for stageworld/distributeworld.

This fixes LD errors during 'make packages' but also for the unlikely case of
'buildworld' on 1 system and 'packages' on another [1].

PR: 212877 [1]
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 81b4423f 22-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Pass along LINKER_* vars during installworld and show in test-system-compiler.

Sponsored by: Dell EMC Isilon


# bb1073be 21-Jun-2017 Enji Cooper <ngie@FreeBSD.org>

Don't build coverage instrumented binaries in the bootstrap-tools or libraries targets

This is being done to establish parity with MK_PROFILE=no in buildworld,
buildkernel, etc.


# 817366f1 20-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

buildworld: Pass which world phase the build is in down to submakes.

This is useful for having directories behave differently depending
on the phase - such as enabling SUBDIR_PARALLEL or disabling
redundant building of library directories already done by
earlier 'make _libraries'.

Sponsored by: Dell EMC Isilon


# 35fb812a 19-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

buildworld: Define SYSROOT to WORLDTMP.

This is to allow downstream Makefiles to know for sure they are building
against a sysroot rather than only depending on ${DESTDIR} or other
assumptions.

This also exports it into buildenv.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# ff6c17c9 12-Jun-2017 Ed Maste <emaste@FreeBSD.org>

remove stale dependencies for utimens* wrappers removed in r319663

Use a similar approach to r318957 (which was for ptrace dependencies):
grep the .depend file for the old source file and delete the stale
dependency if found.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11091


# 69db9346 07-Jun-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Fix src.conf.5 generation

When makeman is generating src.conf(5) it tries to test all variation of options
including WITH_DIRDEPS_BUILD. it results in an error when filemon(4) is not
loaded.

Export variables that are needed to prevent this behaviour.

Helped by: sjg


# c8fab231 04-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Force a host tool rebuild for ino64 in r318736.

Sponsored by: Dell EMC Isilon


# 1a9cc831 04-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Add framework to force rebuilding for major ABI changes.

Normally META_MODE ignores host files for "meta mode" decisions on whether a
file should be rebuilt or not. This is because a simple installworld can
update timestamps and cause the next build to rebuild all host tools, when the
previous ones may not have any changes in the source tree. These tools are
normally still ABI compatible. They are only rebuilt if NO_META_IGNORE_HOST is
set from the workaround/hack in r301467.

One of the major problems with this is when a host tool has objects spread
across many revisions that have mixed-ABI. For example, if struct stat were to
change on the host, some objects for a tool may have different ideas of that
struct's definition. If just 1 source file were modified and rebuilt and
linked into the tool, then that toll will have mixed-ABI objects and crash.
This exact thing happened with the ino64 commit in r301467 followed by a
trivial update to libbfd in r318750. The resulting binary would crash in
buildworld.

Sponsored by: Dell EMC Isilon


# 86f2d54f 03-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Connect makewhatis.

This speeds up some port staging, namely perl.


# 9f685734 01-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Connect lld.

This will ensure that aarch64 gets a working native /usr/bin/ld rather
than requiring the aarch64-binutils hack in Poudriere, or emulating
the aarch64 lld.

PR: 217189
Reported by: swills, jbeich


# bd1c3bad 30-May-2017 Ed Maste <emaste@FreeBSD.org>

add a rescue/sh sanity check before installworld on the running system

FreeBSD does not guarantee kernel forward compatibility (that is,
running a newer userland on an older kernel). The documented upgrade
procedure specifies that installkernel should be performed, followed by
a reboot and then installworld. As a sanity check when installing onto
the running system (DESTDIR is / or unset), attempt to run "sh echo OK"
using rescue from the objdir. If rescue fails (e.g., because the system
has not been rebooted and the "old" kernel lacks a system call required
by the to-be-installed world), abort the installation.

This should avoid ino64 foot-shooting when the proper upgrade procedure
is not followed.

Reviewed by: allanjude, gjb, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10987


# 55b87d46 26-May-2017 Ed Maste <emaste@FreeBSD.org>

rm stale ptrace dependencies after r305012

This is similar to r318912, except that ptrace.[sS] was previously a
file in the source tree, not a generated assembly wrapper.

Check for the existence of ptrace.[sS] in the .depend file to determine
if we have to clean it up. This is a bit hackish and will not be left
in place indefinitely, but provides a useful example case when
investigating a better solution in bmake.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10930


# 90d4415d 25-May-2017 Ed Maste <emaste@FreeBSD.org>

libc: rm stale generated files which are no longer syscalls

This is an attempt to help -DNO_CLEAN builds after r302092 (which
removed the pipe libc syscall wrapper) and r318736 (which removed
getdents, lstat, mknod, and stat).

Dependencies cannot cope with certain source tree changes,
particularly with respect to removing source files and replacing
generated files. Handle these cases from _worldtmp in an ad-hoc
fashion.

Reviewed by: bdrewery, cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10876


# ac4ef3f9 25-May-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Now that roff documentation has been disconnected from the build, it is no
longer necessary to have groff(1) as a bootstrap tool


# c596c287 09-May-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add a -DNO_LIBS to skip building the libraries phase as well.

This is useful for cases where -DWORLDFAST is useful.

Sponsored by: Dell EMC Isilon


# 16892c77 09-May-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Support -DWORLDFAST to skip all build steps up to 'libraries' and 'everything'.

This allows for building the world against the already-created
host/sysroot environment. It is not overly useful outside of cases of
large-impact changes such as a testing a new compiler. It will
allow quickly getting back to an error in the target-phases of the
build where a new compiler is being used.

Sponsored by: Dell EMC Isilon


# 6d75a7a8 09-May-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Support skipping 'make obj' tree-walk.

This is part of a larger effort for WITH_AUTO_OBJ and a WORLDFAST
option.

Sponsored by: Dell EMC Isilon


# d5392a41 08-May-2017 John Baldwin <jhb@FreeBSD.org>

Honor WITHOUT_LIB32 on mips64.

The closing paren for the list of architectures that should enable LIB32
by default was in the wrong place resulting in LIB32 always be enabled on
mips64 regardless of WITH_LIB32/WITHOUT_LIB32.

Submitted by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Obtained from: CheriBSD
Sponsored by: DARPA / AFRL


# a17665bc 20-Apr-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Replace again GNU diff with BSD diff

After a firts failed attempt, BSD diff is now good enough to replace
GNU diff.

Relnotes: yes


# 5e50a318 18-Apr-2017 Glen Barber <gjb@FreeBSD.org>

Use relative symlink for 'latest' to allow repo to work after being
moved.

Submitted by: woodsb02
MFC after: 3 days
PR: 217197
Sponsored by: The FreeBSD Foundation


# 848d5e92 13-Apr-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Cache compiler metadata and reuse it at installworld time.

Right after cross-tools, a compiler-metadata.mk file is created that
stores all of the bsd.compiler.mk metadata. It is then read in
with a fail-safe during installworld time.

The file is explicitly removed when invoking cross-tools to ensure that
a stale file is not left around from odd manual 'make _cross-tools' ->
'make installworld' invocations.

This fixes several issues:
- With WITH_SYSTEM_COMPILER (default yes on head and no on releng/11.0):
If you build on a system where the bootstrap compiler does not
build due to the host compiler matching the in-tree one, but then
installworld on another system where that logic fails (a
bootstrap compiler is needed), the installworld immediately fails
with:
sh: cc: not found
Note that fixing this logic may then hit a case where a rebuild is
attempted in installworld. Normally cc would be ran with
'CFLAGS+=ERROR-tried-to-rebuild-during-make-install' to cause an
error such as:
cc: error: no such file or directory: 'ERROR-tried-to-rebuild-during-make-install'
However, now it will just fail with the 'cc: not found' error.
Inspection of the compile line will show
'ERROR-tried-to-rebuild-during-make-install'; It's not useful to
set CC to anything other than 'cc' during install as it is more
helpful to see the attempted compile rather than some other bogus
error.
- This now avoids running bsd.compiler.mk (cc executions) even more
during installworld. There are compiler-dependent SUBDIR in the
tree which required having a compiler during install.

There is at least 1 case where CC is still executed in the install,
such as from a LOOKUP!= in secure/lib/libcrypto/Makefile.inc checking
for 'vzeroall' support. This is not significant for installworld
as the lookup has a fallback (and hides its error) and only modifies CFLAGS,
thus it's not worth fixing.

PR: 212877
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# d5b29b60 13-Apr-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Pass COMPILER_FEATURES down to submakes for installworld.

This is for WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, external
compiler, etc.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# ffe63c8b 08-Apr-2017 Ed Maste <emaste@FreeBSD.org>

Introduce LLD_BOOTSTRAP to control lld as bootstrap linker

Add WITH_LLD_BOOTSTRAP and WITHOUT_LLD_BOOTSTRAP knobs, similar to the
Clang bootstrap knobs.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10249


# 1bf5e133 07-Apr-2017 Ed Maste <emaste@FreeBSD.org>

do not require binutils port when using lld as ld

r279908 added logic to Makefile.inc1 to automatically set
CROSS_BINUTILS_PREFIX for architectures not supported by the in-tree
binutils: arm64 when first introduced, and later riscv64 as well.

LLVM's LLD linker is now included in the base system, and is enabled by
default for arm64 and capable of linking world and kernel. Thus, avoid
automatically setting CROSS_BINUTILS_PREFIX and requiring the binutils
port if WITH_LLD_IS_LD is true.

Reviewed by: kan
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10310


# dbbb03c2 06-Apr-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Fix build-tools still sometimes rebuilding during target build.

In a cross-build, the build-tools are native host binaries. We do not
want to rebuild them when building for the target. Bmake previously
did not support checking .NOMETA on an existing target, so .NOMETA_CMP
was used here. However, .NOMETA_CMP still triggers meta mode conditions
if the number of commands or the command changes. In r312467 the paths
to build ncurses files were modified and thus triggered meta mode to
rebuild the build tools (make_keys, make_hash) in ncurses during the
target build. Bmake 20160604 committed in r301462 changed .NOMETA to
also skip meta mode logic for an existing .meta file as well, thus it
is now the proper fix here.

I explored moving the build-tools output to WORLDTMP/tools with
relatively good success, but have concerns that doing so would be
problematic for downstream vendors who use LOCAL_TOOL_DIRS and
expect the tools to be in current OBJDIR for the target. It also
adds more complexity into finding the tools during target build
and handling of where they are for rescue/rescue and
mkcsmapper_static/mkesdb_static which should really not be connected in
build-tools anyway.

MFC after: 2 weeks
Reported by: many
Sponsored by: Dell EMC Isilon


# 35070067 21-Mar-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Rename _cc to _gcc to be more clear.

MFC after: 1 week
Sponsored by: Dell EMC Isilon


# 2c5ddcf8 19-Mar-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Temporary readd GNU diff

etcupdate requires --change-group-format it is not easy to implement
in bsd diff so for now readd GNU diff


# 5714b701 11-Mar-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Fix native-xtools after replacement of GNU diff


# 97ab006d 10-Mar-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Remove the WITHOUT_MANDOCDB option

mandoc database is activated since FreeBSD 11.0, let's remove the previous
database format for FreeBSD 12.0


# 0e4e8f1b 06-Mar-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Added comments for why nmtree/libmd are bootstrapped.


# 51c6e78d 05-Mar-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Fix bootstrapping mtree after r313404 for older systems.

r313404 made libnetbsd require sha384.h from libmd. Libmd added it in
r292782. Update BOOTSTRAPPING to account for this.

Reported by: bde
Reviewed by: ngie


# 6fc94bc4 21-Feb-2017 Warner Losh <imp@FreeBSD.org>

Document why cat is a bootstrap tool.


# 74464d3c 18-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Include ${LOCALBASE}/bin in $PATH when running "make checkworld"

Some of the tests in devel/atf // devel/kyua rely on the tools being in $PATH,
which means that the tests fail when run via "make checkworld" because $PATH
is restricted to exclude directory elements like "${LOCALBASE}/bin".

MFC after: 1 week
Sponsored by: Dell EMC Isilon


# 66df1425 18-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Quote path to doxygen/kyua in test(1) -x check

This is a basic stopgap against ${LOCALBASE} containing spaces in it

MFC after: 1 week
Sponsored by: Dell EMC Isilon


# 68a558ec 17-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Fix after libc++ update in r300873.

The xdev build needed the same fixes as libcompat and external toolchain
support needed for handling of --sysroot, -L, -B, etc.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# e36b831f 17-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

xdev: Build yacc which is needed for recent libpcap updates.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 9e580940 17-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE+xdev: Don't rebuild build-tools during normal build.

See r297997 for more information.

MFC after: 1 week
Sponsored by: Dell EMC Isilon


# e2972270 03-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Remove LOCAL_LIB_DIRS warning added in r275839.

The case for which this was added, r274807, causes this warning to
always show. LOCAL_DIRS=foo LOCAL_LIB_DIRS=foo/lib. The only case in
which r274807 is a problem is if foo/Makefile does not contain
SUBDIR+=lib, which is a normal convention. LOCAL_LIB_DIRS is a special
hack only to get a library into the _generic_libs list for the
'make libraries' bootstrapping phase. The old behavior changed in
r274807 was only in head during the 10.0 cycle, so the warning was
only ever needed until release anyhow.

Reported by: ngie
MFC after: 1 week
Sponsored by: Dell EMC Isilon


# c6dc1332 03-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Fix typo in variable name (_REDUNDENT_LIB_DIRS -> _REDUNDANT_LIB_DIRS)

MFC after: 3 days
Sponsored by: Dell EMC Isilon


# 27f134b6 03-Feb-2017 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Add missing readelf.

The switch to elftoolchain's readelf in r280859 caused native-xtools
to no longer build readelf. This fixes poudriere builds not using
a native readelf when expected.

Reported by: strejda on freenode
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 2b375b4e 27-Jan-2017 Yoshihiro Takahashi <nyan@FreeBSD.org>

Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes: yes


# d63b10f0 27-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Update clang400 branch for LD_AS_LLD -> LD_IS_LLD


# f52e4bdf 26-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Rename LLD_AS_LD to LLD_IS_LD, for consistency with CLANG_IS_CC

Reported by: Dan McGregor <dan.mcgregor usask.ca>


# 737872e9 25-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Also apply WITH_LLD_AS_LD to build tools

Previously WITH_LLD_AS_LD installed LLD as /usr/bin/ld in the target
system, but still used the GNU BFD ld to link the binaries in that
target. LLD 4.0.0 can link the FreeBSD/amd64 world and kernel so use
LLD as the build-time linker as well when the knob is set.

Reviewed by: dim
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9226


# 69b4d461 06-Jan-2017 John Baldwin <jhb@FreeBSD.org>

Enable /usr/lib32 for o32 binaries on mips64.

Build and install an o32 set of libraries on mips64 suitable for
running o32 binaries via COMPAT_FREEBSD32. Enable COMPAT_FREEBSD32 in
MALTA64.

Reviewed by: jmallett, imp
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D9032


# 94ef145e 02-Jan-2017 Enji Cooper <ngie@FreeBSD.org>

Only bake krb5_config.h support in to ssh(3), etc if both MK_GSSAPI and
MK_KERBEROS_SUPPORT != no

This fixes the odd case where someone specified MK_GSSAPI=no and
MK_KERBEROS_SUPPORT=yes (which admittedly, probably doesn't make sense,
but the build system doesn't prevent this case today, and it didn't when
I filed the bug back in 2011 either).

MFC after: 2 weeks
PR: 159745


# 715652a4 02-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Make native-xtools build correctly after clang/llvm 3.9.0 import

During the clang/llvm 3.9.0 import, the build structure for it was
completely revamped. This broke the native-xtools target.

It first attempts to build libllvmminimal, then the llvm-tblgen and
clang-tblgen executables, but these fail to link because they are linked
to the 'full' libllvm by default, as they normally are during the
'world' stage.

To make these link against libllvmminimal instead, define TOOLS_PREFIX,
similarly as during the bootstrap-tools phase. The value itself is
empty, as we don't really want to use a prefix.

Reviewed by: imp
PR: 215684
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9026


# aeb76c0b 16-Dec-2016 Matthew Seaman <matthew@FreeBSD.org>

Revert r309339, thus re-instating r309314

The original problem with conflicting definitions of ${PKG_CMD} was
solved by r427523 in ports (see https://reviews.freebsd.org/D8677), so
this should be safe now.

Reviewed by: gjb
Approved by: gjb
Differential Revision: https://reviews.freebsd.org/D8120


# 629582ca 10-Dec-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Now that external gcc directly natively links to libc++ we can remove
the dirty hack made to fake libstdc++


# 158c18ff 02-Dec-2016 Warner Losh <imp@FreeBSD.org>

dd is currently a bootstrap tool. It really doesn't have any business
being a bootstrap tool. However, for reproducible build output,
FreeBSD added dd status=none because it was otherwise difficult to
suppress the status information, but retain any errors that might
happen. There's no real reason that dd has to be a build tool, other
than we use status=none unconditional. Remove dd from a bootstrap tool
entirely by only using status=none when available. This may also help
efforts to build the system on non-FreeBSD hosts as well.

Differential Revision: https://reviews.freebsd.org/D8605


# ebc7f2b8 30-Nov-2016 Glen Barber <gjb@FreeBSD.org>

Revert r309314, which breaks installing ports.

Requested by: antoine
Differential Revision: https://reviews.freebsd.org/D8120 (related)
Sponsored by: The FreeBSD Foundation


# 26e28783 30-Nov-2016 Dimitry Andric <dim@FreeBSD.org>

Cleanup old debug dirs in delete-old-dirs target

Any .debug or .symbols files under /usr/lib/debug which correspond to
OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up
by the delete-old target. Make this also apply to any OLD_DIRS entries.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D8683


# 91c915fa 30-Nov-2016 Matthew Seaman <matthew@FreeBSD.org>

Allow a user-overridable setting 'PKG_CMD' to control the command used
to create a repo during 'make packages'

This would have been useful for a situation I found myself in where
pkg(8) had been upgraded to a version that wanted the FBSD_1.5 ABI
version but libc.so.7 had not been upgraded, and only provided
FBSD_1.4. I found I needed to update libc in order to run pkg, and I
also needed to use pkg to update libc... Which is why pkg-static
exists, but there's currently no way to tell the build system to use
pkg-static instead of pkg.

This creates a variable PKG_CMD, default value 'pkg', that can be
overridden from the command line.

Reviewed by: gjb
Approved by: gjb
Differential Revision: https://reviews.freebsd.org/D8120


# 0aa5466e 25-Nov-2016 Ed Maste <emaste@FreeBSD.org>

Add WITH_LLD_AS_LD build knob

If set it installs LLD as /usr/bin/ld. LLD (as of version 3.9) is not
capable of linking the world and kernel, but can self-host and link many
substantial applications. GNU ld continues to be used for the world and
kernel build, regardless of how this knob is set.

It is on by default for arm64, and off for all other CPU architectures.

Sponsored by: The FreeBSD Foundation


# 7804dd52 16-Nov-2016 Ruslan Bukin <br@FreeBSD.org>

Add full softfloat and hardfloat support for RISC-V.

Hardfloat is now default (use riscv64sf as TARGET_ARCH
for softfloat).

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8529


# 7c6d0bb1 12-Nov-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move libsysdecode-specific hack out of buildworld.

This should fix the lib32 build since it was not removing the generated
ioctl.c. This file is generated by a find(1) call, so cannot use normal
dependency tracking methods.

Reported by: jhb
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 111bf579 10-Nov-2016 Antoine Brodin <antoine@FreeBSD.org>

Add limits(1) to native-xtools so that it can be used in qemu user-mode jails


# c7fbd772 04-Nov-2016 Ed Maste <emaste@FreeBSD.org>

Connect new LLVM-based libgcc_eh & libgcc_s to the build

Compiler-rt and LLVM's libunwind provide a suitable replacement for
libgcc.a, libgcc_eh.a, and libgcc_s.so.

Remove the now-unused LLVM_LIBUNWIND block from gnu/lib/libgcc.

PR: 213480 [exp-run]
Reviewed by: brooks, ed
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8189


# e4195e2e 01-Nov-2016 Jonathan Anderson <jonathan@FreeBSD.org>

Add rules to build LLVM IR binaries and libraries.

Running `make libfoo.ll` or `make libfoo.bc` within a library directory
will now give us an LLVM IR version of the library, and `make foo.full.ll`
or `make foo.full.bc` will give us an IR version of a binary.

As part of this change, we add an LLVM_LINK variable to sys.mk that can be
specified/overridden using an external toolchain.

Reviewed by: bdrewery, brooks
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8388


# 5bca2215 31-Oct-2016 Ruslan Bukin <br@FreeBSD.org>

Add full softfloat and hardfloat support for MIPS.

This adds new target architectures for hardfloat:
mipselhf mipshf mips64elhf mips64hf.

Tested in QEMU only.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D8376


# 90136961 23-Oct-2016 Warner Losh <imp@FreeBSD.org>

Tweak the UPDATING message a bit about the upgrade path.
Add some automation into Makefile.inc1 to to enforce known good
upgrade from source paths.


# dc9b124d 21-Oct-2016 Justin Hibbits <jhibbits@FreeBSD.org>

Create a new MACHINE_ARCH for Freescale PowerPC e500v2

Summary:
The Freescale e500v2 PowerPC core does not use a standard FPU.
Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor
unit, which doubles as a FPU. The PowerPC SPE ABI is incompatible with the
stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this.
Additionaly, the SPE opcodes overlap with Altivec, so these are mutually
exclusive. Taking advantage of this fact, a new file, powerpc/booke/spe.c, was
created with the same function set as in powerpc/powerpc/altivec.c, so it
becomes effectively a drop-in replacement. setjmp/longjmp were modified to save
the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by
the SPE).

Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not
support double-precision floating point.

Also, without a new MACHINE_ARCH it would be impossible to provide binary
packages which utilize the SPE.

Additionally, no work has been done to support ports, work is needed for this.
This also means no newer gcc can yet be used. However, gcc's powerpc support
has been refactored which would make adding a powerpcspe-freebsd target very
easy.

Test Plan:
This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222
(P1022-based) board, compiled against the new ABI. Base system utilities
(/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot
multiuser.

Reviewed By: bdrewery, imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D5683


# c615275c 20-Oct-2016 Ed Maste <emaste@FreeBSD.org>

Don't build libssp as a prereq lib if WITHOUT_SSP is set

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


# 801b3919 19-Oct-2016 Ed Maste <emaste@FreeBSD.org>

Fix MK_SHAREDOCS test from r306864

Groff is needed only if MK_GROFF and MK_SHAREDOCS are both true.


# 24ff5a32 08-Oct-2016 Baptiste Daroussin <bapt@FreeBSD.org>

groff is not needed in the bootstrap tools if the system is built
WITHOUT_SHAREDOCS

MFC after: 2 weeks


# f987297f 27-Sep-2016 Ed Maste <emaste@FreeBSD.org>

Add a WITHOUT_DIALOG src.conf(5) knob

It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup).

Reviewed by: dteske
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7969


# fcc803df 01-Sep-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Bump __FreeBSD_version for crunchgen META_MODE fix in r305254.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 986e05bc 26-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.


# 4d611b2b 23-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix in-tree GCC builds after r304681.

There were a few issues.
- In-tree GCC won't have X_COMPILER_TYPE defined but will have
WANT_COMPILER_TYPE==gcc set from the SYSTEM_COMPILER logic that can
be used. Make the clang check specific to clang as well to ensure
-target doesn't leak into a GCC build.
- When using a cross-compiler GCC (with a default sysroot or arch) and also
passing --sysroot, it basically forgets all internal paths for
libraries. We've already worked around this quite a bit for
the external toolchains. Now for the in-tree bootstrap cross-compiler
GCC, also pass in the needed -B${WORLDTMP}/usr/lib to find the crt
object files, but also -isystem and -L to fix the paths. This creates
quite a spammy build log, but it is clear and still achieves the goals
and stays consistent between internal and external build flags.
Reducing the spam by using the '=' prefix feature will help and be
done later.

MFC after: 3 days
X-MFC-With: r304681
Reported by: bz
Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division


# bb0cd1b5 23-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Always pass in -target and --sysroot flags for the build.

The internal bootstrap compiler has a default sysroot set by TOOLS_PREFIX
and target set by TARGET/TARGET_ARCH. However, there are several needs to
always pass an explicit --sysroot and -target.
- External compiler needs sysroot and target flags.
- External ld needs sysroot.
- To be clear about the use of a sysroot when using the internal compiler.
- Easier debugging.
- Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to
the flip-flopping build command when sometimes using external and
sometimes using internal.
- Allow using no lld which has support for default paths.

The default sysroot in the bootstrap compiler is not changed. The
buildenv compiler will still work with its default and will also
include -target/--sysroot from CC in the environment.

MFC after: 3 days
Discussed with: emaste, brooks (BSDCam)
Reviewed by: emaste
Sponsored by: EMC / Isilon Storage Division


# 0295d98c 15-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Trim unneeded bootstrap after r301470 made 9.1 the minimum supported release.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division


# c8de0c57 12-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Avoid showing the bootstrap make command for check-old, etc.

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


# 14009f5e 10-Aug-2016 Li-Wen Hsu <lwhsu@FreeBSD.org>

Only remove empty directories before packaging.

This preserves files are intentionally empty, most of them are in tests.txz

Reviewed by: bdrewery
MFC after: 3 days


# 87ae8210 29-Jul-2016 Mark Johnston <markj@FreeBSD.org>

Add libprocstat prebuild library dependencies.

X-MFC-With: r303531


# a7e13d50 29-Jul-2016 Mark Johnston <markj@FreeBSD.org>

librtld_db: Use the auxv to figure out where to look up loader symbols.

Previously, librtld_db just hardcoded /libexec/ld-elf.so, which isn't
correct for processes that aren't using the native ABI. With this change,
librtld_db can be used to inspect non-native processes; in particular,
dtrace -c now works for 32-bit executables on amd64.

MFC after: 1 month


# fd406aa3 27-Jul-2016 Ed Maste <emaste@FreeBSD.org>

Remove ${OBJDUMP} as it is not used by the base system

It was added to sys.mk relatively recently (r274503) for EFI builds
but is no longer used by the base system. The in-tree binutils are
outdated, will not be updated, and will be removed in the future.
Remove it from the toolchain build now to slightly simplify the build
and make sure we don't grow an accidental dependency.

Note that this affects only the toolchain build, and does not affect
/usr/bin/objdump in the built world.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6460


# 73371266 24-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't disable binutils/elftoolchain bootstrapping with external compiler.

This was a regression from r300349.

Setting MK_CROSS_COMPILER=no forces the compiler bootstraping *and* the
binutils/elftoolchain bootstrapping to be disabled in share/mk/src.opts.mk.
The only intent with using an external compiler is to disable bootstrapping of
the compiler. The binutils/elftoolchain bootstrapping must still occur unless
XAS is set. This did not affect WITH_SYSTEM_COMPILER.

Now that setting an external compiler sets both MK_CLANG_BOOTSTRAP and
MK_GCC_BOOTSTRAP to no, and MK_CROSS_COMPILER does the same via
share/mk/src/opts.mk, remove redundant logic that checks for
MK_CROSS_COMPILER. It will not always be true now that MK_CROSS_COMPILER==no
when an external compiler is used and --sysroot/-target is needed.

Reported by: sbruno
Pointyhat to: bdrewery
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division


# a9254587 24-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix empty WANT_COMPILER_TYPE when neither compiler is bootstrapped.

Bug in r303272.

MFC after: 3 days
X-MFC-With: r303272
Sponsored by: EMC / Isilon Storage Division


# b17f5b22 24-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

SYSTEM_COMPILER: Rework the logic to allow a 'make test-system-compiler'.

1. Always calculate what the expected values are.
2. Add 'make test-system-compiler' to show all of the computed values
vs the wanted values.
3. Extend the .info line to buildkernel/kernel-toolchain/toolchain/_cross-tools.
4. Consolidate all of the logic to one condition.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division


# 4143850b 21-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add LOCAL_XTOOL_DIRS to add into cross-tools.

Sponsored by: EMC / Isilon Storage Division


# fe50ba05 19-Jul-2016 Ed Maste <emaste@FreeBSD.org>

Include makewhatis in ITOOLS when MK_MAN_UTILS is true

Previously it was conditional on MK_MAN. It's possible to build
FreeBSD with man pages but without man page tools. MK_MAN_UTILS
is the conditional used in share/man/Makefile for determining whether
makewhatis is executed at install time, so it is the proper one for
ITOOLS as well.

PR: 210142
MFC after: 1 week


# bcc238ea 15-Jul-2016 Cy Schubert <cy@FreeBSD.org>

Revert r302865 and it's sister r302866 as r302865 causes some breakage.

Reported by: Guy Yur <guyyur@gmail.com>


# 507cef93 14-Jul-2016 Cy Schubert <cy@FreeBSD.org>

When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

Reviewed by: ngie@
MFC after: 1 week
Differential Revision: D7167


# b987685f 12-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r302670 and r302671 for now.

MACHINE_CPUARCH smells like MACHINE except for arm64/aarch64 which
has it backwards.


# 79156eb7 12-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Create a TARGET_CPUARCH thing to go with MACHINE_CPUARCH.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7160


# 6cdb0cba 11-Jul-2016 Glen Barber <gjb@FreeBSD.org>

Fix TARGET_TRIPLE for 12.0-CURRENT.

Submitted by: rene
Sponsored by: The FreeBSD Foundation


# a356b784 07-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_COMPILER: Don't enable for xdev or native-xtools.

Otherwise they get no compiler.

Reported by: swills
Tested by: swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division


# 48413367 28-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_COMPILER: Avoid using GCC4.8+ logic on native GCC4.2 platforms.

As the XXX notes, these should really be checking MK_GNUCXX since there is
already a version check in share/mk/src.opts.mk to disable it. Fixing that
here is more complex though. This could also be using X_COMPILER_FEATURES
but uses X_COMPILER_VERSION to keep in sync with the src.opts.mk logic.

Tested by: andreast
Sponsored by: EMC / Isilon Storage Division
Approved by: re (gjb)


# 07394091 15-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix native powerpc64 build of lib32 with in-tree GCC.

- This was broken by r300350 and r300885.
- Add some comments around the external GCC logic since it is spread out
and in need of some cleanup.
- The problem was that X_COMPILER_TYPE is always defined from CC->XCC's
default, so if /usr/bin/cc is GCC (as it is on native powerpc64) then
X_COMPILER_TYPE was getting GCC and triggering the external logic in
Makefile.libcompat. It was intended to always provide -isystem with
GCC since --sysroot is used into the lib32 sysroot which won't modify
the header path without the -isystem. The use of the libc++/std=c++11
override was only intended to be used for external compilers though
(more accurately GCC 4.8+ but that's a separate assumption to
cleanup). Apply the same logic from Makefile.inc1 to Makefile.libcompat
to only add the libc++ override when needed for external compilers.

Pointyhat to: bdrewery
Tested with: native ppc64 (swills), universe, ppc64 xtoolchain,
amd64 xtoolchain, sparc64 cross-build of ppc64 (host GCC 4.2)
Reported by: andreast, swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division


# 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


# aa06dfc9 05-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

legacy: Avoid building/installing headers twice.

Sponsored by: EMC / Isilon Storage Division


# 4d40df1b 05-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add a MINIMUM_SUPPORTED_OSREL and bump it to 900044.

This is actually a revision in the stable/9 branch released as 9.1. The
localedef build requires xlocale from this period.

Sponsored by: EMC / Isilon Storage Division


# 95348a57 04-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix incorrect logic in r301394.

Reported by: Mark Millard


# b4dd4229 04-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r301287: Pass external compiler metadata when used.

This fixes WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, external compiler, to
pass the external compiler metadata rather than the ${CC} metadata. On
a build host that has clang as CC it was passing the clang metadata rather than
GCC metadata during the build.


# bbfcc681 03-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITHOUT_CROSS_COMPILER: Fix installworld.

Since no WORLDTMP/usr/bin/cc is created, cc cannot be found
during installworld time since /usr/bin is not in the PATH.
Pass along the known compiler metadata to allow installworld
to work. The same fix was used for WITH_SYSTEM_COMPILER.

A better route would be to store a cookie in buildworld
containing this compiler metadata and then using that
at install time, rather than rerunning cc.

Reported by: Mark Millard
Sponsored by: EMC / Isilon Storage Division


# c371433e 03-Jun-2016 Dimitry Andric <dim@FreeBSD.org>

For clang, move the definition of FREEBSD_CC_VERSION into its own header
file, lib/clang/freebsd_cc_version.h, instead of reusing Version.inc.
The header is only included from one .cpp file in the clang tree.

This minimizes the number of .cpp files that need to be rebuilt if the
version is bumped.

Discussed with: bdrewery


# f661dbee 29-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

GCC External: Revert r300886, r300904, r300917, r300918

The fix in r300873 is mostly enough. A fix for lib32 will be
committed.separately.


# ce00342b 27-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move external GCC compiler hacks to bsd.sys.mk.

This allows respecting -nostdinc, -nostdinc++ and -nostdlib before
making the decision to add in -isystem, etc. The -isystem flags
are problematic for building lib/libc++ and lib/libcxxrt which wants
to only use its own headers.

More information the need of these flags can be found at
https://gcc.gnu.org/ml/gcc/2016-03/msg00219.html

This also reverts r300873.

Sponsored by: EMC / Isilon Storage Division


# 5929ee29 27-May-2016 Glen Barber <gjb@FreeBSD.org>

Make PKG_VERSION aware of '-ALPHA*'.

Submitted by: Ben Woods
Sponsored by: The FreeBSD Foundation


# eb9b07bb 26-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_AUTO_OBJ: Fix crunchgen builds.

Passing MAKEOBJDIRPREFIX to the main prog build (rescue) would confuse
WITH_AUTO_OBJ and cause it to create a recursed object directory that
then broke the actual prog build. This is normally not a problem since
we do not call 'make -f prog.mk obj' before building anything in it.

Crunchgen(1) also assumes that if -o is not passed then if an object
directory does not already exist then it should build in the source
directories. The normal buildworld process will have already ran 'make
obj' in each of the component directories so this is not a problem.
With WITH_AUTO_OBJ though this is not the case. So we must tell
crunchgen(1) that MK_AUTO_OBJ=yes will create the directory and to not
require it be present before generating its Makefile.

Sponsored by: EMC / Isilon Storage Division


# 016448a5 26-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Move the kernel support to kern.pre.mk.

This allows using META_MODE directly from the kernel build directory.
This also allows removing a hack from the DIRDEPS_BUILD kernel target.

Sponsored by: EMC / Isilon Storage Division


# 2d86a958 26-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove leftover _crunchide from r283108


# 7e1b3c5e 23-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move binutils handling after src.opts.mk.

This fixes the arm64 build after r300348.

Sponsored by: EMC / Isilon Storage Division


# 6120aabd 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Opportunistically skip building a cross-compiler with SYSTEM_COMPILER set.

This will still build the compiler for the target but will not build the
bootstrap cross-compiler in the cross-tools phase. Other toolchain
bootstrapping, such as elftoolchan and binutils, currently still occurs.

This will utilize the default CC (cc, /usr/bin/cc) as an external compiler.

This is planned to be on-by-default eventually.

This will utilize the __FreeBSD_cc_version compiler macro defined in the
source tree and compare it to CC's version. If they match then the
cross-compiler is skipped. If [X]CC is an external compiler (absolute
path) or WITHOUT_CROSS_COMPILER is already set, then this logic is skipped.
If the expected bootstrap compiler type no longer matches the found CC
compiler type (clang vs gcc), then the logic is skipped. As an extra
safety check the version number is also compared from the compiler to
the tree version.

Clang:
The macro FREEBSD_CC_VERSION is defined in:
lib/clang/include/clang/Basic/Version.inc
For clang -target will be used if TARGET_ARCH != MACHINE_ARCH. This
is from the current external toolchain logic. There is currently an
assumption that the host compiler can build the TARGET_ARCH. This
will usually be the case since we don't conditionalize target arch
support in clang, but it will break when introducing new
architectures. This problem is mitigated by incrementing the version
when adding new architectures.

GCC:
The macro FBSD_CC_VER is defined in:
gnu/usr.bin/cc/cc_tools/freebsd-native.h
For GCC there is no simple -target support when TARGET_ARCH !=
MACHINE_ARCH. In this case the opportunistic skip is not done. If we
add proper support for this case in external toolchain logic then it
will be fine to enable.

This relies on the macros being incremented whenever any change occurs
to these compilers that warrant rebuilding files. It also should never
repeat earlier values.

Reviewed by: brooks, bapt, imp
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6357


# 76286f4b 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Enable external compiler logic if both bootstrap compilers are disabled.

Reviewed by: brooks
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6358


# c1b9d002 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Enable and utilize WITHOUT_CROSS_COMPILER logic for external CC.

This is a NOP.

Reviewed by: brooks, bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6354


# 34fb4407 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move external toolchain support earlier.

This is to consolidate external toolchain and WITHOUT_CROSS_COMPILER support.

Reviewed by: brooks, bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6353


# bf0c0f96 20-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Use META_MODE rather than .MAKE.MODE for buildkernel.

This is mostly a style change so that other code does not duplicate
it. The problem is when META_MODE needs to be disabled but it has
been overridden by .MAKE.MODE.

Sponsored by: EMC / Isilon Storage Division


# e873d4db 18-May-2016 Warner Losh <imp@FreeBSD.org>

Turns out, mipsn32el worked at one point, so add it back in.

Pointed out by: jmallet@


# 14e5b32d 18-May-2016 Warner Losh <imp@FreeBSD.org>

Fix negative logic error. We want gnueabihf ABI when we're NOT
requesting soft float ABI.

Noticed by: bdrewery


# 631dbc3b 18-May-2016 Warner Losh <imp@FreeBSD.org>

mipsn32el is not a thing, remove it from the list of valid
architectures. There's no definition for it, nobody uses it
and it is unlikely to ever work. We can put it back when someone
demonstrates it running...

The new default for armv6 is hard float, so extend that default
to the external toolchain support.


# ecb92e2d 18-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Combine restage/reinstall in a safe way.

Sponsored by: EMC / Isilon Storage Division


# 2c0e9e2a 18-May-2016 Warner Losh <imp@FreeBSD.org>

Make armv6 hard float abi by default. Kill armv6hf.
Allow CPUTYPE=soft to build the current soft-float abi libraries.
Add UPDATING entry to announce this.

Approved by: re@ (gjb)


# 396f5ab6 13-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Support libsoft for restage.

This is essentially fixing a merge conflict.


# d4ca5483 09-May-2016 Glen Barber <gjb@FreeBSD.org>

Revert r299292, which was not a mismerge. It has an additional horrible
side effect of replacing /etc/{master.,}passwd and /etc/group.

Submitted by: O. Hartmann
Pointyhat to: gjb (myself)
Sponsored by: The FreeBSD Foundation


# 381fcf10 09-May-2016 Glen Barber <gjb@FreeBSD.org>

Combine the 'reinstall' and 'restage' targets, which appears to have
been a mismerge.

Sponsored by: The FreeBSD Foundation


# 79ccc589 04-May-2016 Enji Cooper <ngie@FreeBSD.org>

Default NO_INSTALLEXTRAKERNELS to yes, not no

The old (^/stable/9) default was yes, not no ("no" was the new default
introduced recently that broke POLA). Restore it to keep POLA like
glebius intended in r299077

MFC after: 3 days
X-MFC with: r299086
Pointyhat to: ngie (research before assuming and committing next time)
Sponsored by: EMC / Isilon Storage Division


# c0fd4255 04-May-2016 Enji Cooper <ngie@FreeBSD.org>

Default NO_INSTALLEXTRAKERNELS to "no" to unbreak the build

MFC after: soon (was insta-MFCed -_-..)
Pointyhat to: glebius
Sponsored by: EMC / Isilon Storage Division


# f4ae78bd 04-May-2016 Gleb Smirnoff <glebius@FreeBSD.org>

Make it possible to override NO_INSTALLEXTRAKERNELS.

Reviewed by: gjb


# a1ff7af0 03-May-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

Misc. build: minor spelling fixes.

No functional change.


# 561e173f 26-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Allow buildkernel to create .meta files with curdir==objdir.

Without this the incremental build was broken since .depend.* are not
generated with .MAKE.MODE=meta and .meta files were not created to
track dependencies. Typically meta mode does not create .meta files
when building with curdir==objdir but the kernel build is special.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by: EMC / Isilon Storage Division


# 75a6cb4f 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix unset variables from r298417.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division


# 40cf3344 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add more missing .PHONY

Sponsored by: EMC / Isilon Storage Division


# 59e2f057 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove redundant logic from the pkg-base merge.

These will be set from the logic right above it.

Reviewed by: gjb
Sponsored by: EMC / Isilon Storage Division


# ae001499 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make -n' for new packaging targets.

Sponsored by: EMC / Isilon Storage Division


# c943a53e 21-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add more missing .PHONY.

This also protects them from trying to create .meta files
with WITH_META_MODE.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by: EMC / Isilon Storage Division


# 97c316c6 21-Apr-2016 Ed Maste <emaste@FreeBSD.org>

Adjust BOOTSTRAPPING test after MFC of kbdcontrol's -P option


# fcede88b 18-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Add MK_AUTO_OBJ=no to ${MAKE} invocation if PKG_VERSION needs to be
created to avoid creating ${.OBJDIR}.

The duplicate REVISION/BRANCH/VERSION evaluation will be addressed
separately.

Sponsored by: The FreeBSD Foundation


# 473fda75 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE+filemon: Default -DNO_CLEAN enabled.

When using meta mode with filemon, the build is reliably incremental
safe. Bmake will use the meta files, along with filemon information,
to rebuild targets when their dependencies change, commands change,
or files they generate are missing.

Sponsored by: EMC / Isilon Storage Division


# fdff4951 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Pass along the default sysroot in bootstrap-tools to avoid rebuilds later.

Some of the clang libraries build in this phase and the cross-tools
phase. Later in the cross-tools phase when they build with a default
TOOLS_PREFIX, they see a changed build command in meta mode due to
the changed DEFAULT_SYSROOT. This is avoided by passing along
TOOLS_PREFIX earlier.

Sponsored by: EMC / Isilon Storage Division


# d1dd034d 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Don't rebuild build-tools targets during normal build.

This avoids 'build command changed' due to CFLAGS/CC changes during the
normal build. Without this the build-tools targets end up rebuilding
for the *target* rather than keeping the native versions built in
build-tools.

Sponsored by: EMC / Isilon Storage Division


# a561b106 14-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Mark some more .PHONY targets.

Sponsored by: EMC / Isilon Storage Division


# 7cbd0a29 13-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Simplify building libpam and fix libpam.a not containing the modules since r284345.

The change in r284345 moved the creation of openpam_static_modules.o to
lib/libpam/static_modules but never managed to get them into libpam.a.

Move this logic to lib/libpam/static_libpam and have it create a static
library for libpam.a The main lib/libpam/libpam will only create a
shared library. No redundancy in compilation or installation exists
in this solution.

This avoids requiring a pass with -D_NO_LIBPAM_SO_YET.

Sponsored by: EMC / Isilon Storage Division


# d13c4614 12-Apr-2016 Steve Wills <swills@FreeBSD.org>

Try harder to find svn

While here, elliminate last references to CVS_UPDATE and SUP_UPDATE

Reviewed by: gjb
Approved by: gjb


# 14cda706 11-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Set explicit ordering to prevent packaging failures with parallel
(-jN) make(1) jobs.

Sponsored by: The FreeBSD Foundation


# 7a888f32 07-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Avoid using DESTDIR in packaged-base targets, which can
cause bizarre packaging failures with non-default OBJDIR
and/or MAKEOBJDIRPREFIX and REPODIR set to a location not
within OBJDIR.

Reported by: many
Tested by: sef
Sponsored by: The FreeBSD Foundation


# 31f3abb1 05-Apr-2016 Glen Barber <gjb@FreeBSD.org>

Fix errors packaging the base system when using non-default DESTDIR
and MAKEOBJDIRPREFIX.

Sponsored by: The FreeBSD Foundation


# 91da7698 05-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove leftover _LDSCRIPTROOT missed in r297270.

Sponsored by: EMC / Isilon Storage Division


# d043a786 30-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix the external GCC build after r297271 by setting -L <sysroot>/usr/lib.

GCC does add <sysroot>/usr/lib to the library search path but it comes after
/usr/local/lib which can find ports libraries such as libedit.so. The
bad path comes in as /usr/local/lib/gcc/x86_64-portbld-freebsd11.0/5.3.0/../../../
which corresponds to <prefix>/lib.

This partially reverts r297271.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division


# 497e8091 30-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Remove the old depend (mkdep) code and make FAST_DEPEND the one true way.

Reviewed by: emaste, hselasky (partial), brooks (brief)
Discussed on: arch@
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5742


# 915d57ae 28-Mar-2016 Ed Maste <emaste@FreeBSD.org>

simplify compile-time default keyboard map generation

In r296926 the -P <path> option was added to kbdcontrol, which enables
this change for a simplified compile-time default keymap build process.

PR: 193865
Reviewed by: Oliver Pinter
Tested by: Oliver Pinter
MFC After: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5708


# ac978f5a 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITHOUT_TOOLCHAIN: Fix includes not being staged in WORLDTMP.

This has been the case since r264930 and r274662.

Sponsored by: EMC / Isilon Storage Division


# 4e3252c4 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

CROSS_BINUTILS_PREFIX: Reduce redundant logic.

Sponsored by: EMC / Isilon Storage Division


# 5df2c3cc 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

External compiler: Remove redundant flags from CXXFLAGS.

The use of XCXXFLAGS is to assign it to CXX in CROSSENV.
XCFLAGS is also assigned here so there is no need to have
--syroot and -B flags again.

Sponsored by: EMC / Isilon Storage Division


# d63cb012 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITHOUT_CROSS_COMPILER: Fix this to use external compiler logic.

Without this the default toolchain in /usr/bin/ would not use
WORLDTMP via --sysroot, and would lack --target if cross-building.

PR: 196193
Related: D3970
Sponsored by: EMC / Isilon Storage Division


# 1b89301d 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Update flags for external GCC.

- The -L WORLDTMP/usr/lib is not needed as GCC is already adding in
-L =/usr/lib internally with --sysroot. It does not do this for
header include paths though, thus passing -isystem =/usr/include is
still needed.

For the forced libc++ usage:
- Use -isystem rather than -I for libc++ headers.
- Use -std=c++11 rather than gnu++11.
- Use -nostdinc++ to ensure GCC's headers don't leak in.

Sponsored by: EMC / Isilon Storage Division


# 1b337a34 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Build libcompat (lib32) with a --sysroot pointing into its stage directory.

This overrides the cross-compiler's default sysroot to use the WORLD32's
sysroot for building the lib32 libraries. Previously the cross-compiler
would default the sysroot to the 64bit WORLDTMP and -B/-L/-isystem flags
were used to build using the lib32 files. This leads to multiple issues
discussed later. Some extra headers are now needed to be staged since the
64bit WORLDTMP is not referenced at all for headers. The 64bit WORLDTMP
is still used via PATH for build tools. Overriding the default
target/arch is retained in the CC/CXX overrides.

This allows reverting the LDSCRIPT rewriting in installworld from r296921 and
r235122, thus allowing read-only objdirs to work for installing again.

This removes the need for _LDSCRIPTROOT.

This allows progressing the change to always use --sysroot for the build
rather than only relying on the cross-compiler's default sysroot. The
work for that is in D3970 and needed to resolve WITHOUT_CROSS_COMPILER
not using a --sysroot [1].

PR: 196193 [1]
Sponsored by: EMC / Isilon Storage Division


# b0b64494 22-Mar-2016 Glen Barber <gjb@FreeBSD.org>

Make WSTAGEDIR, KSTAGEDIR, and REPODIR configurable.

This should fix the 'packages' target when MAKEOBJDIRPREFIX or
DESTDIR is set in the make(1) environment or via command line.

Reported by: kmoore, sef, Marko Turk
Sponsored by: The FreeBSD Foundation


# bb52d711 12-Mar-2016 Warner Losh <imp@FreeBSD.org>

Use the newly minted Makefile.libcompat to implement libsoft libraries
for the armv6 ABI switch. This also make WITH_LIBSOFT functional on
the arm platform. As a transition thing, this seems to work even
without switching the ABI (we basically build the same libraries
twice when MK_LIBSOFT=yes until the ABI cut over next
month). MK_LIBSOFT remains default no.


# cb1469fd 12-Mar-2016 Ed Maste <emaste@FreeBSD.org>

Bump BOOTSTRAPPING test for libelf after cross-endian fix in r296685


# dba75e9f 11-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move Makefile.lib32 to Makefile.libcompat and generalize it.

This is in preparation for LIBSOFT.

This file only supports *1* LIBCOMPAT value currently and must be capitalized.
In Makefile.libcompat given LIBCOMPAT=FOO there can be values set for
LIBFOOCFLAGS, LIBFOOCPUFLAGS, LIBFOOWMAKEENV, LIBFOOWMAKEFLAGS, LIBFOOCPUFLAGS,
and LIBFOODTRACE. These will have the standard cross-build values appended
onto them.

This could be extended to support multiple libcompat libraries in the future
once there is a need.

Reviewed by: imp
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5612


# 52023717 10-Mar-2016 Warner Losh <imp@FreeBSD.org>

Factor out lib32 generation to its own file. This is prep for a
similar Makefile.libsoft which will do the same for armv6 soft fp API
libraries in prep for pulling the trigger on moving to armv6 hard
float. Once there's two files, I'll work with bdrewery@ to merge the
two files as they are mostly the same. The high rate of churn for
Makefile* makes it quite difficult to make progress out of tree.

Differential Review: https://reviews.freebsd.org/D5566


# 0481f785 08-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't ever create object directories here with MK_AUTO_OBJ.

Sponsored by: EMC / Isilon Storage Division


# b0bdd783 08-Mar-2016 Glen Barber <gjb@FreeBSD.org>

Avoid adding the '-release' suffix to non-debug kernel packages.

Sponsored by: The FreeBSD Foundation


# 34f4acc8 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Conditionalize building makewhatis(1) for upgrades that need it.

Remove building of the legacy makewhatis(1) since it was only needed for
6.0 upgrades.

On my 2.2 GHz system libsqlite3 takes 60-100 seconds to build, which due to
its serialized nature can hold up the build waiting on it to finish in
bootstrap-tools.

makewhatis(1) was only required to be a build tool to support upgrades
from 6.0 which was properly removed in r208324 but later reverted due to
installworld using it. The installworld issue was fixed in r275622
when it was added to ITOOLS. A BOOTSTRAPPING check was missed when
makewhatis(1) was replaced with mandoc in r283777.

Sponsored by: EMC / Isilon Storage Division


# 2bece0ce 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't add duplicates from LOCAL_LIB_DIRS.

This causes parallel failures.

Sponsored by: EMC / Isilon Storage Division


# 400b94bb 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix over/under-linking in contrib/ofed.

Sponsored by: EMC / Isilon Storage Division


# bd6daf52 04-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

NO_ROOT: Create the METALOG directory on installworld/distributeworld.

When not using NO_ROOT the DESTDIR is implicitly created by the
distrib-dirs call. However with NO_ROOT it is trying to write
to the METALOG right away before running distrib-dirs which
may fail.

Sponsored by: EMC / Isilon Storage Division


# 6cb64f84 04-Mar-2016 Ed Maste <emaste@FreeBSD.org>

Add dd as a bootstrap tool, for status= support

In r295757 I added status=none to buildworld's use of dd, but FreeBSD
versions before April 2014 lack support.


# 28c9d1af 02-Mar-2016 Glen Barber <gjb@FreeBSD.org>

Set ALLOW_BASE_SHLIBS when creating base packages to enable
shared library tracking.

Note, this requires a patched pkg(8) to do anything, but pkg(8)
does not complain when an option is specified that it does not
recognize.

Sponsored by: The FreeBSD Foundation


# c501d73c 25-Feb-2016 Mariusz Zaborski <oshogbo@FreeBSD.org>

Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.

Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by: drysdale@google.com, bdrewery
Approved by: pjd (mentor)
Differential Revision: https://reviews.freebsd.org/D4277


# f4d0f67f 24-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

FAST_DEPEND: Skip 'make depend' for buildworld and kernel since it is auto-ran now.

Sponsored by: EMC / Isilon Storage Division


# 3a3f435f 23-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Include a 'package-pkg' target, intended for use for
architectures we do not provide upstream pkg(8) packages.

This is not tied to anything as-is, and likely will break
your system if used (based on experience with testing with
powerpc).

There is an overwhelming amount of evil happening here,
so until the issues are fixed, it will not be tied into the
'packages' target.

Sponsored by: The FreeBSD Foundation


# 90963403 23-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Set PORTSDIR if not already set.

Sponsored by: The FreeBSD Foundation


# debac084 23-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Further subdir-ize WSTAGEDIR and KSTAGEDIR base on the
TARGET/TARGET_ARCH value, since there are valid use cases
for having multiple on any given system.

Sponsored by: The FreeBSD Foundation


# 4821f9ed 16-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Always include the kernel name in the resulting package.
While functionally expected to be a no-op on big-iron hardware,
embedded hardware (arm, mips) do not have a GENERIC kernel, so
the KERNCONF value must be included in the package to avoid
conflicting packages for the default kernel (RPI-B versus RPI2,
for example).

While here, correct the kernel name in the metadata.

Sponsored by: The FreeBSD Foundation


# 619a5d7b 15-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't descend into test directories for distribution->installconfig.

Sponsored by: EMC / Isilon Storage Division


# c1da2974 12-Feb-2016 Ed Maste <emaste@FreeBSD.org>

Add libpe for elfcopy(1) PE/COFF support

Sponsored by: The FreeBSD Foundation


# acf5bd83 09-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Remove unnecessary env(1) invocations.

Sponsored by: The FreeBSD Foundation


# a5395435 09-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Add logic to rotate the package repository, keyed on PKG_VERSION,
and create a 'latest' symlink to the PKG_VERSION repository path.

Suggested by: des
Sponsored by: The FreeBSD Foundation


# ea85204f 08-Feb-2016 Dag-Erling Smørgrav <des@FreeBSD.org>

Rename the signpackages target to sign-packages, and include it in the
packages meta-target so 'make packages' now does everything.


# ee1627c4 08-Feb-2016 Dag-Erling Smørgrav <des@FreeBSD.org>

Split the packages target into stage-packages and create-packages to make
it possible to roll new packages from an existing build without having to
restage them.


# 71b7fa12 07-Feb-2016 Enji Cooper <ngie@FreeBSD.org>

Simplify running the FreeBSD test suite

Replace `make regress` (legacy test make target) and `make test` (incomplete
test make target added with the FreeBSD test suite) with make check as it's
consistent with other open source projects.

`make check` defaults to running tests from `.OBJDIR`, but can be overridden
with the `CHECKDIR` variable.

Add `make checkworld` target to simplify running the FreeBSD test suite from
`TESTSBASE` (i.e. the top-level tests directory), similar to buildworld.

Document `make check` and `make checkworld` in build(7).

Other minor changes:

- Rename intermediate file (`Kyuafile.auto`) to `Kyuafile` to simplify
`make check`.
- Remove terse warnings attached to `beforetest`/`aftertest`.
- Add kyua binary check to check target in suite.test.mk; error out if it's
not found

The MFC is [partly] contingent on other build related changes being MFCed.

Differential Revision: https://reviews.freebsd.org/D4406
MFC after: 2 months
X-MFC to: stable/10
Relnotes: yes
Reviewed by: bdrewery, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division


# 848f2374 04-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Silence a few command lines.

Sponsored by: The FreeBSD Foundation


# 5c52b2f5 04-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Rework the way <packagename>.ucl files are generated.
One of the major pain points with how this was implemented
is the requirement of in-tree, hard-coded <name>.ucl, as
well as <name>-<suffix>.ucl where <suffix> can be lib32,
profile, development, debug, or any combination of the four.

This created significant overhead when adding new packages
and any of the files in any of the combinations were missing.

Instead of test(1)-ing if the <packagename>.ucl file exists,
hand off to a script to figure out what the final ucl file
name should be before invoking pkg(8).

The default behavior is 'template.ucl' is used as a fallback.

This affects only the userland packages, as the kernel code
is already smart enough to handle these variations.

Sponsored by: The FreeBSD Foundation


# db9ba9ee 03-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Deduplicate distrib-dirs logic from r289086 in distribution.

This does it correctly this time, rather than the incorrect version in
r295167.

Sponsored by: EMC / Isilon Storage Division


# 4be4b11f 02-Feb-2016 Conrad Meyer <cem@FreeBSD.org>

Revert r295167 at bdrewery's request

$ svn merge -c -295167 .

JHB reports Navdeep reports that it breaks distribution and etcupdate.

Approved by: bdrewery


# fb872bbc 02-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Deduplicate distrib-dirs logic from r289086 in distribution.

Sponsored by: EMC / Isilon Storage Division


# 7cd7d126 02-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Adjust install .WAITs for lib/ and etc/ to allow parallelization more.

Only 'installworld' needs to be protected and only when not using
-DNO_ROOT, which implies not installing to / and not needing the
lib dependency protections.

Sponsored by: EMC / Isilon Storage Division


# 1793d339 29-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Wrap long lines after recent commits.

Sponsored by: The FreeBSD Foundation


# 35854cea 29-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Make sure 'pkg config ABI' uses ABI_FILE for the target.

Sponsored by: The FreeBSD Foundation


# d9b0aafd 29-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Reorder execution in the 'packages' target so both userland
and kernel are staged before invoking the 'create-<foo>-packages'
targets.

Include PKG_VERSION value in the 'create-{world,kernel}-packages'
targets so the value is not redefined when packaging the kernel,
which otherwise results in inconsistent and confusing package
version results.

Sponsored by: The FreeBSD Foundation


# d7a8d386 28-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Avoid excessively invoking 'pkg bootstrap' if already done.

Sponsored by: The FreeBSD Foundation


# f61b1691 27-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Fix naming for multiple kernels when building/packaging more than one.

Sponsored by: The FreeBSD Foundation


# 3d98f473 27-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Add 'stagekernel' target, which invokes 'distributekernel'
with -DNO_ROOT to create the METALOG mtree(8) file.

Separate the default STAGEDIR for world (WSTAGEDIR) and kernel
(KSTAGEDIR).

Fix the 'create-kernel-packages' target to work properly.

Evaluate if 'kernel' is set when invoking mtree-to-plist.awk,
which splits the kernel and kernel.debug into separate plist
files.

Fix METALOG creation when building/packaging multiple kernels.

Sponsored by: The FreeBSD Foundation


# d46f0432 25-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Add a 'signpackages' target, which creates the pkg repository
metadata files and uses the path of PKGSIGNKEY for signing,
if set.

Sponsored by: The FreeBSD Foundation


# f9371dca 22-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Create a _pkgbootstrap target, and remove the env(1) prefix
to pkg(8) commands.

Move the resulting packages outside STAGEDIR to minimize
pollution.

When invoking 'pkg create', include the ABI in the REPODIR
path so the correct hierarchy is created for cross-builds.

Move the STAGEDIR and REPODIR declarations above the targets
that use them to keep things cleaner, and move the packages
target.

Include '-o ABIFILE=DESTDIR/bin/sh' in pkg(8) invocations in
the create-kernel-packages target.

Sponsored by: The FreeBSD Foundation


# bc3f9191 21-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Ensure pkg(8) is bootstrapped, and avoid prompting for confirmation
to install, in case the 'packages' target is run non-interactively.

Sponsored by: The FreeBSD Foundation


# 57ce33ac 11-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Correct a comment.

Submitted by: jhb


# 1f17dba4 08-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Chase r292622: Update path to ioctl.c for incremental build hack.

Sponsored by: EMC / Isilon Storage Division


# 8dc7b23a 08-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix upgrading from OSVERSION 1000002-1000032 after r288829.

r288829 states that lex requires the latest m4, but was not always building it.
Move lex to the same logic as m4 since they are closely tied now.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
Reported by: Slawa Olhovchenkov <slw@zxy.spb.ru>


# b46e9175 06-Jan-2016 Gleb Smirnoff <glebius@FreeBSD.org>

Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF
won't be installed, only the first one would.


# 88343186 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Merge ^/projects/release-install-debug:

- Rework MANIFEST generation and parsing via bsdinstall(8).
- Allow selecting debugging distribution sets during install.
- Rework bsdinstall(8) to fetch remote debug distribution sets
when they are not available on the local install medium.
- Allow selecting additional non-GENERIC kernels during install.
At present, GENERIC is still required, and installed by default.

Tested with: head@r293203
Sponsored by: The FreeBSD Foundation


# c60009cc 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

In 'create-kernel-packages', do not exit with an error if NO_ROOT is
not set. The 'stageworld' target is invoked with -DNO_ROOT, so the
metalog file(s) will be created regardless.

This matches the behavior of 'create-world-packages'.

Sponsored by: The FreeBSD Foundation


# 51daa9fe 05-Jan-2016 Glen Barber <gjb@FreeBSD.org>

Do not implicitly invoke 'buildworld' as part of the 'packages' target.

This retains the original behavior of release-related targets, which
assume 'buildworld' and 'buildkernel' have already happened.

Sponsored by: The FreeBSD Foundation


# 34cdd776 31-Dec-2015 Dimitry Andric <dim@FreeBSD.org>

First part of updating llvm/clang build glue: getting llvm-tblgen,
clang-tblgen and clang itself built.


# 7144d5cb 23-Dec-2015 Sean Bruno <sbruno@FreeBSD.org>

Fixup native-xtools target for poudriere cross build jails after svn
r291955 by excluding all debug files.

Reported by: swills

Reviewed by: emaste


# 4a2a740e 19-Dec-2015 Enji Cooper <ngie@FreeBSD.org>

Always expose LOCALBASE, not just when CROSS_TOOLCHAIN is defined

Instead of using which(1) to look for doxygen, look for it in <LOCALBASE>/bin .
$PATH gets mangled by make buildenv, etc so it's better to just be explicit
about the path if someone uses that for instance.

Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division


# 37ded2a7 14-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r290423: Don't use CSH for buildenv shell.

It does not properly import PATH; the PATH is reset by included profile
files on startup which breaks the biggest feature of buildenv (using
sysrooted cc from WORLDTMP)

Spotted by: smh, kib
Sponsored by: EMC / Isilon Storage Division


# c492eb76 14-Dec-2015 Andrew Turner <andrew@FreeBSD.org>

Split KNOWN_ARCHES so we have one per line to simplify merging future
architectures.


# 1fdcc5e5 11-Dec-2015 Ruslan Bukin <br@FreeBSD.org>

Start support for the RISC-V 64-bit architecture developed by UC Berkeley.

RISC-V is a new ISA designed to support computer research and education, and
is now become a standard open architecture for industry implementations.

This is a minimal set of changes required to run 'make kernel-toolchain'
using external (GNU) toolchain.

The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv.

Reviewed by: andrew, bdrewery, emaste, imp
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D4445


# 9229b179 08-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix some makeman issues.

- Don't bother looking up REVISION/BRANCH/etc from release/, or the
CPUTYPE check, as these are not used for makeman and wastes time. The also
invokes auto.obj.mk after I reverted auto.obj.mk ignoring -V in r291312.
- Don't modify CC or PATH when WITH_CCACHE_BUILD or WITH_META_MODE is enabled
as it leads to bsd.compiler.mk errors.

Sponsored by: EMC / Isilon Storage Division


# 1c2a618b 07-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix spelling of internal hack.

Reported by: ngie


# 03173d2f 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

bsd.subdir.mk: Only recurse on called targets, rather than dependencies.

This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.

This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.

This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.

This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids
various issues such as the one fixed in r289462. As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.

Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438. This is so users do not get a probably broken build if they
run 'make all' from the top-level. Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion. Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.

This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331. This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk
for now.

I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack. If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.

Discussed on: arch@
MFC after: never
Sponsored by: EMC / Isilon Storage Division


# 6fa97020 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add NO_INSTALLKERNEL to undo the assumption that the first KERNCONF will be
installed as "kernel". This is relevant for packaging of the kernel when
not wanting a default "kernel.txz".

Submitted by: Russell Cattelan <cattelan@thebarn.com>
MFC after: 2 weeks
Obtained from: OneFS
Sponsored by: EMC / Isilon Storage Division


# 0a63717c 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Allow storing package(world|kernel) tarballs into a different location at PACKAGEDIR.

Submitted by: Russell Cattelan <cattelan@thebarn.com>
Discussed with: gjb
MFC after: 2 weeks
Obtained from: OneFS
Sponsored by: EMC / Isilon Storage Division


# b67490a3 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix errors being ignored in many phases of the build since the bmake integration.

Say it with me, "I will not chain commands with && in Makefiles"

This was originally fixed and explained quite well by bde@ in r36074. The
initial bmake integration caused 'set -e' to stop being used which lead to
r252419. Later 'set -e' expectations were fixed with bmake in r254980.

Because of the && here, errors would be ignored when building in parallel and
a dependency failed. Such as bootstrap-tools since it builds everything in
parallel. If any tool failed in obj/depend/all, it would just ignore the error
and continue to build. This later would result in cascaded errors that only
confused the real issue. This could also cause commands after the failed
command to still execute, leading to more confusion.

This should be fine if the command is in a sub-shell such as: (cmd1 && cmd2)

This reverts r252419.

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


# 7f911abe 27-Nov-2015 John Baldwin <jhb@FreeBSD.org>

Add support to libkvm for reading vmcores from other architectures.
- Add a kvaddr_type to represent kernel virtual addresses instead of
unsigned long.
- Add a struct kvm_nlist which is a stripped down version of struct nlist
that uses kvaddr_t for n_value.
- Add a kvm_native() routine that returns true if an open kvm descriptor
is for a native kernel and memory image.
- Add a kvm_open2() function similar to kvm_openfiles(). It drops the
unused 'swapfile' argument and adds a new function pointer argument for
a symbol resolving function. Native kernels still use _fdnlist() from
libc to resolve symbols if a resolver function is not supplied, but cross
kernels require a resolver.
- Add a kvm_nlist2() function similar to kvm_nlist() except that it uses
struct kvm_nlist instead of struct nlist.
- Add a kvm_read2() function similar to kvm_read() except that it uses
kvaddr_t instead of unsigned long for the kernel virtual address.
- Add a new kvm_arch switch of routines needed by a vmcore backend.
Each backend is responsible for implementing kvm_read2() for a given
vmcore format.
- Use libelf to read headers from ELF kernels and cores (except for
powerpc cores).
- Add internal helper routines for the common page offset hash table used
by the minidump backends.
- Port all of the existing kvm backends to implement a kvm_arch switch and
to be cross-friendly by using private constants instead of ones that
vary by platform (e.g. PAGE_SIZE). Static assertions are present when
a given backend is compiled natively to ensure the private constants
match the real ones.
- Enable all of the existing vmcore backends on all platforms. This means
that libkvm on any platform should be able to perform KVA translation
and read data from a vmcore of any platform.

Tested on: amd64, i386, sparc64 (marius)
Differential Revision: https://reviews.freebsd.org/D3341


# 20f68058 18-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove unneeded libmd from bootstrap-tools (reverting r246784).

The bootstrap-tools are supposed to be host tools, which in most cases, use
host headers and libraries. As such, directly including the src tree's headers
for libmd here causes the need to link libmd in since it will be built with
the new symbols (which /usr/lib/libmd.so) won't have unless it is new enough.
During the target build in buildworld the target headers are staged into
WORLDTMP and used via --sysroot, allowing the target xinstall to be built with
the new/target libmd.

The .PATH here was also not doing anything since xinstall does not use libmd
source files.

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks


# 2cc77b79 17-Nov-2015 Brad Davis <brd@FreeBSD.org>

Don't match on "version" when found as a value.

Approved by: bapt


# f2307a2a 13-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Avoid setting schg in the objtree for lib32 build.

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


# ddd945c7 09-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make cleanworld' to respect TARGET/TARGET_ARCH for cross-build objtrees.

This simplifies the logic to always try removing the objdir if it exists
and to fallback on a 'cleandir' if no objdir exists. The reasoning for
this is to avoid rm -rf src/* (r126024)

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks


# 2753ba1a 09-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Move 'make cleandir' from Makefile to Makefile.inc1.

This leads the way for fixing cross-build cleanup, and eventually replacing
'cleandir' with it during the build.

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks


# 9160419c 07-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add built-in ccache build support via WITH_CCACHE_BUILD option.

ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not
used to achieve a safe pseudo-incremental build. This is explained in
more detail upstream [1] [2]. It incurs about a 20%-28% hit to populate the
cache, but with a full cache saves 30-50% in build times. When combined with
the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the
resulting dependency file, which it does not do when using mkdep(1)/'CC
-E'. Stats are provided at the end of this message.

This removes the need to modify /etc/make.conf with the CC:= and CXX:=
lines which conflicted with external compiler support [3] (causing the
bootstrap compiler to not be built which lead to obscure failures [4]),
incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid
Clang errors with parenthesis, and did not work with META_MODE.

The option name was picked to match the existing option in ports. This
feature is available for both in-src and out-of-src builds that use
/usr/share/mk.

Linking, assembly compiles, and pre-processing avoid using ccache since it is
only overhead. ccache does nothing special in these modes, although there is
no harm in calling it for them.

CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap
compiler to hash the content of the compiler binary to determine if it
should be a cache miss. For external compilers the 'mtime' option is used
as it is more efficient and likely to be correct. Future work may optimize the
'content' check using the same checks as whether a bootstrap compiler is needed
to be built.

The CCACHE_CPP2 pessimization is currently default in our devel/ccache
port due to Clang requiring it. Clang's -Wparentheses-equality,
-Wtautological-compare, and -Wself-assign warnings do not mix well with
compiling already-pre-processed code that may have expanded macros that
trigger the warnings. GCC has so far not had this issue so it is allowed to
disable the CCACHE_CPP2 default in our port.

Sharing a cache between multiple checkouts, or systems, is explained in
the ccache manual. Sharing a cache over NFS would likely not be worth
it, but syncing cache directories between systems may be useful for an
organization. There is also a memcached backend available [5]. Due to using
an object directory outside of the source directory though you will need to
ensure that both are in the same prefix and all users use the same layout. A
possible working layout is as follows:
Source: /some/prefix/src1
Source: /some/prefix/src2
Source: /some/prefix/src3
Objdir: /some/prefix/obj
Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj'
This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace
all absolute paths to be relative. Using something like this is required due
to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache
adds into its hash for the object without CCACHE_BASEDIR.

distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc.
I have not personally tested this and assume it will not mix well with
using the bootstrap compiler.

The cache from buildworld can be reused in a subdir by first running
'make buildenv' (from r290424).

Note that the cache is currently different depending on whether -j is
used or not due to ccache enabling -fdiagnostics-color automatically if
stderr is a TTY, which bmake only does if not using -j.

The system I used for testing was:
WITNESS
Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes
DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
The arc was fully populated with src tree files and ccache objects.
RAM: 76GiB
CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16

The WITH_FAST_DEPEND feature was used for comparison here as well to show
the dramatic time savings with a full cache.

buildworld:
x buildworld-before
+ buildworld-ccache-empty
* buildworld-ccache-full
% buildworld-ccache-full-fastdep
# buildworld-fastdep
+-------------------------------------------------------------------------------+
|% * # +|
|% * # +|
|% * # xxx +|
| |A |
| A|
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 3744.13 3794.31 3752.25 3763.5633 26.935139
+ 3 4519 4525.04 4520.73 4521.59 3.1104823
Difference at 95.0% confidence
758.027 +/- 43.4565
20.1412% +/- 1.15466%
(Student's t, pooled s = 19.1726)
* 3 1823.08 1827.2 1825.62 1825.3 2.0785572
Difference at 95.0% confidence
-1938.26 +/- 43.298
-51.5007% +/- 1.15045%
(Student's t, pooled s = 19.1026)
% 3 1266.96 1279.37 1270.47 1272.2667 6.3971113
Difference at 95.0% confidence
-2491.3 +/- 44.3704
-66.1952% +/- 1.17895%
(Student's t, pooled s = 19.5758)
# 3 3153.34 3155.16 3154.2 3154.2333 0.91045776
Difference at 95.0% confidence
-609.33 +/- 43.1943
-16.1902% +/- 1.1477%
(Student's t, pooled s = 19.0569)

buildkernel:
x buildkernel-before
+ buildkernel-ccache-empty
* buildkernel-ccache-empty-fastdep
% buildkernel-ccache-full
# buildkernel-ccache-full-fastdep
@ buildkernel-fastdep
+-------------------------------------------------------------------------------+
|# @ % * |
|# @ % * x + |
|# @ % * xx ++|
| MA |
| MA|
| A |
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 571.57 573.94 571.79 572.43333 1.3094401
+ 3 727.97 731.91 728.06 729.31333 2.2492295
Difference at 95.0% confidence
156.88 +/- 4.17129
27.4058% +/- 0.728695%
(Student's t, pooled s = 1.84034)
* 3 527.1 528.29 528.08 527.82333 0.63516402
Difference at 95.0% confidence
-44.61 +/- 2.33254
-7.79305% +/- 0.407478%
(Student's t, pooled s = 1.02909)
% 3 400.4 401.05 400.62 400.69 0.3306055
Difference at 95.0% confidence
-171.743 +/- 2.16453
-30.0023% +/- 0.378128%
(Student's t, pooled s = 0.954969)
# 3 201.94 203.34 202.28 202.52 0.73020545
Difference at 95.0% confidence
-369.913 +/- 2.40293
-64.6212% +/- 0.419774%
(Student's t, pooled s = 1.06015)
@ 3 369.12 370.57 369.3 369.66333 0.79033748
Difference at 95.0% confidence
-202.77 +/- 2.45131
-35.4225% +/- 0.428227%
(Student's t, pooled s = 1.0815)

[1] https://ccache.samba.org/performance.html
[2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html
[3] https://reviews.freebsd.org/D3484
[5] https://github.com/jrosdahl/ccache/pull/30

PR: 182944 [4]
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Relnotes: yes


# a55d4ddd 07-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add a hack to workaround ZSH as BUILDENV_SHELL breaking CPUTYPE.

ZSH considers CPUTYPE a magic variable that will be the output of 'uname -m'
even if already set in environment when starting up.

The CPUTYPE?= check in Makefile.inc1 and supporting overriding CPUTYPE
manually in the buildenv shell make automatic workarounds too tricky
here. ZSH should really respect variables set in the environment before
trashing them.

X-MFC-With: r290423
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 208f1083 05-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Allow 'make buildenv' to work anywhere in the src tree.

Sponsored by: EMC / Isilon Storage Division


# e4fa4faf 05-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Allow 'make buildenv' to default to the caller's shell by using SHELL.

Also pass BUILDENV=1 into the sub-shell to allow modifying PS1 in .profile such
as:
if [ -n "${BUILDENV}" ]; then
PS1="(buildenv) ${PS1}"
fi

SHELL defaults to 'sh' in share/mk/sys.mk, but is typically passed down by
the shell invoking make as well. Rather than forcing all 'buildenv' users
to use plain /bin/sh, let them use their favorite shell.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Discussed with: imp


# e5ff3aad 05-Nov-2015 Warner Losh <imp@FreeBSD.org>

Fix CC being wrong during install* targets.

Move CROSS_TOOLS stuff to top of file (before bsd.compiler.mk) so that
decisions made by bsd.compiler.mk can properly affect the defaults in
src.opts.mk. Move that to after bsd.compiler.mk. Add a comment about
why we include bsd.compiler.mk here despite the fact that src.opts.mk
currently does too. Also remove bsd.arch.inc.mk that's been OBE.

Differential Revision: https://reviews.freebsd.org/D4087


# a36eca08 04-Nov-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Rename libohash to libopenbsd.

libopenbsd is an internal library which
to bring in compatibility stuff from OpenBSD.
This will allow us to bring in more
OpenBSD utilities into the FreeBSD base system.

We similarly use libnetbsd for bringing in stuff from NetBSD.

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


# 6aa2fe89 26-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add a note about DEPFLAGS which is currently a hack around not properly passing
CXXFLAGS to sub-makes.

The bad passing also causes bsd.dep.mk's logic to selectively pull only some
flags from C[XX]FLAGS to not apply which can be seen with '-L' being passed to
mkdep when using an external compiler.


# c9ec6256 23-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Replace common path with NXBDESTDIR.

Also combine some mkdir calls.

Sponsored by: EMC / Isilon Storage Division


# 5eedd0c0 23-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

native-xtools: Fix build with WITH_DEBUG_FILES.

Sponsored by: EMC / Isilon Storage Division


# 68847f14 21-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Parallelize build-tools.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division


# 8f9403e9 21-Oct-2015 Ed Maste <emaste@FreeBSD.org>

Warn that NOCLEAN is deprecated - use NO_CLEAN instead

NO_CLEAN has been the correct spelling for over a decade.


# 7f1636b7 21-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.

Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)

Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.

SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.

With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.

- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.

- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.

- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.

- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.

The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.

This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.

- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.

- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.

- Document these changes in build.7

Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks


# e0499c11 21-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix my change in r289435 causing 'etc' to be added to SUBDIR when using
SUBDIR_OVERRIDE.

MFC after: 2 weeks
X-MFC-With: r289435
Sponsored by: EMC / Isilon Storage Division


# d82fd861 20-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add some missing '+', .MAKE, and .PHONY modifiers.

Some of these targets were lacking both .MAKE and a '+'. Others were just
inconsistent.

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


# 74c52c65 20-Oct-2015 Julio Merino <jmmv@FreeBSD.org>

Handle lib32 files during delete-old* when MK_LIB32=no.

Extend OptionalObsoleteFiles.inc to delete all lib32 files when MK_LIB32 is
set to no on a system that previously had lib32 libraries installed.

Also, to prevent "make delete-old-dirs" from always deleting lib32 directories
after an installworld, move the lib32 subtree to its own mtree file that only
gets applied when MK_LIB32=yes.

Test: Ran "make delete-old" and "make delete-old-libs" on a system that never
had MK_LIB32 enabled, and on a system where MK_LIB32 was enabled and later
disabled. Did this both on amd64 and powerpc64.

Test: Ran "make tinderbox" without errors.

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


# b02f187c 17-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove unneeded MK_CTF=no when MK_CDDL=no.

This has been handled since r228158 made MK_CTF dependent on MK_CDDL
in share/mk/bsd.opts.mk.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 4c339735 17-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix wrong PATH being set for world 'includes' stage after r289438.

The 'includes' target is currently a pseudo target in bsd.subdir.mk that
does 'cd ${.CURDIR} && ${MAKE} buildincludes && ${MAKE} installincludes',
versus all over targets that just recurse.

In Makefile.inc1 the older duplicated bsd.subdir.mk logic for calling
'includes' was being executed in each subdir directly, meaning 'cd lib && make
includes' became 'cd lib && make buildincludes && make installincludes'. Now
that the bsd.subdir.mk logic is used it is calling 'make buildincludes && make
installincludes' from the top-level which pulls in the PATH=<default path>
from /Makefile.

The sub-make logic for 'includes' in bsd.subdir.mk was attempted to be removed
in r289282 but turned out to be wrong. I have a working version now but
it is not yet ready for commit. So for now in Makefile.inc1 split out
'includes' to 'buildincludes' and 'installincludes' which will avoid the
problem.

MFC after: 2 weeks
X-MFC-With: r289438
Sponsored by: EMC / Isilon Storage Division


# 53c0e6d5 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

For 'buildenvvars' show any .exported variables as well to cover recent
exporting of OSRELDATE and VERSION. These already do export to 'buildenv'
fine.

Sponsored by: EMC / Isilon Storage Division


# a378087d 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Always export VERSION to the environment to avoid looking it up again in
sub-makes.

Some of the world phases that used plain '${MAKE} -f Makefile.inc1' were not
passing this variable along which caused them to look it up again. By
using bmake's .export we can remove it from all of the other environment
lines.

Add a comment about the usage for VERSION for ctfmerge.

Sponsored by: EMC / Isilon Storage Division


# 470c2b3a 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Export OSRELDATE so sub-makes don't look it up again.

We pass BOOTSTRAPPING=${OSRELDATE} to some of the sub-makes. Rather than
chase every ${MAKE} invokation, just export it as bmake lets us.

Sponsored by: EMC / Isilon Storage Division


# fb84a99e 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Rework the world subdir build targets to use the standard SUBDIR_PARALLEL mechanism.

Back in r30113, the 'par-*' targets were added to parallelize portions of
the build in a very similar fashion as the SUBDIR_PARALLEL feature used in
r263778. Calling a target without 'par-' (for 'parallel') resulted in the
standard bsd.subdir.mk handling without parallelization. Given we have
SUBDIR_PARALLEL now there is no reason to duplicate the handling here.

In build logs this will result in the ${dir}.${target}__D targets now showing
as the normal ${target}_subdir_${dir} targets.

I audited all of the uses of Makefile.inc1 and Makefile's targets that use
bsd.subdir.mk and found that all but 'all' and 'install' were fine to use
as always parallel.
- For 'install' (from installworld -j) the ordering of lib/ and libexec/
before the rest of the system (described in r289433), and etc/ being last
(described in r289435), is all that matters. So now a .WAIT is added in
the proper places when invoking any 'install*' target. A parallel
installworld does work and took 46% of the time a non-parallel
install would take on my system with -j15 to ZFS.
- For 'all' I left the default handling for this to not run in parallel. A
'par-all' target is still used by the 'everything' stage of buildworld
to continue building in parallel as it already has been. This works
because most of the dependencies are handled by the early bootstrap
phases as well as 'libraries' and 'includes' phases. This lets
all of the SUBDIR build in parallel fine, such as bin/ and lib/. This
will not work if the user invokes 'all' though as we have dependencies
spread all over the system with no way to depend between them (except
for the dirdeps feature in the META_MODE build). Calling 'make all'
from the top-level is still useful at least when using SUBDIR_OVERRIDE.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 23ffbc10 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix adding manpages installed by LOCAL_DIRS to whatis file.

The ordering of 'etc' in the install has a long history dating back to the
first time it was realized it needed to be "last" in r4486. That commit
still left it before LOCAL_DIRS though. By having it before LOCAL_DIRS
any manpages they install were not being added to the whatis database in the
install image. They would likely show up in the file after a periodic
rebuild of the file though.

Currently the whatis file is built by an 'afterinstall' hook in etc/Makefile
that calls share/man's 'makedb' target.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# c38230eb 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove lockf as an ITOOL.

It was added in r152006 to handle serializing access of info/dir when
installing INFO files. We no longer support INFO files since r276551
though.

Sponsored by: EMC / Isilon Storage Division


# 7e81b832 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Correct a bitrotted comment about installworld order requirements.

The case of make(1) using a new /bin/sh issue was fixed in r173219 when ITOOLS
was introduced.

There are still issues with mid-install errors leaving a system unusable that
are currently non-trivial to solve. The safest ordering requires installing
rtld, libc and libthr (in that order) before anything else. We don't do that
now though. Much improvement is needed here still.

Discussed with: kip and kan (rtld/library ordering)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division


# 35511448 16-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Remove .MAKE from targets that do more than just run sub-makes, such as
calling rm or mtree.

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


# 651e2703 15-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix delete-old and check-old-files not removing old debug symbols.

This was handled for libraries in r256842 but for some reason was missed
for files (bsd.prog.mk).

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


# 7b9c2f16 15-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix buildworld with clean objdir after r289351.

Sponsored by: EMC / Isilon Storage Division


# 86f58908 15-Oct-2015 Glen Barber <gjb@FreeBSD.org>

Pass .MAKEFLAGS in the 'packages' target to allow parallel
builds.

Pass '-B' when invoking the 'stageworld' target, similar to
what is done for 'installworld'.

Sponsored by: The FreeBSD Foundation


# ba831a2c 14-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Consider top-level targets to be .PHONY as bmake won't build them
otherwise if a file with the same name is found in the directory.

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


# 33388a16 14-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add temporary workaround for .MAKE being applied to _worldtmp, since r251750.

This was causing files to be removed from the objdir when -n was used.
_worldtmp makes no sub-make calls.

A more comprehensive solution is coming involving fine-grained '+' where
appropriate.

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


# 07670b30 14-Oct-2015 Ed Maste <emaste@FreeBSD.org>

Create /usr/tests *.debug file directory hierarchy

Reviewed by: bdrewery, ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3896


# 5d8d6498 10-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix installing config files as non root

Reported by: adrian


# dd985c8f 09-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Change make distribution so that it now call installconfig in all dirs along
with the current behaviour of calling "distribution" in the etc target.

This allows mergemaster/etcupdate to still work when some configuration will be
moved to be handled in the same directories their source code lives in.


# 89ef7a96 05-Oct-2015 Ian Lepore <ian@FreeBSD.org>

The latest version of lex requires the latest m4 to build, add a dependency
when running the build-tools stage.

The requirement is due to the -P flag used when running m4 from usr.bin/lex
Makefile to generate skel.c. With the old m4 that fails and the failure is
ignored, resulting in an empty(-ish) skel.c, which leads to later build
failures when the misconfigured new lex tool is run.

This enables building -current (and 10-stable after MFC) on a stable-8
system again.

MFC after: 3 days


# 6ae1554a 02-Oct-2015 Colin Percival <cperciva@FreeBSD.org>

Final step of eliminating the "games" distribution: Merge src/games
(or what's left of it, at least) into src/usr.bin.

This change will not be MFCed.

Discussed at: EuroBSDCon 2014
Committed from: EuroBSDCon 2015


# 9875367b 27-Sep-2015 Andriy Gapon <avg@FreeBSD.org>

remove unused sgsmsg utility (originally imported from opensolaris)

MFC after: 25 days


# 3cad5c68 25-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Make it easier to keep the bootstrap-tools args in sync.

Sponsored by: EMC / Isilon Storage Division


# 2518edf6 24-Sep-2015 Ed Maste <emaste@FreeBSD.org>

Remove EOL whitespace from Makefile.inc1


# b5512f3b 21-Sep-2015 Ed Maste <emaste@FreeBSD.org>

Move DTrace tools to cross-tools stage

Bootstrap tools exist for backwards compatibility support. DTrace tools
tools are also needed for cross builds, so belong in cross-tools.

Reviewed by: imp (earlier), markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2144


# 26b7188d 16-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Let makeman run 'make showconfig' without hitting the aarch64 error.


# 1b87f1f3 15-Sep-2015 Brad Davis <brd@FreeBSD.org>

Fix grammer in an error message

PR: 202310
Submitted by: Chris Petrik <chris@bsdjunk.com>
Approved by: will


# 286bbc34 14-Sep-2015 Mark Johnston <markj@FreeBSD.org>

Unconditionally build CTF tools in the bootstrap-tools phase of the build.

Stale CTF tools are a frequent source of DTrace issues, and they compile
quickly enough that the increase in build time is negligible.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D3670


# b779ff2b 12-Sep-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Rename kernel-pkgs into create-kernel-packages to be consistent with world


# 05f05f8b 02-Sep-2015 Gleb Smirnoff <glebius@FreeBSD.org>

The ${BUILDKERNELS:[2..-1]} appears to produce a non zero result for
a one word variable, which is quite unexpected from documentation.
So, to avoid double installation of a single kernel, protect the extra
kernels loop with ${BUILDKERNELS:[#]} > 1 conditional.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.


# f3c7b830 01-Sep-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Not only build with buildworld, but also install with installworld all
alternative kernels.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.


# 6d04a5ad 01-Sep-2015 Gleb Smirnoff <glebius@FreeBSD.org>

When building multiple kernels use [2..-1] to extract !INSTALLKERNEL
from BUILDKERNELS list. This is more strict, since INSTALLKERNEL by
definition is the first word of BUILDKERNELS list. The previous
code failed if INSTALLKERNEL is a substring of additional kernel name.

Reviewed by: gjb
Sponsored by: Netflix
Sponsored by: Nginx, Inc.


# 0f3c3059 24-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove now unused LIBPRIVATEDIR

Sponsored by: Gandi.net


# c404eb64 23-Aug-2015 Warner Losh <imp@FreeBSD.org>

Sparc64 is the odd-man out, so form the if that way rather than
listing everybody else.


# 08474898 17-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Separate ELFTOOLCHAIN_BOOTSTRAP from BINUTILS_BOOTSTRAP

For most cases they are equivalent, but BINUTILS_BOOTSTRAP is a
BROKEN_OPTION on arm64 as the in-tree GNU binutils do not support it,
so we need a separate internal flag for ELF Tool Chain.

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


# 39d3a844 13-Aug-2015 Warner Losh <imp@FreeBSD.org>

Spell binaries in the customary way.

Submitted by: jhb@


# 1bc28ffc 13-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Roll WITHOUT_ELFTOOLCHAIN_TOOLS into WITHOUT_TOOLCHAIN

The option was added only to ease the transition from GNU Binutils to
ELF Tool Chain tools, and that process is now complete (for the viable
replacements). Noting the removal in UPDATING is sufficient as we have
not shipped a release with the option.

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


# d7768ad4 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Fix the fixing of the build I broke. rescue/rescue has the right
target, but rescue doesn't.

Pointy hat: imp@


# 572ec1c5 12-Aug-2015 Xin LI <delphij@FreeBSD.org>

Fix build.


# 9aca5ced 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Document build-tools better. Add rescue back because it builds /bin/sh
which has a build-tools target (see commit for how build-tools and
cross-tools differ).


# 1ddcdb76 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Why on earth have we been building rescue as a build tool for the past
12 years? Nothing downstream in the build uses it. Eliminate it as a
build tool.

Reviewed by: emaste@ ("just delete it")


# ad38a9d9 12-Aug-2015 Warner Losh <imp@FreeBSD.org>

Crunchgen needs to be bootstrapped to pick up the STRIP->STRIPBIN
changes to prevent the 'rescue: not found' errors from happening.
Bump FreeBSD_version to 1100078 since there's been no version bumps
since this change was made. Only people that installed since r284356
really need to do this bootstrapping, but since crunchgen needs to
bootstrap for other reasons, bumping the number was the simplest.


# d9933780 11-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Fix comment describing legacy target and wrap to 80 columns


# 8551ff3f 11-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Build libelf and libdwarf in the legacy stage

They need to be built and installed (including headers) prior to the
DTrace CTF tools.

Reviewed by: imp (as part of a larger change)
Sponsored by: The FreeBSD Foundation


# f600d35f 09-Aug-2015 Warner Losh <imp@FreeBSD.org>

cmp and cp are used by the kerberos install, so need to be imclided in
ITOOLS. They are tiny enough that I'm not making conditional: the
minuscule savings in disk space isn't worth the obfuscation of
Makefile.inc1.


# 1fd99f14 08-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

libavl is not needed anymore for localedef(1)


# 57df665a 07-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add localedef(1) to bootstrap tools


# b78ee15e 01-Jul-2015 Ruslan Bukin <br@FreeBSD.org>

First cut of DTrace for AArch64.

Reviewed by: andrew, emaste
Sponsored by: ARM Limited
Differential Revision: https://reviews.freebsd.org/D2738


# af38028d 27-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Make all shared library a relative symlink

This makes sysroot usable for cross building, it also removes the need for
_SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have no time
to test it)

Differential Revision: https://reviews.freebsd.org/D2920
Submitted by: imp, adrian
Tested by: adrian


# 0f20a3cd 21-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Only build gperf as a bootstrap tool if gcc is going to be built


# ffe11f41 20-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove temporary changes that crept in r284417 when it should not have

Reported by: antoine, jbeich


# 18b2ee82 15-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Revert r284417 it is not necessary anymore


# b589e629 10-Jun-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Remove extra blank lines


# 3e82c722 03-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Revert r283938 it is not needed anymore and broken

gzip(1) cannot be used as bootstrap tools as it depends on syscalls that only
exists on HEAD


# 0bbe6da5 03-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

mandoc's makewhatis requires gnuzip to be in the path when deadling with
with compressed manpages.

This should fix spam during installworld: "exec: No such file or directory"

Reported by: many


# 75e20d65 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove libmandoc from bootstrap tools


# f5e4216e 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Only push libohash once in bootstrap tools


# 8faa40d1 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Switch to mandoc's version of makewhatis(8), whatis(1), apropos(1) utilities.

This change among other things improve search capabilities over the manpages
allowing fine grain query.

A new build option WITHOUT_MANDOCDB has been added to keep the ancient version
of the database and the tools. The plan is to entirely remove this option before
11.0-RELEASE.

Differential Revision: https://reviews.freebsd.org/D2603


# 645acf41 30-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Do not make libsqlite3 dependency chain only defined for kerberos, soon more
options would need libsqlite3 as well thus depends on this definitions


# 8e9b16e5 26-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix build WITHOUT_CDDL by unconditionnaly adding libproc and librtld_db
on supported arches to the prebuild libs


# 2b42dcf7 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

_Really_, _Really_ fix buildworld by moving the conditionals down, fixing some
typos, and fixing the dependency when MK_LIBCPLUSPLUS != no

- `:D` operator evaluation is immediate, i.e. like .if defined(..). So r283159
was in effect a no-op commit.
- Fix dependency in MK_LIBCPLUSPLUS case in two ways:
-- lib/libc++ was the wrong dependency. It should have been libcxxrt.
-- lib/libc++ was missing __L, so again it was depending on the directory, not
the relevant .PHONY target.

Tested with: make tinderbox (amd64, arm, sparc64) and JFLAG=-j16
In collaboration with: bdrewery, imp, peter
BIG pointyhat to: ngie (for trying to commit things at 6am while staying up all
night working on other tasks)


# f3dba867 20-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Make kerberos use the same sqlite libraries as other sqlite consumer.

This reduces the number of copy of sqlite we have to just one and easier
tracking version of sqlite

Differential Revision: https://reviews.freebsd.org/D2443
Reviewed by: imp, stas, bjk


# cf13852b 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

Fix breakage I didn't fully solve in r283151 by depending on the .PHONY
target, not the directory when building libctf for libproc

Reported by: many, Jenkins
Submitted by: rodrigc


# 3f480759 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

Unbreak the arm64/sparc64 tinderbox by only compiling lib/libproc and
lib/librtld_db on architectures where they're supported

Reported by: bz, Jenkins
Pointyhat to: bapt


# ebfd9f66 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

cddl/lib/libctf isn't always a requirement for lib/libproc; its use is dependent
on MK_CTF != "no". Use the other divined value instead of reinventing the wheel


# 5731a3ce 19-May-2015 Enji Cooper <ngie@FreeBSD.org>

Add _more_ missing dependencies for lib/libproc to further squash build races

Verified via `cd lib/libproc; make -VLIBADD`

Pointyhat to: ngie


# d0edea4a 19-May-2015 Enji Cooper <ngie@FreeBSD.org>

Articulate all dependencies for lib/libproc to squash build races after r283139
on !arm64 and !sparc64

Pointyhat to: bapt
Sponsored by: EMC / Isilon Storage Division


# b61e5e48 20-May-2015 Enji Cooper <ngie@FreeBSD.org>

Only build sys/boot/usb/tools if MK_USB != no

Sponsored by: EMC / Isilon Storage Division


# f4547478 20-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix buildworld by adding libproc and librtld_db to the _prebuild_libs
Those are needed to build libdtrace


# 7f36f2d0 19-May-2015 Ed Maste <emaste@FreeBSD.org>

Update crunch bootstrapping test for recent fixes

- r277259 crunchide: Correct 64-bit section header offset
- r281674 crunchide: always include both 32- and 64-bit ELF support

With built-in cross-size support we also no longer need a special case
for cross-build crunchide.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2576


# 4d372549 12-May-2015 Ed Maste <emaste@FreeBSD.org>

Remove redundant csu subdir logic

The appropriate subdirectories are handled by lib/csu/Makefile. There's
no need to duplicate this logic in Makefile.inc1 and lib/Makefile.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2523


# 55b13095 10-May-2015 Thomas Quinot <thomas@FreeBSD.org>

Unbreak build following rev. 282726

(Makefile.inc1): add dependency of xinstall on libmd to
avoid failure of parallel bootstrap.

(lib/libmd/*.h): do not redefine symbols if already
defined as macros (libcrypt uses the same sources internally,
redefining symbols with a prefix of its own).

Fixes build failures caused by previous change to libmd.

Reported by: ian
Pointy hat to: thomas


# 363da138 01-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Replace groff's soelim by soeliminate(1) renamed soelim(1)


# 0484aa59 29-Apr-2015 Sean Bruno <sbruno@FreeBSD.org>

Setting PATH to anything is useless as a bare command. Its only relevant
if its set in the environement of each command seperately.

Move the PATH setting to the NXBMAKE variable so its picked up to find
the one-off gperf build for the native-xtools target.

Pointed Out by: ngie


# bf3befad 29-Apr-2015 Sean Bruno <sbruno@FreeBSD.org>

Fix native-xtools breakage when building a gcc enabled target on a clang
enabled host. Build a one-off gperf and put it in the PATH for the rest
of the target so the ONE call to gperf by the gcc build picks it up and
DTRT.

Reviewed by: imp


# 9dc634de 21-Apr-2015 Enji Cooper <ngie@FreeBSD.org>

Serialize all of _kerberos5_bootstrap_tools to avoid build failures involving
make bootstrap-tools

On the plus side, this also greatly reduces complexity

MFC after: 1 week
Pointyhat to: ngie
Reported by: Willem Jan Withagen <wjw@digiware.nl>


# 2d8d8e3c 17-Apr-2015 Ed Maste <emaste@FreeBSD.org>

Bump crunch BOOTSTRAPPING for ELF header offset fix in r277557


# c5e8e000 17-Apr-2015 Warner Losh <imp@FreeBSD.org>

RELEASEDIR was removed in FreeBSD 9.x, at the same time /boot/loader
stopped using kgzip in the release process. We no longer need to build
kgzip as a cross tool, and tests for RELEASEDIR are obsolete, so
remove both.

Differential Revision: https://reviews.freebsd.org/D2313


# 6c4f9295 16-Apr-2015 Enji Cooper <ngie@FreeBSD.org>

Defeat race with MK_KERBEROS == yes introduced with bootstrap-tools
parallelization work done in r279197

- kerberos5/lib/libroken requires kerberos5/tools/make-roken to build
- kerberos5/tools/asn1_compile, kerberos5/tools/slc, and usr.bin/compile_et
require kerberos5/lib/libroken and kerberos5/lib/libvers

This race is incredibly evident when cross-building sparc64 on
ref10-amd64.freebsd.org

MFC after: 1 week
Pointyhat to: ngie


# 008bd7c6 16-Apr-2015 Warner Losh <imp@FreeBSD.org>

People are still getting burned by the byacc upgraded, switch to
always doing byacc until someone figures out the more nuanced version
to switch off of.


# b40d31d0 02-Apr-2015 Andrew Turner <andrew@FreeBSD.org>

Only use the CROSS_BINUTILS_PREFIX tool if it exists.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation


# 76e2c537 02-Apr-2015 Dimitry Andric <dim@FreeBSD.org>

Ensure the cross assembler, linker and objcopy are used for the build32
stage, just like for the regular world stage.

Reviewed by: rodrigc, imp, bapt, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D2187


# 5ab58881 26-Mar-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Add --sysroot to the compiler flags for clang or gcc external toolchains

Before this fix, --sysroot was only added to the compiler flags if a clang
external toolchain was used.

Reviewed by: imp


# 996d8a0d 25-Mar-2015 Warner Losh <imp@FreeBSD.org>

Add some more explanation to the different phases of the build.


# b9a9d9ca 25-Mar-2015 Ed Maste <emaste@FreeBSD.org>

Force MK_INCLUDES for the legacy stage

As legacy executes "make installincludes" we don't want it to be
disabled by a src.conf setting.

Reviewed by: imp
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2143


# 8daa8167 19-Mar-2015 Andrew Turner <andrew@FreeBSD.org>

Start to import support for the AArch64 architecture from ARM. This change
only adds support for kernel-toolchain, however it is expected further
changes to add kernel and userland support will be committed as they are
reviewed.

As our copy of binutils is too old the devel/aarch64-binutils port needs
to be installed to pull in a linker.

To build either TARGET needs to be set to arm64, or TARGET_ARCH set to
aarch64. The latter is set so uname -p will return aarch64 as existing
third party software expects this.

Differential Revision: https://reviews.freebsd.org/D2005
Relnotes: Yes
Sponsored by: The FreeBSD Foundation


# 8cf263c8 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

run pw_mkdb and cap_mkdb at post-installation for cross installation the version
from the host would be run but the generated files will be on the target
respecing the endianness of the target


# 9269ba46 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Always cleanup remnant plist in destdir if any


# ee1376bc 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Fix printing the package name when creating


# d3cd95cf 18-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Now that pkg create can directly accept both a file and a plist in command line,
directly use it


# 9d732154 17-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Detect ABI based on what would be packaged


# a8bed44a 17-Mar-2015 Ed Maste <emaste@FreeBSD.org>

When cross-building with an external toolchain we still need a target strip

It is used by at least crunchide(1).


# 215d02b7 17-Mar-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add LIB_CXX so that C++ libraries will use CXX to link.

This fixes C++ libraries not implicitly linking in libc++. This is
generally not an issue because the final linking with the compiled binary
will involve CXX via PROG_CXX or other means. It is however
inconsistent with libraries implicitly linking in libc and problematic
for trying to build libraries with '-z defs' to ensure all direct
dependencies are linked in.

libatf-c++ is currently the only consumer of this new feature.

Differential Revision: https://reviews.freebsd.org/D2039
Reviewed by: imp
Discussed with: bapt
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 5d3fd44b 15-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Directly use bmake's ':gmtime'


# 42450b49 15-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Create a "packages" target takes care of all the magic


# 4c4073fd 12-Mar-2015 Ed Maste <emaste@FreeBSD.org>

Provide automatic cross-binutils path if no BINUTILS_BOOTSTRAP

The in-tree binutils does not support arm64, so will not work for the
forthcoming FreeBSD arm64 port. BROKEN_OPTIONS will include
BINUTILS_BOOTSTRAP, so provide a default CROSS_BINUTILS_PREFIX for this
case.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation


# e22b7515 12-Mar-2015 Warner Losh <imp@FreeBSD.org>

It appears that xlint isn't used in the build process, so it certainly
doesn't need to be a build tool.


# ca0abefb 04-Mar-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add new create-world-packages target to generated the packages out of world

Dynamically figure out the list of targets based on tags passed on the mtrees
First sanity check that all packages have existing manifests
Generate the packages

Please note that for now the mtree needs more work as it has duplicate entries,
everything is not yet tagged

The packages now have generic entries and needs to be customize


# fe692231 26-Feb-2015 Ed Maste <emaste@FreeBSD.org>

Support CROSS_BINUTILS_PREFIX with in-tree compiler

Reviewed by: bapt, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1974


# 3e3b7072 22-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Fill in missing dependencies for dtrace related tools so the bootstrap-tools
compiles properly on older hosts

Pointyhat to: me
X-MFC with: r279197
MFC after: 2 weeks


# aebc0e35 22-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Parallelize building bootstrap-tools

Differential Revision: https://reviews.freebsd.org/D1901
MFC after: 2 weeks
Reviewed by: ian
No serious objections from: imp


# 9c633deb 18-Feb-2015 Jung-uk Kim <jkim@FreeBSD.org>

Fix bootstrap on systems with old yacc with small MAXTABLE.


# 784b6cd5 18-Feb-2015 Peter Grehan <grehan@FreeBSD.org>

Restore the ability to use clang as an external compiler. This was
inadvertently removed when support for external GCC was added.

Deprecate XFLAGS in favour of the newer XCFLAGS/XCXXFLAGS.

Tested with: make universe, make CROSS_COMPILER_PREFIX=/usr/bin/ buildworld
Reviewed by: imp, bapt


# bd9cab6f 17-Feb-2015 Rui Paulo <rpaulo@FreeBSD.org>

release: use xz via pipe when compressing the tarballs.

libarchive(3) doesn't support the new liblzma API yet, but this change
allows us to enable multi-threaded xz compression.
``make release'' should now finish in half the time on a machine with
several cores and fast disks (our typical build server).

This behaviour only applies when building a release and it doesn't
affect buildworld/installworld. To disable threaded xz compression,
set XZ_THREADS=1.

Reviewed by: gjb
Tested by: gjb


# 3b66656a 16-Feb-2015 Rui Paulo <rpaulo@FreeBSD.org>

Fix a typo when invoking tar(1) to create the debug distributions.


# 11d9aa67 11-Feb-2015 Colin Percival <cperciva@FreeBSD.org>

Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.

The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive. Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.

The next steps will be:

2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.

3. Merging src/games into src/usr.bin.

This change will not be MFCed.

Reviewed by: jmg
Discussed at: EuroBSDCon
Approved by: gjb (release-affecting changes)


# b48e3e73 11-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove remnant from texinfo


# c69a9896 10-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add a new target make stageworld which basically does the same job as:
make installworld distribution but preparing the mtree the same way
distributeworld does and respecting -DNO_ROOT


# cf4b80d8 09-Feb-2015 Glen Barber <gjb@FreeBSD.org>

Exclude 'tests' from DEBUG_DISTRIBUTIONS.

Sponsored by: The FreeBSD Foundation


# 64e55c39 09-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove remnants from texinfo


# 3f98b1eb 09-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add a user message to explain what package is being created


# 0b6a052e 08-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove the verbose flag from pkg invocation as it is not in pkg releases yet


# 183a8ead 08-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add a new kernel-pkgs target to create pkg(8) packages from the kernel

The version scheme used is the following:
For stable/current branches:
${REVISION}.sYYYYMMDDhhmmss

s standing for snapshot

For releases branches:
${REVISION}_${PATCHLEVEL}

When packaging the kernel 2 different package are created per kernel
release (only contains the regular kernel and modules)
debug (contains the .symbols files)

Note that package the kernel (packaging world will follow the same rule) can
only by passing -DNO_ROOT to the build (hence can be done as a regular user)

To package the kernel:
make buildkernel
make distributekernel DESTDIR=/somewhere -DNO_ROOT
make kernel-pkgs DESTDIR=/somewhere -DNO_ROOT

The packages will be created inside the DESTDIR


# 9312c006 08-Feb-2015 Baptiste Daroussin <bapt@FreeBSD.org>

if BUILD_PKGS is set add sha256 hash into the metalogs


# 31a741f4 03-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Conditionalize building radius support into libpam, ppp, etc via
MK_RADIUS_SUPPORT

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


# 27051ca1 23-Jan-2015 Ed Maste <emaste@FreeBSD.org>

Restore addr2line to cross tools

Addr2line is not required for the build, and a per-arch binary is no
longer required with the switch to the ELF Tool Chain. However, building
these tools during the cross tools stage can be useful for developers
who cross build HEAD from stable/10, and adds very little to the build
time.

Reviewed by: ian, imp
Differential Revision: https://reviews.freebsd.org/D1583


# 8b817932 21-Jan-2015 Ed Maste <emaste@FreeBSD.org>

Fix bootstrap on systems with old libdwarf and WITHOUT_CDDL

ELF Tool Chain tools need libelf and libdwarf.

Submitted by: jmallett (earlier version)
Reviewed by: jmallett
Sponsored by: The FreeBSD Foundation


# da010b56 21-Jan-2015 Ed Maste <emaste@FreeBSD.org>

Remove addr2line from cross elftoolchain tools list

It is not required, and there is no reason to install it just because it
came with the binutils cross tools.

Sponsored by: The FreeBSD Foundation


# 2d281361 02-Jan-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove GNU texinfo from base along with all info pages.

To be able to info pages consider installing texinfo from ports print/texinfo or
via pkg: pkg install texinfo

Differential Revision: https://reviews.freebsd.org/D1409
Reviewed by: emaste, imp (previous version)
Relnotes: yes


# 7d612a43 30-Dec-2014 Ed Maste <emaste@FreeBSD.org>

Use BINUTILS_BOOTSTRAP knob for binutils only

Previously it also disabled building elftoolchain bootstrap tools such as
strip(1).

Differential Revision: https://reviews.freebsd.org/D1398
Reviewed by: imp
Sponsored by: The FreeBSD Foundation


# 851cc4c0 21-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Update the text for building texinfo with build-tools to reflect the fact
that make install is being called as well

MFC after: 1 week
X-MFC with: r276052


# 492c2b1f 21-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Build selective portions of gnu/usr.bin/texinfo as part of build-tools to
ensure that building on a host without makeinfo (i.e. a host where
make delete-old -DWITHOUT_INFO was run), then building with MK_INFO == yes
doesn't manifest in build errors when building info pages

This manifested itself like the following when I was build testing an MFC
change on stable/10:

makeinfo --no-split -I /usr/src/gnu/lib/libregex/doc -I /usr/src/gnu/lib/libregex/doc regex.texi -o regex.info
makeinfo: not found
*** [regex.info] Error code 127

make[6]: stopped in /usr/src/gnu/lib/libregex/doc
1 error

Tested on a head VM without makeinfo installed and by building with MK_INFO=yes

MFC after: 1 week


# 6bb8b90b 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Put all of gnu/usr.bin/groff back

Forgot about those pesky definitions files..


# 3c24213a 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Parallelize bootstrap-tools

Based on a patch submitted via -arch:
https://lists.freebsd.org/pipermail/freebsd-arch/2014-December/016493.html

MFC after: 1 week
Submitted by: Jia-Shiun Li <jiashiun@gmail.com>
Sponsored by: EMC / Isilon Storage Division


# f0fc0336 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Try building a little less groff for build-tools


# 9e7d291e 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Fix accidental MK_DEBUG_FILES=no addition to NXBMAKE in r275909

X-MFC with: r275909
Sponsored by: EMC / Isilon Storage Division


# c8ed1da7 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Don't build full clang toolchain or clang extras in stages 1-3 of buildworld

MFC after: 1 week
Reviewed by: dim (as part of a "larger" diff)
Phabric: D1336
Sponsored by: EMC / Isilon Storage Division


# f703589e 18-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Fix building/installing tests when TESTSBASE != /usr/tests

The work in r258233 hardcoded the assumption that tests was the last component
of the tests tree by pushing tests as an explicit prefix for the paths in
BSD.tests.dist and /usr was the prefix for all tests, per BSD.usr.dist and all
of the mtree calls used in Makefile.inc1. This assumption breaks if/when one
provides a custom TESTSBASE "prefix", e.g. TESTSBASE=/mytests .

One thing that r258233 did properly though was remove "/usr/tests" creation
from BSD.usr.dist -- that should have not been there in the first place. That
was an "oops" on my part for the work that was originally committed in r241823

MFC after: 2 weeks
Phabric: D1301
Reviewed by: imp
Sponsored by: EMC / Isilon Storage Division


# f9d93ea7 17-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Fix sporadic build failures due to race when running make installworld
when strip gets replaced at install time by adding it to ITOOLS for the
default usr.bin/xinstall STRIP_CMD

This will fix the failure noted in this Jenkins build step:
https://jenkins.freebsd.org/job/Build-UFS-image/688/

This will also fix the issue reported by alfred@ dealing with installing on
targets that differ from build hosts (e.g. installing on i386/i386 when built
on amd64/amd64)

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


# 4e816302 16-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Remove leftover MK_VI == no from previous work that's no longer needed


# eb1f96f4 16-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Do not enable DEBUG_FILES in stages 1. through 3. of the build

Blindly building debugging symbols into the toolchain slows down builds
considerably and eats up a lot more resources than required, both in
terms of memory and disk I/O

This change has no noticeable effect for those who do not build with
MK_DEBUG_FILES=no (which is the default)

Sponsored by: EMC / Isilon Storage Division


# 5f25ee9c 16-Dec-2014 Brooks Davis <brooks@FreeBSD.org>

Add an UPDATING entry and warning about the change in r274807 to help users
transition to the new behavior.

Discussed with: jmallett
Sponsored by: DARPA, AFRL


# 989966a8 10-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Remove building usr.bin/vi as part of build-tools per r275687


# 46fe68cd 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Add makewhatis to ITOOLS if MK_MAN != no

This will fix installation with differing host targets in installworld, so
one can build i386/i386 on an amd64 host, then install to an i386/i386 target

Reported by: alfred
Phabric: D1280
MFC after: 1 week


# c05228ba 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

- Document why usr.bin/vi needs to be built as part of bootstrap-tools
- Do not build usr.bin/vi as part of bootstrap-tools if NO_SHARE is defined
as share/termcap will be skipped if NO_SHARE is defined; that being said,
something needs to be done for dealing with make distribute as it will be
built via make distribute if not done during make buildworld.
- Add -DNO_SHARE to NOFUN to deal with make xdev because of the fact that it
implements a partial make buildworld/make installworld, but because it
doesn't define everything, not all install paths exist in expected stages,
which results in build failures with usr.bin/vi in bootstrap-tools because
"WORLDTMP" is not fully populated when _xb-bootstrap-tools is run.

tl;dr: this is enough to just make sure that make xdev isn't broken on this
branch when MK_VI == no and make delete-old has been run on the build host


# 2bc62d50 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Build gperf with xdev as part of _xb-bootstrap-tools to unbreak the build
if/when MK_CXX == no and make delete-old has been run on the build host,
post-r272849

Tested with the following command:

% sudo env MK_CLANG=no MK_CLANG_BOOTSTRAP=no MK_GCC=yes MK_GCC_BOOTSTRAP=yes \
MK_GNUCXX=yes make xdev


# 1955a4bf 07-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Push the build-tools logic down into Makefile.inc1 so it's localized all in
one spot, and the potential for installing to the wrong DESTDIR is lower


# 31942939 01-Dec-2014 Ed Maste <emaste@FreeBSD.org>

Build infrastructure for elftoolchain tools

Set WITH_ELFTOOLCHAIN_TOOLS in src.conf to use the elftoolchain version
of the following tools:

* addr2line
* elfcopy (strip / mcs)
* nm
* size
* strings

Reviewed by: bapt (earlier version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1224


# 1d91a058 28-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

share/termcap requires ex from usr.bin/vi in order to compile, and since usr.bin
comes after share in SUBDIR in Makefile.inc1, the build will fail when vi is not
installed on the build host

Run build-tools for usr.bin/vi and install ex, etc to WORLDTMP to enable building
share/termcap on hosts that don't have nvi installed on them


# f541dd9b 26-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Implement MK_RADIUS_SUPPORT to make libradius and assorted support optional


# 7e57795a 25-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Don't try and build 32-bit versions of hyperv / bhyve


# 0e97688f 21-Nov-2014 Brooks Davis <brooks@FreeBSD.org>

Slightly alter the handling of LOCAL_LIB_DIRS to skip addition of
directories in LOCAL_LIB_DIRS if they are subdirectories of directories
listed in LOCAL_DIRS. This allows a hierarchy like:

foo
foo/lib
foo/usr.bin
foo/usr.sbin

to be supported with LOCAL_DIRS=foo LOCAL_DIRS=foo/lib.

MFC after: 1 week
Sponsored by: DARPA, AFRL


# e163efb6 21-Nov-2014 Brooks Davis <brooks@FreeBSD.org>

Add a guard against attempting to invoke the buildenv target with -j# as
that silently exits rather than doing something useful.

MFC after: 1 week
Sponsored by: DARPA, AFRL


# e93397e5 16-Nov-2014 Sean Bruno <sbruno@FreeBSD.org>

Add mv, echo and hostname to the native-xtools target. Missed these
when profiling.

MFC after: 2 weeks


# e98c3c3f 16-Nov-2014 Sean Bruno <sbruno@FreeBSD.org>

Flush out many more static binaries that can be used in a jail for building
pkgs via poudriere. This removes a significant amount of emulation speeding
up run times.

Phabric: D1172
Reviewed by: imp
MFC after: 2 weeks


# 2c8c40a7 13-Nov-2014 Sean Bruno <sbruno@FreeBSD.org>

Add more static binaries to the native-xtools target. These help speed
up the cross builds significantly.

adding:
bin/sh
bin/csh
sbin/md5
usr.bin/bzip2
usr.bin/fetch
usr.bin/gzip
usr.bin/tar
usr.bin/unzip
usr.bin/xz

Phabric: D1146
Reviewed by: imp bdrewery
MFC after: 2 weeks


# 6e48c752 07-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Fix build race in Makefile.inc1 after r274226 by adding lib/libm__L dependency
for gnu/lib/libdialog

Sponsored by: EMC / Isilon Storage Division


# b78618fb 06-Nov-2014 Devin Teske <dteske@FreeBSD.org>

For really fast machines, an edge-case may exist where dpv(3) may be
built before contrib dependency, dialog(3). Add dialog(3) to the list
of _prebuild_libs to ensure that this does not happen.

Tested on: 11.0-CURRENT amd64 @ r274205
Thanks to: kargl, Larry Rosenman <ler@lerctr.org>, ngie, markj
Recommended by: ngie
Reviewed by: ngie, markj
MFC after: 21 days
X-MFC-to: stable/10 stable/9
X-MFC-with: 274116 274120 274121 274123 274144 274146 274192 274203


# 2b293f6a 06-Nov-2014 Devin Teske <dteske@FreeBSD.org>

SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for me.
Add to using _prebuild_libs in (top-level) Makefile.inc1.
NB: Unbreak build yet again (we'll get this right eventually)

Reviewed by: markj, ngie
Thanks to: ian, markj, ngie, Nikolai Lifanov <lifanov@mail.lifanov.com>
MFC after: 21 days
X-MFC-to: stable/10 stable/9
X-MFC-with: 274116 274120 274121 274123 274144 274146 274192


# 75c3b117 27-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Rename XFLAGS to XCFLAGS and XXFLAGS to XCXXFLAGS

This is less confusing names and actually more reflexting what they are intended
to.

Discussed with: brooks


# b55e8e6e 21-Oct-2014 Warner Losh <imp@FreeBSD.org>

My previous commit exposed an issue as it fixed a different
issue. lib/atf isn't a prereq_lib, since it isn't required for other
libraries to build. Remove it. The old kludge of always building it
had effectively been retired. Since we don't want to build the
libraries with the tests when we're bootstrapping, invent
MK_TESTS_SUPPORT which normally defaults to the current MK_TESTS
value, except when explicitly defined. Make lib/atf depend on it being
yes. When building the libraries set MK_TESTS to no, and
MK_TESTS_SUPPORT to the current value of MK_TESTS so that later stages
of the build work correctly. This should fix (and does for me)
people's issues with parallel builds racing between lib/atf and
libexec/atf. Since lib/atf is built during the libraries phase, the
race disappears.


# 983678dd 21-Oct-2014 Warner Losh <imp@FreeBSD.org>

Generate both userland and kernel option settings for showconfig.

PR: 191920


# e8a66c33 21-Oct-2014 Warner Losh <imp@FreeBSD.org>

You aren't allowed to test WITH_xxx or WITHOUT_xxx here, so remove it.
Even if you were allowed to test for it, the test makes no sense as it
always results in adding -DWITH_ATF unless WITH_ATF was already
defined. But if MK_ATF != no, then we know it was defined. This, in
turn, caused tools/build/options/makemake always think WITH_ATF is the
default, which removed control of that from sys.conf.mk.

To get the intent of the deleted comment, another mechanism is
required, assuming that the intent of that comment is desirable.


# 1ff70c71 21-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Make the external toolchain support grows to the knowleged of XXFLAGS for C++ dedicated flags
and DEPFLAGS for mkdep flags
Pass the path to the libc++ headers in both, enforce the gnu++11 standard in the XXFLAGS
to satisfy libc++ requirements pass the libc++ objectdir as a location where to find
libraries so it can find libstdc++.so and libstdc++.A

Reviewed by: imp


# a5edb5fb 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Add size(1) to the cross build toolchain


# 8329338c 08-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Fix typo


# 481d7bbf 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Add OBJCOPY to the list of external tools


# 46d3ab75 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Fix build when XCC is defined and X_COMPILER_TYPE is not


# 3dce4cb5 09-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Add CROSS_TOOLCHAIN macro select pre seeded external toolchain configuration files
The goal is to provide pre seeded toolchain configurations withing the ports tree
to allow the use of an external toolchain in a simple way:

make CROSS_TOOLCHAIN=powerpc64-gcc TARGET=powerpc TARGET_ARCH=powerpc64 buildworld

This will look for the external toolchain definition in /usr/local/share/mk/powerpc64-gcc.mk
While here add the notion of X_COMPILER_TYPE to the external toolchain framework to allow
to deal with differences between gcc and clang in regards of cross building


# 06429175 05-Oct-2014 Mark Johnston <markj@FreeBSD.org>

Fix dependency errors when linking libproc.

Reported by: Oliver Hartmann
X-MFC-With: r272488


# c36047bd 03-Oct-2014 Xin LI <delphij@FreeBSD.org>

Add dependencies to various libraries to libzfs and libzpool.

Submitted by: sef


# 3dde11c4 30-Sep-2014 Andrew Turner <andrew@FreeBSD.org>

Fix the TARGET_ABI value clang uses. It shpuld be gnueabi on all ARM
soft-float architectures, and gnueabihf for hard-float.


# 6d4766c1 01-Oct-2014 Andrew Turner <andrew@FreeBSD.org>

Remove MK_ARM_EABI, the armeb issues have been fixed. The code to support
the oabi is still in the tree, but it is expected this will be removed
as developers work on surrounding code.

With this commit the ARM EABI is the only supported supported ABI by
FreeBSD on ARMa 32-bit processors.

X-MFC after: never
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D876


# be26ce21 23-Sep-2014 Enji Cooper <ngie@FreeBSD.org>

Have distrib-dirs, distribution, hier, hierarchy, redistribute, and reinstall
depend on the .MAKE special target

This will allow users to do something like the following to print out the
results of the running the simulated make target with bmake, like some of the
other top-level make targets in Makefile.inc1:

% make -f Makefile.inc1 -n distribution TARGET=i386 TARGET_ARCH=i386

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 217c8381 17-Sep-2014 Will Andrews <will@FreeBSD.org>

Root the lib32 object tree under the overall object tree.

This enables a common root directory for all object files for a given tree,
which eases sharing a common MAKEOBJDIRPREFIX, and cleaning up of object trees.

In particular, one can simply (from the source directory) rm -rf /usr/obj$(pwd)
to destroy all object files for it. Or to copy/sync files, etc.

Reviewed by: bdrewery
CR: https://reviews.freebsd.org/D796
MFC after: 1 month
Sponsored by: Spectra Logic


# 5608fd23 19-Aug-2014 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r267233 for now. PIE support needs to be reworked.

1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
where it never would work anyhow, such as csu or loader. This suggests
there may be better ways of adding support to the tree. Many of these
cases can be fixed such that -fPIE will work but there is really no
reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
really building libraries but have been using bsd.prog.mk because the code
is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by: kib


# 75872267 18-Aug-2014 Warner Losh <imp@FreeBSD.org>

Create the native-xtools target. This target creates only the cross
building toolchain for the host computer. This toolchain produces
TARGET_ARCH and assumes the rest of the system contains libraries for
the target. It is intended to be used in a "qemu-user jail" where all
the binaries would otherwise be the target architecture's to build
ports. However, emulation of the compilers is too slow, so we build
native binaries for that. Rather than use the xdev produced binaries,
with all their weird links and paths, these binaries use the native
paths. They will not work unless installed into the qemu-user jail.

Differential Revision: https://phabric.freebsd.org/D518
Reviewed by: sbruno@


# 51483c42 15-Aug-2014 Enji Cooper <ngie@FreeBSD.org>

Fix atmconfig compilation when MK_ATM == yes and MK_BSNMP == no

Makefile.inc1:
Always compile gensnmptree with bootstrap-tools when MK_BSNMP != no
instead of depending on a potentially stale tool installed on the build host

sbin/atm/atmconfig/Makefile:
- Always remove oid.h to avoid cluttering up the build/src tree.
- Consolidate all of the RESCUE/MK_BSNMP != no logic under one
conditional to improve readability
- Remove unnecessary ${.OBJDIR} prefixing for oid.h and use ${.TARGET} instead
of spelling out oid.h
- Add a missing DPADD for ${LIBCRYPTO} when compiled MK_BSNMP == yes and
MK_OPENSSL == yes and not compiling for /rescue/rescue

sbin/atm/atmconfig/main.c:
Change #ifndef RESCUE to #ifdef WITH_BSNMP in main.c to make it
clear that we're compiling bsnmp support into atmconfig

Approved by: jmmv (mentor)
Phabric: D579
PR: 143830
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 37fbf898 08-Aug-2014 Rui Paulo <rpaulo@FreeBSD.org>

Run dtrace in 32-bit mode when compiling 32-bit libraries.

MFC after: 3 days


# 51fa06dd 07-Aug-2014 Ian Lepore <ian@FreeBSD.org>

m4 now requires libohash, ensure it gets built when bootstrapping.


# 4504fbd3 07-Aug-2014 Ollivier Robert <roberto@FreeBSD.org>

10 has a new flex (2.5.37) and the config.h for unbound has been updated to
take this into account. Alas it breaks source upgrade from any version of
9 because flex is not built as a bootstrap-tools (it would be for older
versions).

That means "libunbound/configlexer.c" is built with the old flex but using
config.h for the new one. Build is thus broken going from 9.* to 10.

Make flex a bootstrap-tools entry if host is less than 1000033 to take into
account the flex update in 10.

Tested on both 9.2-RC3 and 9.3 by myself and dim@. Running buildworld in
head but as both 10 and 11 has the new flex, it will not matter.

Reviewed by: imp
Approved by: des, imp
MFC after: 1 week
Phabric: D554


# 92dbec66 04-Aug-2014 Brooks Davis <brooks@FreeBSD.org>

Merge from CheriBSD:

Make the sysinit tool a build tool rather than building in with
/usr/bin/cc and running it from OBJDIR. (It will be moved to usr.bin
once a manpage is written and a few style cleanups are done.)

Split the makefile bits for Hans' kernel shim layer into their own
includable kshim.mk.

Move USB support into a .mk file so loaders can include it.


# 22cbbf9d 23-Jul-2014 Sean Bruno <sbruno@FreeBSD.org>

Deprecate the use of XDEV and XDEV_ARCH and just use TARGET/TARGET_ARCH
for the xdev build target, which is awesome and totally works.

Reapply svn R268377 with correct name of libsupc++ here as this does
resolve one dependancy race when building the xdev target.

the xdev target builds for amd64, i386, mips, mips64 and armv6 with this commit,
must be built as root, must be built from /usr/src, must not have a /usr/obj and
places the xdev tools in /usr/$TARGET_ARCH-freebsd

the xdev target still leaves some assorted files strewn about your /usr/src when
this is done and needs to be investigated further.

Phabric: https://phabric.freebsd.org/D385
Submitted by: bsdimp


# 1782c649 21-Jul-2014 Dimitry Andric <dim@FreeBSD.org>

Run mtree for BSD.tests.dist during make xdev-install, if the tests are
enabled (which they are in the default configuration). Otherwise, it
will fail because ${XDDESTDIR}/usr/include/atf-c does not exist.

MFC after: 3 days


# 9e88096e 10-Jul-2014 Warner Losh <imp@FreeBSD.org>

Make MK_GNUCXX mean "build the libstdc++ and libsupc++ libraries" and
nothing more. Force it to be "no" when MK_CXX is "no" to simplify
usage. It no longer also means "build g++" since we no longer have a
platform where that's interesting now that pc98 no longer needs clang
and gcc, but not g++. pc98 now just uses clang after boot2 changes.


# 9e488366 10-Jul-2014 Warner Losh <imp@FreeBSD.org>

Separate out the links creation from the other targets. This was
supposed to have been done for the original commit, but somebody
forgot.

Pointy-hat-to: imp@


# 9016d25f 07-Jul-2014 Warner Losh <imp@FreeBSD.org>

Typo means that this couldn't have possibly fixed anything, so revert
r268377.


# 8bc01eb6 07-Jul-2014 Warner Losh <imp@FreeBSD.org>

xdev builds libsupc++ and libstdc++ in a slightly strange way. This
cause a race to be exposed between the two. Compensate for this race
by serializing the build/install of libstdc++ before libsupc++.


# 50f73640 02-Jul-2014 Marcel Moolenaar <marcel@FreeBSD.org>

Remove ia64 from the list of known architectures and add an entry to
UPDATING. This is the first step towards the removal of ia64 from
head. A buildworld for ia64 will now yield:

% make buildworld
make[1]: "/usr/src/Makefile.inc1" line 151: Unknown target ia64:ia64.

While here, trim the ia64-specific additions from ObsoleteFiles.inc

Discussed at: BSDcan


# ffc6fb79 01-Jul-2014 Glen Barber <gjb@FreeBSD.org>

Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:

r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.

Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.

r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)

Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.

r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution

This also follows other naming conventions seen in the
wild.

r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.

This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.

r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.

MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation


# 824a9093 29-Jun-2014 Ed Maste <emaste@FreeBSD.org>

Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT

The _SUPPORT knobs have a consistent meaning which differs from the
behaviour controlled by this knob. As the knob is opt-out and has not
appeared in a release the impact should be low.

Suggested by: imp, wblock
MFC after: 1 week


# a0e6a013 17-Jun-2014 Bryan Drewery <bdrewery@FreeBSD.org>

- Add a LOCAL_ITOOLS to allow adding additional tools required for the
installworld and distributeworld targets

PR: 179562
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
MFC after: 1 week


# cce0f182 12-Jun-2014 Ed Maste <emaste@FreeBSD.org>

Build vt(4) fonts during buildworld

vtfontcvt(8) is now built during buildworld, so can be used as a
bootstrap tool to create vt(4) fonts from source .hex or .bdf font
files, rather than having uuencoded binary fonts in the tree.

Sponsored by: The FreeBSD Foundation


# e8a34402 10-Jun-2014 Julio Merino <jmmv@FreeBSD.org>

Put the test suite in its own tests.txz distribution file.

Force all the contents of /usr/tests to go into a separate distribution
file so that users of binary releases can easily choose to not install it.

To make this possible, we need two fixes:
- bsd.subdir.mk needs to properly honor NO_SUBDIR in all cases so that we
do not recurse into 'tests' subdirectories when we needn't. Otherwise,
we end up with some Kyuafiles in base.txz.
- etc/Makefile needs to skip installing tests in its 'distribute' target
so that a Kyuafile doesn't leak into base.txz.

Approved by: gjb


# 864c53ea 08-Jun-2014 Bryan Drewery <bdrewery@FreeBSD.org>

In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.

This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by: Shawn Webb <lattera@gmail.com>
Discussed between: des@ and Shawn Webb [2]


# 403ec796 22-May-2014 Warner Losh <imp@FreeBSD.org>

When libelf and libdwarf were updated, we didn't bump the minimal
version needed for CTF tools, so sometimes we'd use the host's CTF
tools that didn't work. Be sure to bootstrap in that case.


# e00e69ab 21-May-2014 Xin LI <delphij@FreeBSD.org>

Fix build: Build libavl as prebuild-lib.

X-MFC-With: 266520


# 7273339d 10-May-2014 Warner Losh <imp@FreeBSD.org>

Eliminate EARLY_BUILD flag. It is redundant and means MK_CLANG_FULL=no
and MK_LLDB=no, so set those explicitly (now that we can do
that). Simplify tests for these variables as well, since we know they
will always be defined regardless of the phase of the build.


# ab72ce6b 10-May-2014 Warner Losh <imp@FreeBSD.org>

Migrate NO_WARN to MK_WARN. Support legacy NO_WARN usage. Remove a
check for EARLY_BUILD because it isn't necessary (MK_WARN=no will
always be defined for that).


# a46954e2 05-May-2014 Warner Losh <imp@FreeBSD.org>

Document src.opts.mk changes and the decoupling of /etc/src.conf from
anything but the source tree.


# c6063d0d 05-May-2014 Warner Losh <imp@FreeBSD.org>

Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.


# cf35c685 03-May-2014 Thomas Quinot <thomas@FreeBSD.org>

Add appropriate quoting to allow building with a KERNCONFDIR containing
spaces.

PR: kern/162736
MFC after: 1 week


# 56d78e82 30-Apr-2014 Warner Losh <imp@FreeBSD.org>

Turns out this .if evaluated not in the context of the makedtb target
sometimes due to Makefile expansion rules. Make the test for things
being NULL elsewhere...


# 0edb7351 30-Apr-2014 Warner Losh <imp@FreeBSD.org>

Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a
kernel config file. If you also want to have a static DTB compiled
into your kernel, however, it cannot be a list. We have no mechanism
in the kernel for picking one, so that doesn't make sense and will
result in a compile-time error.


# 52cb8b8f 28-Apr-2014 Warner Losh <imp@FreeBSD.org>

Add dependency for libm to libstdc++. This fixes high -j value builds
when not building with clang.

Submitted by: ian@


# 845b7c7b 26-Apr-2014 Warner Losh <imp@FreeBSD.org>

make_dtb.sh is designed to be used in a kernel build environment where
MACHINE is defined to the target's value, not the host's
value. However, in Makefile.inc1, it is still defined to be the host's
value. Make the makedtb target work by expanding TARGET in the
existance test, and passing MACHINE=$TARGET in the call to make_dtb.sh


# 347c9de0 25-Apr-2014 Warner Losh <imp@FreeBSD.org>

Eliminate NO_INCS. It is used one place, and MK_TOOLCHAIN=no will
handle the job just as well. Opt for simplicity rather than one more
option.


# 98407b8b 25-Apr-2014 Warner Losh <imp@FreeBSD.org>

Spell NO_PROFILE= as MK_PROFILE=no.


# 96267df3 25-Apr-2014 Warner Losh <imp@FreeBSD.org>

Remove NO_CTF, exccept as an undocumented compatibility
option. Convert all other uses to MK_CTF=no. Set MK_CTF=no rather than
the indirect WITHOUT_CDDL in filemon regression. It is expected that
NO_CTF will be removed in FreeBSD 12 entirely.


# 2bf36e7e 18-Apr-2014 Warner Losh <imp@FreeBSD.org>

Separate out enabling building clang and/or gcc for the system and
building clang and/or gcc as the bootstrap compiler. Normally, the
default compiler is used. WITH_CLANG_BOOTSTRAP and/or
WITH_GCC_BOOTSTRAP will enable building these compilers as part
bootstrap phase. WITH/WITHOUT_CLANG_IS_CC controls which compiler is
used by default for the bootstrap phase, as well as which compiler is
installed as cc. buildworld now successfully completes building the
cross compiler with WITHOUT_CLANG=t and WITHOUT_GCC=t and produces a
built system with neither of these included.

Similarlly, MK_BINUTILS_BOOTSTRAP controls whether binutils is built
during this phase.

WITHOUT_CROSS_COMPILER will now force MK_BINUTILS_BOOTSTRAP=no,
MK_CLANG_BOOTSTRAP=no and MK_GCC_BOOTSTRAP=no.

BOOTSTRAP_COMPILER was considered, but rejected, since pc98 needs both
clang and gcc to bootstrap still. It should be revisisted in the
future if this requirement goes away. Values should be gcc, clang or
none. It could also be a list.

The odd interaction with Xfoo cross/external tools needs work, but
is beyond the scope of this change as well.


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


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

Determine whether to build clang and its bootstrap tools the same
way. This allows a clang bootstrap to happen, even when WITHOUT_CLANG
is defined. This is a minimal version of a more extensive change which
can be MFC'd more easily. However, we have to also test to see if
we're building clang as not cc, since the bootstrap for that needs
these cross tools and it is easier to build them in just one place.

MFC after: 1 week


# 62c4a462 04-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Prevent XDTP from being a relative path
XDTP is used as the default SYSROOT for clang and thus should be an absolute path.

PR: arm/188249
Submitted by: Edgar Martinez <wink15987@gmail.com>
Reviewed by: imp


# e4dbff8a 03-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

XDDESTDIR should not be set by the user, instead the user might want to tweak
XDTP and let the standard DESTDIR decide where to install.

Discussed with: imp


# cf44c89b 03-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Some xdev fixes:

- if TARGET_ARCH is not defined and XDEV_ARCH is defined then early define
TARGET_ARCH to the valud of XDEV_ARCH: This allow the xdev-build target
to be able to correctly chose the compiler it needs to build
- Allow overwriting XDTP to allow a user to not chose where the xdev env will
live in
- Fix build for gcc only xdev (like ia64) by providing the proper -B to the
toolchain and not relying on gcc being installed already in base
- Fix TOOLS_PREFIX so the generated toolchain has the right default sysroot when
installed intead of getting the DESTDIR one
- Fix supporting DESTDIR
- Also overwrite CXX (needed for cross building c++ libraries with clang) and
CPP (needed to cross build some libraries when gcc is the target default
compiler but gcc is not installed on the building host)

Discussed with: imp


# c77d0c98 01-Apr-2014 Warner Losh <imp@FreeBSD.org>

It is possible that MK_GNUCXX is "yes" but MK_CXX is "no" so make sure
MK_CXX isn't "no" before building these libraries.


# ae85a489 01-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Ensure make xdev respect which compiler is CC
and which compilers should be built according to standard build options


# 63e4d6f7 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

There's no need to guess at the COMPILER_TYPE to pass it down. We
guess wrong for buildkernel when CC=gcc49, say. Eliminate all the
guessing. COMPILER_TYPE propigates properly on its own, if specified,
and we guess it correctly otherwise lower in the build. Also, fix
conditionals for armv6hf when using an external compiler chain. They
were broken before, but unused. Also, prefer checking the compiler
type over CLANG_IS_CC since the latter is only supposed to be used to
determine what symlinks to install (more fixes to follow).


# bfbada6e 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

Move stray targets out of the xdev section.


# 15eee895 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

Kill NO_TESTS and use MK_TESTS=no when we want to skip them.


# e091d985 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

Allow the build system to safely set MK_FOO to avoid the ambiguity
when both WITH_FOO and WITHOUT_FOO are set. Use this where
possible. Only disallow setting of MK_FOO on the command line. This
was preferable to inventing a new mechanism or fixing the undef bug
(bin/183762) which precludes users from turning off anything we turn
off for parts of the build with WITHOUT_FOO prior to this.


# 53eff78a 30-Mar-2014 Warner Losh <imp@FreeBSD.org>

When building g++, we need to build libsupc earlier to avoid a race
with libproc. Not sure why people didn't see this before now, but I
get it often for higher (20-30) -j builds, but never for -j1 builds.


# bd633799 28-Mar-2014 Warner Losh <imp@FreeBSD.org>

Only set XDDESTDIR if it wasn't already set to allow people to
override it.


# 73279d41 22-Mar-2014 Andrew Turner <andrew@FreeBSD.org>

Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.

This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit.
This is an optional coprocessors may not be present in all devices, however
it appears to be in all current SoCs we support.

armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too
old to support this. Because of this there are a number of WITH/WITHOUT
options that are unsupported and must be left as the default value. The
options and their required value are:
* WITH_ARM_EABI
* WITHOUT_GCC
* WITHOUT_GNUCXX

In addition, without an external toolchain, the following need to be left
as their default:
* WITH_CLANG
* WITH_CLANG_IS_CC

As there is a different method of passing float and double values to
functions the ABI is incompatible with existing armv6 binaries. To use
this a full rebuild of world is required. Because no floating point values
are passed into the kernel an armv6 kernel with VFP enabled will work with
an armv6hf userland and vice versa.


# ae094461 20-Mar-2014 Alan Somers <asomers@FreeBSD.org>

Fix kern/187712: config(8) does not respect KERNCONFDIR.
The impact of this bug is that you cannot build a kernel if both of the
following are true:
1) The kernel config file is in a non-default location
2) The kernel config file uses the "include" statement from config(5).

usr.sbin/config/main.c
usr.sbin/config/config.8
usr.sbin/config/config.h
usr.sbin/config/lang.l
Added a "-I path" option to config(8). By analogy to cc(1), it adds
an extra path in which the "include" statement will search for
files.

Makefile.inc1
Pass "-I ${KERNCONFDIR}" to config(8).

PR: kern/187712
Reviewed by: will, imp (previous version)
MFC after: 3 weeks
Sponsored by: Spectra Logic Corporation


# 02701f04 14-Mar-2014 Warner Losh <imp@FreeBSD.org>

With the more generous footprints today, it makes little sense to use
UFS1 by default any more. Switch to UFS2.


# 2c284d93 13-Mar-2014 Gleb Smirnoff <glebius@FreeBSD.org>

Remove IPX support.

IPX was a network transport protocol in Novell's NetWare network operating
system from late 80s and then 90s. The NetWare itself switched to TCP/IP
as default transport in 1998. Later, in this century the Novell Open
Enterprise Server became successor of Novell NetWare. The last release
that claimed to still support IPX was OES 2 in 2007. Routing equipment
vendors (e.g. Cisco) discontinued support for IPX in 2011.

Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.


# 3b8f61cb 01-Mar-2014 Marcel Moolenaar <marcel@FreeBSD.org>

Use ${MAKE} so that we always use the same version/implementation
of make.


# eeb913c9 28-Feb-2014 Warner Losh <imp@FreeBSD.org>

Integrate device-tree upstream files into the build process:
(1) Invoke cpp to bring in files via #include (although the old
/include/ stuff is supported still).
(2) bring in files from either vendor tree or freebsd-custom files
when building.
(3) move all dts* files from sys/boot/fdt/dts to
sys/boot/fdt/dts/${MACHINE} as appropriate.
(4) encode all the magic to do the build in sys/tools/fdt/make_dtb.sh
so that the different places in the tree use the exact same logic.
(5) switch back to gpl dtc by default. the bsdl one in the tree has
significant issues not easily addressed by those unfamiliar with
the code.


# d2ed6da0 30-Jan-2014 Brooks Davis <brooks@FreeBSD.org>

Merge from CheriBSD:
commit 1b41f6de7ca09e04fdc6f66bc478ea6c981a41b9
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date: Mon Jan 27 22:59:02 2014 +0000

Now that mtree is always nmtree use it as mtree

Tested on: ref9-amd64
X-MFC after: never
Sponsored by: DARPA, AFRL


# 2b29a85c 24-Jan-2014 Alan Somers <asomers@FreeBSD.org>

Fix the build so -DNO_TESTS is passed in various phases that don't
require tests in order to build or install. Crucially, don't try to
install tests during the lib32 install phase. This commit supersedes
r261081, which fixed the lib32 install phase problem, but didn't fix
other phases.

Submitted by: Garrett Cooper
Reviewed by: sjg
MFC after: 13 days


# a8eb96d5 23-Jan-2014 Alan Somers <asomers@FreeBSD.org>

Replace the old unix_seqpacket and unix_seqpacket_exercise tests, which
were a little broken and not automatable, with unix_seqpacket_test.
It's coverage is a superset of the old tests and it uses ATF. It
includes test cases for bugs kern/185813 and kern/185812.

PR: kern/185812
PR: kern/185813
Sponsored by: Spectra Logic
MFC after: 2 weeks


# 385d6d47 22-Jan-2014 John Baldwin <jhb@FreeBSD.org>

Generate /var/db/services.db during 'make distribution' so that it is
present during new installs. Update etcupdate and mergemaster to
ignore the generated file.

Tested by: gjb (release build)
MFC after: 1 month


# 50b464aa 07-Jan-2014 Scott Long <scottl@FreeBSD.org>

Remove aicasm as a build dependency. It made sense when the ahc and ahd
drivers and their firmware were under active development, but those days
have passed. The firmware now exists in pre-compiled form, no longer
dependent on it's sources or on aicasm. If you wish to rebuild the
firmware from source, the glue still exists under the 'make firmware'
target in sys/modules/aic7xxx.

This also fixes the problem introduced with r257777 et al with building
kernels the old fashioned way in sys/$arch/compile/$CONFIG when the
ahc/ahd drivers were included.


# 42a85952 02-Dec-2013 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Please welcome casperd daemon. It (and its services) will be responsible for
giving access to functionality that is not available in capability mode
sandbox. The functionality can be precisely restricted.

Start with the following services:
- system.dns - provides API compatible to:
- gethostbyname(3),
- gethostbyname2(3),
- gethostbyaddr(3),
- getaddrinfo(3),
- getnameinfo(3),
- system.grp - provides getgrent(3)-compatible API,
- system.pwd - provides getpwent(3)-compatible API,
- system.random - allows to obtain entropy from /dev/random,
- system.sysctl - provides sysctlbyname(3-compatible API.

Sponsored by: The FreeBSD Foundation


# 2f02600a 01-Dec-2013 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Move my simple logging API to a separate library. It is now already used
by hastctl(8), hastd(8) and auditdistd(8) and will soon be also used
by casperd(8) and its services. There is no documentation and pjdlog.h
header file is not installed in /usr/include/ to keep it private.
Unfortunately we don't have /lib/private/ at this point, only
/usr/lib/private/, so the library is installed in /lib/.

Sponsored by: The FreeBSD Foundation


# 091b8336 17-Nov-2013 Peter Wemm <peter@FreeBSD.org>

Attempt to move the POSIX iconv* symbols out of runtime linker space.
FreeBSD systems usually implemented this as a third party module and
our implementation hasn't played as nicely with the old way as it could
have.

To that end:
* Rename the iconv* symbols in libc.so.7 to have a __bsd_ prefix.
* Provide .symver compatability with existing 10.x+ binaries that
referenced the iconv symbols. All existing binaries should work.
* Like on Linux/glibc systems, add a libc_nonshared.a to the ldscript
at /usr/lib/libc.so.
* Move the "iconv*" wrapper symbols to libc_nonshared.a

This should solve the runtime ambiguity about which symbols resolve
to where. If you compile against the iconv in libc, your runtime
dependencies will be unambiguous.

Old 9.x libraries and binaries will always resolve against their
libiconv.so.3 like they did on 9.x. They won't resolve against libc.

Old 10.x binaries will be satisified by the .symver helpers.

This should allow ports to selectively compile against the libiconv
port if needed and it should behave without ambiguity now.

Discussed with: kib


# 5efcd27a 16-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Move all atf directories to the tests mtree.

This is to ensure that test-related directories don't get needlessly
created (and later deleted) when MK_TESTS=no.

Problem found by jhb@.

Approved by: rpaulo (mentor)


# d8efce39 13-Nov-2013 Colin Percival <cperciva@FreeBSD.org>

Strip the -pN patch level from the VERSION string which gets encoded into
CTF data. Otherwise FreeBSD Update builds think every kernel file has
changed every time there's a security advisory, since the FreeBSD Update
build code isn't smart enough to look inside CTF data to ignore those
changes.

Pointy hat to: cperciva
MFC after: 1 day, or before the next BETA


# d3109d39 08-Nov-2013 Ian Lepore <ian@FreeBSD.org>

This change builds kernel tools based on the same assumption as building
the kernel itself: If building for the same architecture as the build host,
the kernel build assumes that the host toolchain is capable of building the
kernel. If it's not, "make kernel-toolchain" will bootstrap a new set of
tools that will work.

With this change the same assumptions are made for building kernel tools,
and the existing host toolchain is used to do the build (notably, the build
doesn't link the tools with the legacy libraries, which may not even exist).
If ever for some reason the host toolchain isn't capable of building the
kernel tools, then doing a "make kernel-toolchain" will bootstrap newer
tools to get the job done.

So when built as part of buildworld or kernel-toolchain, the kernel tools
are built using the XMAKE (via BMAKE) commands and environment. When built
as part of building just the kernel on a same-target host, the tools are
built using the new KTMAKE commands and environment. What doesn't jump
out at you in the diffs is that the difference between BMAKE and KTMAKE
is that BMAKE contains this magic line which changes how the build is done
because it changes what files get included for .include <bsd.prog.mk> and
other standard includes:

MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"

and KTMAKE doesn't, and contains this instead:

TOOLS_PREFIX=${WORLDTMP}

Hopefully this brings the "how to build aicasm with the right toolchain"
saga to a conclusion that works in all usage scenarios that have
historically been supported.


# e01d128a 08-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Subsume the functionality of MK_ATF into MK_TESTS.

There is no reason to keep the two knobs separate: if tests are
enabled, the ATF libraries are required; and if tests are disabled,
the ATF libraries are not necessary. Keeping the two just serves
to complicate the build.

Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)


# ee695f67 08-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Add libatf-c++ to the prebuild libs.

Some tests may require C++ so we must ensure this library exists as part
of the bootstrap process or else they will fail to build. Do this by
just depending on lib/atf as part of the bootstrap libraries instead of
using lib/atf/libatf-c.

Submitted by: Garrett Cooper <yaneurabeya at gmail dot com>
Approved by: rpaulo (mentor)


# 57028ca4 08-Nov-2013 Julio Merino <jmmv@FreeBSD.org>

Fix buildworld when WITH_TESTS is enabled.

The addition of the TESTS knob and its enabling of the build of tests in
lib/libcrypt/tests/ broke the build. The reason is that we cannot descend
into tests/ subdirectories until all prerequisites have been built, which
in the case of tests may be "a lot of things" (libatf-c in this case).

Ensure that we do not walk tests/ directories during the bootstrapping of
the libraries as part of buildworld.

Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)


# 6abd71b0 07-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Build kernel tools along with other tools during world build, as well as
during kernel build (if they didn't get done with world). This will make
-DMODULES_WITH_WORLD work, and it ensures the kernel tools are built
as part of 'make kernel-toolchain'.


# ed39dd91 07-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Instead of modeling the kernel-tools build after the bootstrap tools, build
kernel tools the way cross-tools get built. This seems to result in the
tool getting installed in the right place. It also seems more correct in
retrospect, because if a tool emitted code or binary data as part of
building the kernel, it should do so in target-specific ways (endianess,
architecture, whatever). That issue is moot for aicasm, our only current
tool, but it still seems to be more correct in principle.


# f382c38e 06-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Do not build aicasm with the cross-tools/kernel-toolchain, instead add a
proper kernel-tools step/target modeled after the world build-tools stuff.

This is a re-do of r257730 which was backed out in r257734, but this time
it's one byte smaller... a leftover trailing backslash resulted in a .for
loop with no rules, so no compiler stuff got built and later steps built
with the wrong toolset.


# 74832336 05-Nov-2013 Glen Barber <gjb@FreeBSD.org>

Revert r257730:
Make head/ buildable again, instead of spewing garbage like:
/src/gnu/lib/csu/../../../contrib/gcc/config/rs6000/crtsavres.asm:280:
Error: no such instruction: `lwz 28,-16(11)'


# 5da6cd47 05-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Do not build aicasm with the cross-tools/kernel-toolchain, instead add a
proper kernel-tools step/target modeled after the world build-tools stuff.


# f827d58e 04-Nov-2013 Ian Lepore <ian@FreeBSD.org>

Rework the aicasm build machinery so that it gets built along with toolchain
components instead of with the kernel and/or modules. This ensures that it
gets built with the host compiler, not the compiler in obj/... used to build
the target components (which may be a cross-compiler outputting code for a
different architecture and using header files with types and options set up
for the wrong architecture).

Reviewed by: imp


# 8b78b15b 29-Oct-2013 Xin LI <delphij@FreeBSD.org>

In r257079, SRCDIR is pointed to ${.CURDIR} when not set. However,
Makefile.inc1 is being called in sub-make's where make(1) would,
by default, implicitly chdir(2) to ${.OBJDIR} before executing any
targets. This would make some targets, like delete-old, when trying
to derive various variables introduced by change r256921 using
``make -f Makefile.inc1'' that also rely on SRCDIR to fail.

This changeset adds an explicit cd ${.CURDIR} before these unwrapped
make calls, making them in line with the other ones that are already
being wrapped with the explicit chdir's.

Tested by: gjb
MFC after: 5 days


# 3d2fb95a 28-Oct-2013 Yoshihiro Takahashi <nyan@FreeBSD.org>

Fix build. Both clang and gcc are required on pc98.

X-MFC with: r256915


# e2197f80 24-Oct-2013 Rui Paulo <rpaulo@FreeBSD.org>

Set up the /usr/tests hierarchy.

Populate /usr/tests with the only test programs that currently live
in the tree (those in lib/libcrypt/tests/) and add all the build
machinery to accompany this change.

In particular:

- Add a WITHOUT_TESTS variable that users can define to request that
no tests be put in /usr/tests.
- Add a top-level Kyuafile for /usr/tests and a way to create similar
Kyuafiles in top-level subdirectories.
- Add a BSD.tests.dist file to define the directory layout of
/usr/tests.

Submitted by: Julio Merino jmmv google.com
Reviewed by: sjg
MFC after: 2 weeks


# 57bd24ce 24-Oct-2013 Glen Barber <gjb@FreeBSD.org>

Fix build host pollution by avoiding calling 'uname -srp' to
determine values for 'VERSION'.

Looked at by: cperciva


# 44c38c2c 24-Oct-2013 Glen Barber <gjb@FreeBSD.org>

Revert r256921 to prevent error output when in the wrong directory.
This should have been reverted with the stable/10/Makefile.inc1
revert, but apparently my commit did not go through.

Discussed with: cperciva (originally)


# a0c65623 22-Oct-2013 Colin Percival <cperciva@FreeBSD.org>

Thou shalt not leak build host state into the system being compiled.

The VERSION variable is encoded into the SUNW_ctf sections of the kernel
and every kernel module when dtrace is enabled; starting with 9.2-RELEASE
(when dtrace was turned on in GENERIC) this means that different host kernels
will result in very different kernel binaries being generated. This tripped
up freebsd-update builds after the build boxes were updated from 9.x to 10.x.

MFC after: 3 days (stable/9)
X-MFC after: 0 days (stable/10)
Security: Rendered two members of so@ temporarily insane


# f936a2e5 22-Oct-2013 Brooks Davis <brooks@FreeBSD.org>

Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC. This allows
bootstrapping a copy of clang without building clang for the base system
which is useful for nanobsd and similar setups. It's still probably
wrong to conflate what is installed as /usr/bin/cc with the selection
of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another
day.

MFC after: 1 week
Sponsored by: DARPA/AFRL


# e45e2255 21-Oct-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make delete-old-libs' and 'make check-libs' to delete .debug
files created by WITH_DEBUG_FILES. Also cleanup .symbols files from
the period between r244236 when .symbols were supported and r251512
when they were renamed to .debug.

Only propose to delete a .debug file if the corresponding library
itself was deleted already.

Reported by: des
Reviewed by: emaste (earlier version)
Approved by: bapt
MFC after: 3 days


# 923cfb89 16-Oct-2013 Ian Lepore <ian@FreeBSD.org>

Allow 'make xdev' to work when DESTDIR is set.

Submitted by: Patrick Kelsey <kelsey@ieee.org>


# c60c0372 10-Oct-2013 Dimitry Andric <dim@FreeBSD.org>

Bump OS versions in the toolchain triples to 11.0, and bump the
__FreeBSD_cc_version predefined macros in clang and gcc.

Approved by: re (gjb)


# 5bab7367 01-Oct-2013 Xin LI <delphij@FreeBSD.org>

Revert-and-redo r255955: the sort -r should be added to delete-old-dirs.

Approved by: re (gjb)


# 5cf4a427 30-Sep-2013 Xin LI <delphij@FreeBSD.org>

Reverse directories order when doing 'make delete-old-dir'. This
ensures subdirectories gets removed before their parents when doing
make delete-old.

Approved by: re (gjb)
MFC after: 2 weeks


# 56b72efe 30-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove BIND.

Approved by: re (gjb)


# 865f7779 24-Sep-2013 John Baldwin <jhb@FreeBSD.org>

Don't parse NO_ROOT metadata for extra kernels if NO_ROOT isn't defined.

Approved by: re (gjb)
MFC after: 1 week


# e8192c89 22-Sep-2013 Andrew Turner <andrew@FreeBSD.org>

Remove the armv6eb architecture as it is unused, and almost certainly
broken. None of our kernels can boot armv6eb. The little-endian kernels do
not have the required code to be able to switch endian when running a
big-endian executable.

Approved by: re (gjb)


# 31caf4c8 17-Sep-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix 'make installcheck' to check for missing UID/GID as well, broken
since r249893, by adding a separate _installcheck_world and
_installcheck_kernel so the destination targets can be more explicit
on which they are needed for.

installcheck will call both, while installworld only calls
_installcheck_world and installkernel only calls _installcheck_kernel

While here, mark the internal targets as starting with _.

Reported by: des
Reviewed by: des
Pointyhat to: bdrewery
Approved by: re (delphij)


# 91270ec5 16-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Add unbound to the list of UIDs / GIDs to check fore before installing.

Approved by: re (blanket)


# 9cfa8b3f 10-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Clean up the OpenSSH build. It is now possible to build most components
as static binaries, if desired. The one exception is sshd, which runs
into trouble due to libpam.a's includion of pam_ssh.

Make OpenSSH use LDNS if available. This allows it to verify signed
SSHFP records.

Approved by: re (blanket)


# 2442cc58 08-Sep-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Create a private library directory (LIBPRIVATEDIR) for libraries which
we don't want to expose but which can't or shouldn't be static.

To mark a library as private, define PRIVATELIB in its Makefile. It
will be installed in LIBPRIVATEDIR, which is normally /usr/lib/private
(or /usr/lib32/private for 32-bit libraries on 64-bit platforms).

To indicate that a program or library depends on a private library,
define USEPRIVATELIB in its Makefile. The correct version of
LIBPRIVATEDIR will be added to its run-time library search path.

Approved by: re (blanket)


# 06362369 29-Aug-2013 Bryan Drewery <bdrewery@FreeBSD.org>

- Fix LOCAL_MTREE so it properly handles multiple files and quotes
its value into submakes

PR: conf/179466
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
Approved by: bapt
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 2d0bcb76 23-Jul-2013 Ed Maste <emaste@FreeBSD.org>

Generate debug data release dist sets

If WITH_DEBUG_FILES is set the standalone debug data will be excluded
from each ${dist}.txz and placed in a ${dist}.debug.txz.

Submitted by: gjb
Reviewed by: brooks


# bb6d7d0e 05-Jul-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Sprinkle some .MAKE magic


# 03630b54 30-Jun-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Use && rather than ; when success of previous job matters.


# c872793d 14-Jun-2013 Brooks Davis <brooks@FreeBSD.org>

Simplify the hierarchy target's logic. [0]

Run hierarchy with WORLDTMP in the path so it works when it is invoked
directly. Such use is nearly alwasy wrong but appears to be common.[1]

PR: conf/178209 [0], conf/178547 [1]
Submitted by: Garrett Cooper <yaneurabeya@gmail.com> [0]
MFC after: 5 days


# d3187057 14-Jun-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Flag recursive make targets with .MAKE
so that job token pipe is passed to them.
To avoid surprising anyone, only add .MAKE to ${TGTS} when -n
has not been specified (at least for Makefile).

Reviewed by: obrien


# aa5084e4 13-Jun-2013 Brooks Davis <brooks@FreeBSD.org>

Be more agressive about bootstrapping ctfmerge and ctfconvert so
builds from existing releases have a chance of working properly.

Sponsored by: DARPA, AFRL
MFC after: 3 days


# 42f8c5b5 07-Jun-2013 Ed Maste <emaste@FreeBSD.org>

Add a new knob WITH_DEBUG_FILES to control the building of standalone
debug files for userland programs and libraries. The "-g" debug flag
is automatically applied when WITH_DEBUG_FILES is set.

The debug files are now named ${prog}.debug and ${shlib}.debug for
consistency with other systems and documentation. In addition they are
installed under /usr/lib/debug, to simplify the process of installing
them if needed after a crash. Users of bsd.{prog,lib}.mk outside of the
base system place the standalone debug files in a .debug subdirectory.
GDB automatically searches both of these directories for standalone
debug files.

Thanks to everyone who contributed changes, review, and testing during
development.


# b9bcca07 05-Jun-2013 Jilles Tjoelker <jilles@FreeBSD.org>

release: Allow empty extra distributions.

For example, WITHOUT_SHAREDOCS= in src.conf creates an empty doc
distribution.

Submitted by: Kurt Lidl
Tested by: Kurt Lidl
Discussed with: gjb
MFC after: 1 week


# 62eec430 04-Jun-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Remove external/bsd (not in this branch yet).


# 80ba5ec8 30-May-2013 Brooks Davis <brooks@FreeBSD.org>

Restore (at least temporarily) SHARED=symlinks in the build includes
stage of buildworld. This was accidentally included in r251140.

Reported by: jhb


# 6c461479 30-May-2013 Brooks Davis <brooks@FreeBSD.org>

Always define INSTALL_DDIR and define it such that it contains no extra
/ characters rather than removing them later on. This should fix
release builds.

PR: conf/178963
Reviewed by: gjb, hrs


# 4e02fd95 28-May-2013 Glen Barber <gjb@FreeBSD.org>

r245757 introduced warning output if update method is set to CVS_UPDATE
or SUP_UPDATE.

CVS exporter for head/ is turned off for nearly one month now.

It is finally time to swing the ax at these update methods.

Reviewed by: eadler
MFC after: 1 month


# 527f7dc3 28-May-2013 Glen Barber <gjb@FreeBSD.org>

Update comments to reflect use of svn/svnup to keep the src/ tree up
to date.

MFC after: 3 days


# 25fbccdc 28-May-2013 Peter Wemm <peter@FreeBSD.org>

Temporarily revert r251058 - it breaks documented use of makeoptions
including the tinderbox.

http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-i386-i386.full
make: don't know how to make modules-all. Stop
make: stopped in /obj/i386.i386/src/sys/PAE
*** Error code 2


# 13b85cea 28-May-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

During buildkernel, print a banner before building modules.


# 6cf6aae2 26-May-2013 Eitan Adler <eadler@FreeBSD.org>

Remove backwards compat layer which was added in r71419 (in 2001).

This change is not intended for MFC.

Reviewed by: peter


# 936d0074 24-May-2013 Marcel Moolenaar <marcel@FreeBSD.org>

Fix building on slightly older -current and stable systems after
the switch to bmake. The rescue bits are built via crunchgen,
which didn't respect the MAKE environment variable until r237574
(i.e. ~11 months ago). This resulted in a failure due to bmake's
internal -J flag being passed around and not being understood by
the standard (i.e. host's) make.
Note that the failure is conditional upon having the jobServer
feature enabled within bmake.


# ab76bc97 21-May-2013 Jung-uk Kim <jkim@FreeBSD.org>

Connect flex 2.5.37 to the build and bump __FreeBSD_version.


# 96cd1f74 21-May-2013 Brooks Davis <brooks@FreeBSD.org>

Restore the ability to build on systems with 32-bit compat when
the system compiler is not clang. clang and gcc appear to differ
signficantly in their interpretation of -isystem and --sysroot. Further
work is likely required to support an external gcc.

Reported by: andreast, fidaj@ukr.net, sergey.dyatko@gmail.com


# 54cf6141 20-May-2013 Brooks Davis <brooks@FreeBSD.org>

Fix distributekernel in the non NO_ROOT case.

PR: conf/178775
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>


# 39da820b 16-May-2013 Brooks Davis <brooks@FreeBSD.org>

Implement NO_ROOT support for distributekernel and packagekernel.


# a09aff83 15-May-2013 Brooks Davis <brooks@FreeBSD.org>

Add support for an external cross compiler. The cross compiler is
specified by passing the XCC, XCXX, and XCPP variables (corresponding to
CC, CXX, and CPP) to buildworld/buildkernel. The compiler must be clang
or be configured to target the appropriate architecture.

To speed build times, if XCC is an absolute path or
WITHOUT_CROSS_COMPILER is defined then no cross compiler will be built
during the cross-tools stage.

Limited documentation of this feature can currently be found at:

https://wiki.freebsd.org/ExternalToolchain

This functionality should be considered experimental and is subject to
change without notice.

Sponsored by: DARPA, AFRL
Discussed with: imp, sjg


# 6b5b16be 11-May-2013 Antoine Brodin <antoine@FreeBSD.org>

Add compile_et to kerberos bootstrap tools.
This makes it possible to build a regular world on a host without kerberos.

PR: conf/178421
Submitted by: Garrett Cooper
MFC after: 1 month


# f26a777c 01-May-2013 Benno Rice <benno@FreeBSD.org>

Optimize SUBDIR_OVERRIDE such that SUBDIR isn't automatically defined if
SUBDIR_OVERRIDE is defined.

PR: conf/174071
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
Sponsored by: EMC / Isilon Storage Division


# ec6bcfa1 29-Apr-2013 Eitan Adler <eadler@FreeBSD.org>

A transition period of more than two years is more than enough:
Remove the compatibility code added in 2011-02-10.

This change is not intended for MFC

Reviewed by: imp


# 55d1493a 24-Apr-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix installworld with DB_FROM_SRC after r249807

Approved by: bapt
Reported by: Tom Everett


# 61f75c49 23-Apr-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix installkernel requiring users/groups defined in CHECK_UIDS
and CHECK_GIDS to exist since r152680. This is only needed for
installworld. The documented procedure of running mergemaster -p
to check for missing users is only needed for installworld, not
for installkernel. This fixes auditdistd incorrectly being
required for installkernel.

PR: misc/174405
Approved by: bapt


# b18ddb2a 20-Apr-2013 Mikolaj Golub <trociny@FreeBSD.org>

This should have been committed in r249666.

MFC after: 1 month


# 862c0d36 31-Mar-2013 Andrew Turner <andrew@FreeBSD.org>

Fix xdev-install when installing to a location other than /


# 45fab5d8 31-Mar-2013 Andrew Turner <andrew@FreeBSD.org>

Fix xdev. Clang and libc were not building correctly on older worlds, for
example, on 9.1.
* To fix clang add an _xb-bootstrap-tools target that mirrors the existing
bootstrap-tools target in the full world.
* For libc have the compiler use the newly installed includes, and, while
here, tell the compiler about the xdev library path as some other
libraries will link against the installed libraries.


# 829e39ff 27-Mar-2013 Rene Ladan <rene@FreeBSD.org>

Fix a typo, 'xdev-build' should be spelled with a 'd' at the end.

Approved by: cognet


# ac66f4a9 05-Mar-2013 Xin LI <delphij@FreeBSD.org>

libzfs_core depends on libnvpair, explicitly say this in Makefile.inc1.

This fixes build with make -j.


# 776a9ddc 25-Feb-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

In all situations where we need to bootstrap yacc, we also need to
bootstrap liby. This was not readily apparent, because a normal 'make
buildworld' or 'make toolchain' builds liby before building anything
that uses yacc. However, 'make kernel-toolchain' does not build
headers or libraries, so it was not possible to build a kernel from
head on, say, stable/9 without first building the complete toolchain.

MFC after: 1 week


# 0af99eef 14-Feb-2013 Hiroki Sato <hrs@FreeBSD.org>

- Fix libmd dependency. It is needed in the bootstrap library list because
usr.bin/xinstall depends on it.
- Remove libutil from usr.bin/xinstall/Makefile. No symbol was actually used.

Reviewed by: brooks


# 3e381257 09-Feb-2013 Brooks Davis <brooks@FreeBSD.org>

Add nmtree to ITOOLS if it is installed on the host instead of keying off
the BOOTSTRAPPING variable. The previous test was wrong because
BOOTSTRAPPING is 0 in most cases.

Tested by: db


# 1dc56acd 04-Feb-2013 Andrew Turner <andrew@FreeBSD.org>

Fix xdev by using the install shell script as it knows about the -l
argument thile the local version install may not.


# de17cbcc 03-Feb-2013 Hiroki Sato <hrs@FreeBSD.org>

- Add CHECKSUM.* support in Makefile[1].
- Use ln -fs to create a symlink.
- Remove pkgadd for docports.
- Use WITHOUT_JADETEX=yes instead of WITH_JADETEX=no.
- Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.
- Use makefs(8) and gpart(8) for sparc64 ISO image[2].
- Add publisher option to makefs(8)[2].

Based on work by: gjb[1]
Discussed with: marius, nwhitehorn[2]


# 64dc091f 29-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Log the addition of login.conf.db, passwd, pwd.db, and spwd.db via cat -l.

Make cat a bootstrap tool to facilitate this.


# beb7ecad 29-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Fix installworld when nmtree is not on the host by only adding it to
ITOOLS when we will be using the host copy.

Fix installkernel when -DNO_ROOT is set.


# 1113cd31 29-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Fix installworld when the host does not need to bootstrap nmtree.

Reported by: lev, jmg


# 6784ea85 25-Jan-2013 Glen Barber <gjb@FreeBSD.org>

Fix update method (s/SUP/CVS) warning.

Submitted by: Ryan Stone
MFC after: 1 day


# 40f0cb19 24-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Strip any trailing slash off of the -D argument to install to support the
rather fragile destdir stripping in the metalog.


# 4a63ae11 22-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Introduce a new option -DNO_ROOT that allows install and distribution
targets to be run without root privilege.

Information about ownership, group, flags, and suid bits are stored in
the file specified by METALOG which defaults to ${DESTDIR}/METALOG.
This file can be used in conjunction with bsdtar or makefs to generate
archives or file system images with correct permissions.

The packageworld target has been altered to use this metadata allowing
non-root releases (subject to further changes in release/Makefile.)

Sponsored by: DARPA, AFRL
Reviewed by: ian, ray


# c3b739c7 22-Jan-2013 David Chisnall <theraven@FreeBSD.org>

Fix spurious leading / on dtc path in Makefile.inc1. Spotted by jhb.


# af0dd31f 22-Jan-2013 David Chisnall <theraven@FreeBSD.org>

Import new (BSDL) device tree compiler. Now built by default, so that it can't
be used on the host system (and not installed on the device, if required). The
GPL'd one is still available if there are any devices that need it (make
universe passes with it, including kernels that use fdt, but there may be some
out-of-tree ones). WITH_GPL_DTC can be used to select the old one, for now.

Probably won't be MFC'd, but we'll remove the GPL'd version in head after the
new one has had a lot more testing and ship it in 10.0.


# 6a473a7d 21-Jan-2013 Glen Barber <gjb@FreeBSD.org>

Chase r245756 of make.conf(5):

- If update method is SUP_UPDATE or CVS, warn that those
update methods are deprecated.

- While here, remove bogus NO_WWWUPDATE.

MFC after: 3 days
X-MFC-with: r245756


# 706b1b65 21-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Always bootstrap nmtree if it is not available on the host. It is fairly
small and it is quite annoying to get all the way through buildworld
only to discover that you forgot the DB_FROM_SRC (or soon NO_ROOT)
option.


# 00f793f8 18-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Remove a harmless (somewhat to my surprise) bogon that crept into r245440.


# 75534bda 17-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Rework the mtree portion of etc/Makefile's distrib-dirs target to run
mtree in a shell loop so there is only one mtree commandline. Move the
implementation of LOCAL_MTREE into etc/Makefile.

Sponsored by: DARPA, AFRL
Reviewed by: mtree :)


# c109162f 17-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Correct the distrib-dirs target in the -DDB_FROM_SRC case.


# afd9b463 17-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Add a new LIBRARIES_ONLY make variable to disable the build and install
of files other than the actual libraries.

Use LIBRARIES_ONLY to supress the inclusion of files in the lib32
distribution that are duplicates of files in base.

Sponsored by: DARPA, AFRL
Reviewed by: emaste


# 41a8e223 14-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Add an option DB_FROM_SRC to use src/etc's user/group databases when
installing. This allows things like running installworld for 10-CURRENT
on a 9.0-RELEASE system without adding extra users and groups to the
passwd and group files.

To prevent potentially risky uid/gid mismatches on systems with
non-standard local values, require that DESTDIR be set if DB_FROM_SRC is
set.

Sponsored by: DARPA, AFRL
Reviewed by: peter


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

Revert r245316. Systems with non-standard uids/gids are more prevalent
that I'd feared. Discussion is ongoing about the scope of a safer
solution.


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

Use the -N option to install and nmtree to eliminate the need for the
checks for missing users and groups.

Sponsored by: DARPA, AFRL


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

Use find -exec to install zoneinfo instead of requiring xargs to be an
install tool.

Suggested by: delphij


# 3da2132e 10-Jan-2013 Brooks Davis <brooks@FreeBSD.org>

Add xargs to the set of install tools when zoneinfo is not disabled.
This fixes installworld which I had broken in r245265.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>


# 248da532 02-Dec-2012 Peter Wemm <peter@FreeBSD.org>

Add auditdistd to the pre-install required uid check list.


# ddcc951f 30-Nov-2012 Simon J. Gerraty <sjg@FreeBSD.org>

The build-tools step during build32 also needs the -legacy magic.

Approved by: marcel (mentor)


# cff4243d 19-Nov-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Unbreak amd64 cross-build where amd64 is the target. While clang
may be installed as cc and we don't need to build gcc as a
cross-tools, we still build gcc and thus need cc_tools built
as a build tool. Not doing this results in building gengenrtl with
the target compiler while we need to run it on the build machine.


# 0c704c35 10-Nov-2012 Dimitry Andric <dim@FreeBSD.org>

Work around pc98 tinderbox failures in sys/boot/pc98, by making sure a
cross gcc gets built during the cross-tools stage.

MFC after: 1 week
X-MFC-With: 242706


# c175365c 21-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Add ATF to the build. This is may be a bit rought around the egdes,
but committing it helps to get everyone on the same page and makes
sure we make progress.

Tinderbox breakages that are the result of this commit are entirely
the committer's fault -- in other words: buildworld testing on amd64
only.

Credits follow:

Submitted by: Garrett Cooper <yanegomi@gmail.com>
Sponsored by: Isilon Systems
Based on work by: keramida@
Thanks to: gnn@, mdf@, mlaier@, sjg@
Special thanks to: keramida@


# 29f5a35c 17-Oct-2012 Brooks Davis <brooks@FreeBSD.org>

Allow LOCAL_(DIRS,LIBS) to install files in directories not found in the
system mtree files via a LOCAL_MTREE variable which contains a list of
mtree files to be applyed along with the base mtree files to the tmp root
and DESTDIR.


# aae8db90 07-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Fix the showconfig target. bmake sends debug output to stderr.

Submitted by: Simon Garrety <sjg@juniper.net>


# 8d6871f4 07-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Fix 32-bit library builds after the removal of adding -E to make for AS,
CC, CXX and LD. This fix implements the intended as it should have been
implemented all along: by passing AS, CC, CXX and LD on the commandline
of the sub-make instead of in the environment of the sub-make.

Breakage pointed-out by: dim@


# 0815243c 06-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Add support for bmake. This includes:
1. Don't do upgrade_checks when using bmake. As long as we have WITH_BMAKE,
there's a bootstrap complication in ths respect. Avoid it. Make the
necessary changes to have upgrade_checks work wth bmake anyway.
2. Remove the use of -E. It's not needed in our build because we use ?= for
the respective variables, which means that we'll take the environment
value (if any) anyway.
3. Properly declare phony targets as phony as bmake is a lot smarter (and
thus agressive) about build avoidance.
4. Make sure CLEANFILES is complete and use it on .NOPATH. bmake is a lot
smarter about build avoidance and should not find files we generate in
the source tree. We should not have files in the repository we want to
generate, but this is an easier way to cross this hurdle.
5. Have behavior under bmake the same as it is under make with respect to
halting when sub-commands fail. Add "set -e" to compound commands so
that bmake is informed when sub-commands fail.
6. Make sure crunchgen uses the same make as the rest of the build. This
is important when the make utility isn't called make (but bmake for
example).
7. While here, add support for using MAKEOBJDIR to set the object tree
location. It's the second alternative bmake looks for when determining
the actual object directory (= .OBJDIR).

Submitted by: Simon Gerraty <sjg@juniper.net>
Submitted by: John Van Horne <jvanhorne@juniper.net>


# 9215d178 13-Sep-2012 Brooks Davis <brooks@FreeBSD.org>

Introduce a new make variable COMPILER_TYPE that specifies what
type of compiler is being used (currently clang or gcc). COMPILER_TYPE
is set in the new bsd.compiler.mk file based on the value of the CC
variable or, should it prove informative, by running ${CC} --version
and examining the output.

To avoid negative performance impacts in the default case and correct
value for COMPILER_TYPE type is determined and passed in the environment
of submake instances while building world.

Replace adhoc attempts at determining the compiler type by examining
CC or MK_CLANG_IS_CC with checks of COMPILER_TYPE. This eliminates
bootstrapping complications when first setting WITH_CLANG_IS_CC.

Sponsored by: DARPA, AFRL
Reviewed by: Yamaya Takashi <yamayan@kbh.biglobe.ne.jp>, imp, linimon
(with some modifications post review)
MFC after: 2 weeks


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

Not all Pmake derivatives silently handle empty shell output, so ensure there
is something for make(1) to consume. Bmake gives output such as:
"warning: Couldn't read shell's output for "/bin/sh -c true"
Note we parted from traditional Pmake behavior in r18864 / r18255.


# 10d2255f 03-Sep-2012 Glen Barber <gjb@FreeBSD.org>

Fix 'distributeworld' target when WITHOUT_GAMES is set.

Reviewed by: des
Approved by: des
MFC after: 3 days
X-MFC-To: 9-only


# 7750ad47 22-Aug-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Sync FreeBSD's bmake branch with Juniper's internal bmake branch.

Requested by: Simon Gerraty <sjg@juniper.net>


# 4da573d9 14-Aug-2012 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Merging of projects/armv6, part 3

r238211:
Support TARGET_ARCH=armv6 and TARGET_ARCH=armv6eb

This adds a new TARGET_ARCH for building on ARM
processors that support the ARMv6K multiprocessor
extensions. In particular, these processors have
better support for TLS and mutex operations.

This mostly touches a lot of Makefiles to extend
existing patterns for inferring CPUARCH from ARCH.
It also configures:
* GCC to default to arm1176jz-s
* GCC to predefine __FreeBSD_ARCH_armv6__
* gas to default to ARM_ARCH_V6K
* uname -p to return 'armv6'
* make so that MACHINE_ARCH defaults to 'armv6'
It also changes a number of headers to use
the compiler __ARM_ARCH_XXX__ macros to configure
processor-specific support routines.

Submitted by: Tim Kientzle <kientzle@freebsd.org>


# e324b4bc 03-Jul-2012 David E. O'Brien <obrien@FreeBSD.org>

Add "hier" as an alternate spelling of "hierarchy" to match hier(9).


# 5814131a 15-Jun-2012 Brooks Davis <brooks@FreeBSD.org>

Minor wording change. The previous commit message should have included:

Sponsored by: DARPA, AFRL


# 6e4ee6dd 15-Jun-2012 Brooks Davis <brooks@FreeBSD.org>

MFP4: 212854, 212854

Add a LOCAL_LIB_DIRS variable to complement the existing LOCAL_DIRS
and LOCAL_TOOL_DIRS variables. Directories in LOCAL_LIB_DIRS are
built at the end of the _generic_libs target.

Reviewed by: imp (212854)


# 883e0f87 03-Jun-2012 Dimitry Andric <dim@FreeBSD.org>

During buildworld and buildkernel, define EARLY_BUILD in the earlier
stages (build-tools, cross-tools, etc) of the build, so we can detect in
bsd.*.mk whether to pass compiler-specific flags to ${CC}.

In particular, this commit will allow using WITH_CLANG_IS_CC when the
base compiler is still gcc, and when ${CC}, ${CXX} and ${CPP} are left
at their defaults. The early stages will then be built using gcc, and
no clang-specific flags will be passed to it. The later stages will be
built as usual.

The EARLY_BUILD define can also serve other uses, such as building the
world stage C++ executables with libc++ instead of libstdc++: during the
early build stages, we cannot assume libc++ is already available, so we
must still build with libstdc++ at that time.

MFC after: 1 week


# 5bfe3851 22-May-2012 Dag-Erling Smørgrav <des@FreeBSD.org>

Bump __FreeBSD_version for the byacc import, and update _bootstrap_tools.


# 727d8c81 18-May-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Fix bootstrapping from FreeBSD 7.x: we also need to build ar.


# 9e460a98 15-May-2012 Warner Losh <imp@FreeBSD.org>

By request, add back support from 7.0 and newer, since the changes for
that are so minimal.


# 0446f881 10-May-2012 Warner Losh <imp@FreeBSD.org>

Do a bit of house cleaning and remove the old, obsolete upgrade from
6.0 support and bump the minimum version to 8.0. These versions have
not been tested and are believed to be broken.


# 51a65f35 07-May-2012 Jeremie Le Hen <jlh@FreeBSD.org>

Introduce the ${SHLIB_LDSCRIPT} variable to have an ld(1) script
instead of a symlink for .so files.

Reviewed by: kib, kan (previous version), dim
Approved by: kib (mentor)
Silence from: -hackers@
MFC after: 1 week


# ae8662c7 26-Apr-2012 Warner Losh <imp@FreeBSD.org>

Fix ordering issue. 'make xdev' can fail with -jN because it tries to run the
xdev-install step while xdev-build is still running.

Submitted by: Ian Lepore


# f8e8c8fa 28-Mar-2012 Juli Mallett <jmallett@FreeBSD.org>

o) Fix mips/mips -> mips for Makefile.inc1.
o) Rebuild src.conf.5.


# 84db023e 28-Mar-2012 Juli Mallett <jmallett@FreeBSD.org>

Assume a big-endian default on MIPS and drop the "eb" suffix from MACHINE_ARCH.
This makes our naming scheme more closely match other systems and the
expectations of much third-party software. MIPS builds which are little-endian
should require and exhibit no changes. Big-endian TARGET_ARCHes must be
changed:
From: To:
mipseb mips
mipsn32eb mipsn32
mips64eb mips64

An entry has been added to UPDATING and some foot-shooting protection (complete
with warnings which should become errors in the near future) to the top-level
base system Makefile.


# 634f9253 23-Mar-2012 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Build CTF tools as a part of toolchain for cross-compilation case


# 0e46933c 22-Mar-2012 Stanislav Sedov <stas@FreeBSD.org>

- Do not build libcom_err and compile_et when kerberos is disabled. They
depends on several heimdal libraries and not used by anything but kerberos
tools.


# 15d321c5 17-Mar-2012 Peter Wemm <peter@FreeBSD.org>

Make sure libgcc_s is finished building in _startup_libs before
building libcxxrt with high -j levels. The workaround in
libc++/Makefile isn't necessary once that race is solved.

Reviewed by: theravin


# 5e07d031 04-Mar-2012 Dimitry Andric <dim@FreeBSD.org>

Fix a thinko in r232322, where gcc (and its tools) are not built during
the cross-tools stage, if CC=clang and WITH_CLANG_IS_CC is not set.

This causes no 'cc' to be installed in the temporary cross-tools tree,
making lint fall over later in the build, because it ignores ${CC} and
attempts to run 'cc' anyway.

To fix this, only skip building gcc during cross-tools, if WITHOUT_GCC
is set, or if WITH_CLANG_IS_CC is set.

Pointy hat to: dim
MFC after: 2 weeks


# dfbaea83 29-Feb-2012 Dimitry Andric <dim@FreeBSD.org>

Add a WITH_CLANG_IS_CC option for src.conf(5), disabled by default, that
installs clang as /usr/bin/cc, /usr/bin/c++ and /usr/bin/cpp.

Note this does *not* disable building and installing gcc, which will
still be available as /usr/bin/gcc, /usr/bin/g++ and /usr/bin/gcpp. If
you want to disable gcc completely, you must use WITHOUT_GCC.

MFC after: 2 weeks


# 5db254ad 30-Jan-2012 Warner Losh <imp@FreeBSD.org>

Allow specification of build shell for the buildenv target.

Submitted by: ian lepore


# 7fa955cd 27-Jan-2012 Dimitry Andric <dim@FreeBSD.org>

When the buildkernel stage 2.3 (build tools) runs, the PATH is still set
to the default from the top-level Makefile. Therefore, invocations of
lex and yacc (used during building of aicasm) will use the executables
in /usr/bin, not those optionally built during the previous buildworld
or kernel-toolchain. This makes kernel builds from older FreeBSD
releases more difficult than necessary.

Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the
bootstrap tools directories are searched before the regular ones.

Silence from: svn-src-{all,head}
MFC after: 1 week


# d6ba7d93 15-Jan-2012 Gleb Smirnoff <glebius@FreeBSD.org>

Restore functionality to pack several kernels into release. All
kernels specified by KERNCONF are built and packed into release.
The first one is packed into kernel.txz, all others to
kernel.CONFIG.txz.

The first one is installed on bootables in /boot.


# 0d9f40f2 05-Jan-2012 Adrian Chadd <adrian@FreeBSD.org>

Fix the broken non-cross compile build. Oops!

Another pointy hat to: adrian, for stirring up more trouble.


# 9b428cfa 05-Jan-2012 Adrian Chadd <adrian@FreeBSD.org>

Allow extra directories to be added to the build-tools target.

Things such as "sh" require local tools to be built before
cross-compiling. This allows for extra software (that's
built via LOCAL_DIRS) to also have a build-tools target where
required.


# 411246d3 22-Dec-2011 Dimitry Andric <dim@FreeBSD.org>

Remove -mfancy-math from LIB32CPUFLAGS for amd64. It has been default
for our gcc since more than three years (see r181534, which is also in
stable/9 and stable/8). This flag used to be for the benefit of the old
in-kernel math emulator, which was removed more than eight years ago.

Pointed out by: arundel
MFC after: 1 week


# 83cb5bae 30-Nov-2011 Max Khon <fjoe@FreeBSD.org>

- CTF knob is now implemented using common scheme: MK_CTF=yes/no is
defined based on WITH/WITHOUT_CTF settings, default is WITHOUT_CTF,
NO_CTF overrides WITH_CTF (used by Makefile.inc1)
- CTFCONVERT_CMD/NORMAL_CTFCONVERT are now defined to empty string
if make(1) can handle empty commands


# d0ed1ea4 29-Nov-2011 Max Khon <fjoe@FreeBSD.org>

Turn off profiled libs build by default.
Can be enabled back using WITH_PROFILE=yes in /etc/src.conf


# 49c8e5e7 25-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Fix breakage after r227983; lib/libcxxrt still got built, because it was
not disabled in the usual way (by adding it to __DEFAULT_NO_OPTIONS in
share/mk/bsd.own.mk), and because the test for MK_LIBCPLUSPLUS in
Makefile.inc1 was incorrect.

Pointy hat to: dim


# bb61ba08 25-Nov-2011 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Provide proper error message when trying to build xdev, xdev-build or
xdev-install targets without either XDEV or XDEV_ARCH defined.


# dcf83bf7 24-Nov-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Revert r227841 and part of r227798. We still build libpam in two passes,
but we use STATIC_CFLAGS instead of our own private .c.o rule.

MFC after: 3 weeks


# 8e2a5aa1 22-Nov-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove libpam from _prebuild_libs. This should unbreak the -jX build.

MFC after: 3 weeks


# e03e3b69 21-Nov-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Simplify the libpam build by removing the shared modules' dependency
on the shared library. The modules are loaded by the library, so we
know it'll be there when we need it.

MFC after: 3 weeks


# 6bac4c3e 19-Nov-2011 Andreas Tobler <andreast@FreeBSD.org>

Rename the linker emulation name for powerpc and powerc64. This is needed that
we can also use the upstream binutils linker where we have to have a unique
name for the FreeBSD emulation.


# 907eed1f 10-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Revert r227403 for now. Since the cross-tools stage purposefully
doesn't have ${WORLDTMP}/usr/bin in its PATH, if you build world with
CC=clang, tblgen tools from /usr/bin will be used instead of the ones
built under ${WORLDTMP}. This can lead to various errors, especially if
you upgrade from an older clang.

Note that building world with gcc would not experience these problems,
because it only uses the tblgen tools in the world stage, where PATH
does contain ${WORLDTMP}/usr/bin.

Pointy hat to: dim


# 338f97fe 09-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Move building of clang's tblgen tools (and required libraries) from the
bootstrap-tools stage to the cross-tools stage. These tools are only
needed for generating llvm/clang include files, and are not necessary
for bootstrapping the build itself.

This shaves off some build time, because the required libraries are now
just built twice (during the cross-tools and world stages), instead of
three times.

Also, if you build world using WITHOUT_CLANG= in src.conf(5), no llvm or
clang code will be compiled at all anymore.

MFC after: 1 week


# 8dcbd431 05-Nov-2011 Dimitry Andric <dim@FreeBSD.org>

Make it possible to set CC and CXX (and optionally, AS and LD) in
make.conf(5), while allowing the build32 stage on 64-bit architectures
to still override them, so that stage can successfully build 32-bit
compatibility libraries.

Explanation:
1) The build32 stage sets environment variables CC, CXX, AS and LD for
its sub-make, to add 32-bit specific flags (-m32 and such).
2) The sub-make reads sys.mk, encounters CC?= and CXX?= assignments, so
does not alter them.
3) After some other stuff, sys.mk reads /etc/make.conf. When you have
"CC=xxx" and "CXX=yyy" statements in there, they will *override* the
build32-supplied CC/CXX values, nullifying the 32-bit specific flags.
4) Thus all objects get built as 64-bit anyway, and since LD is usually
not set in make.conf, it still has the 32-bit flags!
5) Now, whenever something is linked, you will get a "ld: Relocatable
linking with relocations from format elf64-x86-64-freebsd (foo.o) to
format elf32-i386-freebsd (bar.o) is not supported" error.

Fix this by adding "-ECC -ECXX -EAS -ELD" to the build32 sub-make
invocation, which forces those environment variables to always override
any assignment in makefiles. Thus making it possible to simply set:

CC=my-cc
CXX=my-c++

in your make.conf, or specify a path, even:

CC=/usr/local/bin/other-cc
CXX=/usr/local/bin/other-c++

Note this was never a problem on i386, since it has no build32 stage.

Silence from: current@
MFC after: 1 week


# 653eeb7f 26-Oct-2011 Ed Schouten <ed@FreeBSD.org>

Attempt to fix build logic for gensnmptree.

There are two problems with the existing logic. It builds gensnmptree
on <700018, even if WITHOUT_BSNMP is set, but more importantly, we must
not forget to build gensnmptree on systems that have originally been
built without. This causes a buildworld on those systems to fail.

MFC after: 1 week


# e59e2d8e 03-Oct-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Farewall, sysinstall! You served us well for many years, but 10.0 is one
digit beyond your time.

Various sysinstall dependencies (e.g. libftpio, libdisk, libodialog, etc.)
will be cleaned up in coming days. Some will take longer than others due to
a few other consumers (tzsetup and sade).


# 611ff617 27-Sep-2011 Stanislav Sedov <stas@FreeBSD.org>

- Add missing interdependencies to kerberos libraries. Some of the
kerberos libraries were not linked properly (missing dependencies),
which causes 3rd party applications linking to fail when --as-needed
ld flag is used. I also added the --no-undefined ld(1) flag to make
sure that there're no missing dependencies.

MFC after: 3 days


# 69c488cd 15-Jun-2011 Ruslan Ermilov <ru@FreeBSD.org>

It's a bit odd, but "make update" in src/ can also update the ports/,
doc/, and now www/ trees, but only using the "cvsup" transport.

When "make update" is run using a tree's makefile, it can also use
"cvs" (except for www/) and "svn" (only src/).

Clean up documentation and code regarding "make update":

- Increase oddness by adding support for WWWSUPFILE and NO_WWWUPDATE to
Makefile.inc1 (analogous to PORTSSUPFILE/NO_PORTSUPDATE and
DOCSUPFILE/NO_DOCUPDATE; WWWSUPFILE already supported by www/Makefile).

- Document all trees that support CVS_UPDATE.

- Document all trees that support SUP_UPDATE.

- Document SVN_UPDATE.

- Document NO_WWWUPDATE.

- make.conf(5) mistakenly said that *SUPFILE* had defaults.

- Add an example entry for WWWSUPFILE.


# 0163af23 18-May-2011 Warner Losh <imp@FreeBSD.org>

Implement WITH{,OUT}_{GCC,BINUTILS} to provide finer-grained control
over building gcc and binutils. They default to true, unless
MK_TOOLCHAIN is no.

Reviewed by: ru@


# 4b7e6116 18-May-2011 Warner Losh <imp@FreeBSD.org>

Clean up a loose end from the conversion from gnu ar/ranlib to the BSD
one. Without this, we don't have ar or randlib in the tool path,
leading to much pain for some users. This pain is exposed by the
external toolchain enhancements that I'm working on.

Submitted by: John Hein (ages ago, and dropped on the floor by me: sorry)


# 2eb4b00c 17-May-2011 Florent Thoumie <flz@FreeBSD.org>

Backout libinstall.a -> libpkg commit.

Discussed with: erwin, brooks, bapt


# 4b547324 13-May-2011 Attilio Rao <attilio@FreeBSD.org>

Disconnect sun4v architecture from the three.

Some files keep the SUN4V tags as a code reference, for the future,
if any rewamped sun4v support wants to be added again.

Reviewed by: marius
Tested by: sbruno
Approved by: re


# c79f2d97 11-May-2011 David E. O'Brien <obrien@FreeBSD.org>

+ DTrace as a bootstrap tool is only needed on certain older systems.
+ Be more consistent between BMAKE and TMAKE.
+ Add NO_CTF to crosstools as is done for bootstrap and build tools.

Reviewed by: marcel


# cb10fc9d 04-May-2011 David E. O'Brien <obrien@FreeBSD.org>

Correct the kernel config name printed out during install.

PR: 156579
Submitted by: dhw


# 3afb5177 22-Apr-2011 David E. O'Brien <obrien@FreeBSD.org>

Note which of the built kernels is being installed.

PR: 156579
Submitted by: dhw


# 6d67f694 17-Apr-2011 Dimitry Andric <dim@FreeBSD.org>

Remove libobjc and other Objective-C related components, as these are
extremely outdated, and not used by anything in the base system.

Silence from: current@


# b3eb927f 06-Apr-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Complete WITHOUT_CXX support. It implies WITHOUT_GROFF and
WITHOUT_CLANG.

Don't build clang bootstrap/build-tools depending on this flag. We also
keep gperf, devd and libstdc++ around to prevent foot-shooting and to
make this a two-way street.


# 1b595919 05-Apr-2011 Warner Losh <imp@FreeBSD.org>

Make clang default on x86 and powerpc, but not on other architectures.
Make fdt default on arm and powerpc.

This now includes cross compiled targets, where before we tried to
make it host-based.

Also, move the lists of default yes and no options to a variable.

In general, only build tools should get this treatment in bsd.own.mk.
Also, the use of TARGET* in the bsd.*mk files is discouraged, but
necessary here due to the ordering of things in buildworld. We make
the native case work by testing MACHINE_ARCH after TARGET_ARCH.


# 86be7546 01-Apr-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Fix the delete-old/check-old targets to work with arbitrarily long
OLD_FILES/OLD_DIRS/OLD_LIBS lists.

If you specify enough WITHOUT_FOO flags, the argument list passed to the
shell will be too long. Using .for/.endfor make(1) "loop" will make the
parser of the Makefile explode. Hack around this with good old pipes.

No objections: netchild
Reported by: b.f.


# aa0a1e58 21-Mar-2011 Jeff Roberson <jeff@FreeBSD.org>

- Merge in OFED 1.5.3 from projects/ofed/head


# 99ad39c8 02-Mar-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Improve the distributeworld target in Makefile.inc1 and update the release
infrastructure to use it. make distributeworld can now be used without
preparing its environment first and installs games into its distribution
using the regular make distribute logic instead of post-processing with
a script.

Also add two new targets, packageworld and packagekernel, that tar up the
results of distributeworld and distributekernel (also new), respectively.


# 9c216a50 01-Mar-2011 John Baldwin <jhb@FreeBSD.org>

Use a suitable DIRPRFX for each invocation of make in the build32 and
install32 targets so that the full path to each program or library is
displayed in the make output.

MFC after: 1 week


# 6be04ba6 27-Feb-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Commit two more files missed in r219089.

MFC after: 1 month


# ad30f8e7 24-Feb-2011 Gabor Kovesdan <gabor@FreeBSD.org>

Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.

This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:

- Some utilities have been added. There is a conversion table generator,
which can compare conversion tables to reference data generated by
GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
and cleaned up, now it is easy to read and it is also easier to add
support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
GNU version, i.e. sources should build with base iconv.h and
GNU libiconv. It also includes a macro magic to deal with the
char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
encoding in use
- Various cleanups and style(9) fixes.

Approved by: delphij (mentor)
Obtained from: The NetBSD Project
Sponsored by: Google Summer of Code 2009


# 423102c6 22-Feb-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Flesh out WITHOUT_GROFF support to DTRT.

A full featured groff is required during buildworld, so build it always
and don't rely on it being present on the host system.

vgrind(1) is tightly coupled to a roff processor and will not be
built/installed when groff is disabled. Also much of the roff'ed
documentation under share/doc will not be built/installed when
WITHOUT_GROFF is defined.

Reviewed by: ru (partial)


# d51726b0 21-Feb-2011 Warner Losh <imp@FreeBSD.org>

Back out 218933 and 281934. The easy cases still worked, but some
hard cases broke in worse ways than the status quo. Back them out
until that can be resolved.


# acd26693 21-Feb-2011 Warner Losh <imp@FreeBSD.org>

Select building CLANG based on ${TARGET_ARCH} and existence of
WITH{,OUT}_CLANG. We default to yes on some archs, no on others,
unless WITHOUT_CLANG or WITH_CLANG is defined respectively.


# 9b3d9914 10-Feb-2011 Warner Losh <imp@FreeBSD.org>

Hmmm, specifying TARGET and TARGET_ARCH in the environment doesn't
seem to work when building xdev anymore (most likely my changes lately
moving the TARGET guessing stuff to Makefile from Makefile.inc1, but I
really don't grok why). Fix make xdev by putting them on the command
line. This will work either way while I try to figure it out.


# f263e792 10-Feb-2011 Warner Losh <imp@FreeBSD.org>

CPUTYPE is now a required define for calling Makefile.inc1 diretly, so
make sure we define it for the xdev stuff.

Move xdev stuff to be last again in this file.

# xdev-build works now, but xdev-install appears to be broken though.


# fbd0c280 10-Feb-2011 Warner Losh <imp@FreeBSD.org>

You are now *REQUIRED* to pass both TARGET and TARGET_ARCH to any
invocations of Makefile.inc1 (since that's supposed to be an internal
interface for world and related targets). Document this with a .error
message. For a transition period, support passing in just TARGET, but
give a .warning for that case: I plan on removing it in 9.0...


# fda074e4 31-Jan-2011 Warner Losh <imp@FreeBSD.org>

Move the architecture guessing from Makefile.inc1 to Makefile. We
need to do this because variables specified on the command line
override those specified in the Makefile. This is why we also moved
from TARGET to _TARGET in Makefile, and then set TARGET on the command
line when we fork a submake with Makefile.inc1.

This makes mips/mips work again, even without the workaround committed to
lib/libc/Makefile.


# cd2ae253 07-Jan-2011 Warner Losh <imp@FreeBSD.org>

Retire TARGET_ABI.

Implement MACHINE_ARCH=mips64e[lb] to build N64 images. This replaces
MACHINE_ARCH=mipse[lb] TARGET_ABI=n64.

MACHINE_ARCH=mipsn32e[lb] has been added, but currently requires
WITHOUT_CDDL due to atomic issues in libzfs. I've not investigated
this much, but implemented this to preserve as much of the TARGET_ABI
functionality that I could. Since its presence doesn't affect the
working cases, I've kept it in for now.

Added mips64e[lb] to make universe, so more kernels build.

And I think this (finally) closes the curtain on the tbemd tree.


# f0a0ad3b 18-Nov-2010 Mark Murray <markm@FreeBSD.org>

Do not lint code beyond necessity (with apologies to Wiliam of Ockham).

Don't lint externally maintained CDDL code, or relint the 32-bit libraries
in amd64 mode.


# 80595f8a 13-Nov-2010 Warner Losh <imp@FreeBSD.org>

add / to the translation of TARGET_ARCH to TARGET


# 6451dd5e 13-Nov-2010 Warner Losh <imp@FreeBSD.org>

The fixes for mips/mips arm/arm compat hacks broke if TARGET or
TARGET_ARCH wasn't defined. Fix it for that case.

Submitted by: Garrett Cooper


# f10ff4ab 13-Nov-2010 Warner Losh <imp@FreeBSD.org>

Add legacy names for mips:mips and arm with TARGET_BIG_ENDIAN, for the moment.


# 39cd938c 11-Nov-2010 Ed Schouten <ed@FreeBSD.org>

Replace libgcc.a by libcompiler_rt.a.

libcompiler_rt.a is a BSD licensed C language runtime, which implements
many routines which are linked into binaries on architectures where
certain functionality is missing (e.g. 64 bits mul/div on i386).

Unfortunately, libcompiler_rt cannot replace libgcc entirely. Certain
features, such as an unwinder for exception handling, are missing.
That's why only libgcc.a is replaced for now, because this one does seem
to be complete.

Tested by: rene (amd64), nwhitehorn (powerpc), droso (i386 exprun)
and many others. Thanks!
Obtained from: user/ed/compiler-rt


# bf4724fa 09-Nov-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd:
o TARGET=mips --> little endian 32-bit mips build
o mipsel and mipseb TARGET_ARCH are both mips TARGETs
o Add some more architecture combinations


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


# 87ff4bce 08-Sep-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Check TARGET_ARCH as well as TARGET to determine if we are doing a cross
build. This is necessary to be able to cross-build 32-bit PowerPC from
a 64-bit PowerPC host.

Reviewed by: imp


# b12277d1 28-Aug-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Repair some build breakage introduced in r211725 and garbage collect some
code made obsolete in the same commit.


# dda89c73 24-Aug-2010 Warner Losh <imp@FreeBSD.org>

The order was correct before. I'd talked to Nathan about this before,
so this must have been mismerged into tbemd before I merged it back to
head. This unbreaks this on powerpc64

Submitted by: nathanw@


# 25faff34 23-Aug-2010 Warner Losh <imp@FreeBSD.org>

MFtbemd:

Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.


# 767bb849 22-Aug-2010 Warner Losh <imp@FreeBSD.org>

Minor tweak from tbemd


# 029a7373 21-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

Don't link drti.o with libelf_pic.a. This means that all software with
userland SDT probes must be linked with libelf explicitly.

Requested by: kib
Sponsored by: The FreeBSD Foundation


# ad8a0e42 21-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

Add clang to the cross-tools build stage.

Submitted by: Dimitry Andric <dimitry at andric.com>


# 9510083e 21-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

Add libelf to the prebuild libs.

This is needed for the DTrace instrumentation object.

Sponsored by: The FreeBSD Foundation


# 50e2303d 18-Aug-2010 Dag-Erling Smørgrav <des@FreeBSD.org>

Revert r211436; it was a good idea, but not fully thought out.


# d350d2cd 17-Aug-2010 Dag-Erling Smørgrav <des@FreeBSD.org>

Split kernel stage 3.2 (build everything) into 3.2 (build the kernel)
and 3.3 (build the modules). IMHO, this makes it a little easier to
track the progress of a kernel build using whereintheworld et al.

MFC after: 3 weeks


# c606b778 15-Jul-2010 Rafal Jaworowski <raj@FreeBSD.org>

Relax FDT_DTS_FILE validation (and unbreak world build).

Pointed out by: kib


# 24c00a90 15-Jul-2010 Rafal Jaworowski <raj@FreeBSD.org>

Fix FDT_DTS_FILE parsing to properly retrieve its value. This unbreaks the
'builddtb' target.

Make the processing more robust against non-existent kernel config files
(pointed out by imp@).


# 8bb23971 13-Jul-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Connect powerpc64 to the build. It is not presently part of make universe,
which will be added soon.

Reviewed by: imp


# d5872601 24-Jun-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd:

use MACHINE_CPUARCH instead of MACHINE_CPU since the sources for the
CSU is based on MACHINE_CPUARCH

Reviewed by: arch@ (twice)


# 4a5faa67 24-Jun-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd:

change the name of the object tree from ${TARGET} to
${TARGET}.${TARGET_ARCH} so we can do both big and little endian
builds in the same tree.

Reviewed by: arch@ (twice)


# 9998d0c0 24-Jun-2010 Warner Losh <imp@FreeBSD.org>

Merge from TBEMD:

Rather than having arch specific code in Makefile.inc1, generalize so
that we can control the settings of different options on a per
architecutre basis.

Reviewed by: arch@ (twice)


# df06a575 16-Jun-2010 Rafal Jaworowski <raj@FreeBSD.org>

Use awk alone for extracting FDT_DTS_FILE instead of grep/cut, which is
simpler and more robust.

Submitted by: Andrzej Tobola


# 88385abb 13-Jun-2010 Ken Smith <kensmith@FreeBSD.org>

Adjust the cvs branch for 'make update'.

Approved by: re (implicit)


# 3c5326bf 13-Jun-2010 Rafal Jaworowski <raj@FreeBSD.org>

Connect FDT infrastructure to the build system.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation


# 6513cfc8 09-Jun-2010 Roman Divacky <rdivacky@FreeBSD.org>

Hook clang into the build on i386/amd64/powerpc.

Approved by: ed (mentor)


# 5ba4657c 20-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

Revert r208353. It did not work as I expected because WITHOUT_MAN is set
for bootstrap-tools target and WITHOUT_MAN_UTILS was implied by default.

Pointy hat: jkim


# 8a4b934b 20-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

We do not have to build makewhatis as a bootstrap tool when it is disabled
by WITHOUT_MAN_UTILS.


# cdba28b0 20-May-2010 Martin Matuska <mm@FreeBSD.org>

Add xz to rescue.

Approved by: delphij (mentor)


# b05756ac 20-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

Revert r208324. We still need it for installworld as $PATH is overriden.


# 727b4933 19-May-2010 Jung-uk Kim <jkim@FreeBSD.org>

Remove makewhatis(1) from bootstrap tools. We no longer support source
upgrades from versions prior to 6.0 on head.


# c3a3cc87 11-May-2010 Xin LI <delphij@FreeBSD.org>

MFC r205622:

Expose MACHINE_CPU while building lib32 target.


# 7fbeb03e 10-May-2010 Martin Matuska <mm@FreeBSD.org>

Enable liblzma support in libarchive
Adjust dependencies for programs using libarchive
Add xz and linkage against liblzma to rescue system

Approved by: kientzle, delphij (mentor)
MFC after: 2 weeks


# 762c7db2 23-Apr-2010 Florent Thoumie <flz@FreeBSD.org>

- Take libinstall.a out of pkg_install and make it a proper shared library.
- Rework the wrapper support to check libpkg version as well as pkg_install
version.
- Add libfetch to _prebuild_libs.
- There are no new features introduced.

Notes: the API is not stable, so basically, do not use libpkg in your
projects for now. Also there's no manpage for libpkg yet, because the API
will change drastically. I repeat, do not use libpkg for now.


# 096924c9 22-Apr-2010 Alexander Leidinger <netchild@FreeBSD.org>

Remove explicit setting of NO_CTF in WMAKEENV and in the make call for
the buildkernel. This way makeoptions WITH_CTF=yes not only works when
compiling the tradtitional way, but also when using buildkernel. This
does not enable the CTF part of the world, it still defaults to without
CTF info.

The cross/build-tools/bootstrap targets are not affected by this, they
still have and should keep the explicit NO_CTF.

Notified by: np


# f672e5fb 14-Apr-2010 Warner Losh <imp@FreeBSD.org>

Add note about TARGET_ARCH


# e56900fc 24-Mar-2010 Xin LI <delphij@FreeBSD.org>

Expose MACHINE_CPU while building lib32 target.


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


# 460f173d 07-Mar-2010 Antoine Brodin <antoine@FreeBSD.org>

Remove old documents when they are not compressed.
(NO_INFOCOMPRESS, NO_DOCCOMPRESS or NO_MANCOMPRESS)

MFC after: 1 month


# 4ed35fdd 21-Feb-2010 Antoine Brodin <antoine@FreeBSD.org>

Merge r200413 and r202755 from head to stable/8:
reduces white space diff between head and stable/8

Suggested by: ru@


# 6335f05c 19-Feb-2010 Antoine Brodin <antoine@FreeBSD.org>

MFC from head to stable/8:
r202896:
Unbreak world:
- WITHOUT_OPENSSH (and WITH_KERBEROS)
- WITHOUT_KERBEROS and WITH_GSSAPI

PR: 137483
Submitted by: bf
r203016 by ru@:
Regen the list of prebuild libraries using tools/make_libdeps.sh.

Reviewed by: ru@


# 74d5ebae 28-Jan-2010 Jilles Tjoelker <jilles@FreeBSD.org>

MFC r202324: In 'make delete-old', use 'exec' to redirect an fd persistently

That is, write 'exec 3<&0' instead of '3<&0'. Due to an sh(1) bug fixed in
head in r199953, the latter also persisted, provided that fd 3 was not open
before. With newer sh or fd 3 open, it would not delete orphaned catpages.


# 0f49f7eb 26-Jan-2010 Ruslan Ermilov <ru@FreeBSD.org>

Regen the list of prebuild libraries using tools/make_libdeps.sh.


# c1f5e730 23-Jan-2010 Antoine Brodin <antoine@FreeBSD.org>

Unbreak world:
- WITHOUT_OPENSSH (and WITH_KERBEROS)
- WITHOUT_KERBEROS and WITH_GSSAPI

PR: 137483
Submitted by: bf
MFC after: 2 weeks

Note: this breaks harder world WITHOUT_GSSAPI (and WITH_KERBEROS), but well


# 84bee0d7 21-Jan-2010 Ed Schouten <ed@FreeBSD.org>

Remove libulog from the bootstrap again.

libulog now only provides functions that are used by various packages
from the ports tree, namely the libutempter ones. There is no reason to
link it into the crunch/fixit binaries anymore.


# c44809a5 17-Jan-2010 Christian Brueffer <brueffer@FreeBSD.org>

MFC: r197056 by des

Fix comment about KERNFAST.

PR: 142854
Submitted by: Nikolay Denev <ndenev@gmail.com>


# 6f7be14a 14-Jan-2010 Jilles Tjoelker <jilles@FreeBSD.org>

In 'make delete-old', use 'exec' to redirect an fd persistently.

That is, write 'exec 3<&0' instead of '3<&0'. Due to an sh(1) bug fixed in
r199953, the latter also persisted, provided that fd 3 was not open before.
With newer sh or fd 3 open, it would not delete orphaned catpages.

MFC after: 2 weeks


# 03bc68ca 30-Dec-2009 Ed Schouten <ed@FreeBSD.org>

Disable K&R style function definitions for WARNS=6.

Unfortunately there are two slight problems with that:

- Yacc and lex might generate code that generates warnings because of
this. Require yacc and lex to be rebuilt during bootstrap. I'm not
incrementing __FreeBSD_version here, because I assume someone else
will do this eventually.

- When running `make buildkernel', it uses share/mk from the source
treeo to build aicasm. Because aicasm also depends on lex, this would
break. Lower WARNS to 5 for now. We should just increment it to 6
again somewhere in the very far future.


# 62012822 15-Dec-2009 Warner Losh <imp@FreeBSD.org>

Add NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN},
which disables doing a make obj. Use it when you know it will work
only. KERNFAST now implies NO_KERNELOBJ, since you don't need to keep
doing obj when doing incremental kernel builds.


# 17c79ad0 11-Dec-2009 Ed Schouten <ed@FreeBSD.org>

Convert pam_lastlog(8) to libulog.

The information used by the "Last login:"-line is obtained by using
ulog_setutxfile(3) to switch to the lastlog database. Login and logout
are performed using the utility functions ulog_login(3) and
ulog_logout(3).

This also means we must build libulog during bootstrap.

Approved by: des


# 98c98d78 01-Nov-2009 Roman Divacky <rdivacky@FreeBSD.org>

Replace -iprefix with -isystem. We only need alternative header
files search path and thus -isystem is sufficient. -iprefix is
meant to do something entirely different.

Approved by: ed (mentor)
OKed by: ru, kan
Tested by: make universe


# 8d5ed6e7 28-Oct-2009 Edwin Groothuis <edwin@FreeBSD.org>

Now that the zoneinfo data is automatically updated when a new world
is installed, we should at least have the tzsetup tool available!

Suggested by: Andriy Gapon <avg@freebsd.org>
Noticed by: Ben Kaduk <minimarmot@gmail.com>
MFC after: 1 week


# e5367da3 21-Oct-2009 Ruslan Ermilov <ru@FreeBSD.org>

Move sed(1) from cross-tools to bootstrap-tools.


# a7261a62 16-Oct-2009 Alexander Nedotsukov <bland@FreeBSD.org>

MFC r197995, 198020:

Link GSS mechanics modules against libgssapi so they will not fail due
unresolved symbol errors when in turn libgssapi was loaded with RTLD_LOCAL
flag set (which is the default).

Approved by: re (kib)


# b6d632e4 12-Oct-2009 Alexander Nedotsukov <bland@FreeBSD.org>

Chase dependency changes in libgssapi_krb5 module introruced by
revision r197995.


# 767a0b2d 10-Sep-2009 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix comment about KERNFAST.


# e380e5cf 12-Aug-2009 Ken Smith <kensmith@FreeBSD.org>

Adjust 'make update' to use RELENG_8 branch tag for cvs.

Approved by: re (implicit)


# 2286fe76 14-Jul-2009 Alexander Kabaev <kan@FreeBSD.org>

Second attempt at eliminating .text relocations in shared libraries
compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC
generates local calls to this function which result in absolute
relocations put into position-independent code segment, making dynamic
loader do extra work every time given shared library is being relocated
and making affected text pages non-shareable.

Reviewed by: kib
Approved by: re (kib)


# d48890cf 28-Jun-2009 Alexander Kabaev <kan@FreeBSD.org>

Back out previous revision until better tested fix is ready.

Approved by: re (impliciti, by approving previos check-in)


# a162c9ae 28-Jun-2009 Alexander Kabaev <kan@FreeBSD.org>

Eliminate .text relocations in shared libraries compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC generates
local calls to this function which result in absolute relocations put into
position-independent code segment, making dynamic loader do extra work everys
time given shared library is being relocated and making affected text pages
non-shareable.

Reviewed by: kib
Approved by: re (kensmith)


# 51a8ff0c 14-Jun-2009 Mark Murray <markm@FreeBSD.org>

Allow "make update" work with SVN, if you take the time to set up your
/etc/make.conf properly.

Only one SCM?
I do not think this is right.
Now I have fixed it.


# d0c7c272 04-Apr-2009 Warner Losh <imp@FreeBSD.org>

Revert c190007 at the request of Ruslan. It was not correct because
ar had been moved from cross tools to bootstrap tools when bsd ar was
introduced.

Submitted by: ru@


# 5c2ca8d0 18-Mar-2009 Warner Losh <imp@FreeBSD.org>

Add usr.bin/ar to the list of cross tools. Before, when we had gnu
ar, it was built in the gnu/usr.bin/binutils tree. Now it isn't.

Submitted by: John Hein


# badf7d25 15-Mar-2009 Warner Losh <imp@FreeBSD.org>

Restore missing OSREL definition that accidetnally dropped from an
earlier version of this patch.


# 8a6a076c 15-Mar-2009 Gabor Kovesdan <gabor@FreeBSD.org>

- Create the buildworld object directories with mtree instead of various
mkdir calls
- Remove the ugly workaroung from libc NLS, which was to create some of
these directories


# fe73c506 13-Mar-2009 Gabor Kovesdan <gabor@FreeBSD.org>

- Reenable Native Language Support in libc. This feature was disabled due
to possible breakages in the catalog handling code. Since then, that
code has been replaced by the secure code from NetBSD but NLS in libc
remained turned off. Tests have shown that the feature is stable and
working so we can now turn it on again.

- Add several new catalog files:
- ca_ES.ISO8859-1
- de_DE.ISO8859-1
- el_GR.ISO8859-7 (by manolis@ and keramida@)
- es_ES.ISO8859-1 (kern/123179, by carvay@)
- fi_FI.ISO8859-1
- fr_FR.ISO8859-1 (kern/78756, by thierry@)
- hu_HU.ISO8859-2 (by gabor@)
- it_IT.ISO8859-15
- nl_NL.ISO8859-1 (corrections by rene@)
- no_NO.ISO8859-1
- mn_MN.UTF-8 (by ganbold@)
- sk_SK.ISO8859-2
- sv_SE.ISO8859-1
(The catalogs without explicit source has been obtained from NetBSD.)

Approved by: attilio


# 555aaddf 13-Mar-2009 Ruslan Ermilov <ru@FreeBSD.org>

Don't put "install-info" to the list of install-tools if we're
installing with -DWITHOUT_INFO, otherwise one can experience a
failure trying to installworld on a system that is built with
-DWITHOUT_INFO (i.e., without /usr/bin/install-info).

Reported by: bland
MFC after: 3 days


# 25bacc78 13-Mar-2009 Warner Losh <imp@FreeBSD.org>

Implement the xdev target. When you define XDEV=arch XDEV_ARCH=arch,
you can build the cross development tools and install them as
$XDEV-freebsd-xxx for each tool. This allows one to use autoconf to
find the tools for cross building scenarios.


# d9ca85fc 21-Feb-2009 Ruslan Ermilov <ru@FreeBSD.org>

Fix build when WITH_SSP is set explicitly.

Submitted by: Jeremie Le Hen


# b61a9dcf 23-Jan-2009 Warner Losh <imp@FreeBSD.org>

Implement an idea from Sam Leffler:
make KERNFAST=blah buildkernel
is now a short cut for
make KERNCONF=blah -DKERNFAST buildkernel

This change works for all kernel config files not named "1". I did
that to make sure that
make -DKERNFAST buildkernel
remains the same as
make -DKERNFAST KERNCONF=GENERIC buildkernel
rather than trying to build and configure "1". I've never seen a
kernel config file named "1," so I think this is a good compromise.


# 79177775 14-Jan-2009 Warner Losh <imp@FreeBSD.org>

Add KERNFAST define. When defined, it skips all the config, depends
and clean steps. KERNFAST was selected to complement KERNCONF which
is typically used in these scenarios (especially with cross building).

Reviewed by: arch@


# 85cb1ccb 11-Nov-2008 David E. O'Brien <obrien@FreeBSD.org>

Add the kerberos5 libs to the install32 target.
(we've been building the all along, but never installing them)


# a9bff23c 23-Oct-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Back out testing aid that was inadvertantly committed as part of r184205.

Noticed by: rdivacky


# 1ede983c 23-Oct-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Retire the MALLOC and FREE macros. They are an abomination unto style(9).

MFC after: 3 months


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

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


# bcffa935 19-Sep-2008 David E. O'Brien <obrien@FreeBSD.org>

Rescue is "not yet" for MIPS.


# c7f23b87 19-Aug-2008 John Baldwin <jhb@FreeBSD.org>

If a CPUTYPE isn't specified, then don't use -march=k8 when compiling
32-bit compat libs on amd64 since -march=k8 may generate instructions
that are not implemented on Intel EM64T processors. Instead, use
a simpler set of default flags that should work on all amd64-capable
CPUs.

PR: amd64/113111
Submitted by: NIIMI Satoshi sa2c of sa2c.net
MFC after: 1 week


# 03d013bc 01-Aug-2008 John Baldwin <jhb@FreeBSD.org>

Various style fixes in the build32 rules.

Submitted by: bde (mostly)


# e68ed793 01-Aug-2008 John Baldwin <jhb@FreeBSD.org>

Tweak the support for using ldd on 32-bit objects a bit further.
Specifically, build a 32-bit /usr/bin/ldd32 on amd64 which handles 32-bit
objects. Since it is a 32-bit binary, it can fork a child process which
can dlopen() a 32-bit shared library. The current 32-bit support in ldd
can't do this because it does the dlopen() from a 64-bit process. In order
to preserve an intuitive interface for users, the ldd binary automatically
execs /usr/bin/ldd32 for 32-bit objects. The end result is that ldd on
amd64 now transparently handles 32-bit shared libraries in addition to
32-bit binaries.

Submitted by: ps (indirectly)


# 042df2e2 25-Jun-2008 Ruslan Ermilov <ru@FreeBSD.org>

Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
turned opt-in for stable branches depending on the consensus. You
can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
It is harmless to steal the knob as SSP symbols have been provided
by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
(sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
libc will be automatically downgraded to -fstack-protector because it
breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by: Jeremie Le Hen <jeremie@le-hen.org>


# 643d58f9 18-Jun-2008 David E. O'Brien <obrien@FreeBSD.org>

Add MIPS to the list of known arches.


# 51062e59 22-May-2008 John Birrell <jb@FreeBSD.org>

Add the DTrace build tools to the list of tools and pass NO_CTF to all
the stages of the build which don't require CTF conversion.


# 33f12199 07-May-2008 Doug Rabson <dfr@FreeBSD.org>

Fix conflicts after heimdal-1.1 import and add build infrastructure. Import
all non-style changes made by heimdal to our own libgssapi.


# 3d42ee26 14-Apr-2008 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap the build of btxld.


# dbdb679c 29-Mar-2008 Ruslan Ermilov <ru@FreeBSD.org>

Remove options MK_LIBKSE and DEFAULT_THREAD_LIB now that we no longer
build libkse. This should fix WITHOUT_LIBTHR builds as a side effect.


# b18c84b4 02-Mar-2008 Ruslan Ermilov <ru@FreeBSD.org>

Set AR=gnu-ar and RANLIB=gnu-ranlib on systems where we are forced
to use GNU tools. Remove the _WITH_GNUAR knob.

Prodded by: obrien


# 0be8836d 25-Feb-2008 Ruslan Ermilov <ru@FreeBSD.org>

Sort.

Prodded by: obrien


# d0ca9999 25-Feb-2008 Ruslan Ermilov <ru@FreeBSD.org>

Make again BSD ar(1) the default system ar(1), now properly handling
source upgrades by falling back to GNU ar(1) as necessary. Option
WITH_BSDAR is gone. Option _WITH_GNUAR to aid in upgrades is *not*
supposed to be set by the user.

Stop bootstrapping BSD ar(1) on the next __FreeBSD_version bump, as
there are no known bugs in it. Bump __FreeBSD_version to anticipate
this and to flag the switch to BSD ar(1), should it be needed for
something.

Input from: obrien, des, kaiw


# 646df953 05-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Satisfy a particularly obstinate nit-picker :)


# bcb20d7b 05-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Give usr.bin/kdump/kdump_subr.c the same treatment as usr.bin/kdump/ioctl.c
and usr.bin/truss/ioctl.c. This is the correct way to address the problem
that arises when doing an incremental build after a header used by kdump
has been removed (cf. i4b disconnect a while ago)

Explained by: ru
MFC after: 2 weeks


# 51dc1e12 23-Jan-2008 Ruslan Ermilov <ru@FreeBSD.org>

Support source upgrades from at least 6.0-RELEASE.

Reviewed by: imp, obrien


# 50df6ee3 22-Jan-2008 Andrey A. Chernov <ache@FreeBSD.org>

Conditionally add mklocale to bootstrap-tools


# 68c5515f 22-Jan-2008 Ruslan Ermilov <ru@FreeBSD.org>

Cleanup after last commit (remove undefined variables).


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


# 9074b900 16-Jan-2008 Christian Brueffer <brueffer@FreeBSD.org>

Remove WITHOUT_FORTRAN from the XMAKE target, it doesn't exist anymore.

Reviewed by: imp, kan
Approved by: rwatson (mentor)
MFC after: 3 days


# c93073c2 03-Dec-2007 Yaroslav Tykhiy <ytykhiy@gmail.com>

- Explicitly verify if all needed libs were found by ldd(1). Do so
through scanning its output as ldd(1) returns a non-zero status only
for really abnormal conditions such as an improper file format.
Now cp(1) won't get bogus "not" and "found" arguments if a lib
is missing. [1]

- Don't guess if an element of a complex pipeline is assigned to the main
shell or a sub-shell. Namely use stdio, not vars, to pass lists out from
loops. If using vars, there's the risk that a loop will run in a sub-shell
and the list won't make it to the main shell. It appears that braces and
parens give only limited control over the issue while stdio always works
as intended. Apply this solution to both $progs and $libs for consistency,
although I've failed to go without it only in the $libs part.

Requested by: emaste [1]


# 519bc416 31-Oct-2007 Yaroslav Tykhiy <ytykhiy@gmail.com>

Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:

1) ABI breakages should no longer affect installworld over the live system.

2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.

3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.

The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.

Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)


# 1602894e 15-Oct-2007 Ed Maste <emaste@FreeBSD.org>

If a required install tool is missing, provide a more friendly error
message (instead of cp's usage info).


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


# 2d797419 01-Oct-2007 Ruslan Ermilov <ru@FreeBSD.org>

Revise the list of directories we manually create under
${WORLDTMP} and ${LIB32TMP}; some of them are no longer
needed, and some were never needed.

Approved by: re (kensmith)


# 152f2a4a 01-Oct-2007 Ruslan Ermilov <ru@FreeBSD.org>

Always install libpthread.* symlinks if at least one of
the threading libraries is built. This simplifies the
logic in makefiles that need to check if the pthreads
support is present. It also fixes a bug where we would
build a threading library that we shouldn't have built:
for example, building with WITHOUT_LIBTHR and the default
value of DEFAULT_THREADING_LIB (libthr) would mistakenly
build the libthr library, but not install it.

Approved by: re (kensmith)


# 5224b41a 10-Jul-2007 Xin LI <delphij@FreeBSD.org>

Add sed(1) to cross tools. We do want newly built version during
buildworld.

Approved by: re (rwatson)


# a1cdbf32 26-May-2007 Ruslan Ermilov <ru@FreeBSD.org>

lex(1) no longer installs headers into GCC-internal dirs
(since src/usr.bin/lex/Makefile,v 1.20).


# 98a0900a 19-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Revision 1.576 removed too much. I didn't notice because my /usr is on
ZFS, which doesn't support flags...


# 25a362d7 18-May-2007 Alexander Kabaev <kan@FreeBSD.org>

GCC will now properly link libc with all shared objects in order to record
their dependency on libc and its versioned symbols. For that to work,
libc needs to be built before any other shared library that might depend
on it. Add necessary glue to make that happen.


# f27f8258 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Don't use a subshell where it isn't needed.

Noticed by: John E Hein <jhein@timing.com>


# 32cd239b 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Expose all of {check,delete}-old{,-dirs,-files,-libs}.

MFC after: 3 weeks


# 84478d58 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove stray comment which broke delete-old-dirs.


# d1e75b81 16-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Partially revert the check-old / delete-old modifications to clarify the
logic.

Apply similar modifications to {check,delete}-old-dirs, which I had
overlooked.


# ca224410 14-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Restore previous behaviour of aborting delete-old* if rm failed.

Pointed out by: netchild
MFC after: 3 weeks


# 61305271 13-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Greatly speed up {check,delete}-old* by replacing make loops with sh loops.

MFC after: 3 weeks


# 00fb440c 13-May-2007 Daniel Eischen <deischen@FreeBSD.org>

Enable symbol versioning by default. Use WITHOUT_SYMVER to disable it.
Warning, after symbol versioning is enabled, going back is not easy
(use WITHOUT_SYMVER at your own risk).

Change the default thread library to libthr.

There most likely still needs to be a version bump for at least the
thread libraries. If necessary, this will happen later.


# 1c22c47c 17-Apr-2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Link libzpool, ztest and zdb against libpthread.

Requested by: ru


# ceef0c31 05-Apr-2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Connect ZFS to the build.


# 31b4134f 08-Mar-2007 Rong-En Fan <rafan@FreeBSD.org>

Enable ncurses wide character support

Approved by: delphij (mentor)
Tested by: kris on pointyhat (early version), current@


# 857be7a4 01-Mar-2007 Ruslan Ermilov <ru@FreeBSD.org>

Bump the bootstrapping requirements for gensnmptree(1) and remove
a note in UPDATING that tried to work around the build breakage.

Tested by: jhb
OK'ed by: njl


# 51804c79 28-Feb-2007 Ruslan Ermilov <ru@FreeBSD.org>

Resurrect one of the patches from attic and refine the
lib32 build somewhat. Specifically, instead of spamming
${CC} et al with -I${LIB32TMP}/usr/include which can be
harmful (as has been demonstrated by the ncursesw WIP),
use slightly different approach to achieve the same goal.
This also simplifies things a bit.

Prodded by: rafan


# 9c827cec 27-Feb-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Clean the lib32 object directory with cleandir rather than rm -rf.

Discussed with: ru
MFC after: 2 weeks


# af5b5a0f 20-Jan-2007 Rong-En Fan <rafan@FreeBSD.org>

Switch to new ncurses build glue

Approved by: delphij


# 638b0a3e 27-Nov-2006 Ruslan Ermilov <ru@FreeBSD.org>

There was a timeframe where crunchgen(1) was broken; force
an upgrade during the build so those who are affected can
build world again.


# 87b8c12d 12-Nov-2006 Ruslan Ermilov <ru@FreeBSD.org>

There doesn't seem to be a real reason for include/ to be installed
so early.


# 61517751 16-Oct-2006 John Birrell <jb@FreeBSD.org>

Add sun4v to the TARGET_ARCH when just TARGET is set (like pc98 is done).

This is required for 'make universe'.


# ddd53429 08-Oct-2006 Kip Macy <kmacy@FreeBSD.org>

buildworld fixes for sun4v
not sure why pmap.c is included as it is unchanged

Approved by: rwatson (mentor)
Reviewed by: jmg


# 49e62f1c 07-Oct-2006 Ruslan Ermilov <ru@FreeBSD.org>

Shuffle _*_libs assigments (no functional changes).


# b1935562 07-Oct-2006 Ruslan Ermilov <ru@FreeBSD.org>

- Prebuild libgssapi only if building with Kerberos support.

- Remove libnetgraph from the list of prebuilt libraries as
no other library depends on it (snmp_netgraph.so does not
count as we don't build it in the "libraries" target).

- Restore libssh dependencies when compiling with Kerberos
support.


# 89edd7e5 08-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Previous revision wasn't enough for "make TARGET=<machine> build*"
to work. Some build-tools that are part of cross-tools (cc_tools)
also need to know the proper values of TARGET_ARCH and TARGET, so
tell them.


# 0f31538c 07-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

While experimenting with cross-building by specifying just TARGET,
I found one bug. Pass our idea of TARGET_ARCH and TARGET down to
XMAKE, the cross-tools make. Previously it worked because usually
TARGET_ARCH was specified on the initial make's command line.
This should also allow us to simplify the "universe" target, which
I'm currently testing.


# d2f03ebb 07-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Added timestamping to buildworld, similar to buildkernel.


# e6cb78fb 07-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

- Rewrite logic to guess TARGET_ARCH/TARGET to be more readable,
but without changes in behavior.

- Add sanity checking for TARGET_ARCH/TARGET.


# ffbebdce 07-Sep-2006 Warner Losh <imp@FreeBSD.org>

make "make TARGET=foo" work correctly. Before, it would fail to set
TARGET_ARCH correctly. Now it does, even for pc98. We should suggest
TARGET=foo in preference to TARGET_ARCH because the former is
unambiguous and the latter isn't, so update the docs.

This means that a long standing gripe I've had with this comes to a
close. I can build pc98 w/o specify both things. make TARGET=arm
works (rather than trying to build a arm:amd64 image and dying badly
in the attempt).

If you specify only TARGET_ARCH, then you get the old behavior.

# we can likely simplify the UNIVERSE target now to use this, but I'm not
# up for breaking that tonight :-).

# We should consider adding some kind of sanity check for TARGET_ARCH
# and TARGET.


# 1bb2049e 24-Aug-2006 Warner Losh <imp@FreeBSD.org>

Always make obj when building the libraries. This never hurts, and
helps some cross-architecture building tool installation patches that
I'm developing.


# 2b46c64c 22-Aug-2006 Ruslan Ermilov <ru@FreeBSD.org>

Remove alpha left-overs.


# c49d3a7d 09-Aug-2006 Alexander Leidinger <netchild@FreeBSD.org>

Remove sade from build-tools, the tinderbox problem should be fixed now.


# 2d0fba05 08-Aug-2006 Yoshihiro Takahashi <nyan@FreeBSD.org>

Add the sade to build-tools list. This fixes a tinderbox.


# dad90513 02-Aug-2006 Alexander Leidinger <netchild@FreeBSD.org>

Fix doxygen target.

Submitted by: "Alexander Mogilny" <sg@astral.ntu-kpi.kiev.ua>
Pointy hat to: netchild


# 6f13c7ad 06-Jun-2006 Warner Losh <imp@FreeBSD.org>

Also need to quote values so they can be passed on correctly.


# 621e4ae1 06-Jun-2006 Warner Losh <imp@FreeBSD.org>

Create a new target 'buildenvvars'. This target reports the build
environment for cross building (the same one you'd get interactively
in make buildenv). This cannot be a simple

make -f Makefile.inc1 -V WMAKEENV

because in PATH is not set correctly unless one takes a trip through
the Makefile/Makefile.inc1 indirection, the logic of which is too
large to reproduce outside of Makefiles.


# becc5c62 26-May-2006 Alexander Leidinger <netchild@FreeBSD.org>

Connect the kernel subsystem API documentation generation framework to
the build infrastructure: "make doxygen"

Changes to the man pages will be made when some defaults are revisited.

Requested by: gnn


# f6ce2a64 17-May-2006 Poul-Henning Kamp <phk@FreeBSD.org>

Send the pcvt(4) driver off to retirement.


# d6acfaf5 31-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Sort bootstrap-tools entries.


# 03e21a94 30-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Rebuild gensnmptree(1) on 700014 systems too. While 700014 corresponds
to post January 26 systems where gensnmptree(1) code was already fixed,
there was a timeframe between February 14 and February 27 when
usr.sbin/bsnmpd/ including gensnmptree was disconnected from build, so
if you upgraded in this timeframe, you ended up with the 700014 system
but still with a buggy gensnmptree binary. This also means not being
able to buildworld now.

Reported by: jhb
Attention: harti, keramida


# cea557ad 20-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Extend coverage of the MK_IPX build option to the following:

- <netipx> headers [1]
- IPX library (libipx)
- IPX support in ifconfig(8)
- IPXrouted(8)
- new MK_NCP option

New MK_NCP build option controls:

- <netncp> and <fs/nwfs> headers
- NCP library (libncp)
- ncplist(1) and ncplogin(1)
- mount_nwfs(8)
- ncp and nwfs kernel modules

User knobs: WITHOUT_IPX, WITHOUT_IPX_SUPPORT, WITHOUT_NCP.

[1] <netsmb/netbios.h> unconditionally uses <netipx> headers
so they are still installed. This needs to be dealt with.


# ca404c7d 19-Mar-2006 Maxime Henrion <mux@FreeBSD.org>

Change the default SUP command to use csup instead of CVSup for
"make update" when SUP_UPDATE is defined.


# 5740a2b6 18-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Convert NO_PROFILE and NO_LIB32 to new style.


# c3ed02cf 18-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Add the new "showconfig" target that displays build configuration.

Suggested by: phk


# e1fe3dba 17-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Reimplementation of world/kernel build options. For details, see:

http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by: imp, jhb, kris, phk, ru (all bugs are mine)


# 6cb9d90a 16-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

When building for pc98, don't create stray objects in the
usr.sbin/pcvt/keycap source directory.

Found by: phk
MFC after: 3 days


# 00602d09 08-Mar-2006 Giorgos Keramidas <keramida@FreeBSD.org>

After revision 1.4 of `src/usr.sbin/bsnmpd/bsnmpd/Makefile' the
gensnmptree utility is required at "make depend" time, because it
is used to generate `oid.h' for bsnmpd.

This means that all versions of HEAD before 2004/01/23 16:22:49 need
gensnmptree as a bootstrap util when it's not already installed as
part of the base system. The first __FreeBSD_version that we can
assume this can work is 700014 which happened after the gensnmptree
change (in -r 1.263 of `src/sys/sys/param.h', at 2006/02/17 14:14:15).

For __FreeBSD_version values before 700014 add gensnmptree to the
bootstrap tools, to allow upgrades from versions of FreeBSD before
that date.

Approved by: ru, harti


# e8a71dcc 27-Feb-2006 Ruslan Ermilov <ru@FreeBSD.org>

Detect that the "audit" group is missing earlier during install.


# 8a32134c 18-Feb-2006 Alexander Leidinger <netchild@FreeBSD.org>

A file can also be a link, so check not only for a file, but also for a link
in the delete-old and check-old targets.

We don't install a lib (libXY.so.Z) as a link, but an user may have created
something like this. This is dangerous if this link points to a different
version of the lib. So check for a link also in the *-lib targets (an
annoyed user which absolutely wants this redirection of a lib should use
libmap.conf instead of a link).

A directory can also be a link, but in this case just echo a message to
remove it by hand.


# 38311499 02-Jan-2006 Doug Rabson <dfr@FreeBSD.org>

Revert the previous change - the lib32 build should work now.


# 29af427b 02-Jan-2006 Doug Rabson <dfr@FreeBSD.org>

Temporarily disable the kerberos5 lib32 build while I try to fix it
properly.


# c0b9f4fe 29-Dec-2005 Doug Rabson <dfr@FreeBSD.org>

Add a new extensible GSS-API layer which can support GSS-API plugins,
similar the the Solaris implementation. Repackage the krb5 GSS mechanism
as a plugin library for the new implementation. This also includes a
comprehensive set of manpages for the GSS-API functions with text mostly
taken from the RFC.

Reviewed by: Love Hörnquist Åstrand <lha@it.su.se>, ru (build system), des (openssh parts)


# 667d8d10 07-Dec-2005 David E. O'Brien <obrien@FreeBSD.org>

Use cross-compile friendly spelling of CPUTYPE.

Submitted by: ru


# 620b3a0c 07-Dec-2005 Ruslan Ermilov <ru@FreeBSD.org>

Style, no functional changes.


# 21c4855e 07-Dec-2005 David E. O'Brien <obrien@FreeBSD.org>

SSE2 comes thru the users choice of CPUTYPE.


# fef891f7 07-Dec-2005 David E. O'Brien <obrien@FreeBSD.org>

Default to producing 'k8' COMPAT_32BIT bits, but allow override.


# 637750b9 06-Dec-2005 Warner Losh <imp@FreeBSD.org>

Back out my sh -> ${SHELL} change, since it will be a few days before
I can fix it better.

Requested by: ru@


# c26efd48 02-Dec-2005 Doug Ambrisko <ambrisko@FreeBSD.org>

Switch BUILD_ARCH in Makefile to use uname -p suggested by ru.
Switch strncpy to strlcpy suggested by gad and issue found by pjd.
Add to uname(3) man page describing:
UNAME_s
UNAME_r
UNAME_v
UNAME_m
Add to getosreldate(3) man page describing:
OSVERSION

Submitted by: ru, pjd/gad
Reviewed by: ru (man pages)


# d630a05f 01-Dec-2005 Doug Ambrisko <ambrisko@FreeBSD.org>

Add support to easily build FreeBSD unpacked in a chroot of another
FreeBSD machine. To do this add the man 1 uname changes to __xuname.c
so we can override the settings it reports. Add OSVERSION override
to getosreldate. Finally which Makefile.inc1 to use uname -m instead
of sysctl -n hw.machine_arch to get the arch. type.

With these change you can put a complete FreeBSD OS image into a
chroot set:
UNAME_s=FreeBSD
UNAME_r=4.7-RELEASE
UNAME_v="FreeBSD $UNAME_r #1: Fri Jul 22 20:32:52 PDT 2005 fake@fake:/usr/obj/usr/src/sys/FAKE"
UNAME_m=i386
UNAME_p=i386
OSVERSION=470000
on an amd64 or i386 and it just work including building ports and using
pkg_add -r etc. The caveat for this example is that these patches
have to be applied to FreeBSD 4.7 and the uname(1) changes need to
be merged. This also addresses issue with libtool.

This is usefull for when a build machine has been trashed for an
old release and we want to do a build on a new machine that FreeBSD
4.7 won't run on ...


# d53cdc6c 01-Dec-2005 Warner Losh <imp@FreeBSD.org>

In make buildenv, spell sh as ${SHELL}. In this case, we don't want
to hard code /bin/sh since we're forking it for the user to type
commands into. As such, ${SHELL} is the preferred thing users type
commands into.


# 4b2095e8 25-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Revert revision 1.416 and don't create a hierarchy before installing
a kernel. It's slower and is generally only applicable to RELENG_4.


# 1580b6c3 22-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak installworld.


# 0da07b29 21-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Get rid of SPECIAL_INSTALLCHECKS variable that isn't settable
by a user. Instead, add individual checks as dependencies to
the main "installcheck" target. Make sure that installkernel
etc. depend on it (including the UID/GID checks).


# 05359b9b 22-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Fold some common stuff into a macro ${KMAKE}.


# be174d0c 18-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add the NO_INCS knob to bsd.prog.mk and bsd.lib.mk to not include
bsd.incs.mk, and use it when installing 32-bit compat libraries
on amd64. This causes it to *not* overwrite native headers with
i386 versions, which was the case with <fenv.h> and <vgl.h>.

PR: amd64/83806
Prodded by: bde
MFC after: 1 week


# 006846f7 12-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Speed up stale catpages hunting by not running sed(1) for every catpage.


# 0f8bb094 12-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Don't check DESTDIR when making distributeworld; the latter expects
DISTDIR.

Reported by: nyan


# e4a93f1e 10-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add missing shared library interdependencies.


# e576df39 07-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Require DESTDIR to be set when installing for a different architecture.


# 6660f1d7 03-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Serialize access to the info/dir file; needed for parallel installs.

Reported by: scottl

I'm not very fond of using the non-standard lockf(1) here, but I
have no better idea at the moment. NetBSD uses ln(1) to create a
lock file, but this approach can result in a deadlock if make is
interrupted, leaving an orphaned lock file.


# 338953fb 20-Oct-2005 Ruslan Ermilov <ru@FreeBSD.org>

Force an upgrade to Groff 1.19.2.


# 188a72ee 23-Aug-2005 Brian Somers <brian@FreeBSD.org>

Fix a couple of typos


# a332ab6c 20-Aug-2005 Alexander Leidinger <netchild@FreeBSD.org>

Fix the "unexpected operator" bug some people are seeing.

First noticed by: kris


# edd04c6f 07-Aug-2005 Alexander Leidinger <netchild@FreeBSD.org>

Remove cat-pages without corresponding man-pages.


# 8dee0414 05-Aug-2005 Ruslan Ermilov <ru@FreeBSD.org>

- clean ${LIB32TMP} in _worldtmp
- clean ${OBJTREE}/lib32 in _cleanobj
- ensure that ${WORLDTMP} exists in build32


# 467610da 03-Aug-2005 Ruslan Ermilov <ru@FreeBSD.org>

- Remove duplicate setting from LIB32MAKE definition.
- Install lib32 bits using the real install(1) program.


# c8ef0ed5 03-Aug-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make delete-old* and friends useable for cross-builds.


# 1b24254b 30-Jul-2005 Alexander Leidinger <netchild@FreeBSD.org>

- Only make the delete-old related parts visible if one of the 3 targets
are called (wrapped in ".if make(...)"). This may reduce the amount of
memory needed for all other targets (the file lists are already large
and they will grow further).
- Be verbose in the batch case of the delete-old part too.


# 77d2ce5d 30-Jul-2005 Dag-Erling Smørgrav <des@FreeBSD.org>

Enforce the native environment requirement for {check,delete}-old-* at
run time, not parse time. This unbreaks cross-builds.

Pointy hat to: netchild


# af3e19a6 29-Jul-2005 Alexander Leidinger <netchild@FreeBSD.org>

- Move recently added dir into the correct section.
- Add a note about the organisation of the sections.
- Expand shell globs (they worked in a previous version of the delete-old
target, but not in this one).
- Use the correct way of checking for a native environment. [1]
- Add some more obsolete files.
- Fix some bad english. [1]

Suggested by: ru [1]
Approved by: mentor (joerg)


# c9275efa 25-Jul-2005 Dag-Erling Smørgrav <des@FreeBSD.org>

Disable thread support in BIND. It appears to reduce performance rather
than increase it, and seems to be the cause of the memory leaks which some
users have reported.

Requested by: dougb
MFC after: 5 days


# e2a36081 23-Jul-2005 Alexander Leidinger <netchild@FreeBSD.org>

Add delete-old and delete-old-libs targets:
- removes obsolete files/dirs or libraries.
- works in interactive (default) and batch mode
- respects DISTDIR
- documented in UPDATING and build(7)

The head of the file ObsoleteFiles.inc contains instructions how to add
obsolete files/dirs/libs to the list. Obviously one should add obsolete
files to this list, when he removes a file/dir/lib from the basesystem.

Additionally add check-old target:
- allows re@ to check if a file on the obsolete list resurfaces

Design goals:
- allows full control by the user (default interactive mode)
- possibility of scripted removal of obsolete files (batch mode)
- opt-in removal of files (explicit list of files)
- seperate removal of libs (2 delete targets)

Important design decissions:
- structured list of files to remove instead of a plain text file:
* allows to remove additional files if a NO_foo knob is specified
without the need to change the targets (no NO_foo knob is respected
yet)
- not using mtree like NetBSD does:
* mtree doesn't has an interactive mode

Discussed on: arch (long ago), current (this year)
Additional input from: re (hrs)
Approved by: mentor (joerg)


# a59f6433 15-Jul-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make the `distrib-dirs' target official and working properly
when cross-building (installing). (This is useful for NFS
installing world/kernel to another architecture machine.)


# 2b9fc5e6 06-Jul-2005 Alexander Kabaev <kan@FreeBSD.org>

Exclude build32 target from the list of toolchain and kernel-toolchain
dependencies. We do not need to build 32bit compat tools to compile
a kernel.

Approved by: re (scottl)
Reported by: jhb


# ece6831d 16-Jun-2005 Ruslan Ermilov <ru@FreeBSD.org>

Provide 32-bit runtime support on amd64 as a separate distribution, lib32.

Prodded by: obrien
Nodded by: peter
Approved by: re


# cb1e3c19 06-Jun-2005 Ruslan Ermilov <ru@FreeBSD.org>

Allow to override the compiler, linker, and assembler used to build 32-bit
shim libraries on amd64.


# c0913e73 30-May-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add install-info to the list of install tools now that we don't
always bootstrap texinfo.

Reported by: scottl


# 49bf419d 23-May-2005 Ruslan Ermilov <ru@FreeBSD.org>

Stop redundantly rebuilding texinfo on the next __FreeBSD_version bump.


# 7d23fba2 01-May-2005 Warner Losh <imp@FreeBSD.org>

Remove lame and ineffectual attempt to fix ipf breakage of tenderbox.


# a4f4bae7 30-Apr-2005 Warner Losh <imp@FreeBSD.org>

Add some subversive code to cleandir: remove the sbin/ipf tree
entirely to fix the tinderbox machine. This change will be reverted
once the tinderboxen are tindering again.


# 39d2cd6f 05-Apr-2005 Peter Wemm <peter@FreeBSD.org>

Merge from RELENG_5: invert WITH_LIB32 into NO_LIB32 so that we build the
32 bit libraries by default. Define NO_LIB32 in make.conf if you do not
want this.


# 6459b7da 05-Apr-2005 Peter Wemm <peter@FreeBSD.org>

Fix the lib32 build for amd64 after v1.238 of src/include/Makefile (imp).
That change exposed the fact that I'd forgotten to set $MACHINE here.


# 6eb46c30 27-Mar-2005 Ruslan Ermilov <ru@FreeBSD.org>

Fix AMD64 cross-builds when WITH_LIB32 is defined.

(Initially spotted by kris@ on RELENG_5.)


# 9d11d2b6 22-Mar-2005 Ruslan Ermilov <ru@FreeBSD.org>

Protect against DESTDIR being set during the build of build32.

Reported by: pav


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


# 0c5397aa 28-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap pwd_mkdb(8) and use its new feature during "make distribute".


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


# 6067dba1 28-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak buildworld.


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

Make the format of LC_COLLATE files architecture independent.


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

Bootstrap gencat(1).

OK'ed by: phantom


# 9bdd3e84 26-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Added the convenience "distribution" target which calls the
target of the same name from src/etc/Makefile with a proper
environment, suitable to be used during upgrades and cross-
builds.


# 88e7c7a4 27-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Make it clear we no longer support source upgrades from
versions prior to 5.3.


# 552b98b9 27-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add missing continuation.


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

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

Inspired by: obrien


# 20bfae84 26-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Added the "buildenv" target, for developers only!

CAVEAT: if you run tcsh(1) from within this target, this will
reset your PATH making this target mostly useless. Careful!

Submitted by: jmg, ru


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


# 6fe37d13 22-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add endianness support to cap_mkdb(1), useful for cross builds.


# eac161ef 19-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Add lorder(1) to the list of bootstrap-tools.


# fb64060c 19-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Allow to cross-build amd64 on non-i386.


# 951e4d1c 20-Jan-2005 Ruslan Ermilov <ru@FreeBSD.org>

In crunchgen(1), when calling make(1), don't redirect stderr to stdout,
just rely on the exit status to detect an error. This makes crunchgen(1)
safe to use with certain make(1) debugging flags.

MFC after: 1 week


# 4e6242df 29-Dec-2004 David E. O'Brien <obrien@FreeBSD.org>

Remove the special sparc64 time_t support.
If someone isn't running with a 64-bit time_t by now, they don't
track -CURRENT and would probably go to RELENG_5 vs. 6-CURRENT.


# 0f399181 22-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

Further fix the case mentioned in rev. 1.302. The
intent was (and still is) that if a user has say
CPUTYPE=i686 set in /etc/make.conf, we don't print
the assignment type warning unless TARGET_CPUTYPE
is overridden.

Unfortunately, the implementation was buggy, and
only recent changes to bsd.cpu.mk that swapped
canonical and alias values of some CPU types made
the bug apparent.

Here's what happens here.

- CPUTYPE=i686 is set in /etc/make.conf,
- bsd.cpu.mk reset it to "pentiumpro",
- Makefile.inc1 compares this canonical value
with the result of the following test,

make -f /dev/null CPUTYPE=pentiumpro -V CPUTYPE

and expects the result to be "pentiumpro" too,
but "i686" is returned, here's why. We have two
CPUTYPE variables, global, set to "i686" in
/etc/make.conf, and command-line (of a higher
precedence), set to "pentiumpro".

The following part of bsd.cpu.mk,

. elif ${CPUTYPE} == "i686"
CPUTYPE = pentiumpro

which is responsible for converting aliases to
canonical values, sees the value of the CPUTYPE
command-line variable first, "pentiumpro", and
no conversion is done -- the net effect is that
CPUTYPE global stays with its old value "i686",
and "make -V CPUTYPE" (which prints variables
in the global context) returns "i686".

The fix was to pass the CPUTYPE in the test above
as an environment variable instead of as a command
line variable, i.e.,

CPUTYPE=pentiumpro make -f /dev/null -V CPUTYPE

This time, CPUTYPE global is still set to "i686"
initially (by /etc/make.conf), and an envieronment
variable CPUTYPE (of a lower precedence) is set
to "pentiumpro". The .elif sees it's set to
"i686" and resets it to "pentiumpro", and so
"make -V" returns "pentiumpro".

NB: these various types of make(1) variables can
be very painful, especially when combined with
"make -V".


# 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


# 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


# 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


# 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


# 3a35b5b9 17-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

Minor tweaks in "make update" comments.


# 0228d5b6 01-Dec-2004 Peter Wemm <peter@FreeBSD.org>

Do not leave build droppings in /usr/src for usr.sbin/pcvt/keycap and
usr.bin/lex/lib for the 32 bit libraries on amd64. Add an explicit
obj for these two directories that are built in for the "libraries" target.


# d938e8d6 23-Nov-2004 Ruslan Ermilov <ru@FreeBSD.org>

Hopefully fix the "aicasm" build-tool issue when using ${KERNSRCDIR}
different from ${.CURDIR}.

Reported by: jhb


# 63d76a5f 20-Nov-2004 Peter Wemm <peter@FreeBSD.org>

In the amd64 hybrid libraries case, move the kerberos5 tools to before
building the kerberos5 includes. This is not the same patch that
Bjoern A. Zeeb came up with, but the credit still goes to him for finding
the problem. Thanks!


# 9291686f 14-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Oops, all my test boxes have NO_KERBEROS set, so I didn't hit the kerberos5
build tools problem. I'd missed the kerberos5/tools stuff entirely. Add
the missing bits.


# 6c58990d 13-Nov-2004 Bjoern A. Zeeb <bz@FreeBSD.org>

Add knob NO_NIS (fka NO_YP_LIBC) and make world compileable when set.
If turned on no NIS support and related programs will be built.

Lost parts rediscovered by: Danny Braniss <danny at cs.huji.ac.il>
PR: bin/68303
No objections: des, gshapiro, nectar
Reviewed by: ru
Approved by: rwatson (mentor)
MFC after: 2 weeks


# 0931d0a9 12-Nov-2004 Ruslan Ermilov <ru@FreeBSD.org>

Show stray files during "cvs update".


# f9faa1eb 10-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Ruslan told me I should have quoted the arch strings when comparing to
MACHINE_ARCH. Belatedly get around to doing it.


# fae9d999 10-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Change WANT_LIB32 to WITH_LIB32. Sorry for the whiplash folks.
It was pointed out to me that the convention we have is to use WITH_
elsewhere in the system, eg: ports etc. This is all temporary anyway
and presumably will be inverted to a NO_LIB32 or something like it in
the future.


# 1d9468ee 05-Nov-2004 Peter Wemm <peter@FreeBSD.org>

Convert tools/lib32/build.sh into world connectable hooks. This still
rates pretty high on the "hack!" scale, but it works for me. Adding
-DWANT_LIB32 to the world build command line, or 'WANT_LIB32=yes' to
/etc/make.conf will include the 32 bit libraries with the build.

I have not made this default behavior. Cross compiling this stuff is an
adventure I have not investigated.

This is still a WIP. We needed this at work so that we could install from
a readonly obj tree - lib32/build.sh wasn't up to that.


# a35d8893 24-Oct-2004 Ruslan Ermilov <ru@FreeBSD.org>

For variables that are only checked with defined(), don't provide
any fake value.


# c5ebbe8f 11-Oct-2004 Peter Wemm <peter@FreeBSD.org>

Catch another gcc-3.3 c++ include path reference and update it to 3.4.


# 2a614447 27-Sep-2004 Doug Barton <dougb@FreeBSD.org>

1. Add much finer granularity to the NO_BIND knobs with the addition of:
NO_BIND_DNSSEC, NO_BIND_ETC, NO_BIND_NAMED, and NO_BIND_UTILS.

2. Make creation of directories in /usr/include that are only needed
in the WITH_BIND_LIBS case conditional.

Reviewed by: ru, des


# e19f6f27 21-Sep-2004 Ruslan Ermilov <ru@FreeBSD.org>

Hopefully fix alpha and sparc64 builds: on these architectures,
libpthread is provided by src/lib/libc_r.

Also, removed lib/bind from _generic_libs, "lib" will suffice.
Also, removed redundant lib/bind dependency on lib/libpthread
(as lib/bind is not in the _prebuild_libs, it's not needed).

Prodded by: trhodes@ reporting that des@ is on the flight


# cd3ee173 21-Sep-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

Switch from BIND 8 to BIND 9.

Submitted by: (in part) dougb@, trhodes@
Reviewed by: dougb@, trhodes@, re@
MFC after: 5 days


# d0beb853 07-Sep-2004 Warner Losh <imp@FreeBSD.org>

Although 'Unanimous Consent' appears to be a well defined and used in
the US Senate, Canadian Parliament and Australian Senate, it was
causing some confusion. After some consultation with Mark Murray,
change this to 'without objection' since often times a plain-speaking
term is preferable to a regionally used term.

Also, clarify that this procedure is to be used when for more mundane
matters that need a sanity check, but don't need the whole, ponderous
voting proceedure that more difficult issues require. Core members
that read email in any given 48 hour period are trusted enough to know
the difference and to provide the sanity check as necessary.

Reviewed by: markm


# db68d2a6 26-Aug-2004 Paul Richards <paul@FreeBSD.org>

Backout the CVSTAG variable, it could potentially be dangerous if
you track multiple releases in different trees.

Leave the CVSOPTIONS variable there since it could be useful.


# e5d264a3 25-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

Fix "make world DESTDIR=/mnt" to work again. A recent change
to make(1) that causes command-line variables to be passed as
command-line variables to sub-processes that make(1) executes
broke it. By changing the type of all DESTDIR variables used
internally in Makefile.inc1, from environment to command-line
variables of the highest priority, I was able to "make world"
with success, with the command-line variable DESTDIR set.


# e8826115 24-Aug-2004 Paul Richards <paul@FreeBSD.org>

Add a CVSTAG makefile variable that can be set in /etc/make.conf that
determines which CVS tag to track when running make update. This makes
it easier to configure a box to track a particular release if it does
automated updates from a cvs repository.


# 7c996c4a 18-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

A fix from rev. 1.52 of gnu/usr.bin/cc/cc_tools/Makefile was lost
in rev. 1.57. Fix this regression by making cc_tools a new-style
build-tool in Makefile.inc1. For details of what has been fixed,
please see the gnu/usr.bin/cc/cc_tools/Makefile,v 1.52 commit log.

Caught this by accidentally touching param.h while in the process
of cross-buildworld for amd64.


# 0ec443a0 18-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

Moved the MAKEOBJDIRPREFIX check from Makefile.inc1 to Makefile,
to suppress warnings with installworld and distributeworld when
env(1) cannot be found in the PATH.


# bf90c6ee 16-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

sys/boot seems to compile fine on Alpha; unbreak ``make release''.

Prodded by: re-alpha (wilko)


# 88e29990 11-Aug-2004 Hartmut Brandt <harti@FreeBSD.org>

Ensure that a new gensnmptree is built. This should fix the problems
with the snmp_atm module.


# 72e3b039 11-Aug-2004 Ruslan Ermilov <ru@FreeBSD.org>

Enforce the check that MAKEOBJDIRPREFIX (if set) is set in environment
only, and not as a global (in /etc/make.conf) or command-line variable.

MAKEOBJDIRPREFIX has never been a global or command-line variable, and
the fact that it works in some scenarios for "make buildworld" doesn't
make it any more correct. Using it as a global or command-line variable
is error prone, discouraged, costs us lot of false build reports, etc.

This commit is aimed to fix it once and for all.

Anyone potentially objecting to this change is encouraged to read the
make(1) and make.conf(5) manpages, and the comments regarding the use
of the MAKEOBJDIRPREFIX variable in /usr/share/mk/bsd.obj.mk and
/usr/share/examples/etc/make.conf.


# de5b5e45 10-Aug-2004 Hartmut Brandt <harti@FreeBSD.org>

Fix recent breakage in rescue. We need to build a new crunchgen
that will not emit the bad MAKE=make line that caused the breakage.

Submitted by: ru


# 088cf0fb 09-Aug-2004 Hartmut Brandt <harti@FreeBSD.org>

Make make recurse into sub-directories and sub-makes when given
two -n flags. If only one -n flag is given the old behaviour
is retained (POLA). In order to make this working for installworld
change the IMAKEENV in this case so that the tools are found
(we have no temporary installation environment in this case).

Submitted by: ru (IMAKEENV part)


# e62200e7 09-Aug-2004 David E. O'Brien <obrien@FreeBSD.org>

The file(1) related build-tool moved to libmagic.


# 81efba8c 27-Jul-2004 Alexander Kabaev <kan@FreeBSD.org>

Bmake glue for GCC 3.4.2-prerelease.


# be628d28 08-Jul-2004 Hartmut Brandt <harti@FreeBSD.org>

Get rid of the THISHOST variable when building on sparc64. The problem
with it is that it is set by calling hostname and hostname isn't normally
in the path at that point.


# 2c67a07f 17-Jun-2004 David E. O'Brien <obrien@FreeBSD.org>

Third time's a charm?? (the logic was reversed from desired)
Time for sleep...

Submitted by: ru


# 6e009069 16-Jun-2004 David E. O'Brien <obrien@FreeBSD.org>

Grrr, use the userland spelling not the kernel tree spelling.


# f1e3e1c7 16-Jun-2004 David E. O'Brien <obrien@FreeBSD.org>

Fall out from Binutils 2.15: disable building the Alpha loader.


# b4c3fa62 17-May-2004 Ruslan Ermilov <ru@FreeBSD.org>

Allow buildworld and friends to complete when make(1) is called
with some debug flags (-d).

Noticed by: Gleb Smirnoff


# 11167919 13-May-2004 Ruslan Ermilov <ru@FreeBSD.org>

Record the libssl.so dependency on libcrypto.so. This should
help some ports that depend on libradius that recently gained
the dependency on libssl. This is also how the stock OpenSSL
build would link libssl.so on FreeBSD.

Prompted by: kris
OK'ed by: markm, nectar


# 466b960f 12-May-2004 Ruslan Ermilov <ru@FreeBSD.org>

Catch up with the current output of tools/make_libdeps.sh:

- Removed the stale dependency of libypclnt on librpcsvc.
- Fixed the dependency graph of libssh.


# b4b831ef 27-Apr-2004 Ruslan Ermilov <ru@FreeBSD.org>

- Added rad_demangle() for demangling user-passwords (needed for
MS-CHAPv1 MPPE-keys).
- Added rad_demangle_mppe_key() for demangling mppe-keys (needed
for MPPE-keys).
- Added some typecasts for avoiding compiler warnings.
- Fix: better handle wrong usage of the lib (if the programmer
has not called rad_create_request() but rad_put_*(), then a
weird error message was returned).
- Added a new function for putting the Message-Authenticator.
- Verify the Message-Authenticator, if it was found inside a
response packet and silently drop the packet, if the validation
failed.
- Implicitly put the Message-Authenticator, if the EAP-Message
attribute was added.
- Added some missing defines.

Submitted by: Michael Bretterklieber
PR: 46555


# 9de3b350 14-Apr-2004 Hartmut Brandt <harti@FreeBSD.org>

Move the SNMP MIBs and tree definitions from /usr/share/bsnmp to
/usr/share/snmp. This mirrors the use of /usr/local/share/snmp and
makes also more sense when non-bsnmp-specific MIBs go in.


# 43fc6762 13-Apr-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

Add a kernel-toolchain target which only builds the bits required to build
a kernel. This is essentially the same as the toolchain target, except
that it does not build headers and libraries.

Submitted by: ru


# 839274c7 24-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Added the `toolchain' top-level target, which builds enough of
buildworld, up to and including libraries, except for actually
building the world.

Requested by: many


# e5b369af 19-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Removed 3x2 dots I don't like. ;)


# 0aacff4d 19-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Create /usr/sbin in ${WORLDTMP}. I've accidentally removed it in
revision 1.343, but it's needed for btxld(8), and this fix (along
with the --enable-64-bit-bfd configured BFD on i386) allows other
architectures to successfully cross-build the i386 world.

Tested on: alpha


# ba3ae554 18-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Comment various stages of buildkernel, symmetrical to buildworld.


# 125499e5 14-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Don't scare non-root users attempting to build world.


# 2f00651d 13-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Create hierarchy before installing a new kernel. This is needed
because we require that a new kernel be installed prior to a new
world, and we may need some new directories to succeed.

Once MFCed, this will also help those poor souls who redundantly
``mv /modules /modules.old'' in RELENG_4 before an installkernel.

Requested by: many
MFC after: 3 days


# e436e60b 12-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Hide internal implementation details of UID/GID checks from the user.


# 2ff05f90 12-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Use find(1) instead of ``pw groupshow'' to detect missing groups.
Restore checks for recently added PF groups.

Reviewed by: mlaier


# 7698f25a 11-Mar-2004 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

Use 'pw groupshow' instead of 'id -g' to see if a group exists.

PR: 64073
Submitted by: jhb
MFC after: 5 days


# e12b910d 10-Mar-2004 Max Laier <mlaier@FreeBSD.org>

Back out id -g checks as they are wrong (sendmail group untouched).

Requested by: dwhite
Approve by: dwhite


# 0ab11e65 10-Mar-2004 Max Laier <mlaier@FreeBSD.org>

Add installcheck for proxy:proxy and authpf.

Suggested by: ru
Approved by: bms(mentor)


# 171ae50e 05-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Reword two more lines to avoid wrapping.


# b7d44576 04-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Minor stylistic improvements in the SPECIAL_INSTALLCHECKS section, mainly
to reduce the number of wrapped lines.

Suggested by: bde


# 9565bbf3 04-Mar-2004 Bruce Evans <bde@FreeBSD.org>

Improved the description of the installkernel targets.

Don't hide what we do to force failures for the installkernel targets
or other targets.


# afc6f086 03-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Commit the first set of files for changing time_t on freebsd/sparc64
from a 32-bit value to a 64-bit value. This commit does not actually
change anything. It merely provides instructions, scripts, and a safety
measure in Makefile.inc1 for people who want to make the change.

The real change to 64-bit time_t's on sparc64 is scheduled to happen
on March 10th, assuming that so major problems are found between now
and then by early-adopters.

Reviewed by: freebsd-sparc64


# 1e405604 13-Feb-2004 Ruslan Ermilov <ru@FreeBSD.org>

Drop directory existence checks.

OK'ed by: bde


# 11bf3600 31-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

Overhaul of kerberos5/ makefiles. Most significant changes are:

- Dropped support for standalone builds, this was only partially
supported anyway, and required so much magic in makefiles that
made life dangerous (e.g., by using the custom yacc rules).

- Got rid of .OBJDIR in makefiles -- makes building of individual
files possible again.

- Made the .x.c transformations -j safe.

- Reprogrammed LDADD to fix static build of some utilities that
was broken.

- Fixed LDFLAGS and DPADD in the WITH_OPENLDAP case -- positively
affects the contents of .depend files.

- Removed redundant .h's from SRCS, only kept those that are
generated.

- libkrb5/ INCS were bogusly installed again with libgssapi/.

- Made build-tools real tools with their own makefiles in
separate directories. This allows us to properly track
their dependencies, etc.

- Faster build, 21% less of makefile code!

Approved by: nectar
Reviewed by: markm
Silence on: arch


# b6a6dd18 23-Jan-2004 Hartmut Brandt <harti@FreeBSD.org>

Create the OID and tree files while building the modules and the daemon
instead of creating them by hand and storing them in the CVS tree. Add
gensnmptree to the bootstrap tools (it is used to generated these files).
This simplifies the update procedure.

Submitted by: ru


# bbe8270c 22-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

- Run makewhatis(1) in etc/Makefile at the end of "install".
- Removed redundant and undocumented NO_MAKEDB_RUN knob.


# 5151e722 16-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

Create ${WORLDTMP}/legacy/usr/include/c++/3.3 for usr.bin/lex.


# 33b53e37 16-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

lex(1) prior to flex.skl,v 1.8 and gen.c,v 1.7 requires bootstrapping.

Prodded by: nectar


# 897ca6eb 15-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

Alongside revision 1.382, don't build profiled libraries so early
in the build -- it's OK to keep this for the "make all" phase.


# 5091e3df 08-Dec-2003 Garance A Drosehn <gad@FreeBSD.org>

Fix a problem where 'make installworld' will fail and leave the
system in a messy state *if* the user is upgrading from a system
which has no /libexec to a system which builds a DYNAMICROOT, and
if that user has set DISTDIR (as documented for ports, but it turns
out that the same variable name is used for a completely unrelated
purpose in 'make release').

There are other possible fixes for this issue, and ru@ may later
decide to commit one of those fixes. I just wanted some fix in
ASAP, and this is the fix that I have tested.

Reviewed by: bde, imp, and ru


# 5257abea 16-Nov-2003 Gordon Tetlow <gordon@FreeBSD.org>

Invert the condition that installs the dynamic linker early, since
DYNAMICROOT is now the default. Also document -DNO_DYNAMICROOT since
that is going to be a documented feature.

Submitted by: matusita, rushani


# 360b288f 12-Nov-2003 Hartmut Brandt <harti@FreeBSD.org>

The snmp_netgraph module depends on libnetgraph. So add a dependency and
add libnetgraph to the list of prebuilt libraries in the main Makefile.

Reviewed by: ru


# cd7b6c1e 10-Nov-2003 Hartmut Brandt <harti@FreeBSD.org>

Make two directories under usr/share/bsnmp that are needed during
library build to install tree definition files and MIBS.

Okay'ed by: ru


# c54d7e02 03-Nov-2003 Ruslan Ermilov <ru@FreeBSD.org>

Don't be so chatty about building includes.


# 829340b1 04-Oct-2003 Ruslan Ermilov <ru@FreeBSD.org>

Retired the "most" and "installmost" targets -- they just
do not have a chance to work nowadays as we have a lot of
internal libraries in lib/.

Discussed with: marcel, wollman


# 9ed60552 15-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

Help those attempting to upgrade from static to dynamic root.


# 3d0d5c76 15-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

Catch up with libpthread/support/Makefile.inc,v 1.6 and revert
Makefile.inc1 revisions 1.365 and 1.367: libc_pic.a is no longer
necessary to build libpthread.so (ie: libkse.so).


# be01c222 07-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

- No need to create libfoo.so -> libfoo.so.X symlinks in /lib,
as it was decided that our toolchain will revert to looking
for libraries in /usr/lib only.

- Make /usr/lib/libfoo.so -> /lib/libfoo.so.X symlinks absolute
so that they still work if /usr is symlinked.

- Remove stale /usr/lib/libfoo.so.X libraries during install.

Discussed with: gordon, obrien, peter


# d61a976b 01-Sep-2003 Scott Long <scottl@FreeBSD.org>

Clarify the numbering of some of the build stages.


# e95130d9 30-Aug-2003 Ruslan Ermilov <ru@FreeBSD.org>

Revert rev. 1.378, and restore the correct arithmetic expression
syntax. The

make buildworld
mv /usr/include /usr/include.old
make installworld

issue has been fixed a month ago in Makefile,v 1.285, and there
is no valid reason to continue to keep the wrong syntax here --
buildworld takes care of upgrading a make for you if necessary.
But if you find yourself in an environment with an old make(1)
binary that breaks on this, and this is because you attempted
to run a target other than buildworld, don't whine but try again
with -DALWAYS_CHECK_MAKE defined -- it should do the trick.
Otherwise, if you still have a problem, please report it as a
bug and attach the ``make -dl ...'' output.

Reviewed by: marcel


# bb66285c 28-Aug-2003 Marcel Moolenaar <marcel@FreeBSD.org>

Remove the AFM (Anti-Footshooting Measure) added when we split the
5.x signal code from the 4.x signal code. The split happened in
Oct 2002 and we have had 2 releases since then. A kernel older than
5.0-R cannot reasonably be called a -current kernel anymore.

This does not break upgrading from an 10 month older kernel. It just
makes it more exiting.


# c3754771 26-Aug-2003 Warner Losh <imp@FreeBSD.org>

OSRELDATE should fallback to 'unknown' rather than the kernel that's
booted on this machine. This is a slightly better default to use.

Requested by: ru


# e4df6a7d 25-Aug-2003 Warner Losh <imp@FreeBSD.org>

Add @ before the shell invocation for the testing of sufficiently new sh.
No need to see this message twice.


# b21d83f1 25-Aug-2003 Warner Losh <imp@FreeBSD.org>

Fall back to using the kernel version for the OSRELDATE when
/usr/include/osreldate.h doesn't exist on the system. While this
could be worked around by saying something like 'make includes
OSLRELDATE=0' when this file doesn't exist, it is just as easy to
provide a fallback when the file we know we depend on doesn't exist.
While this doesn't make all targets work w/o a
/usr/include/osreldate.h, because some of the FreeBSD bootstrap tools
use this file. 'make includes' however does work.

Noticed by: peter, obrien (and likely others)
Pointy hat to: imp (for suggesting a method that depended on /usr/include)


# 0b0c9474 17-Aug-2003 Gordon Tetlow <gordon@FreeBSD.org>

In preparation for libraries being installed in /lib, add lib to the
list of build directories during the tool creation phase of the build.


# 234f7acb 24-Jul-2003 Mark Murray <markm@FreeBSD.org>

Don't lint(1) so early in the build. Its OK to keep this for the
"make all" phase.


# 234a6529 14-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Apparently we prefer underscores in new options. Sorry for the churn folks.

Requested by: obrien


# a20c015c 11-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Forgot that the rescue subdir needs to be a conditional for the
build-tools bit.


# 4d938af0 11-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Turn rescue back on, conditional to NORESCUE. We seem to be split on
using underscores or not, so I just randomly picked a style. I think
I have the logic correct, but if someone wants to give it a once over
that would be good.

Tim submitted a patch to fix the cross-building issues which I tested
with a tinderbox run for sparc64.

Submitted by: Tim Kientzle <kientzle@acm.org>


# dda36143 09-Jul-2003 Kris Kennaway <kris@FreeBSD.org>

Correct makefile syntax error in r1.375.


# 67599f45 07-Jul-2003 David E. O'Brien <obrien@FreeBSD.org>

Style nit.


# d0c749d3 06-Jul-2003 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

Use 'id' instead of 'grep' to detect the presence of the smmsp user/group.
This fixes the check for users with smmsp in NIS instead of their local
files.

Suggested by: peter
MFC after: 5 days


# 5dc63117 04-Jul-2003 Ruslan Ermilov <ru@FreeBSD.org>

Fixed style bugs related to parentheses in Makefile.inc1.

Submitted by: bde

Fixed nearby bug: propagate the root Makefile's idea of
the appropriate "make" binary down to release/Makefile.


# 18ecbedd 02-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

More NO_RESCUE to RESCUE transitions.

Submitted by: ru


# e9693da9 01-Jul-2003 Gordon Tetlow <gordon@FreeBSD.org>

Switch the logic on the /rescue bits from NO_RESCUE to RESCUE, at least
until there is a fix for cross building available.


# 3cc95654 30-Jun-2003 Ruslan Ermilov <ru@FreeBSD.org>

Put rescue/ into a correct slot in the SUBDIR list. Sort bootstrap-,
build-, and cross-tools lists, reformat lists for easier maintenance.

Submitted by: bde, ru


# a3d6b3e7 30-Jun-2003 Ruslan Ermilov <ru@FreeBSD.org>

Only bootstrap crunchide(1) and build crunchgen(1) when necessary.
The latter needs to be built either if it's used as a cross-tool
(${TARGET_ARCH} != ${MACHINE_ARCH}) or if it has backward compat
issues, like e.g. lack of the AMD64 support.


# 4e650399 29-Jun-2003 Gordon Tetlow <gordon@FreeBSD.org>

Do the deed and hookup /rescue to the build. As a result, always build
crunchgen and crunchide as cross-tools.

Submitted by: Tim Kientzle <kientzle@acm.org>


# e3724050 27-Jun-2003 Sean Kelly <smkelly@FreeBSD.org>

- Fix a typo.

PR: bin/53864
Submitted by: Lukas Ertl <l.ertl@univie.ac.at>
Approved by: jeff (mentor)


# 0147d2aa 22-Jun-2003 Hidetoshi Shimokawa <simokawa@FreeBSD.org>

Allow installkernel.debug and reinstallkernel.debug.


# c4529532 14-Jun-2003 Warner Losh <imp@FreeBSD.org>

Minor tweaks to the build process so that we can build 5.1-current on
4.8-stable:

Must build lib/libc before libpthread. Fix how we do this to be more
consistant with how lists are handled in the file. Also, don't bother
to prebuild libc if we're not building libpthread.

Submitted by: ru@
Reviewed by: bde@ (before ru@ submitted it)


# f212249a 14-Jun-2003 Dag-Erling Smørgrav <des@FreeBSD.org>

Do not bogusly set CSTD to the empty string.


# 21e24af3 07-Jun-2003 Warner Losh <imp@FreeBSD.org>

Add lib/libc to list of _prebuild_libs because we need the target
built libc_pic.a for libkse.

# This should finally fix the build on 4.x

Submitted by: kan


# 59d855a0 07-Jun-2003 Warner Losh <imp@FreeBSD.org>

When boot strapping from older systems, don't specify a C standard in
the bootstrap process. This allows one to more completely build from
a -stable box.

Reviewed by: ru@ (briefly)


# 652b5a75 31-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Wrap gperf & groff wth NO_CXX.


# a0218a2a 21-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak world build if NO_OPENSSL is defined but NO_KERBEROS is not.

Submitted by: Marius Strobl <marius@alchemy.franken.de>
Approved by: re (jhb)


# 7691f66a 19-May-2003 Dag-Erling Smørgrav <des@FreeBSD.org>

Retire the useless NOSECURE knob.

Approved by: re (scottl)


# 8ec00e70 18-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak parallel make of _includes after revision 1.356 changes.

Spotted by: bde
Approved by: re (scottl)


# 5d296100 17-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

-lbsdxml lives in lib/libexpat. *Blush*

Submitted by: tmm (Makefile.inc1)


# 81d5f438 17-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak world: record libgeom dependency on libbsdxml here too.

Forgotten by: ru
Submitted by: des
Verified by: tools/make_libdeps.sh
Approved by: re (scottl) (related change)


# 50da533c 15-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Use the installed world's idea of OSRELDATE rather than the kernel.
This was the initial intent anyway, and it became clear that it is
really necessary to treat it this way, as many people happen to run
with kernel newer than the installed world.

Submitted by: imp, ru
Approved by: re (scottl)


# a270eca5 04-May-2003 Bruce Evans <bde@FreeBSD.org>

Install symlinks to individual headers instead of symlinks to directories
in the SHARED=symlinks case. Symlinks to directories only work if all the
the necessary headers are in 1 directory, but the necessary headers are
scattered for at least ipfilter headers in <netinet>. This change also
avoids polluting /usr/include with non-headers; the /usr/include hierarchy
is now independent of the setting of SHARED.

Submitted by: ru (edited to fix netgraph/bluetooth/include and machine/pc)
PR: 44148


# 4ee05d29 05-May-2003 Mark Murray <markm@FreeBSD.org>

Negate the logic of MAKE_KERBEROS5, and replace it with NO_KERBEROS.


# 22bd4d16 03-May-2003 Warner Losh <imp@FreeBSD.org>

Many developers run with userland != to kernel. While this isn't
supported, it usually works for months at a time. Allow these people
to override the OSRELDATE of their installed world when things don't
match and the exact OSRELDATE matters and is different than the
kernel. Now that Makefile.inc1 depends more and more about which date
you have to optimize the pieces it builds, it may be necessary to
pessimize things if its guesses are wrong.

If OSRELDATE is already set, we won't fork the sysctl to find out what
the kernel's date is.

Developers on IRC suggested that they run mismatches all the time as
well.

Reviewed by: obrien


# dd2aac02 01-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

For the time being, upgrade the whole Groff (to version 1.19),
but stop doing so again on the next __FreeBSD_version bump.


# 01b63a10 29-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Restore the ordering of NO's and remove one redundant NOLINT.

Reviewed by: markm


# 945e0cea 30-Apr-2003 Mark Murray <markm@FreeBSD.org>

Fix "make world" for the WANT_LINT case. The various build tools
must not try to lint(1) stuff at *-tools time; keep the linting
for the actual build (which comes later).


# 007bf12e 30-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Groff after 2002/10/15 has no known backward compatibility issues,
but we always want the latest macro files.


# 69e74195 16-Apr-2003 John Baldwin <jhb@FreeBSD.org>

Rename KRNLSRCDIR to KERNSRCDIR and allow it to be overridden. The name
change was to be consistent with other overridable variables such as
KERNCONFDIR and KERNCONF.


# c2400c8e 14-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

kbdcontrol.c rev. 1.35 and onwards support the KEYMAP_PATH
environment variable, and don't need to be bootstrapped.


# 692ebfe9 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

yacc(1) with skeleton.c rev. 1.29 in HEAD and rev. 1.28.2.1 in RELENG_4,
and onwards, are believed to not require bootstrapping.


# da54b929 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

xargs.c rev. 1.10 in HEAD and rev. 1.9.2.1 in RELENG_4,
and onwards, have support for the -J option we need.


# 47c95a33 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

elf2aout.c,v 1.6 and onwards have no known backward compatibility issues.


# 710b5ef8 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

uudecode.c rev. 1.23 in HEAD and rev. 1.13.2.3 in RELENG_4,
and onwards, have no known backwards compatibility issues.


# 7a9bf940 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Only create directories that are really needed.


# ad1520bd 13-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Install bootstrap-tools into a separate subtree of ${WORLDTMP}.
This allows us to use them as early as possible while building
bootstrap-, build-, and cross-tools. Some cleanups to follow.

This change resolves the gperf(1) bootstrapping issue (missing
-E option) in gnu/usr.bin/cc/cc1plus while in the cross-tools
stage when upgrading from 4.0-RELEASE.


# cb66f4dd 12-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Make sure legacy stuff comes last. Some tools that use
legacy stuff (binutils) depend on this order.

For this to work, provide (and use) specialized versions
of bsd.prog.mk and bsd.lib.mk that include the standard
versions first, then augment CFLAGS, DPADD, LDADD, and
LDFLAGS as necessary, with the legacy stuff.

Tested on: 4.0-RELEASE


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

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


# c0006b49 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Put back the undocumented change from rev. 1.334 too: no
need to create ${WORLDTMP}/legacy/usr/include explicitly.


# 5675749e 06-Apr-2003 Warner Losh <imp@FreeBSD.org>

Put back parts of 1.335 and 1.336 that 1.337 accidentally backed out.

Submitted by: ru


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


# 5ceb21ff 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Always remove ${WORLDTMP}/build/usr/include, even in the NOCLEAN
case. This way, we won't have stale compatibility headers there.


# cfc236e8 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Moved libbuild target to where it belongs. Added a comment.


# 32054bbb 06-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Fixed buildworld stages names in comments.


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

We can't use ${WORLDTMP}/usr/{include,lib} for the compat layer. This
is because we populate these directories later, and a subsequent
-DNOCLEAN build may fail. So, we put them in
${WORLDTMP}/build/usr/{include,lib} instead and adjust Makefile.boot.

Again, this works on -stable and -current, but might break older
versions.

Submitted by: ru@


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


# 756ec6a4 04-Apr-2003 Warner Losh <imp@FreeBSD.org>

Diff reduction with my p4 changes:

Add @ before ${ECHODIR} where appropriate because we don't need to echo
the echo command... This gets rid of extra echo ===> in log files...


# cdcdfd87 01-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Parallelize (on the top-level SUBDIR list) the "all" stage of
buildworld. This gives 5-11% percent gain in real buildworld
times on various UP and SMP systems here. I used 4 * hw.ncpu
as an argument to "make -j" in my tests.


# b9040d98 01-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Pass NO_WARNS to the build-tool stage too; -Wsystem-headers
isn't known to the 4.x system compiler.


# effd19ed 31-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Enable cpp(1) warnings in system headers. GCC is oriented on
glibc which is externally maintained, so GCC ships with these
warnings turned off by default. This is also consistent with
the src/contrib/gcc/c-lex.c,v 1.2 change.


# fcdc2713 30-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Slightly improve buildworld times by excluding crunchide(1)
and kgzip(8) from the list of cross-tools during the normal,
non-"make release" buildworld.

Also, don't gratuitously build them, btxld(8) and elf2aout(1)
for native architecture builds, since they have no known
boostrapping issues along the supported upgrade path.

Prodded by: peter


# 8eb1c4ca 11-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Convert kgzip(8) to be an i386 cross-tool. This is needed for
cross-releasing i386 on different architectures. This version
provides an i386 version of <a.out.h>, and handles endianness.

Tested on: alpha, sparc64


# 4d9e5ead 08-Mar-2003 Mark Murray <markm@FreeBSD.org>

KerberosIV de-orbit burn continues. Disconnect from "make world".


# f93bdc08 06-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

With CVS_UPDATE, use read-only repository mode by default.


# f617fa52 04-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Doh, committed to the wrong branch.

Spotted by: johan


# 7adf0ebb 04-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

MFC: Ship with /etc/login.conf hashed.

Approved by: re


# 6192b1df 03-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Make sure the default install comes with /etc/login.conf hashed.


# 73ba057c 03-Mar-2003 Ruslan Ermilov <ru@FreeBSD.org>

Catch up with sys/conf/kern.post.mk,v 1.39 -- we can now use
plain ${CLEANDIR} to clean kernel and modules. This has an
additional nicety of respecting NOCLEANDIR.


# 2ff31e0d 24-Feb-2003 Ruslan Ermilov <ru@FreeBSD.org>

Ensure that build-tools end up in the object directory different
from the source directory. (This mostly affects the RELENG_4's
``make release'' release.5 target, where "rtermcap" build-tool
for release/sysinstall ends up in the source directory and later
steps of release.5 wipe it out.)

Spotted by: jhay


# 9a9c78bd 21-Feb-2003 Ruslan Ermilov <ru@FreeBSD.org>

Respect ``makeoptions NO_MODULES'' specified in the kernel config file.


# 24cc1d58 11-Feb-2003 Tom Rhodes <trhodes@FreeBSD.org>

Add -DNOMAN to the list.


# 07e5ffba 07-Feb-2003 Joseph Koshy <jkoshy@FreeBSD.org>

Catch typos in the kernel name specified for an "installkernel" invocation
early on, rather than failing later with an obscure error message.

Make error messages appear consistent.


# d0cfa43f 04-Feb-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Don't attempt buildworld if the path to the source-tree contains a comma.

Can be removed if the underlying issue is fixed.

Submitted by: Flemming Jacobsen <fj@batmule.dk>


# cbb66355 30-Dec-2002 David E. O'Brien <obrien@FreeBSD.org>

Move elf2aout back to /usr/bin -- it is a general development tool, not
a sysadmin tool.


# fc599016 02-Dec-2002 Ruslan Ermilov <ru@FreeBSD.org>

For installkernel, use the fresh tools (if we've built them with
buildworld).

Reviewed by: imp, marcel
Approved by: re (rwatson)


# 3f66c888 14-Nov-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make dynamic PAM modules depend on dynamic PAM library.

Requested by: des, markm


# 40c6b893 13-Nov-2002 Ruslan Ermilov <ru@FreeBSD.org>

Take __FreeBSD_version into account when BOOTSTRAPPING.


# fb404d6f 03-Nov-2002 Scott Long <scottl@FreeBSD.org>

Hook the aic7xxx modules up. This requires some extra care since aicasm
is a compiler tool and needs to be compiled by the host compiler. I've
tested this in i386->sparc cross-build, 4.7->current upgrade, normal
buildkernel target, and normal /sys/i386/compile/GENERIC configurations.

Submitted by: ru


# 60e155d9 28-Oct-2002 Ruslan Ermilov <ru@FreeBSD.org>

Emptify.


# 6ef0c770 26-Oct-2002 Peter Wemm <peter@FreeBSD.org>

DISTDIR is used by 'make release', lets see if this is enough to turn
off the execution test.


# 13f571a3 25-Oct-2002 Peter Wemm <peter@FreeBSD.org>

Provide a bit of anti-foot-shooting protection. Make sure that in the
non-cross cases without DESTDIR, that the bin/sh that we're about to
install works. Otherwise, a 'make installworld' without having already
rebooted with a post-signal-fix kernel is a rather big disaster when
important things like /bin/sh coredump.


# 017b462e 22-Oct-2002 Ruslan Ermilov <ru@FreeBSD.org>

_games is gone in rev. 1.305.


# dc2f663b 20-Oct-2002 Mark Murray <markm@FreeBSD.org>

Do not build the majority of the games. Remaining are the
"utility-like" games and everyone's favourite, fortune(6).


# 66422f5b 16-Sep-2002 Peter Wemm <peter@FreeBSD.org>

Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports. As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL. It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha


# c065f5b2 22-Aug-2002 Johan Karlsson <johan@FreeBSD.org>

Similar to bsd.subdir.mk, echo the name of the dir before
doing the cd. This is done for bootstrap-tools,
build-tools, cross-tools, and the libraries loop.

Reviewed by: ru
Approved by: sheldonh (mentor)
MFC after: 1 week


# d4f7b113 08-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

The intent in rev. 1.299 was to make the CPUTYPE assignment type check
bother "only those who attempts to set it to a different value". This
got broken in rev. 1.300 (that fixed another race).

Reported by: ache


# 10a6b1ff 07-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

Makefile.inc1 may eventually be merged with Makefile, so fix an
endless recursion bug similar to the one that has been fixed in
release/Makefile,v 1.698, in advance. A related fix to make(1)
has been committed in make/main.c,v 1.68.

Requested by: bde (who has them merged already)


# 9f3089ac 05-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

An empty CPUTYPE now means ``the default CPUTYPE'' in bsd.cpu.mk.
If there was no CPUTYPE assignment in /etc/make.conf, this would
cause the ``CPUTYPE assignment type'' check to falsely fail.

Reported by: johan

Fixed this by making sure we always pass the non-empty CPUTYPE.
Also make sure we use the correct set of share/mk files in our
test.


# 32f8ca45 02-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

TARGET_CPUTYPE should exist solely in Makefile.inc1, similar to
TARGET_ARCH and TARGET. This is problematic when one has the =
(unconditional) type of assigment for CPUTYPE in /etc/make.conf.
(This would override what was set on the command line to "make
buildworld".)

Add a (horrible) kludge to Makefile.inc1 to check the type of
assignment for CPUTYPE (only for those who attempts to set it to
a different value). Fix an example make.conf. Fix the kernel's
build-tools target (aicasm only at the moment) to catch up with
bsd.cpu.mk,v 1.15 (BOOTSTRAPPING replaced with NO_CPU_CFLAGS in
Makefile.inc1's BMAKE).

Reviewed by: jhb


# 22e256fd 30-Jul-2002 John Baldwin <jhb@FreeBSD.org>

- Define NO_CPU_CFLAGS during BMAKE and TMAKE (and thus XMAKE) so that
bsd.cpu.mk doesn't have to worry about compilers other than the current
version.
- Allow TARGET_CPUTYPE to override CPUTYPE in bsd.cpu.mk.
- Treat an empty CPUTYPE the same as an undefined CPUTYPE.
- For buildworld, buildkernel, etc., define TARGET_CPUTYPE to CPUTYPE for
native builds and define it to be empty for cross-builds.
TARGET_CPUTYPE is only defined if it is not already defined via the
commandline or environment.


# 609b7b31 24-Jul-2002 Ruslan Ermilov <ru@FreeBSD.org>

Inline ${_cxx_consumers}.


# 6b308680 24-Jul-2002 Peter Wemm <peter@FreeBSD.org>

We're done with 1.287 and 1.288 now.

Submitted by: ru


# 6faeb369 11-Jul-2002 Ruslan Ermilov <ru@FreeBSD.org>

Pass -DBOOTSTRAPPING to the kernel's build tool (sys/dev/aic7xxx/aicasm).
This way, it has a chance to be built with gcc 2.95.x (using the bandaid
in share/mk/bsd.cpu.mk,v 1.11).

Feedback timeout from: gordon


# b0346d34 01-Jul-2002 Juli Mallett <jmallett@FreeBSD.org>

libufs does not need built before most things, after all.

Submitted by: bde, ru


# a306cfd1 30-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Add libufs to prebuild_libs, since lots of things will want it, in time.


# 072f6798 21-Jun-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make NO_OPENSSL actually imply NO_OPENSSH, as documented in make.conf(5).


# f9382a3c 16-Jun-2002 Maxim Sobolev <sobomax@FreeBSD.org>

Don't try to build libssh if NO_OPENSSL is defined because NO_OPENSSL implies
NO_OPENSSH.


# 4093807d 06-Jun-2002 Ruslan Ermilov <ru@FreeBSD.org>

libfetch now depends on libcrypto and libssl.


# 99b73fff 31-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

On behalf of lib/compat/compat4x.i386/libusb.so.0.bz2.uu,v 1.1,
added uudecode(1) to bootstrap-tools.


# 3c67aa80 30-May-2002 Peter Wemm <peter@FreeBSD.org>

Ignore a c++ that is version other than 3.1 if it does not also match
cc's version. libgcc.a will have been clobbered and will no longer have
the old c++ support.

Submitted by: jhb


# f119dc7c 28-May-2002 Peter Wemm <peter@FreeBSD.org>

Bandaid for helping people who have a broken /usr/bin/c++ installation.

This only affects the -current early adopters and developers who have
done a 'make world' in the last few weeks and as a result installed a
gcc-3.1 version of /usr/bin/c++ but without the corresponding library
support that this now requires. This is a temporary hack that should be
deleted within a few weeks. In this case we will use the existing
gperf/groff one last time around for the early stage1 bootstrap. (This
isn't so bad, because we were unconditionally using the host one before)


# 0367ff75 28-May-2002 Peter Wemm <peter@FreeBSD.org>

Put on peril sensitive sunglasses and turn C++ stuff back on.


# 6af587dc 28-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed the world breakage caused by my last commit.
NOMAN is defined when building bootstrap-tools.

Submitted by: jhay


# a6290aac 27-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap makewhatis(1).


# 02c0301f 25-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Move elf2aout to usr.sbin/.

Approved by: jake


# b501b9b5 20-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap elf2aout(1) for sparc64; used to build sys/boot/sparc64/boot1.


# d246873e 18-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Back out rev 1.278. Seems we grew a getconf(1) that requires it.


# 17dbb179 18-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Remove local patch that crept in.


# ef446fb2 17-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Don't build gperf.


# 10b2978e 16-May-2002 Mark Murray <markm@FreeBSD.org>

Remove the perl bits from the build.


# 83f56d9a 15-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make sure to not yet build the GNU C++, but still allow
for the C++ progs to be built with e.g. an old compiler,
CXX=/usr/bin/c++, for the time being.


# 5d862037 15-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Rename `includes' to `buildincludes'.
Rename `incsinstall' to `installincludes'.
Make `includes' a -j safe shortcut for `buildincludes' + `installincludes'.
`buildincludes' and `installincludes' are SUBDIR friendly, if run directly.


# 1fbb6ab5 14-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Restore comment that got lost in revision 1.265.


# 1b690a48 14-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Do not run `includes' and `incsinstall' in parallel.

Spotted by: jhay

Parallel worlds and releases should be working again.


# c7b111cb 12-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

Added new bsd.incs.mk which handles installing of header files
via INCS. Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files. Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.

Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1. Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):

kerberos5/lib/libtelnet/Makefile
lib/libbz2/Makefile
lib/libdevinfo/Makefile
lib/libform/Makefile
lib/libisc/Makefile
lib/libmenu/Makefile
lib/libmilter/Makefile
lib/libpanel/Makefile

Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.

Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD. Similarly for INCOWN, INCGRP,
and INCMODE.

Consistently use INCLUDEDIR instead of /usr/include.

gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.

These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".


# 42801998 12-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Quiet the peanut gallary and back out magical "breakage".


# bd7ce31c 09-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Turn off groff and gperf -- they will not compile with the in-tree Gcc 3.1.


# c3bb8639 09-May-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Add rpcgen to the bootstrap tools.


# fdc6a23f 09-May-2002 David E. O'Brien <obrien@FreeBSD.org>

`beforeinstall' w/the csu bits is a nop.


# 1b860b61 08-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Build our native CSU bits before the compiler-specific ones.
This helps in the compiler build.


# ce7c5cc8 07-May-2002 David E. O'Brien <obrien@FreeBSD.org>

Make NO_CXX, really mean NO_CXX.


# 61e86e72 30-Apr-2002 Bruce Evans <bde@FreeBSD.org>

Sorted the directories in the rule for the includes target as much as
possible.


# 8f1f55e9 30-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Milestone #2 in cross-arch make releases. They now work!

You need to set TARGET_ARCH and possibly TARGET, the same
way you normally do it for a cross build(7).

Renamed `distribworld' to a more natutal `distributeworld'.

Put pwd_mkdb(8) under ${INSTALLTMP}; for `distributeworld'.


# d6e61d98 30-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Back out part of the revision 1.261: "etc" indeed needs to be
last for "distribute" to succeed -- the "make makedb" part of
the etc/Makefile:distribution target should be the last thing
made.


# 64b06e78 30-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make crunchide(1) a cross-tool; needed for cross-arch "make release".
Note that a.out is only supported for the non-cross i386 case.


# d672a609 29-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Parallel "make release" fixes.


# 6bde859f 26-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Milestone #1 in cross-arch make releases.

Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.

Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.

Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).

Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).

In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.

Moved the creation of the "crypto" dist from release.5 to
release.2.

In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.

Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.

Inline createBOOTMFS target.

Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.

Assorted fixes:

Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".

Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.

gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.

release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.

Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.

XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)

Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.

Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>


# b56f8802 20-Apr-2002 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

Despite the fact that it is documented in the handbook, the release notes,
and UPDATING and has been posted to both freebsd-current and
freebsd-stable, users are still not adding the required smmsp user and
group before doing an installworld. Therefore, don't let users do an
installworld unless they have followed directions.

Add a new installcheck Makefile target which installworld runs before
actually starting the installation. This target can be used by other parts
of userland as well. The first addition to the target is to check for the
smmsp user and group if NO_SENDMAIL isn't defined.

Others may add checks to this target as they see fit.

MFC after: 1 week


# 92815c0c 16-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Sort _startup_libs, _prebuild_libs, and _generic_libs lists alphabetically.

Submitted by: bde, ru


# dc173bd8 16-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Keep up with lib/Makefile,v 1.64 (uhh).


# 5de7148c 15-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix incorrect ordering in previous commit.


# 004e6863 15-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Add libypclnt to the prebuild library list, and record its dependency on
librpcsvc.


# 761139b1 13-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Add libypclnt to the includes target.


# 4d8bba46 12-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Add a tool (and the first application of it) that could be used
to automate building of libraries.

Prodded by: bde


# b2490f91 11-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

I now don't seem to be able to reproduce the -DNOCLEAN buildworld
breakage with ioctl.c. The .depend file should track dependencies
just fine, and the worst we can have is to miss new ioctls.

But I still think it's a good idea to have -DNOCLEAN build produce
the same ioctl.c as it would without -DNOCLEAN.

Prodded for a long time by: bde


# 04454986 11-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Don't special case i386/pc98, replace it with the smarter logic
of setting ${TARGET} -- make it default to ${MACHINE} if we are
not cross-building, and ${TARGET_ARCH} otherwise.

Set MAKEOBJDIREPREFIX based on ${TARGET}, not on ${TARGET_ARCH}.
This is useful if you want to cross-build pc98 worlds on i386.


# 66002be3 08-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Avoid cleaning modules twice in `buildkernel'.


# e69e7778 08-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap xargs(1) -- sys/conf/kmod.mk uses the new -J option.

PR: bin/36747


# 56f2a75b 03-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Unbreak buildworld after include/Makefile,v 1.167 commit.


# 1b88dfbd 01-Apr-2002 Josef Karthauser <joe@FreeBSD.org>

Back out lots of the last commit that was committed by accident.
(It's my test rig for some CVSUP,SUP code).

Spotted by: Michael G. Petry <petry@NetMasters.Com>


# 388f4c1d 01-Apr-2002 Josef Karthauser <joe@FreeBSD.org>

Install libusbhid.h during 'make includes'.

Requested by: jhb
MFC after: 3 days


# 9f1207d5 26-Mar-2002 Ruslan Ermilov <ru@FreeBSD.org>

Install sys/security/lomac/*.h to /usr/include/security/lomac/.

Install sys/<arch>/include/pc/*.h to /usr/include/machine/pc/.

PR: docs/29534

Install sys/netatm/*/*.h to /usr/include/netatm/*/.

Don't install compatibility symlinks for <machine/soundcard.h>
and <machine/joystick.h>. Three years is enough to be aware of
the change, and these weren't visible in the SHARED=symlinks
case.

Back out include/Makefile,v 1.160 that was a null change anyway
due to the bug in the path, and we now don't want to install
these headers because they would otherwise be invisible in the
SHARED=symlinks case.

Don't install IPFILTER headers. Userland utilities fetch them
directly, and they were not visible in the SHARED=symlinks case.

Resurrect SHARED=symlinks in Makefile.inc1.

PR: bin/28002

Prodded by: bde
MFC after: 2 weeks


# bd42830f 20-Mar-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make lint(1) a cross-tool.

(See commit log for usr.bin/xlint/Makefile,v 1.11 for what was wrong
with enabling build of lint libraries in rev. 1.12.)

This fixes cross-arch compiles (running binaries for a different arch
when generating lint.7 and lint libraries) and cross-branch compiles
(4.x -> 5.0 buildworld should be working again).


# 7b7aae42 20-Mar-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed the NO_PERL braino.


# 5ad400ab 16-Mar-2002 Mark Murray <markm@FreeBSD.org>

Update for Perl 5.6.1


# 9365c8a3 16-Mar-2002 Mark Murray <markm@FreeBSD.org>

Allow the use of NO_PERL as well as NOPERL. The latter is going to
be removed.


# 9c15e38a 06-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

1-true-AWK has a build-tool target.


# ea5c0da9 21-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

Obviate the need to set the COMPILER_PATH and LIBRARY_PATH in Makefile.inc1
to pick up the correct cross-tools (the compiler executables and binutils)
and special linker files (crt*.o). This is now controlled by a single knob,
TOOLS_PREFIX, when building cross-tools.

Fixed regression in Makefile.inc1,v 1.203 (-nostdinc). This clobbered target
architecture's CFLAGS with building host's CPUTYPE setting in /etc/make.conf,
and had a nice but nasty side effect of exposing some (normally hidden) bugs
in system headers.

(Attempt to move the "-nostdinc -I..." part of CFLAGS into the new CINCLUDES
(modeled after a similar CXXINCLUDES) eventually failed because hard-coding
${WORLDTMP}/usr/include to be the first in the include list does not always
work, e.g. lib/libbind.)

Compensate the -nostdinc removal by making cpp(1) built in the cross-tools
stage to not look for <> header files in the building host's /usr/include
(already committed as gnu/usr.bin/cc/cc_tools/freebsd-native.h, revisions
1.10-1.12, STANDARD_INCLUDE_DIR).

: $ /usr/obj/usr/src/i386/usr/bin/cpp -v /dev/null
:
: Before:
:
: #include <...> search starts here:
: /usr/obj/usr/src/i386/usr/include
: /usr/include
: End of search list.
:
: After:
:
: #include <...> search starts here:
: /usr/obj/usr/src/i386/usr/include
: /usr/obj/usr/src/i386/usr/include

(Disabling the use of GCC_INCLUDE_DIR in the FREEBSD_NATIVE case would fix
the duplicate above.)

Get rid of the (now unneeded) -I${DESTDIR}/usr/include magic in bsd.prog.mk
and bsd.lib.mk. Finish the removal of LDDESTDIR in bsd.lib.mk,v 1.55 -- we
no longer have users of it.

The required changes to gcc were already committed as contrib/gcc.295/gcc.c,
revisions 1.23 and 1.24.

Basically, this allows for the changes above plus makes gcc(1) persistent
about path configuration, whether it's configured as a native or a cross
compiler:

: $ /usr/obj/usr/src/i386/usr/bin/cc -print-search-dirs
: install: /usr/obj/usr/src/i386/usr/libexec/(null)
: programs: /usr/obj/usr/src/i386/usr/libexec/elf/:/usr/obj/usr/src/i386/usr/libexec/
: libraries: /usr/obj/usr/src/i386/usr/lib/
:
: $ /usr/obj/alpha/usr/src/i386/usr/bin/cc -print-search-dirs
: install: /usr/obj/alpha/usr/src/i386/usr/libexec/(null)
: programs: /usr/obj/alpha/usr/src/i386/usr/libexec/elf/:/usr/obj/alpha/usr/src/i386/usr/libexec/
: libraries: /usr/obj/alpha/usr/src/i386/usr/lib/

Reviewed by: bde, obrien


# 7a6051e8 14-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

The previous fix for broken -DMAKE_KERBEROS5 world was incomplete.
Finish it by adding kerberos5/lib/libvers to the build-tools list.

(I didn't notice it before because I tested my fix in a -DNOCLEAN
environment, and static libc.a was already in ${WORLDTMP}/usr/lib,
and libvers's make-print-version build tool used it for linking.)

Spotted by: John Indra <maverick@office.naver.co.id>


# 19f56da9 11-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed -DMAKE_KERBEROS5 world breakage in kerberos5/lib/libroken
(make-roken is a build tool). This bug was hiding itself after
a just fixed bug in cross-linker (binutuils/ld/Makefile,v 1.20).

The bug was fatal for cross builds; for example, an alpha binary
(make-roken) was attempted to be run on i386.

Added make-roken to the list of build-tools in libasn1. It only
worked because another build tool needs make-roken implicitly:

(build-tools: asn1_compile: print_version.o: roken.h: make-roken).

Spotted by: nectar


# e47a40e7 08-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

Now that cross-tools ld(1) has been fixed to look for dynamic
dependencies in the correct place, record the fact that -lssh
depends on -lcrypto and -lz.

Removed false dependencies on -lz (except ssh(1) and sshd(8)).
Removed false dependencies on -lcrypto and -lutil for scp(1).

Reviewed by: markm


# fac6ec1f 08-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

FreeBSD 4.1 bootstrapping aid (setproctitle(3) is in -lutil).

This backs out (sort of) delta 1.18 to perl/miniperl/Makefile.
Update to the ld(1) comment by peter in this revision:

ld(1) built as part of the cross-tools stage of buildworld has
been fixed to look for dynamic dependencies in the right place,
${WORLDTMP}/usr/lib, effective binutils/ld/Makefile,v 1.20.

Approved by: markm


# 0f958c27 28-Dec-2001 Paul Richards <paul@FreeBSD.org>

gnu/libexec has gone so remove it from the most targets.


# d235a1a0 23-Dec-2001 Chris D. Faulhaber <jedgar@FreeBSD.org>

Specify the full path to mktemp


# 0525c7ea 20-Dec-2001 Chris D. Faulhaber <jedgar@FreeBSD.org>

Use a more secure method of creating the temporary
install directory.


# 2694e8c7 13-Dec-2001 Warner Losh <imp@FreeBSD.org>

Move NO_WERROR from CROSSENV to BMAKE. In CROSSENV it disables it for
the entire build. We only want it for the bootstrap process.

Submitted by: ru


# 68f04dad 12-Dec-2001 Warner Losh <imp@FreeBSD.org>

Add NO_WERROR to the cross building environment so that we do not bail on
warnings generated by earlier versions of the compilers when bootstrapping.

Also a minor formatting nit in the tools list.

Reviewed by: markm


# 5f4a79e5 11-Dec-2001 Alexey Zelkin <phantom@FreeBSD.org>

Get rid of unsed since rev 1.109 of lib/Makefile WANT_CSRG_LIBM define.
Also replace internal make variable _libm with hardcoded path to lib/msun

Reviewed by: bde


# b69cb634 06-Dec-2001 John Baldwin <jhb@FreeBSD.org>

Just to be pedantic and more aesthetically pleasing, move the secure/
top-level subdirectory prior to share/ so that the top-level directories
are processed in alphabetical order.


# 09b50a98 19-Nov-2001 David E. O'Brien <obrien@FreeBSD.org>

Add the CVS knob so it may be overridden (or have options added).

Submitted by: Andrea Campi <andrea@webcom.it>


# b721f69c 15-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Don't cleandir also if MODULES_WITH_WORLD.

MFC after: 3 days


# acd9c8a8 15-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Typo fix (my test version doesn't have this...)


# 6a798cfa 15-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Run "make cleandir" if NO_MODULES are set, or there is no sys/modules
directory. Previous commit breaks buildkernel if NO_MODULES was set.
Sorry...

Noticed by: mike


# 4271dfbc 14-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

"make cleandir" before building a kernel and modules.

This will hopefully fix the recent 'I cannot compile linux module with
buildworld' problem. MFC will come shortly.

Submitted by: imura@ryu16.org


# 2ec22946 13-Nov-2001 Makoto Matsushita <matusita@FreeBSD.org>

Set full-path of cvsup.

In src/Makefile rev 1.232, environment variable PATH is set explicitly
to /sbin:/bin:/usr/sbin:/usr/bin. As a result, binaries located on
non-standard path cannot be executed without full-path (it's the change
of this revision).

However, cvsup is not in our base system -- you lose if you try to
"make update" without setting SUP in make.conf or command line argument.
I think it is safe to assume that cvsup is located at /usr/local/bin,
and it would help other people who first try to do "make update".

PR: 31932
MFC after: 1 day


# 2335a3d7 02-Nov-2001 David E. O'Brien <obrien@FreeBSD.org>

Bring Gawk back. There just isn't any other POSIX compliant AWK out there.
The biggest thing missing from Bell-Labs AWK is the character class regexes.


# 491beb71 31-Oct-2001 David E. O'Brien <obrien@FreeBSD.org>

Add 'awk' to the build-tools, so that the small utility used to build
one of the source files is made for the host, not target.


# 444ff633 25-Oct-2001 Ruslan Ermilov <ru@FreeBSD.org>

Fix cross-building further.

Introduce ${TARGET} defaulting to ${MACHINE} which should be set to
whatever your target ${MACHINE} is, and use that with world-related
stages. That is, to build pc98 on alpha, one now needs to set both
TARGET_ARCH=i386 and TARGET=pc98.

The scope of ${TARGET} is limited to Makefile.inc1 and cross-tools.

In particular, this change was tested to fix:

1. Cross building of "alpha" on i386. The breakage was introduced
by rev. 1.10 to sbin/i386/Makefile (missing <machine/cronyx.h>).

2. Descending into machine-specific subdirs for a different arch.
Previously, sbin/i386 and usr.sbin/boot0cfg were descended into
when cross-building "alpha" or pc98 on i386.

3. Fixes pc98 cross-building which was horribly broken, caused by
not setting MACHINE correctly (most ${MACHINE} == pc98 checking
Makefiles put -DPC98 to CFLAGS).


# 4448c79e 29-Sep-2001 Ruslan Ermilov <ru@FreeBSD.org>

Fix cross-building, etc:

1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!

2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.

We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.

Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.

That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.

3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.

There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:

1) They use (and depend on) the host environment.

2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.

In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.

4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.

5. Fixed "includes" to install secure/lib/libtelnet headers if
required.

Reviewed by: bde


# b4e13f7b 24-Sep-2001 Ruslan Ermilov <ru@FreeBSD.org>

Removed touch(1) from the list of installworld tools that
was added in previous revision for no apparent reason.

Submitted by: bde


# 9356546b 19-Sep-2001 Mark Murray <markm@FreeBSD.org>

Add which(1) the stuff that we need early on. The perl build needs it
to find miniperl.


# a1e0e968 17-Sep-2001 Ruslan Ermilov <ru@FreeBSD.org>

Run the `bootstrap-tools' and `cross-tools' stages with BOOTSTRAPPING
flag defined. This replaces the WORLD flag that got lost in revision
1.96.


# 02d4de15 29-Aug-2001 Bruce Evans <bde@FreeBSD.org>

Fixed world breakage. mkdir was not copied to ${INSTALLTMP}, but it is
used by src/include/Makefile in the SHARED=symlinks case.


# 934372e2 26-Aug-2001 Paul Richards <paul@FreeBSD.org>

Change the name of KRNLDEFDIR to KERNCONFDIR.

Suggested by Bruce, since the latter is more acceptable for a variable
that is externally visible.

Fix a style nit with a long line.


# f981dd25 26-Aug-2001 Paul Richards <paul@FreeBSD.org>

Add a variable KRNLDEFDIR that specifies where to find the kernel
config files.

It defaults to KRNLCONFDIR.


# a1a21b0e 26-Aug-2001 Mark Murray <markm@FreeBSD.org>

More libss removal.


# e2e0201c 26-Aug-2001 Mark Murray <markm@FreeBSD.org>

Adjust dependancies; now that a PAM module (pam_unix) can change
NIS passwords, libpam needs rpc dependancies.


# 4870a3d3 19-Aug-2001 Kris Kennaway <kris@FreeBSD.org>

Say goodbye to libss, which somehow managed to crouch hidden in the tree
for long after it was used.


# 1687fcd3 17-Aug-2001 David E. O'Brien <obrien@FreeBSD.org>

Use a build-tool to create the .mgc files.

Submitted by: ru (partial)
Obtained from: NetBSD (basic idea)
Reviewed by: bde, ru


# c4a5ef6e 04-Aug-2001 Thomas Moestl <tmm@FreeBSD.org>

Add some features to libdevstat, and overhaul the interface a bit:

1.) prefix all functions in the library with devstat_ (compatability
functions are available for all functions that were chaned in an
incompatible way, but are deprecated).
2.) Add a pointer to a kvm_t as the first argument to functions that
used to get their information via sysctl; they behave the same
as before when NULL is passed as this argument, otherwise, the
information is obtained via libkvm using the supplied handle.
3.) Add a new function, devstat_compute_statistics(), that is intended
to replace the old compute_stats() function. It offers more
statistics data, and has a more flexible interface.

libdevstat does now require libkvm; a library depedency is added, so
that libkvm only needs to be explicitely specified for statically linked
programs.
The library major version number is bumped.

Submitted by: Sergey A. Osokin <osa@freebsd.org.ru>, ken (3)
Reviewed by: ken


# 7bd0b867 29-Jul-2001 Dima Dorfman <dd@FreeBSD.org>

Enable the new libmp in the build, and disable libgmp and its
henchmen.


# 132463ca 09-Jul-2001 Mark Murray <markm@FreeBSD.org>

Axe S/Key. OPIE is the true and faithful successor.


# 9488e5f3 13-Jun-2001 Peter Wemm <peter@FreeBSD.org>

Part 2 of gensetdefs de-orbit burn. linker sets are now self contained
for ELF, see src/sys/linker_set.h log.


# d531238a 13-Jun-2001 Ruslan Ermilov <ru@FreeBSD.org>

WARNS= is fully functional again.


# 8411c946 11-Jun-2001 Ruslan Ermilov <ru@FreeBSD.org>

- Restore -nostdinc that got lost in rev.1.105; we don't
want host headers during `buildworld'.

- During `buildworld', install headers in a "copy" mode
until we decide what to do with the (currently broken)
SHARED=symlinks.

- Temporarily run `buildworld' with -DNO_WERROR, which
effectively disabled the -Werror bit of recently added
WARNS=X feature. This is required because adding the
-nostdinc bit back revealed bugs in some header files
that were hiding after not using -nostdinc.
It is unclear currently how exactly (and why) -nostdinc
affects gcc(1) warnings.


# 3f628ce1 28-May-2001 Ruslan Ermilov <ru@FreeBSD.org>

Bootstrap install(1).


# a24874dc 14-May-2001 Ruslan Ermilov <ru@FreeBSD.org>

Add kbdcontrol(1) to bootstrap-tools.
This fixes the upgrade path breakage in usr.sbin/sysinstall.


# 19a27152 26-Apr-2001 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Remove xlint from build-tools. This needs to be fixed in a different way.


# 1048d3c9 24-Apr-2001 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Add usr.bin/xlint to build-tools.


# 0a51d0d9 23-Apr-2001 Gregory Neil Shapiro <gshapiro@FreeBSD.org>

${MAKEOBJDIRPREFIX}/usr/src/i386/usr/include/isc was being created as a plain
file during the bootstrapping process of a buildworld and contained the
last isc include file to be installed. It was meant to be a directory for
the isc include files.


# d8d4bc9a 17-Apr-2001 Ruslan Ermilov <ru@FreeBSD.org>

Add groff to bootstrap-tools.


# 3393f8da 26-Mar-2001 Kenneth D. Merry <ken@FreeBSD.org>

Rewrite of the CAM error recovery code.

Some of the major changes include:

- The SCSI error handling portion of cam_periph_error() has
been broken out into a number of subfunctions to better
modularize the code that handles the hierarchy of SCSI errors.
As a result, the code is now much easier to read.

- String handling and error printing has been significantly
revamped. We now use sbufs to do string formatting instead
of using printfs (for the kernel) and snprintf/strncat (for
userland) as before.

There is a new catchall error printing routine,
cam_error_print() and its string-based counterpart,
cam_error_string() that allow the kernel and userland
applications to pass in a CCB and have errors printed out
properly, whether or not they're SCSI errors. Among other
things, this helped eliminate a fair amount of duplicate code
in camcontrol.

We now print out more information than before, including
the CAM status and SCSI status and the error recovery action
taken to remedy the problem.

- sbufs are now available in userland, via libsbuf. This
change was necessary since most of the error printing code
is shared between libcam and the kernel.

- A new transfer settings interface is included in this checkin.
This code is #ifdef'ed out, and is primarily intended to aid
discussion with HBA driver authors on the final form the
interface should take. There is example code in the ahc(4)
driver that implements the HBA driver side of the new
interface. The new transfer settings code won't be enabled
until we're ready to switch all HBA drivers over to the new
interface.

src/Makefile.inc1,
lib/Makefile: Add libsbuf. It must be built before libcam,
since libcam uses sbuf routines.

libcam/Makefile: libcam now depends on libsbuf.

libsbuf/Makefile: Add a makefile for libsbuf. This pulls in the
sbuf sources from sys/kern.

bsd.libnames.mk: Add LIBSBUF.

camcontrol/Makefile: Add -lsbuf. Since camcontrol is statically
linked, we can't depend on the dynamic linker
to pull in libsbuf.

camcontrol.c: Use cam_error_print() instead of checking for
CAM_SCSI_STATUS_ERROR on every failed CCB.

sbuf.9: Change the prototypes for sbuf_cat() and
sbuf_cpy() so that the source string is now a
const char *. This is more in line wth the
standard system string functions, and helps
eliminate warnings when dealing with a const
source buffer.

Fix a typo.

cam.c: Add description strings for the various CAM
error status values, as well as routines to
look up those strings.

Add new cam_error_string() and
cam_error_print() routines for userland and
the kernel.

cam.h: Add a new CAM flag, CAM_RETRY_SELTO.

Add enumerated types for the various options
available with cam_error_print() and
cam_error_string().

cam_ccb.h: Add new transfer negotiation structures/types.

Change inq_len in the ccb_getdev structure to
be "reserved". This field has never been
filled in, and will be removed when we next
bump the CAM version.

cam_debug.h: Fix typo.

cam_periph.c: Modularize cam_periph_error(). The SCSI error
handling part of cam_periph_error() is now
in camperiphscsistatuserror() and
camperiphscsisenseerror().

In cam_periph_lock(), increase the reference
count on the periph while we wait for our lock
attempt to succeed so that the periph won't go
away while we're sleeping.

cam_xpt.c: Add new transfer negotiation code. (ifdefed
out)

Add a new function, xpt_path_string(). This
is a string/sbuf analog to xpt_print_path().

scsi_all.c: Revamp string handing and error printing code.
We now use sbufs for much of the string
formatting code. More of that code is shared
between userland the kernel.

scsi_all.h: Get rid of SS_TURSTART, it wasn't terribly
useful in the first place.

Add a new error action, SS_REQSENSE. (Send a
request sense and then retry the command.)
This is useful when the controller hasn't
performed autosense for some reason.

Change the default actions around a bit.

scsi_cd.c,
scsi_da.c,
scsi_pt.c,
scsi_ses.c: SF_RETRY_SELTO -> CAM_RETRY_SELTO. Selection
timeouts shouldn't be covered by a sense flag.

scsi_pass.[ch]: SF_RETRY_SELTO -> CAM_RETRY_SELTO.

Get rid of the last vestiges of a read/write
interface.

libkern/bsearch.c,
sys/libkern.h,
conf/files: Add bsearch.c, which is needed for some of the
new table lookup routines.

aic7xxx_freebsd.c: Define AHC_NEW_TRAN_SETTINGS if
CAM_NEW_TRAN_CODE is defined.

sbuf.h,
subr_sbuf.c: Add the appropriate #ifdefs so sbufs can
compile and run in userland.

Change sbuf_printf() to use vsnprintf()
instead of kvprintf(), which is only available
in the kernel.

Change the source string for sbuf_cpy() and
sbuf_cat() to be a const char *.

Add __BEGIN_DECLS and __END_DECLS around
function prototypes since they're now exported
to userland.

kdump/mkioctls: Include stdio.h before cam.h since cam.h now
includes a function with a FILE * argument.

Submitted by: gibbs (mostly)
Reviewed by: jdp, marcel (libsbuf makefile changes)
Reviewed by: des (sbuf changes)
Reviewed by: ken


# aeebb4e7 25-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

Add missing NOSECURE check for `includes' target.

Reviewed by: markm


# d9d1a7bb 22-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

Enhancement to 1.99 -> 1.100.
Avoid EPERM from ln(1) in a different (proper) way.


# afcf05e4 02-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

setlocale(3) has been fixed to match POSIX standard:
LC_ALL takes precedence over other LC_* envariables.


# 7de7569f 22-Feb-2001 John Baldwin <jhb@FreeBSD.org>

MACHINE_ARCH is the target arch to crossbuild to, not TARGET_ARCH.

Requested by: marcel


# 682d4db4 22-Feb-2001 John Baldwin <jhb@FreeBSD.org>

Document TARGET_ARCH.


# 58445af0 16-Feb-2001 Bruce Evans <bde@FreeBSD.org>

Removed some garbage (genassym(8) and its infrastructure).


# c1f3d847 14-Feb-2001 Mark Murray <markm@FreeBSD.org>

Fix make world.


# 2f74661c 23-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Provide backwards compatable recognition of ${KERNEL}. You should be
able to use KERNEL= again with buildkernel, but it will point you at
KERNCONF= and press on regardless.


# 6d84d742 22-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Sigh, I thought we still had the rm -rf objdir stuff in make world, which
would have taken care of the possibility of buildkernel crossing over
from one binutils set to another. Back out the part about turning off
'make clean' if the 'make depend' is still active, but add a NO_KERNELCLEAN
target instead that works like NOCLEAN but just for the kernel.


# 51dfb947 22-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Use 'make clean' instead of 'config -r', and only if the 'depend' step has
been skipped. We went to a lot of trouble to make the 'blow away' stage
unneeded, and it has not been needed for quite some time.


# 5963db0f 22-Jan-2001 Warner Losh <imp@FreeBSD.org>

As threatened in hackers@ on Friday, obviate the need for a buildworld
to preceed a buildkernel.

The buildworld is still required when upgrading across major releases,
across binutil upgrades and when config changes version. If
buildkernel breaks, and you haven't done a buildworld, then do not
complain unless you do a buildworld and it still breaks.


# c1ae5e3d 22-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Using "KERNEL" for buildkernel was a very very bad mistake. $KERNEL is
already used by the kernel makefiles themselves, and this leads to a lot
of trouble when people put "KERNEL=MYKERNEL" in make.conf. Bite the bullet
and change it to KERNCONF instead, before it gets too far entrenched.

The kernel Makefiles use ${KERNEL} as the name of what to install the
kernel as, eg: /boot/${KERNEL}/kernel or /${KERNEL}. This leads to much
unhappiness with things like /LOCAL instead of /kernel. buildkernel is
severely limited as it is only useful directly after a buildworld.

Reviewed by: jhb


# c80a5c4c 21-Jan-2001 Jordan K. Hubbard <jkh@FreeBSD.org>

Also add some timing information for kernel builds so that it's
easy to do "make world kernel |grep -e '^>>>'" and get a complete
event log.


# 26379603 19-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Create a build-tools target for sysinstall and rtermcap. This is still
not right because rtermcap would be reading the *host* termcap, not
from the termcap in the src tree. Besides, /usr/sbin/sysinstall
(not the crunched one in /stand) should use the runtime termcap
not the precompiled set.


# 3e530495 24-Dec-2000 KATO Takenori <kato@FreeBSD.org>

Removed pc98-hack of aout tools.


# d6deedef 03-Dec-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix cross-building once again.

Forgotten by: ache


# 0a0743b5 20-Nov-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix release, broken by the perl cross-build fixes.

The distribute target is basicly the same as an install. For
perl, this means that miniperl is needed. Since miniperl is
only present in the object directory, we need to make sure
the path is set correctly. To do this, we have make release
use a new distribworld target that sets the path before doing
a make distribute.


# ad879ce9 19-Nov-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix cross-building.

o Move building libperl and miniperl from build-tools to
cross-tools. libperl uses MACHINE_ARCH to determine the
right configuration, which doesn't match the build
machine when cross-building if they are built as build-
tools.
o Since miniperl needs to be built as a cross-tool, it
needs to be installed under /usr/obj so that it can be
used (cross-tools have a special object directory to
avoid build conflicts. As a downside, you can't easily
run cross-tools from their object directory). Remove
the install and distribute override targets. To avoid
having miniperl installed by installworld, remove it
from SUBDIR.
o We can't pickup miniperl from the object directory but
since it's installed, depend on PATH. This is save,
because the makefiles are run with a known path.
o Build libperl again as part of the library target. A
_libperl variable existed, but it was never defined.
o Add chmod to the list of saved tools, because perl
conditionally uses it during install.

The bootstrap-tools and cross-tools targets are modified to
avoid building profiled and shared libraries. While here,
have these targets build static binaries instead of shared
binaries.

Approved by: markm


# cb6f6857 10-Nov-2000 David E. O'Brien <obrien@FreeBSD.org>

libgcc now needs to be built earlier in the build.

Submitted by: jdp


# ae7c8a2b 28-Oct-2000 David E. O'Brien <obrien@FreeBSD.org>

* Bring back the guts of crt{i,n}.S. This allows C++ exceptions to work
when using the egcs and gcc-devel ports, along with GCC built from stock
public FSF sources. With out this change, FreeBSD will be removed from
the list of systems GCC 3.0 must be evaluated on before release. With
the effort some of us put into getting FreeBSD on this list, we should
not turn this effort into a waste, else we might not be worth fighting
for in the future. (note that Alpha and IA-64 versions of crt{i,n}.S
are needed)

* Switch from our own crt{begin,in} to those created from GCC's crtstuff.c.
This will allow us to switch to DWARF2 exceptions in the future, along with
staying in sync with any future GCC requirements.

* Break out our ELF branding bits into a seperate file. Currently this
is now included by our crt1.c files (since this functionality was part of
our native crtbegin.c). Later crtbrand.o will be merged in the creation
of crti.o.


# a62264fb 24-Oct-2000 Joseph Koshy <jkoshy@FreeBSD.org>

Fail the 'buildkernel' target if not even one of the specified kernel configuration
files was found.

Reviewed by: obrien


# 13387c45 12-Oct-2000 David E. O'Brien <obrien@FreeBSD.org>

Number the stages in the documentation to match what is printed out when
running.


# 18ebc2ea 17-Sep-2000 Justin T. Gibbs <gibbs@FreeBSD.org>

This is really gross.

If a user decides to forego a make depend during "make buildkernel",
they should get what they deserve if no previous make depend has
been run for that kernel. Instead, the build process includes
special instructions to unconditionally rebuild aicasm. When aicasm
moved to its own directory, this hack broke.

Correct the hack until a get buy off on killing it.


# 66bea2a0 17-Sep-2000 Warner Losh <imp@FreeBSD.org>

Add reinstallkernel target. Does same thing as installkernel, but
executes the reinstall target rather than the install target that
installkernel does.


# a3f02cc0 09-Sep-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Include libfetch in the includes target.


# 1b73d196 08-Sep-2000 Peter Wemm <peter@FreeBSD.org>

USA_RESIDENT is no longer required for buildworld, do not force it.


# ae78d52f 02-Sep-2000 David E. O'Brien <obrien@FreeBSD.org>

Allow one to specify what the installed kernel's name is by setting
"INSTKERNNAME".

Reviewed by: marcel


# 6fd0f272 12-Aug-2000 Josef Karthauser <joe@FreeBSD.org>

Define SUPHOST. If this is set a '-h ${SUPHOST}' is added to the
SUPFLAGS when a 'make update' is run. This means that the supfile
doesn't need to be edited because the -h will override the
CHANGE_THIS.FreeBSD.org host.


# ef102276 07-Aug-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Make the update target consistent; both ports and doc are updated
if their SUPFILE variables are defined _and_ NO_PORTSUPDATE and
NO_DOCUPDATE respectively are not defined.

Previously, only ports was updated and there was no way to prevent
this without undefining its SUPFILE variable.

PR: 17514
Reported by: Udo Erdelhoff <ue@nathan.ruhr.de>


# f7ff24ef 02-Aug-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix buildkernel and installkernel when KERNEL is defined in
/etc/make.conf.

PR: 20325
Submitted by: Johan Karlsson <k@numeri.campus.luth.se>


# a5061fba 23-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Argh... mtree has been removed from the bootstrap-tools. In that
case we need to save it in installworld. That latter I forgot...

Pointy hat: me


# dce97721 23-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Name all kernels 'kernel'. This fixes the incompatible behaviour
of the buildkernel and installkernel targets where the kernel
was called after the config name.

While here, fix the brokenness of the installkernel target. It
used to use ${IMAKEENV}, but since that has a very restricted
PATH, it couldn't find make(1). Use ${CROSSENV} instead.


# fa90cca2 23-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Remove mtree for bootstrap-tools. The -L switch change has been
backed out.


# a0982e93 22-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Don't save cp(1) in installworld. Its use has been replaced by
a use of install.


# eb263e04 19-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add awk and wc to the list of copied binaries for the installworld
target. These are needed by liloldr.

Found by: make release


# 39b909da 19-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add cp(1) to the list of binaries we need to save. The cp(1) command
is used by the installation of ld-elf.so when an existing version
exists.


# 2e826432 19-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Don't save install-info. We already have that built. We'll use
the one we built anyway.


# 767ab900 18-Jul-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Save any binaries we use by installworld, so that we won't use the
binaries we just installed. This allows a future upgrade target to
install a new system without intermediate reboots and also
prevents conflicts for parallel make runs where we might exec a
binary that's being installed at the same time.


# 7d66a72a 17-Jul-2000 Andrey A. Chernov <ache@FreeBSD.org>

Move mtree to bootstrap-tools and add PATH=${TMPPATH} to IMAKEENV to pick it


# 199b3e83 17-Jul-2000 Andrey A. Chernov <ache@FreeBSD.org>

Add mtree to cross-tools to make it updated for new -L option
It must solve make world breakage


# 58804eac 02-Jul-2000 Mark Murray <markm@FreeBSD.org>

Perl's version number needs to change.


# f307c8a7 25-Jun-2000 Mark Murray <markm@FreeBSD.org>

Rearrange Perl's build priority; it needs to get made earlier.


# 59bb1d9c 15-Jun-2000 Brian Somers <brian@FreeBSD.org>

Add -DNO_KERNELDEPEND and -DNO_KERNELCONFIG

Not reviewed by: sheldonh


# 625de7fe 09-Jun-2000 Brian Somers <brian@FreeBSD.org>

Set KERNEL=${INSTALLKERNEL} doing a make install in /sys/conf


# a82162d4 05-May-2000 Yoshihiro Takahashi <nyan@FreeBSD.org>

GENERIC98 is removed.


# fc5361f9 27-Apr-2000 Garrett Wollman <wollman@FreeBSD.org>

Make gperf be a bootstrap-tool, since we now depend on features of
the specific version in -current.

Approved in principle by: marcel


# 095a235e 27-Apr-2000 Garrett Wollman <wollman@FreeBSD.org>

Revert my changes to make gperf a build-tool; that was the wrong thing.
All builds had been broken; now just upgrade builds are until I or
someone else can figure out the Right Thing.


# 85a00bb0 27-Apr-2000 Garrett Wollman <wollman@FreeBSD.org>

Add gperf(1) to build tools. It should have been one before, but
gcc does not depend on version-specific gperf behavior (yet).


# 68924308 27-Apr-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Create ${KRNLOBJDIR} before running config(8), since config(8) does
not create required parent directories of the kernel compile
directory specified with its -d option.


# 9ad4708e 16-Apr-2000 Kris Kennaway <kris@FreeBSD.org>

Unbreak make world (libpam depends on libopie)


# f67ecfeb 30-Mar-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Fix the buildkernel and installkernel targets for the case where
KERNEL specifies multiple kernels.

PR: 17536
Submitted by: Johan Karlsson <k@numeri.campus.luth.se>


# 8d76bd01 29-Mar-2000 Ruslan Ermilov <ru@FreeBSD.org>

Get rid of "sticky" files when updating sources with cvs(1).

Approved by: peter


# bb49f794 08-Mar-2000 Kris Kennaway <kris@FreeBSD.org>

Buildworld fixes for NO_OPENSSH and NO_OPENSSL

Approved by: jkh


# 5bf514a3 28-Feb-2000 Mark Murray <markm@FreeBSD.org>

A lot of tools need to be built before compilation proper can happen.


# 84a9e747 24-Feb-2000 Mark Murray <markm@FreeBSD.org>

We have a new world order in libraries.

Goodbye libdes; Welcome libcrypto.


# 3da5eca4 20-Feb-2000 Jordan K. Hubbard <jkh@FreeBSD.org>

Docfix: Note krb5 flags.

PR: 16818
Submitted by: martti.kuparinen@nomadiclab.com


# 858b4471 03-Feb-2000 Ruslan Ermilov <ru@FreeBSD.org>

Now that bsd.lib.mk has PRECIOUSLIB feature back (rev 1.91),
we need -DNOFSCHG at stage 4 (building libraries) to support
non-root buildworlds.

Reviewed by: <buildworld@current.freebsd.org>


# 6f96b351 30-Jan-2000 David E. O'Brien <obrien@FreeBSD.org>

The readline includes handling was moved down a level in
src/gnu/libreadline -- reflect that change here.

Ok'ed by: JKH


# f0d6a665 29-Jan-2000 Warner Losh <imp@FreeBSD.org>

Back out 1.134. It works from 3.3R, but breaks cross compilation for too
little gain. I'll work out the issues after 4.0R is out.


# e208d108 28-Jan-2000 Warner Losh <imp@FreeBSD.org>

Remove Fortran from build tools. It isn't needed to build the system
and costs us an extra 2% to build it for no reason. It may break
building cross compilation environments for fortran, but that isn't
officially supported at this time anyway (also, the % of our user base
that would use that is < .001% imho). This does't break fortran (it
is built again later anyway).

Reviewed by: obrien
Tested by: make buildworld and make buildworld -DNOCLEAN


# d092560c 24-Jan-2000 Mark Murray <markm@FreeBSD.org>

Build Kerberos5 if the correct macro is set. This is not for the
faint_hearted; serious hackers only!


# f8c52b7c 18-Jan-2000 Kris Kennaway <kris@FreeBSD.org>

Require USA_RESIDENT to be 'NO' or 'YES' if building secure/

Reviewed by: marcel


# 85dd55e4 18-Jan-2000 Ruslan Ermilov <ru@FreeBSD.org>

Finally resolve the texinfo issue by moving it
from the cross-tools to the bootstrap-tools.

Requested by: bde, marcel


# 7e3e88c6 18-Jan-2000 Ruslan Ermilov <ru@FreeBSD.org>

For some reason compiler should be the last in the list of cross-tools.
Unbroke the world by moving gnu/usr.bin/texinfo before gnu/usr.bin/cc.

Submitted by: Jim Bloom <bloom@acm.org>


# 4928e3ce 17-Jan-2000 Ruslan Ermilov <ru@FreeBSD.org>

Add gnu/usr.bin/texinfo to the list of cross-tools.
We need an up-to-date `makeinfo' and `install-info'
at `world' and `install' stages.

Pointed out by: bde


# d8180fbd 12-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add gross hack to work around bogus dependency information created
by gnu/usr.bin/cc/cc_tools/Makefile. This bug is painfully visible
when making buildworld with -DNOCLEAN. This work around is beyond
dirty...


# 2a7a0de6 12-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Fix broken installkernel target. Don't use the WMAKE context to
install; use the IMAKE context.

Reported by: sheldonh


# 15e1a306 11-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Revert gratuitous change in rev. 1.123 which broke building world
as non-root.

Breakage caused by: green


# ae41b16c 11-Jan-2000 David E. O'Brien <obrien@FreeBSD.org>

Remove Bison from "bootstrap-tools" as we don't use it to build anything
in /usr/src/ anymore.


# 55904856 10-Jan-2000 Brian Feldman <green@FreeBSD.org>

This is the second half of unbreaking the world build. Add a -DNOHTML
corollary for -DNOINFO and -DNOMAN. I'll fix this properly (add
specific HTML doc magic) in the .mk files later; right now, just
unbreak the world.


# d4ab519b 11-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add the -r flag to CONFIGARGS instead of assigning to it so that
it's more easy to build a kernel with debugging information.

Suggested by: sheldonh


# f3bb8dbd 09-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add a buildkernel and an installkernel target. With these targets
users can more easily upgrade.

buildworld now makes usr.sbin/config in bootstrap-tools so that
when you first make buildworld, buildkernel will use config(8)
from the temp. world tree (and of course also the compiler).

Which kernel to built is determined by the KERNEL variable. You
can have as many kernels listed as you like. When a config file
exists for the given MACHINE it will be built. When KERNEL has
not been defined it will be set to "GENERIC GENERIC98".

The first valid kernel named in the list will be used by the
installkernel target.

When NOCLEAN is defined the kernel object directory is *not*
removed by config first. This is in line with normal buildworld
behaviour.

The buildkernel target makes aicasm in sys/dev/aic7xxx first and
unconditionally. This hack allows us to cross-build kernels and
can go away when the problem is solved in a structural way.


# 1d19afde 04-Jan-2000 Marcel Moolenaar <marcel@FreeBSD.org>

Add btxld to the list of cross-tools on machines that don't have it
natively (ie non-i386 architectures).


# 37379a44 30-Dec-1999 Mark Murray <markm@FreeBSD.org>

Grrrr... This was supoosed to go with the commit to kerberosIV/.../libroken's
Makefile.

Fix make world by building appropriate build-tools.

Submitted by: marcel


# a886640d 29-Dec-1999 David E. O'Brien <obrien@FreeBSD.org>

Restore changes I spammed.


# 253745e1 29-Dec-1999 David E. O'Brien <obrien@FreeBSD.org>

Allow the specification of a prefix for gcc to find all the various bits.
If one wishes to anchor the compiler toolchain tree somewhere other than /,
all one needs to do is set "TOOLS_PREFIX" to a different rooting.

Submitted by: marcel (in a different format and reworked by me)


# 4712894e 29-Dec-1999 Kris Kennaway <kris@FreeBSD.org>

Only make beforeinstall in libcrypto/libssl if they actually exist. I haven't
imported these on Freefall yet for the reasons previously explained.

Noticed by: asami


# 1a75f3dd 29-Dec-1999 Satoshi Asami <asami@FreeBSD.org>

Oops, the previous commit was bogus. I shouldn't commit something without
reading all my mail.

I still don't understand why this was was committed on freefall before
the libcrypto and libssl subdirectories were imported on freefall though.


# 019d7e0f 29-Dec-1999 Satoshi Asami <asami@FreeBSD.org>

Typo (libcrypto -> libcrypt).


# 47dbe12f 28-Dec-1999 Kris Kennaway <kris@FreeBSD.org>

Build openssl properly during make world.


# 7377751f 23-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't build caesar as a tool. fortune(6) doesn't depend on it
anymore. Update comments and variable names as well to wipe out any
traces that may confuse people in the future.


# 3eafbc1a 23-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Revert previous commit, and

o Add genassym to the list of cross-tools
o Remove sh hashing work-around, we don't need it anymore
o Clean more directories in WORLDTMP when NOCLEAN is specified

The sh hashing work-around is not needed anymore, because we don't
trigger the bug anymore.

When NOCLEAN is not defined, we wipe out the complete WORLDTMP,
including the object directories of the tools we have built. When
NOCLEAN is defined, we remove anything that we install anyway, which
is usr/bin, usr/games, usr/include, usr/lib and usr/sbin.


# 02fdddce 22-Dec-1999 Andrey A. Chernov <ache@FreeBSD.org>

Add ${WORLDTMP}/sbin to ${STRICTTMPPATH} - sysctl not found otherwise


# 76762624 20-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o make SHARED=symlinks a caller defined instead of a callee defined
property. This fixes the includes target when DESTDIR is empty.
o Do not make build-tools for f771 when NO_FORTRAN is defined.
o Add new build stage. See below.
o Change banners so that staging information is displayed.

The addition of the build-tools target broke the upgrade path because
we couldn't make use of previously built tools that were made for
compatibility reasons. Doing so would also result in the cross-compiler
being used and that is exactly what had to be avoided.

This is solved by designating the bootstrap-tools stage for building
anything that is needed for compatibility only and to create a new
stage (started after the build-tools stage) that handles cross-tools
building. We now have the following stages:
1. bootstrap-tools (for compatibility issues only)
2. build-tools
3. cross-tools (what it says)
4. world
5. install

Stages 1-4 (inclusive) are handled by buildworld.
Stage 5 is handled by installworld.

Any more stages and I'll join Nik in his quest for the
holy grail^W^Wworld :-)


# 5233a96c 17-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't build usr.sbin/pcvt/keycap on anything other than i386 when
building the libraries target. pcvt is i386 specific.


# bfc59eb8 16-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.

The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.

This is the last major update towards cross-building.


# f647fd15 15-Dec-1999 Bill Fumerola <billf@FreeBSD.org>

It is possible for someone to want to 'make update' wht SUPFILE not defined
while SUPFILE1 or PORTSSUPFILE are defined.


# 4ac29d1e 12-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Add colldef to the list of tools. It's needed on older systems.


# 0dd0e829 12-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Add gensetdefs to the list of tools.
o Don't set CFLAGS in the bootstrap env. It is very likely to be
overridden my any CFLAGS setting in /etc/make.conf. Setting it
here is almost useless. So far, it doesn't seem necessary.


# 845eb537 11-Dec-1999 Yoshihiro Takahashi <nyan@FreeBSD.org>

Build a.out tools if MACHINE_ARCH == i386 and MACHINE == pc98.
The boot2 for pc98 is still a.out program.

I made the original patch, and many problems were fixed by Marcel Moolenaar.


# 3f2aa30a 11-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't add MACHINE_ARCH to MAKEOBJDIRPREFIX when not cross-building.
This should fix make release.

Reported by: jhay, phk


# f80df2fa 10-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Don't make games/fortune/strfile if games does not exist or NOGAMES
has been defined.
o Make libraries before making depend.


# 08265f35 10-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Remove installworld related settings that I had as a safety-net and
for development. :-/


# 0ea234de 10-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

More cross-building related changes:
o Build tools before doing anything in or with the object tree.
o Tools don't use the object tree any more, but have there object
tree located in the temp. world.
o Use the proper make env. for cleaning and building the object tree.
o Don't create kernel include subdirectories in the temp. world. These
are removed later on and replaced by symlinks.
o Change the layout of the object tree:

The temp. world now is /usr/obj/${MACHINE_ARCH}${.CURDIR}/${BUILD_ARCH}.
/usr/obj can be set/changed by using MAKEOBJDIRPREFIX, and {.CURDIR}
obviously depends on where the source tree is located. MACHINE_ARCH
is the arch. for which the world is to be build and BUILD_ARCH is the
arch. on which we are building.

The object tree now is /usr/obj/${MACHINE_ARCH}${.CURDIR}.

This allows concurrent cross-builds and allows the object tree to be
shared on different archs., each doing the same cross-build. This of
course assumes that the output on Alpha (for example) is the same as
the output of an Alpha cross-build on i386 (for example).

The use of NOCLEAN is is still dangerous, but should be usable in many
more situations than before. It should now be possible to safely
restart an interrupted build with NOCLEAN without side-effects. Because
the tools don't share the object tree with the normal (cross-build), no
tools have to be rebuild.


# 7466caf4 09-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Don't make gdb, objc and f77 when building tools.


# aae5d688 09-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Make sure the links to the source tree end up in the source tree.


# db10927b 09-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

o Add usr/lib/compat/aout to the temp world. This is needed by release.
o If you can't beat them, join them: use symlinks to populate the obj
tree. This avoids using mtree.


# 894157f5 08-Dec-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Restore the upgrade path from -stable to -current and prepare for
non-root cross-building.

o Makefile.inc0 is not used anymore.
o The legacy aout build has been removed.
o Selectively build tools *before* building includes/libraries.
o Avoid using mtree to populate the obj tree.


# e13b3c78 25-Nov-1999 Julian Elischer <julian@FreeBSD.org>

Place netgraph entry into alphabetical position
along with the misplaced entries that it was next to.


# 30fdccdc 23-Nov-1999 David E. O'Brien <obrien@FreeBSD.org>

Revert to rev 1.91. Revs 1.9{2,3} were causing problems for people with
pre-Aug 4.0-CURRENT worlds and those with pre-GCC 2.95.2 worlds.

The problem with pre-Aug worlds is the installed Byacc and Bison doesn't
have necessary changes to compile either GCC 2.95 or EGCS 1.1.x.

The problem with pre-GCC 2.95 worlds is libgcc is built with the wrong
compiler. See rev 1.17 of src/gnu/lib/libgcc/Makefile (which used to live
in src/gnu/usr.bin/cc/libgcc) + commit messge for details of the requirements.


# 6de9679e 23-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Fix some bugs and make some policy changes.

o Send libmytinfo back to the afterlife. It was revived by mistake,
o Make gnu/lib/libgcc before making lib/libpam. This dependency has
been overlooked in constructing the list,
o make depend before make all. It's by using make depend that the
dependency was found in the first place and we need it to prevent
cleaning everything up before we start,
o Don't specify -DNOINFO -DNOMAN for the libraries target. Let the
target handle it. We can do away with a single run over the libs
if we make everything while we're there and only install the
libraries in the object tree.


# be4512ec 21-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Build tools against the host's includes and libraries. Also, don't
build make(1) twice and merge the bootstrap-libraries and libraries
targets.

This change solves the bug where build-tools, compiled against the
includes and libraries built from the sources failed to run on the
host, as was the case with the sigset_t change. With this update, a
buildworld will fail if the tools won't compile on the host. This
is solved in further commits where backward compatibility of the
tools is enlarged.

The libraries target has been fixed. The libraries are now build in
the proper order, satisfying the dependencies. The comment is updated
to reflect this.

The linux module and netboot have been removed from the list of tools.
More to follow.

Reviewed by: bde, imp


# f5c0c6ab 15-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

Remove CROSS_MAKE_FLAGS.


# 0917704b 14-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

${MACHINE} -> ${MACHINE_ARCH}

All Makefiles now use MACHINE_ARCH for the target architecture.
Unification is required for cross-building.

Tags added to:
sys/boot/Makefile
sys/boot/arc/loader/Makefile
sys/kern/Makefile
usr.bin/cpp/Makefile
usr.bin/gcore/Makefile
usr.bin/truss/Makefile

usr.bin/gcore/Makefile:
fixed typo: MACHINDE -> MACHINE_ARCH


# 5dd05de9 25-Oct-1999 Julian Elischer <julian@FreeBSD.org>

install netgraph.h a bit earlier.

Submitted by: Boris Popov <bp@butya.kz>


# f24bb3a4 14-Oct-1999 Boris Popov <bp@FreeBSD.org>

Make libncp actually compiled.

Reviewed by: mdodd


# 6d77c2de 04-Oct-1999 Peter Wemm <peter@FreeBSD.org>

Add libkvm to the includes target.


# 1f687ff1 20-Sep-1999 Mark Murray <markm@FreeBSD.org>

Minor (but important) comment change.


# 7dd5e27c 04-Sep-1999 Bruce Evans <bde@FreeBSD.org>

FIxed disorder in the comments about library build order.


# da52b932 31-Aug-1999 Mark Murray <markm@FreeBSD.org>

Further preparation for tn3270's demise.


# 4c2a26e3 30-Aug-1999 Peter Wemm <peter@FreeBSD.org>

Update for ncurses5 aftermath..


# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 4f1b474e 08-Aug-1999 John Polstra <jdp@FreeBSD.org>

Remove f2c-related stuff from the "includes" target and from a
comment. Fixes broken make world.


# d72e8db8 05-Aug-1999 John Polstra <jdp@FreeBSD.org>

Add usr.sbin/elf2exe to the build-tools target on the Alpha. This
fixes the make buildworld breakage in sys/boot/arc/loader.


# 17139066 06-Jul-1999 Warner Losh <imp@FreeBSD.org>

Per requests from the community, commit rudimentary cross compilation
support. I've been building world with these changes for months w/o
ill effect. I've also managed to build the cross tool chain for MIPS
with these patches.

Please note that the extent to which these patches work is largely
dictated by how well our tool chains support the cross compilation.
Building alpha binaries on i386 doesn't work. Supposedly building
i386 binaries on alpha does work, but I've not verified it with these
patches, however.


# 55496537 04-Jun-1999 Bill Fumerola <billf@FreeBSD.org>

${.CURDIR} doesn't have to be /usr/src, especially in a cvs checkout. Make
sure what is reported to the user is accurate.

Stolen From: mharo


# 03a6bd91 31-May-1999 Bill Fumerola <billf@FreeBSD.org>

'make update' in the ports directory.


# 7c2a64c4 03-May-1999 David E. O'Brien <obrien@FreeBSD.org>

Document NO_FORTRAN.


# 5a528acb 02-May-1999 Mark Murray <markm@FreeBSD.org>

Perl is moving up a maintenance version.

While I'm here - reorder crypto directories to better support
dependancies. Perl and others like it better that way.


# 7725a6c9 19-Apr-1999 Joseph Koshy <jkoshy@FreeBSD.org>

Change 'exists()' constructs to refer to directories in ${.CURDIR}.
Tested with a make world.

PR: misc/4395
Submitted by: J Wunsch
Reviewed by: bde


# db0343ca 11-Apr-1999 Dag-Erling Smørgrav <des@FreeBSD.org>

Don't build man page indices if NOMAN is defined.

PR: bin/11035
Submitted by: Chris Costello <chris@holly.dyndns.org>


# 5999400e 05-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

Clean up "lib-tools:", folding libgcc into the rest.


# a295bf4e 04-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

Remove a lingering reference to libg++.


# 68b7e6e7 03-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

Missed a gnu/usr.bin/cc/libgcc.


# 871b1fd2 03-Apr-1999 David E. O'Brien <obrien@FreeBSD.org>

EGCS will have some new includes that need to be installed.


# 15b7d605 02-Apr-1999 Peter Wemm <peter@FreeBSD.org>

Add libwrap to includes target, otherwise <tcpd.h> doesn't get installed
in time to build inetd. (If you already have /usr/include/tcpd.h, the
build doesn't fail. This mainly affects upgrades and 'make world' from
systems more than a few weeks old)


# 094f0393 30-Mar-1999 David E. O'Brien <obrien@FreeBSD.org>

An earlier version of Rev 1.66 was reviewed by bde and the issues were
hashed out with his gracious help.


# 5bcba11b 30-Mar-1999 David E. O'Brien <obrien@FreeBSD.org>

* Deal with libgcc's move from gnu/usr.bin/cc to gnu/lib.
Move was necessary as libgcc should be built with the freshly built
compiler and thus we must wait until the freshly built bits have been
installed somewhere so we can use them. libgcc presence in gnu/usr.bin/cc/
gets in the way of building the new compiler. We could have either
cd'ed to specific directories w/in gnu/usr.bin/cc/ and built and installed
individual bits, or move libgcc out of the way and let our normal subdir
building process work.

* Don't build libgcc in "bootstrap-libraries:" target it should not be
assumed the currently installed compiler can correctly build libgcc.
(as is the case for g++ 2.7.2 and EGCS' libgcc)


# af59b932 28-Feb-1999 Warner Losh <imp@FreeBSD.org>

The legacy boot stuff is available only on i386, not all architectures
which aren't the alpha. Test for MACHINE_ARCH == i386 rather than
MACHINE_ARCH != alpha.


# 2d932f16 26-Feb-1999 Jordan K. Hubbard <jkh@FreeBSD.org>

Add a new flag, "WORLD", for telling certain tools that they're
being build as part of a bootstrap.


# ad5ebf3f 14-Feb-1999 Dag-Erling Smørgrav <des@FreeBSD.org>

Ignore errors from chflags. This makes it possible to make installworld
with DESTDIR set to an NFS-mounted file system.


# 9c2bbd3b 27-Jan-1999 Jordan K. Hubbard <jkh@FreeBSD.org>

further refine the upgrade process.


# 08275689 23-Jan-1999 Mark Murray <markm@FreeBSD.org>

More broken crypt(3) backout.


# 2ccdfd96 22-Jan-1999 Brandon Gillespie <brandon@FreeBSD.org>

One more fix to remove secure/lib/libcrypt from the build (both
cases are now handled in lib/libcrypt, depending upon if
secure/lib/libcrypt/crypt-des.c exists)

Reviewed by: Mark Murray


# 3b5d5dca 19-Jan-1999 Mark Murray <markm@FreeBSD.org>

Help for Perl5 to make in cross-build environments.
Submitted by: Eivind Eklund


# b8c993ec 07-Jan-1999 Eivind Eklund <eivind@FreeBSD.org>

Don't do the ldconfig rescan if DESTDIR is set.


# c9ef6e40 06-Jan-1999 Peter Wemm <peter@FreeBSD.org>

``Disable'' a.out 'make world', as per flag day notification on current and
committers. A 'make aout-to-elf' is strongly encouraged. This isn't quite
the end of the line for people who have a real problem with updating yet,
but we've got to get this over and done with. Yes, it's bound to be a
couple of bumpy couple of days.


# fad499d2 06-Jan-1999 Bruce Evans <bde@FreeBSD.org>

Removed the weak spam of ${DESTDIR}/usr/include in the bootstrap
target (see the previous log message). This works for bootstrapping
from 2.2.7. It won't work for bootstrapping from 2.1.x, but that
fails due to include problems earlier.


# 1ff0f342 03-Jan-1999 Bruce Evans <bde@FreeBSD.org>

Backed out rev.1.49. It broke bootstrapping from 2.1.5 2.2.7 and
probably other versions by spamming ${DESTDIR}/usr/include in much
the same way as `make includes'.

Details for 2.2.7: the bootstrap target has always done a weak spam
of ${DESTDIR}/usr/include; we depend on it not installing any
significant anachronisms (it probably shouldn't touch the headers
at all; however, we may be depending on it for things like the
renaming of ts_nsec to ts_sec in <sys/time.h>). Rev.1.49 strengthens
the spam to everything in src/include. For 2.2.7, this is not
immediately fatal. However, the `make all' step in src/includes
is not followed by a `make clean' step, so new rpc headers are not
generated after we've bootstrapped rpcgen. This causes a fatal
error much later when the old (generated) rpc headers are used with
the current headers (sys/types.h and/or the non-generated rpc
headers).

Details for 2.1.x: the bug is immediately fatal. It gives definition
of errno that is not supported by 2.1.x's libc. The weak spam in the
restored version avoids this problem by not installing errno.h.
(Bootstrapping from 2.1.5 actually breaks much earlier.)

I think the header problems supposedly fixed by rev.1.49 were caused
by using NOCLEAN and having the build fall over when the weakly
spammed headers are active. Minor differences in the layout will
then cause the .depend files to point to nonexistent headers. It
is a feature for symlinks like errno.h -> sys/errno.h to not exist
early.

The other change in rev.1.49 breaks building obj directories if NOCLEAN
is set. It is only safe for _re_building with NOCLEAN set.


# cc854440 01-Jan-1999 Peter Wemm <peter@FreeBSD.org>

Reconnect pcvt hooks..

Reviewed by: core


# 40b84391 29-Dec-1998 Bruce Evans <bde@FreeBSD.org>

Backed out previous commit. It depends on a.out utilities and libraries
somehow being available even on pure elf systems.


# 621be745 30-Dec-1998 Bruce Evans <bde@FreeBSD.org>

Fixed bootstrapping of /usr/mdec/boot[12].


# 41da0323 28-Dec-1998 Peter Wemm <peter@FreeBSD.org>

Dip my toes into the fire and zap the leftover lkm hooks.. It seems they
try and recurse if the lkm dir exists for some reason but there isn't any
Makefile there. (eg: stray files prevented cvs update -P from removing the
empty dirs)


# 306f93f5 27-Dec-1998 Poul-Henning Kamp <phk@FreeBSD.org>

follow up to:
Pre 3.0 branch cleanup casualty #4: pcvt


# df00a036 21-Dec-1998 Matthew Dillon <dillon@FreeBSD.org>

Elf (and a.out?) rebuild of bootstrap tools appeared to be broken due to
some tools requiring header files, such as errno.h, that are softlinks.
The mini installation of include files in Makefile.inc1 wasn't doing
the job, so it has been ripped out and replaced with a true make of the
/usr/src/include/ directory (make all and make beforeinstall). I think
the original idea was to save time by not installing unnecessary header
files, but it doesn't really save all that much time.

Also, I have moved a NOCLEAN conditional to cover rebuilding the object
tree 'Rebuilding the ${OBJFORMAT} obj tree' section. This may or may not
be correct but it appears to function properly. If it is not correct we
need to find another way to avoid scanning every single file in the
entire source hierarchy for make restarts.


# 70152088 12-Dec-1998 Matthew Dillon <dillon@FreeBSD.org>

Grr. removed. backed-out. sorry!


# fed7770a 12-Dec-1998 Matthew Dillon <dillon@FreeBSD.org>

This needs to be commited now to fix usbd for make world


# 23284b17 28-Nov-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Revert previous commit; write idea, wrong way.


# f8303e79 28-Nov-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Remove netboot from build order; it's not ready for the limelight
and probably doesn't belong there anyway.


# 127a2cfa 19-Nov-1998 John Polstra <jdp@FreeBSD.org>

Make sure libskey is built before libpam. It is required for one of
the PAM modules.

Fix the comments describing the PAM dependencies to be consistent
with other related comments.


# 3da08d4a 17-Nov-1998 John Polstra <jdp@FreeBSD.org>

Add libpam to the "includes" and "libraries" targets.

Build the ordered list of libraries in a variable "_libs" before
building any of them. This eliminates a little bit of duplicated
code. More importantly, it makes it easier to include or exclude
libraries with .if constructs, because the list can be built in
multiple steps using "+=".


# c271ea0e 17-Nov-1998 John Polstra <jdp@FreeBSD.org>

Note the requirement that libcrypt be built before libkrb.


# d5f87f1a 15-Nov-1998 John Birrell <jb@FreeBSD.org>

Remove share/info from build tools because it breaks the build when
INFODIR is set.


# 5a51bc8e 12-Nov-1998 John Polstra <jdp@FreeBSD.org>

Add libradius and libtacplus to the includes target. Note their
dependence on libmd.


# 0eda097a 05-Nov-1998 Mike Smith <msmith@FreeBSD.org>

Typo , -> .

Submitted by: Shaun Courtney <shaun@emma.eng.uct.ac.za>


# fafe9c62 04-Nov-1998 Peter Wemm <peter@FreeBSD.org>

sys/modules/linux has a build-tools target


# 2bb39627 03-Nov-1998 Peter Wemm <peter@FreeBSD.org>

Add usr.bin/gensetdefs to build-tools; it is used for src/sys/modules and
maybe for other things that use linker sets under ELF.


# 2a6c45c9 17-Oct-1998 Bruce Evans <bde@FreeBSD.org>

Don't add /usr/games to $PATH. Adding it here can only work for the
`make world' case, and only made a difference for the evil NOTOOLS case
of `make world' since games tools are installed in ${TOOLROOT}/usr/bin
if they are built, but the PR was for normal builds. This is fixed
in rev.1.14 of src/games/fortune/datfiles/Makefile.

PR: 7936


# 59bec036 16-Oct-1998 Bruce Evans <bde@FreeBSD.org>

Fixed missing directories in the libraries target:
- in the elf case, csu must be built and installed before any shared
libraries. It wasn't, but we usually used a stale version that
happened to work. E.g., in the !NOTOOLS case we used the version
built and installed by the bootstrap-libraries target. Only cross
building was completely broken.
- the shared libmd must be built and installed before any shared
libraries that link to it. It wasn't, but we sometimes used a stale
version that happened to work, as above. For elf, this caused
bogus linkage of the target shared libatm and libopie with the host
static libmd. It isn't clear what this actually breaks, except for
cross compiling. For aout, the shared libmd is not built at all, so
all shared libraries linked to libmd may be broken. The linker
reports them by spewing RRS warnings.

Note that building src/lib early and building subdirs of src/lib in
the correct order in src/lib/Makefile doesn't help, since the subdirs
are all built before any are installed.

Fixed bitrot in the comments about the ordering requirements.


# 24f6ecd4 13-Oct-1998 Robert Nordier <rnordier@FreeBSD.org>

Include btxld in build-tools only for i386.


# daf326ce 13-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Conditionalise boot block building on i386.


# 14b49748 11-Oct-1998 Robert Nordier <rnordier@FreeBSD.org>

Remove sys/boot from the install as well.


# 1b9112ea 11-Oct-1998 Robert Nordier <rnordier@FreeBSD.org>

In src/Makefile.inc1:
Remove /sys/boot from legacy-build.
Add btxld to build-tools.
In src/sys/Makefile:
Add /sys/boot for i386 ELF.

I'm still not sure why the new boot code was being built along with the
legacy stuff, which meant a completely wrong default environment for it.

This may well still be the wrong way to go about this, but it can't work
all that much worse than it has been.


# 04e2ebf5 11-Oct-1998 Peter Wemm <peter@FreeBSD.org>

Comment about libm and libmd being needed for some libraries.
Prompted by: bde

Also. Don't build & install legacy lkm's when NOLKM has been set.
Otherwise it gets built in the src tree rather than obj, because the
previous 'make obj' at the start of legacy-build does respect NOLKM.


# 2de520a5 10-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Move OBJFORMAT hack to the correct line; what can I say, it was very
late. :)


# e313ef33 10-Oct-1998 KATO Takenori <kato@FreeBSD.org>

PC-98 uses different boot code from IBM-PC. So, MACHINE is used
instead of MACHINE_ARCH.

Submitted by: Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>


# 07bf7f4a 10-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Quick commit to see if I can't fix Robert's i386/boot problem in one line.
If this doesn't work, we'll try something else.


# 322a4708 10-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Don't chain makes with &&; apparently this is evil for parallelism.
According to: bde


# 87ee69f0 09-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Clean up the boot targets a bit.
Suggested by: jdp


# e2d56569 08-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Make both types of boot targets.


# 400b2cc5 05-Oct-1998 Mike Smith <msmith@FreeBSD.org>

Add libstand to the includes target.


# 5ca77c07 25-Sep-1998 Søren Schmidt <sos@FreeBSD.org>

Backout my last commit.
Find another way to get the LKM's rebuild.


# db8b174e 25-Sep-1998 Søren Schmidt <sos@FreeBSD.org>

Build the LKM's both on aout & ELF systems.

Reviewed by: jkh


# bc767300 23-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

Add printf(1) to the list of early-build tools.
(needed to build Amd, and causing the -jN crowd problems w/o being here)
((I will revisit the usage of printf(1) in building Amd at a later time))


# 51a6b2cb 23-Sep-1998 Mark Murray <markm@FreeBSD.org>

Complete the Perl NOSHARED repair. I had not ensured that the shared library
was constructed early enough, so perl was linking against the static lib.
This was breaking perl under ELF, as perl could not load shared objects
(in fact would dump core).


# b510e4c2 21-Sep-1998 John Birrell <jb@FreeBSD.org>

Remove the bootstrap-rtld target which wasn't needed.

Install the rest of the legacy libraries (like libgcc.a, libl.a).

Add games to the user's path to avoid the temptation for people to
hack paths to unsuitable tools.


# 52984c04 17-Sep-1998 Andreas Klemm <andreas@FreeBSD.org>

Purely cosmetic but useful change.
Make output of make world more readable for grep. Now a
grep '>>>' world.log
shows you the single stages through which the bootstrap
process went as discussed on -current. Could be used to
debug the bootstrap mechanism in case of trouble more
easily. Would be fine if any further @echo "..." messages
containing a description, what's going on, could use the
new format: @echo ">>> ..."


# d8004495 17-Sep-1998 Poul-Henning Kamp <phk@FreeBSD.org>

Two patches from the HARP people:

Various Makefile related fixes.

-Wformat fixes.

Submitted by: Mike Spengler <mks@networkcs.com>


# c3deaba9 16-Sep-1998 Justin T. Gibbs <gibbs@FreeBSD.org>

libscsi is obsoleted by CAM.


# 3f8c4506 15-Sep-1998 Poul-Henning Kamp <phk@FreeBSD.org>

(this is an extract from src/share/examples/atm/README)

===================================
HARP | Host ATM Research Platform
===================================

HARP 3

What is this stuff?
-------------------
The Advanced Networking Group (ANG) at the Minnesota Supercomputer Center,
Inc. (MSCI), as part of its work on the MAGIC Gigabit Testbed, developed
the Host ATM Research Platform (HARP) software, which allows IP hosts to
communicate over ATM networks using standard protocols. It is intended to
be a high-quality platform for IP/ATM research.

HARP provides a way for IP hosts to connect to ATM networks. It supports
standard methods of communication using IP over ATM. A host's standard IP
software sends and receives datagrams via a HARP ATM interface. HARP provides
functionality similar to (and typically replaces) vendor-provided ATM device
driver software.

HARP includes full source code, making it possible for researchers to
experiment with different approaches to running IP over ATM. HARP is
self-contained; it requires no other licenses or commercial software packages.

HARP implements support for the IETF Classical IP model for using IP over ATM
networks, including:

o IETF ATMARP address resolution client
o IETF ATMARP address resolution server
o IETF SCSP/ATMARP server
o UNI 3.1 and 3.0 signalling protocols
o Fore Systems's SPANS signalling protocol

What's supported
----------------
The following are supported by HARP 3:

o ATM Host Interfaces
- FORE Systems, Inc. SBA-200 and SBA-200E ATM SBus Adapters
- FORE Systems, Inc. PCA-200E ATM PCI Adapters
- Efficient Networks, Inc. ENI-155p ATM PCI Adapters

o ATM Signalling Protocols
- The ATM Forum UNI 3.1 signalling protocol
- The ATM Forum UNI 3.0 signalling protocol
- The ATM Forum ILMI address registration
- FORE Systems's proprietary SPANS signalling protocol
- Permanent Virtual Channels (PVCs)

o IETF "Classical IP and ARP over ATM" model
- RFC 1483, "Multiprotocol Encapsulation over ATM Adaptation Layer 5"
- RFC 1577, "Classical IP and ARP over ATM"
- RFC 1626, "Default IP MTU for use over ATM AAL5"
- RFC 1755, "ATM Signaling Support for IP over ATM"
- RFC 2225, "Classical IP and ARP over ATM"
- RFC 2334, "Server Cache Synchronization Protocol (SCSP)"
- Internet Draft draft-ietf-ion-scsp-atmarp-00.txt,
"A Distributed ATMARP Service Using SCSP"

o ATM Sockets interface
- The file atm-sockets.txt contains further information

What's not supported
--------------------
The following major features of the above list are not currently supported:

o UNI point-to-multipoint support
o Driver support for Traffic Control/Quality of Service
o SPANS multicast and MPP support
o SPANS signalling using Efficient adapters

This software was developed under the sponsorship of the Defense Advanced
Research Projects Agency (DARPA).

Reviewed (lightly) by: phk
Submitted by: Network Computing Services, Inc.


# 7004be9b 15-Sep-1998 Justin T. Gibbs <gibbs@FreeBSD.org>

Hook up beforeinstall targets for libcam and libdevstat


# c4e8b7e4 09-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

I don't want to be the only one to use ``cut''. Use ``sed'' instead.


# 8f748848 09-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

Add ``usr/bin/cut'' to "build-tools" target.
Used in usr.sbin/amd/include/newvers.sh.


# ddf0071c 09-Sep-1998 Mark Murray <markm@FreeBSD.org>

Remove the NOPERL block to building Perl5.

Perl 5 will rebuild/bootstrap itself next time a make world is done
with this in effect.


# fad8371b 09-Sep-1998 Mark Murray <markm@FreeBSD.org>

Add the Perl5 bootstrap tools.


# 62dfd75a 09-Sep-1998 Mark Murray <markm@FreeBSD.org>

Another place to set NOPERL.


# ff5fcc93 04-Sep-1998 Satoshi Asami <asami@FreeBSD.org>

Remove tcl from /usr/src, according to prior agreement. BTW, tcl-8.0 *is*
a port so there is nothing to be done on that side now.

Approved by: jkh
===
To: "Jordan K. Hubbard" <jkh@time.cdrom.com>
cc: Andreas Klemm <andreas@klemm.gtn.com>, current@freebsd.org
Subject: Re: Make this a relese coordinator decision (was Re: ports-current/packages-current discontinued)
From: David Greenman <dg@root.com>
Date: Sun, 03 Aug 1997 20:23:31 -0700

>decision is, I'll respect it.

Another chance to architect people's principles...I can hardly wait. Seems
quite appropriate for a Sunday - I just need to get one of those collection
plates (and money envelopes) so I can profit, too. :-)
Tcl stays in /usr/src for now, but it needs to be kept up to date; same
for perl. If Jordan doesn't have "setup" (written in tcl) ready for 3.0,
then tcl will be yanked prior to the 3.0 release (and made into a port).
As for the ports tree only supporting the last FreeBSD release, this seems
sensible to me. The "ports" have always been a moving target between releases
and the problem is only going to get worse when we expand to supporting other
processor architectures. In any case, Satoshi is and always has been in charge
of the ports tree and whatever he wants to do with it (within reason :-)) is
his decision.
Does this cover the issue completely? I admit to deleting messages in this
thread with unusual fervor (people have FAR too much time on their hands!).
There's a fair bit of reasoning behind the above, but since everyone is sick
of arguing about this, I'll spare you the analysis.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project


# d64c14ce 05-Sep-1998 John Birrell <jb@FreeBSD.org>

Change i386 in a few paths to ${MACHINE} to support MACHINE=pc98.


# 146cbe7e 03-Sep-1998 John Birrell <jb@FreeBSD.org>

Only run ldconfig if the OBJFORMAT is aout.


# 741d299c 01-Sep-1998 John Birrell <jb@FreeBSD.org>

Force NOMAN and NOINFO on legacy-install as well as legacy build.


# ff1284f6 31-Aug-1998 John Birrell <jb@FreeBSD.org>

Add a target to check the consistency of the make OBJFORMAT variable
with the object format determined by objformat. This prevents foot
shooting (a form of boot scooting for hackers?) where local changes
to /etc/make.conf or /etc/make.conf.local try to override OBJFORMAT
in an incomplete way.


# f471c448 31-Aug-1998 John Birrell <jb@FreeBSD.org>

MACHINE -> MACHINE_ARCH to allow PC98 to define MACHINE=pc98.

Submitted by: Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>


# 11fb97da 30-Aug-1998 John Birrell <jb@FreeBSD.org>

E-day build system changes.

- Moved most of the guts of Makefile to Makefile.inc1 to become the
backend for the build system.
- The new Makefile doesn't suffer from problems including the wrong
sys.mk because it doesn't use anything in there or bsd.own.mk. So,
from now on, the proper build command is just `make world' (or
buildworld).
- The intermediate makefiles called Makefile.inc0 and Makefile.upgrade
fiddle with the OBJFORMAT and MAKEOBJDIRPREFIX variables so that
both aout and elf object trees can coexist. Makefile.upgrade contains
the aout->elf transition build.
- A cross build environment is now very close to reality. Specifying
TOOLDIR, setting OBJFORMAT and MAKEOBJDIRPREFIX allow that.

See the comments in Makefile for more info.