History log of /freebsd-current/share/mk/src.opts.mk
Revision Date Author Comments
# 16d8dfde 17-May-2024 Brooks Davis <brooks@FreeBSD.org>

aarch64: disable LIB32 with gcc

gcc doesn't have -m32 support on aarch64 so mark LIB32 broken there.

We have to check both COMPILER_TYPE and X_COMPILER_TYPE becuase
X_COMPILER_TYPE is only conditionally set and COMPILER_TYPE is the host
compiler in Makefile.inc1.

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


# 68cbb072 25-Apr-2024 Brooks Davis <brooks@FreeBSD.org>

Revert "config.mk: Add MK_VIMAGE knob"

This commit broke "make makeman" checks in github CI due to a lack of
option description files. The split between VIMAGE and VIMAGE_SUPPORT
is not clearly justified and the code is broken because there is no
opt_vimage.h (it's in opt_global.h).

This reverts commit 22ca6db50f4e6bd75a141f57cf953d8de6531a06.


# ee3187f6 23-Apr-2024 John Baldwin <jhb@FreeBSD.org>

Remove the MK_NVME build option

The drivers and utilities are now built and installed unconditionally.

Reviewed by: imp, emaste
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44843


# 91d35fb6 23-Apr-2024 Ed Maste <emaste@FreeBSD.org>

Remove WITHOUT_CAPSICUM build support

Capsicum is non-optional as of c24c117b9644 ("Remove
WITHOUT_{CAPSICUM,CASPER} options").

`#ifndef WITHOUT_CAPSICUM` is left in the source for the benefit of
downstream consumers, but is never defined in FreeBSD.

Reviewed by: oshogbo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42077


# 2fda3ab0 16-Apr-2024 Warner Losh <imp@FreeBSD.org>

WITH_NVME: Remove from broken.

NVME works everywhere, so we can eliminate this. We may remove the
option altogether.

Sponsored by: Netflix
Discussed with: ken, jhb


# 22ca6db5 09-Apr-2024 Stephen J. Kiernan <stevek@FreeBSD.org>

config.mk: Add MK_VIMAGE knob

Default to VIMAGE as yes.
Add VIMAGE to __DEFAULT_DEPENDENT_OPTIONS (to define VIMAGE_SUPPORT)

Only output VIMAGE to opt_global.h when VIMAGE support is wanted.

Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39636


# a42d6f76 23-Nov-2022 Baptiste Daroussin <bapt@FreeBSD.org>

nuageinit: add basic support for cloudinit.

this is a very early script to support cloudinit, it does not intend to
be a full featured cloudinit client, but will support a good enough
subset to be viable in most case.

It support nocloud and openstack config-2 config drive mode (iso9660 or
msdosfs)

The following features are currently supported:
- adding users (including a default user named 'freebsd' with password
'freebsd'
- adding groups
- adding ssh keys
- static ipv4, static ipv6, dynamic ipv4

With this one is able to use the 'bring your own image feature" out of
box.

It is expected that the script grows the support of other clouds
supporting cloud-init, contributions are welcomed.

It is designed to be only run once via the firstboot mecanism.

Sponsored by: OVHCloud
MFC After: 3 weeks
Differential Revision: https://reviews.freebsd.org/D44141


# 0da51f1f 22-Feb-2024 Warner Losh <imp@FreeBSD.org>

Add missing .endif

Last second move from inside the prior block to outside bites me.

Noticed by: jrtc23
Fixes: dcb621efd664
Sponsored by: Netflix


# dcb621ef 22-Feb-2024 Warner Losh <imp@FreeBSD.org>

loader: Mark BEARSSL broken on powerpc

When BEARSSL is enabled, we pull in libsecureboot, which has EFI
dependencies which don't exist on powerpc. This needs to be detangled,
but until then mark it as broken.

Sponsored by: Netflix


# 63e9c976 17-Feb-2024 Warner Losh <imp@FreeBSD.org>

loader: Add new option WITH_LOADER_BIOS_TEXTONLY

This option will omit all the graphics support, the teken terminal
library, video mode support, etc and support a simple, basic, text-only
video console for the x86 BIOS boot loader. It uses the FreeBSD 12
version of vidconsole.c. It defaults to NO.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43912


# 73ff7384 11-Feb-2024 Dimitry Andric <dim@FreeBSD.org>

Optionally create full debuginfo for llvm-related executables

Commit de6feefdb7cfd limited the amount of debuginfo generated for clang
and other llvm-related executables. This was done to save disk space and
memory during building, but it makes debugging any of these executables
much harder.

Add a new src.conf(5) setting, WITH_LLVM_FULL_DEBUGINFO, to generate
full debuginfo instead. This is off by default, but could for example be
enabled for release builds or snapshots, so llvm executables are easier
to debug.

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


# ec4c2adb 13-Nov-2023 Brooks Davis <brooks@FreeBSD.org>

Retire LLD_IS_LD option

The option was added to parallel the CLANG_IS_CC which was removed in
commit 20a66ab4bf8511e51e11321b775d36c92e77fa69.

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


# 38981026 10-Oct-2023 Baptiste Daroussin <bapt@FreeBSD.org>

dialog(1): switch off dialog(1) by default

Every direct consumers in base have switch to use bsddialog(1) by
default


# 166a655f 05-Oct-2023 Baptiste Daroussin <bapt@FreeBSD.org>

bsdinstall: decouple from the MK_DIALOG option

bsdinstall does not depend on libdialog(3) or anything using
libdialog(3) for a while now, it does not need to depend on MK_DIALOG
anymore


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

Add support for host32 for DIRDEPS_BUILD

Allow building 32bit libs for host.

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

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


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

libc: add LIBC_MALLOC option

This will enable alternative mallocs to be included in the tree and
selected by setting LIBC_MALLOC. As there is only one today (jemalloc)
this option does nothing, but we expect to add other implementations
in the future. This will also reduce diffs to CheriBSD.

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


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

Remove $FreeBSD$: one-line sh pattern

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


# 6de02228 01-Aug-2023 Domagoj Stolfa <ds815@cam.ac.uk>

dtrace: Add WITH_DTRACE_ASAN

See commit 4ae6991228105eb34989c870194ae7b0a1e23be4. This version of
the commit avoids inadvertently changing SHLIBDIR for libdtrace.so.


# 77f6be44 01-Aug-2023 Ed Maste <emaste@FreeBSD.org>

retire SHARED_TOOLCHAIN knob

Toolchain components were historically statically linked. They became
normal dynamically linked executables in commit 6ab18ea64d19. There is
no need to keep a special case build option for the toolchain; users who
want statically linked toolchain (or any other) components can use the
existing NO_SHARED knob.

Reviewed by: dim, sjg
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41266


# 5cdaac92 01-Aug-2023 Mark Johnston <markj@FreeBSD.org>

dtrace: Revert the addition of WITH_DTRACE_ASAN

The follow-up fix triggers a lib32 build failure, revert everything
until the problem is addressed.


# 4ae69912 27-Jul-2023 Domagoj Stolfa <ds815@cam.ac.uk>

dtrace: Add WITH_DTRACE_ASAN

This option is a blanket for all the DTrace-related software. The option
when enabled passes in -fsanitize=address -fsanitize=undeifned, enabling
ASAN and UBSAN in the following components:

- libdtrace
- dtrace(1)
- lockstat(1)
- plockstat(1)

The option defaults to "no" and is intended as a developer aid.

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


# 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


# 642cd511 06-Jul-2023 Greg Becker <becker.greg@att.net>

libthr: Add src.conf variable WITHOUT_PTHREADS_ASSERTIONS

This patch fixes a bug which prevents building libthr without
_PTHREADS_INVARIANTS defined. The default remains to build libthr
with -D_PTHREADS_INVARIANTS. However, with this patch, if one builds
libthr with WITHOUT_PTHREADS_ASSERTIONS=true then the latency to
acquire+release a default pthread mutex is reduced by roughly 5%, and a
robust mutex by roughly 18% (as measured by a simple synthetic test on a
Xeon E5-2697a based machine).

Reviewed by: jhb, kib, mjg
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40900


# c24c117b 17-Jun-2023 Colin Percival <cperciva@FreeBSD.org>

Remove WITHOUT_{CAPSICUM,CASPER} options

At this point CAPSICUM and CASPER are merely forced on via the newly
added __REQUIRED_OPTIONS list; after stable/14 branches I'll sweep
the tree for MK_{CAPSICUM,CASPER}.

This change will not be MFCed.

Discussed on: freebsd-arch
Differential Revision: https://reviews.freebsd.org/D40592


# b908f6c4 17-Jun-2023 Colin Percival <cperciva@FreeBSD.org>

bsd.mkopt.mk: Add REQUIRED_OPTIONS list

Options on this list will be forced to 'yes'. This is intended for use
as a transitional measure when an option is ceasing to be optional,
before all of the associated make logic is removed.

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


# cb1fc924 30-May-2023 Baptiste Daroussin <bapt@FreeBSD.org>

genl: add new command to list genetlink(4)

This commands list genetlink protocols and its operations and
capabilities

Name: nlctrl
ID: 0x10, Version: 00, header size: 2, max attributes: 10
supported operations:
- ID: 0x3, Capabilities: 0xe (can modify; can get/dump;
has policy)
multicast groups:
- ID: 0x30, Name: notify
Name: carp
ID: 0x11, Version: 00, header size: 2, max attributes: 2
supported operations:
- ID: 0x1, Capabilities: 0xe (can modify; can get/dump;
has policy)
- ID: 0x2, Capabilities: 0xb (requires admin permission;
can modify; has policy)

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D40330


# ad9d10a8 11-May-2023 Warner Losh <imp@FreeBSD.org>

efi: mark as broken on i386

We're never going to support EFI booting on i386 (32-bit). Start to
decommission it, since it's never worked.

Sponsored by: Netflix
Reviewed by: tsoome, emaste
Differential Revision: https://reviews.freebsd.org/D40011


# 0b4568e3 01-May-2023 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: Decouple MK_INCLUDES from MK_TOOLCHAIN

Prior to 590461a4b89b installation of include files was controlled
directly by ${MK_TOOLCHAIN}. 590461a4b89b added an INCLUDES knob
defaulting to YES. Setting WITHOUT_TOOLCHAIN forced it off to retain
existing behaviour.

Decouple them now, as there are reasonable use cases for installing
libraries and include files without a compiler or other tool chain
components.

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


# 4f6a5e1d 27-Apr-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: enable NETLINK_SUPPORT by default on all architectures.

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


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

Enable building tar for non-FreeBSD host

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

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

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

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


# df53ae0f 22-Apr-2023 Colin Percival <cperciva@FreeBSD.org>

Remove portsnap(8)

Rather than having a tool in the FreeBSD base system for obtaining
the FreeBSD ports tree, users are encouraged to `pkg install git`
and then `git clone https://git.FreeBSD.org/ports.git /usr/ports`.

The portsnap servers will continue operating until FreeBSD 13 reaches
its End-of-Life, and portsnap is available from the ports tree as
ports-mgmt/portsnap.

Requested by: portmgr
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D39563
X-MFC: no


# 8612e445 20-Apr-2023 Brooks Davis <brooks@FreeBSD.org>

Remove unused NETLINK build option

NETLINK was added along side NETLINK_SUPPORT to control building netlink
specific programs, but it has no consumers so remove it for now.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D39678


# c4c981c1 17-Apr-2023 Simon J. Gerraty <sjg@FreeBSD.org>

Move include of site.src.opts.mk to allow more control

Sometimes a site may have different policy needs,
include site.src.opts.mk just before bsd.mkopt.mk to allow
more control.

Reviewed by: imp


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

Remove LLVM build glue for MIPS as a native architecture.

This does not remove LLVM_TARGET_MIPS. Note that the only
MACHINE_ARCH values ending in 'hf' were all MIPS architectures, hence
removing the pattern matches for 'hf'.

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


# a85dcd4a 26-Mar-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: restrict default userland switch to netlink to i386/amd64.


# 64dfea86 26-Mar-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: add NETLINK/NETLINK_SUPPORT userland options.

Make userland tools such as netstat, route, arp and ndp use
either netlink or rtsock interfaces based on the NETLINK_SUPPORT
options.
Both NETLINK and NETLINK_SUPPORT options are turned on by default.

Reviewed By: eugen
Differential Revision: https://reviews.freebsd.org/D39148


# 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


# 63715498 11-Mar-2023 Alfredo Dal'Ava Junior <alfredo@FreeBSD.org>

powerpc: enable ZFS on 32 bit powerpc/powerpcspe

Enable ZFS on powerpc 32 bit since it appears to build and work
correctly.

MFC after: 3 weeks
Relnotes: yes


# 3916fdd2 10-Mar-2023 Warner Losh <imp@FreeBSD.org>

opts: fix silly typo

It's powerpcspe not powerpcspc

Pointy Hat To: imp
Noticed by: jhibbits
Fixes: 41cf798e8206
Sponsored by: Netflix


# 41cf798e 10-Mar-2023 Warner Losh <imp@FreeBSD.org>

opts: popwerpcspc is also 32-bit

Mark ZFS broken here too, add comment about why. Add comments about
OFED being disabled on 32-bit arm, add comment about why too.

Sponsored by: Netflix


# 9503d270 10-Mar-2023 Warner Losh <imp@FreeBSD.org>

opts: Minor cleanup of ZFS options

Remove redundant CPUARCH test: we really just want a plain MACHINE_ARCH
here.

Second, always turn off LOADER_ZFS when we turn off ZFS. Not 100%
required, but we did it some places and not others. There's no current
mechanism to say that if X is disabled then X_Y must be too.

Sponsored by: Netflix


# aad600e5 09-Mar-2023 Brooks Davis <brooks@FreeBSD.org>

Remove WITH(OUT)_ATM option

With the removal of NgATM it no longer controls anything.

Reviewed by: manu, emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38882


# fe0f6950 08-Mar-2023 John Baldwin <jhb@FreeBSD.org>

Enable OFED on all platforms except for 32-bit arm.

32-bit arm triggers multiple -Wunaligned-access errors due to
structure packing.

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


# 1a718f7a 07-Mar-2023 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: Remove long-unused NDIS option

NDIS was removed a couple of years ago, but the src.conf knob was left
behind.

Fixes: bfc99943b04b ("ndis(4): remove as previous announced")
Sponsored by: The FreeBSD Foundation


# 7661a2ab 07-Mar-2023 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: sync FDT and OFED options with kern.opts.mk

Where options exist in both src.opts.mk and kern.opts.mk they should be
kept in sync.

It may be that the option should be flipped the other way (e.g.,
enabling OFED in the kernel on arm64); if so that will be done as a
subsequent commit after further testing.

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


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

src.opts.mk: mark ZFS broken on powerpc, matching kern.opts.mk

Where options exist in both src.opts.mk and kern.opts.mk they should be
kept in sync.

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


# d43812b1 02-Mar-2023 Emmanuel Vadot <manu@FreeBSD.org>

Disable ATM programs by default

ATM is an old technology, remove build of related programs by default

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


# e552cac3 25-Feb-2023 Piotr Kubaj <pkubaj@FreeBSD.org>

powerpc64*: port mlx5, OFED, KTLS and krping

Summary:
This review ports mlx5 driver, kernel's OFED stack (userland is already enabled), KTLS and krping to powerpc64 and powerpc64le.

krping requires a small change since it uses assembly for amd64 / i386.

NOTE: On powerpc64le RDMA works fine in the userspace with libmlx5, but on powerpc64 it does not. The problem is that contrib/ofed/libmlx5/doorbell.h checks for SIZEOF_LONG but this macro exists on neither powerpc64* nor amd64. Thus, the file silently goes to the fallback function written for 32-bit architectures. It works fine on little-endian architectures, but causes a hard fail on big-endian. It's possible it may also cause some runtime issues on little-endian.
Thus, on powerpc64 I verified that RDMA works with krping.

Reviewers: #powerpc, hselasky

Subscribers: bdrewery, imp, emaste, jhibbits

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


# f5a1c871 25-Feb-2023 Piotr Kubaj <pkubaj@FreeBSD.org>

Revert "powerpc64*: port mlx5, OFED, KTLS and krping"

Wrong push, another commit was supposed to be pushed.

This reverts commit 83d6d8877ef7dad4f4e8f409a01c9f28139cd026.


# 83d6d887 25-Feb-2023 Piotr Kubaj <pkubaj@FreeBSD.org>

powerpc64*: port mlx5, OFED, KTLS and krping

Summary:
This review ports mlx5 driver, kernel's OFED stack (userland is already enabled), KTLS and krping to powerpc64 and powerpc64le.

krping requires a small change since it uses assembly for amd64 / i386.

NOTE: On powerpc64le RDMA works fine in the userspace with libmlx5, but on powerpc64 it does not. The problem is that contrib/ofed/libmlx5/doorbell.h checks for SIZEOF_LONG but this macro exists on neither powerpc64* nor amd64. Thus, the file silently goes to the fallback function written for 32-bit architectures. It works fine on little-endian architectures, but causes a hard fail on big-endian. It's possible it may also cause some runtime issues on little-endian.
Thus, on powerpc64 I verified that RDMA works with krping.

Reviewers: #powerpc, hselasky

Subscribers: bdrewery, imp, emaste, jhibbits

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


# 46010641 03-Feb-2023 Warner Losh <imp@FreeBSD.org>

kboot: Enable for aarch64

Enable building loader.kboot for aarch64/arm64.

Sponsored by: Netflix
Reviewed by: tsoome, kevans, andrew
Differential Revision: https://reviews.freebsd.org/D38262


# 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


# 073ccb9d 07-Dec-2022 Simon J. Gerraty <sjg@FreeBSD.org>

Allow site.*.mk to augment local.*.mk and src.*.mk

Add some extra customization points so that FreeBSD build
can be adapted to local requirements.
We use these to minimize changes to share/mk

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


# 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


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

src.opts.mk: Require C++20 for C++ support.

libc++ requires C++20, so mark C++ (MK_CXX) as broken if the compiler
does not support C++20.

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


# 8a744de2 18-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: Remove i386-only support fire firewire

Remove support for booting off of firewire, and for having dcons via
firewire in the loader. Kernel support for these things is unchanged.
Discussed on arch@ and the current state is not working (and the build
was wrong to boot).

Sponsored by: Netflix
Discussed: https://lists.freebsd.org/archives/freebsd-arch/2022-November/000267.html
Reviewed by: kevans, melifaro, emaste
Differential Revision: https://reviews.freebsd.org/D37334


# f53dc31b 15-Nov-2022 John Baldwin <jhb@FreeBSD.org>

src.opts.mk: Disable all of LLVM if C++ support is disabled.

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


# 9729f076 27-Oct-2022 Souradeep Chakrabarti <schakrabarti@microsoft.com>

arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 3, final)

This is the last part for ARM64 Hyper-V enablement. This includes
commone files and make file changes to enable the ARM64 FreeBSD
guest on Hyper-V. With this patch, it should be able to build
the ARM64 image and install it on Hyper-V.

Reviewed by: emaste, andrew, whu
Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D36744


# 20adba8b 08-Aug-2022 Gleb Popov <arrowd@FreeBSD.org>

src.conf: Introduce WITHOUT_MACHDEP knob.

Summary:
This knob can be used to make buildsystem prefer generic C implentations of
various functions, instead of machine-specific assembler ones.

Test Plan: `make buildworld` on amd64

Reviewed by: imp, emaste

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

MFC after: 3 days


# 3bf66365 06-Jul-2022 Brooks Davis <brooks@FreeBSD.org>

cddl/*: add a WITH(OUT)_DTRACE option

Add an option to enable/disable DTrace without disabling ZFS. New
architectures such as CHERI may support ZFS before they support DTrace
and the old model of WITHOUT_CDDL disabling both wasn't helpful.

For compatiblity, the CDDL option remains and WITHOUT_CDDL implies
WITHOUT_DTRACE. WITHOUT_DTRACE also implies WITHOUT_CTF.

As part of this change, largely convert cddl/*/Makefile to using the
more compact SUBDIR.${MK_<FOO>}+= form rather than using intermediate
variables.

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


# 7df08a14 01-May-2022 Warner Losh <imp@FreeBSD.org>

stand: Initial kboot support on amd64

Get amd64 compiling. However, the current kboot supports an old way of
enumerating memory and the new way needs to be incorporated as well. The
powerpc folks could use either, it seems and newer powerpc platforms
need some changes for kboot to work anyway.

This commit includes the linker script, trampoline code to start the new
kernel, Linux system calls and the necessary configuration glue needed
to build the binaries.

This includes a quick hack to get multiboot support, but we need to
really share these defines. The multiiboot2.h is the minimum needed to
build. We have multiboot information in three places now, so a
refactoring is in order.

This should be considered, at best, preliminary and experimental for
anybody wishing to try it out.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D35100


# 8dc42f98 08-Feb-2022 Ed Maste <emaste@FreeBSD.org>

Invert CPU arch test for LLDB default

LLDB currently defaults to enabled on all architectures except arm and
riscv64 (and can probably be enabled for 32-bit arm). Switch to an
opt-out list.

Reviewed by: pkubaj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34218


# d68224c2 08-Feb-2022 Piotr Kubaj <pkubaj@FreeBSD.org>

powerpc64le: enable CXGBETOOL and MLX5TOOL

While mlx5 is not yet enabled on powerpc64le, cxgbe is.
The binary seems to work properly.

Differential revision: https://reviews.freebsd.org/D34026
Reviewed by: emaste


# 0b2d2290 26-Jan-2022 Piotr Kubaj <pkubaj@FreeBSD.org>

powerpc: Enable LLDB on all powerpc architectures

While LLDB on powerpc and powerpcspe builds as-is, on powerpc64 and
powerpc64le it requires adding a couple of additional source files
to build.

Differential review: https://reviews.freebsd.org/D34043
Approved by: dim, imp, emaste


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

libsoft: Remove

libsoft was a transition from the FreeBSD/armv6 10 (and earlier) with
'softfp' ABI (that is, hardware float, but passed as integer registers)
to the 'hardfp' ABI that was in FreeBSD/armv[67] in FreeBSD 11 and
newer. It's been off by default since it was created.

This was mostly used by people that wanted to do a source upgrade of
their system from FreeBSD 10 to 11 or from 11-current before the cutover
to 11-current after. This should not be confused with the full software
floating point implementation (that doesn't use the hardware floating
point instructions at all) that is used out of tree by at least one
company selling armv7 gear that has no FPU.

There's no longer a need for the transition, so retire it like should
likely have happened sometime before FreeBSD 12 was released 3 years
ago.

Sponsored by: Netflix
Suggestions by: jrtc27, jhb
Reviewed by: manu, mmel
Differential Revision: https://reviews.freebsd.org/D33761


# 69ee64c1 01-Jan-2022 Warner Losh <imp@FreeBSD.org>

src.opts.mk: Remove most of the mips support

Mips had a number of special cases that disabled features that didn't
work. Remove them all. However, retain the llvm mips bits because that
requires a lot more effort to unwind and will be done separately.

Sponsored by: Netflix


# e0281204 02-Jan-2022 Warner Losh <imp@FreeBSD.org>

Add clarifying comments

Expand on the terse comments for where each of these files is used.

Reviewed by: emaste
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33716


# 1a7ed7fe 30-Dec-2021 Warner Losh <imp@FreeBSD.org>

kboot: Add MK_LOADER_KBOOT

Control building of KBOOT same as we do for uboot.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D33511


# 40218ffe 21-Dec-2021 Piotr Kubaj <pkubaj@FreeBSD.org>

riscv64*: enable OFED

Summary:
OFED on riscv64 builds fine, so it's ok to enable it.

Also MFC to stable/13.

Test Plan: make buildworld

Reviewers: mhorne

Subscribers: bdrewery, imp, emaste

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


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

stand/uboot: reorg

Build uboot ubldr and friends like we build efi binaries
o move everything to be under stand/uboot
o md code goes in arch/$ARCH
o move everything over from the library
- Had to rename console.c, disk.c and module.c due to conflicts
o update version to 1.5 to reflect the new way of building

This results in a more consistent build system and should represent no
functional change, apart from powerpc version getting new help
file. Also, moved to exlcuding uboot on powerpc64le by using
BROKEN_OPTION instead of the incidental exclusion we had before due to
Makefile reorgs.

Sponsored by: Netflix
Feedback by: stevek, jrtc27
Differential Revision: https://reviews.freebsd.org/D33362


# 4dbc7835 10-Dec-2021 Warner Losh <imp@FreeBSD.org>

mips: Turn off LLVM MIPS targets by default

Now that MIPS isn't a recognized target for buildworld, move llvm mips
to off by default.

Sponsored by: Netflix
Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D33364


# 0e1c8648 28-Oct-2021 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: Add WITHOUT_CXX dependencies

OFED, OPENMP, and PMC depend on C++ support. Force them off when
building WITHOUT_CXX.

Reported by: Michael Dexter, Build Option Survey
Reviewed by: imp, jrtc27
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32730


# 6940d0e4 28-Oct-2021 Ed Maste <emaste@FreeBSD.org>

Force WITHOUT_OPENSSL_KTLS off when WITHOUT_OPENSSL

Discussed with: jhb
MFC after: 1 week
Reported by: Michael Dexter, Build Option Survey
Sponsored by: The FreeBSD Foundation


# ddedf2a1 11-Sep-2021 Edward Tomasz Napierala <trasz@FreeBSD.org>

tzcode: Implement timezone change detection

Implement optional timezone change detection for local time libc
functions. This is disabled by default; set WITH_DETECT_TZ_CHANGES
to build it.

Reviewed By: imp
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #47
Differential Revision: https://reviews.freebsd.org/D30183


# 24f58618 06-Sep-2021 Alex Richardson <arichardson@FreeBSD.org>

Enable MK_LLVM_BINUTILS if MK_ASAN is requested

ASan will not be able to provide backtraces with symbol names with
elftoolchain's addr2line. To fix this turn MK_LLVM_BINUTILS on by
default when ASan instrumentation is requested.

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


# 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


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

Don't default MK_LLVM_TARGET_ALL to yes unless MK_CLANG is requested

When building -DWITH_LLVM_BINUTILS -DWITHOUT_CLANG, this avoids
building a few hundred C++ source files that should not be needed
by default.

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


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

Revert "Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now"

The fixes for this have now been committed so we can re-enable these.

This reverts commit d9f25575a29ff7c83f226349a10a37b9aaf75ad5.

MFC after: 1 week


# d9f25575 17-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now

I enabled these options again in 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3,
but unfortunately only my specific build configuration worked whereas the
build with default options is still broken.


# 31ba4ce8 02-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Allow bootstrapping llvm-tblgen on macOS and Linux

This is needed in order to build various LLVM binutils (e.g. addr2line)
as well as clang/lld/lldb.

Co-authored-by: Jessica Clarke <jrtc27@FreeBSD.org>
Test Plan: Compiles on ubuntu 18.04 and macOS 11.4
Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D31057


# d8514fa6 10-Jul-2021 Warner Losh <imp@FreeBSD.org>

mk: LZMA_SUPPORT is unused

Retire LZMA_SUPPORT. It's unused since r332995.

Reviewed by: delphij
PR: 244302
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31088


# aa033e0b 25-Jun-2021 Piotr Kubaj <pkubaj@FreeBSD.org>

Enable OPENMP on riscv64* by default.

Differential revision: https://reviews.freebsd.org/D30862
Approved by: mhorne


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

Remove svnlite.

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


# a2bc1747 05-May-2021 John Baldwin <jhb@FreeBSD.org>

Disable building svnlite(1) by default.

Now that all repositories have switched to git, initiate the de-orbit
burn for svnlite(1).

Reviewed by: emaste
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D30105


# 68274355 16-Mar-2021 Jung-uk Kim <jkim@FreeBSD.org>

pkgbase: Fix building out-of-tree manual pages

c7e6cb9e08d6 introduced MK_MANSPLITPKG but it was not available for
building out-of-tree manual pages. For example, x11/nvidia-driver fails
with the following error:

===> doc (all)
make[3]: "/usr/share/mk/bsd.man.mk" line 53: Malformed conditional (${MK_MANSPLITPKG} == "no")
make[3]: Fatal errors encountered -- cannot continue

Move the definition from src.opts.mk to bsd.opts.mk to make it visible.


# c7e6cb9e 16-Mar-2021 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Add an src.conf option for splitting man pages

Man pages can be big in total, add an options to split man pages
in -man packages so we produce smaller packages.
This is useful for small jails or mfsroot produced of pkgbase.
The option is off by default.

Reviewed by: bapt, Mina Galić <me@igalic.co>
Differential Revision: https://reviews.freebsd.org/D29169
MFC after: 2 weeks


# e4d63c5d 02-Mar-2021 Kyle Evans <kevans@FreeBSD.org>

Remove fmtree(8)

fmtree(8) deprecation was announced on February 12, 2021, and no longer
built by default as of that date. The deprecation notice was merged
back to stable/12 and stable/13 + releng/13.0.

Continue with the plan by finishing the removal.

Relnotes: yes


# c975494a 10-Feb-2021 Kyle Evans <kevans@FreeBSD.org>

build: turn off FMTREE by default to prepare for removal

nmtree is derived from fmtree, and has been the default mtree(8) since
6adfbbbf161, a little over a year after its introduction.

fmtree has not seen any substantial work since then, except for build
fixes and runtime issues that were diagnosed in nmtree and backported
because this was still in the tree.

Turn it off by default.

Reviewed by: bdrewery, brooks, cy, emaste
Differential Revision: https://reviews.freebsd.org/D28573


# e5cc1c47 30-Jan-2021 Mitchell Horne <mhorne@FreeBSD.org>

src.opts.mk: set MK_ZFS conditional on MK_OPENSSL

libzfs has a dependency on libcrypto. This causes a buildworld link
failure when WITHOUT_OPENSSL/WITHOUT_CRYPT is set.

This dependency was added implicitly by the switch to OpenZFS, and
explicitly in 40d0fd287510 and cd568e2b1b67.

PR: 252841
Reviewed by: kevans, freqlabs
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28431


# 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


# e6b7809c 28-Jan-2021 Allan Jude <allanjude@FreeBSD.org>

Flip the default for OPENSSL_KTLS to arm64

This is required to make use of KERN_TLS

Reviewed by: jhb
Sponsored by: Ampere Computing
Submitted by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D28405


# aa906e2a 15-Jan-2021 John Baldwin <jhb@FreeBSD.org>

OpenSSL: Support for kernel TLS offload (KTLS)

This merges upstream patches from OpenSSL's master branch to add
KTLS infrastructure for TLS 1.0-1.3 including both RX and TX
offload and SSL_sendfile support on both Linux and FreeBSD.

Note that TLS 1.3 only supports TX offload.

A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with
KTLS support. It defaults to enabled on amd64 and disabled on all
other architectures.

Reviewed by: jkim (earlier version)
Approved by: secteam
Obtained from: OpenSSL (patches from master)
MFC after: 1 week
Relnotes: yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28273


# 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


# 7c5a624a 04-Jan-2021 Adrian Chadd <adrian@FreeBSD.org>

[wpa] Add support for hostapd/wpa_supplicant when WITHOUT_CRYPT=YES
is enabled.

This builds wpa_supplicant / hostpad using internal encryption routines
rather than using libcrypt.

This has been supported in wpa for years now, however since we use
local makefiles for this, we bitrotted dependencies and configuration
options.

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


# 8aff76fb 22-Dec-2020 Kyle Evans <kevans@FreeBSD.org>

build: remove the option to build gnugrep

Unconditionally install bsdgrep as grep, bootstrap or not. Remove all
build glue and stop installing both gnugrep and libgnuregex now that
all consumers of the latter are gone.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27732


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

Remove additional GDB leftovers missed in r368667


# 32420de9 10-Dec-2020 Kyle Evans <kevans@FreeBSD.org>

Flip the GNU_GREP default to OFF

bsdgrep was made the default in r368439. Stop building gnugrep entirely as
the natural next step towards removal.


# bee11ec2 08-Dec-2020 Ed Maste <emaste@FreeBSD.org>

Default to WITHOUT_GDB (GDB 6.1.1) for FreeBSD 13

As discussed on -current, -stable, -toolchain, and with jhb@ and imp@,
disable the obsolete in-tree GDB 6.1.1 by default. This was kept only
to provide kgdb for the crashinfo tool, but is long-obsolete, does not
support all architectures that FreeBSD does, and held back other work
(such as forcing the use of DWARF2 for kernel debug).

Crashinfo will use kgdb from the gdb package or devel/gdb port, and will
privde a message referencing those if no kgdb is found.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation


# b82a9ec5 08-Dec-2020 Kyle Evans <kevans@FreeBSD.org>

src.opts.mk: switch to bsdgrep as /usr/bin/grep

This has been years in the making, and we all knew it was bound to happen
some day. Switch to the BSDL grep implementation now that it's been a
little more thoroughly tested and theoretically supports all of the
extensions that gnugrep in base had with our libregex(3).

Folks shouldn't really notice much from this update; bsdgrep is slower than
gnugrep, but this is currently the price to pay for fewer bugs. Those
dissatisfied with the speed of grep and in need of a faster implementation
should check out what textproc/ripgrep and textproc/the_silver_searcher
can do for them.

I have some WIP to make bsdgrep faster, but do not consider it a blocker
when compared to the pros of switching now (aforementioned bugs, licensing).

PR: 228798 (exp-run)
PR: 128645, 156704, 166842, 166862, 180937, 193835, 201650
PR: 232565, 242308, 246000, 251081, 191086, 194397
Relnotes: yes, please


# 7c2f310f 04-Dec-2020 Kyle Evans <kevans@FreeBSD.org>

Retire GNU_GREP_COMPAT knob

This was introduced and then disabled by default primarily to avoid dealing
with bugs in libgnuregex. rS363823 switched to using libregex for it, so
let's just rip the option out now so we can make sure we're getting tested
with libregex via bsdgrep.

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


# 9fa94e1c 04-Nov-2020 Dimitry Andric <dim@FreeBSD.org>

Turn on WITH_LLVM_CXXFILT by default

LLVM's demangler supports more modern C++ constructs such as lambdas and
unnamed types, and is actively maintained. The command line tool is
usable as a drop-in replacement for GNU c++filt, or elftoolchain's
cxxfilt. The latter is still available by using WITHOUT_LLVM_CXXFILT, if
needed.

PR: 250702
MFC after: 2 weeks


# 07bab441 03-Nov-2020 Dimitry Andric <dim@FreeBSD.org>

Add WITH_LLVM_CXXFILT option to install llvm-cxxfilt as c++filt

Since elftoolchain's cxxfilt is rather far behind on features, and we
ran into several bugs, add an option to use llvm-cxxfilt as an drop-in
replacement.

It supports the same options as elftoolchain cxxfilt, though it doesn't
have support for old ARM (C++ Annotated Reference Manual, not the CPU)
and GNU v2 manglings. But these are irrelevant in 2020.

Note: as we already compile the required libraries as part of libllvm,
this will not add any significant build time either.

PR: 250702
Reviewed by: emaste, yuri
Differential Revision: https://reviews.freebsd.org/D27071
MFC after: 2 weeks


# 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


# 1d2a0dce 14-Sep-2020 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC] Remove obsolete MK_LOADER_FORCE_LE

In D12421, the ability to compile stand/ in little-endian was added, with the
intention to extend loader.kboot to run in Petitboot.

However, no further work was done, as the kernel then gained self-execution
capabilities as Petitboot was taught to load FreeBSD kernels directly.

The FreeBSD installer on powerpc64 (on POWER8 and POWER9) uses
/boot/etc/kboot.conf instead of loader.

As this option does nothing but cause stand/ to be miscompiled and actively
causes confusion, remove it.

(I have a functioning petitboot loader in my local tree, however, it turned
out to be quite inconvient to use due to the current petitboot plugin design
so I put it on hold.)

Reviewed by: emaste, imp, jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D26430


# d3980671 08-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

opts: FREEBSD_UPDATE no longer relies on PORTSNAP

phttpget is no longer tied to the portsnap build as of r365490.

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D26255


# 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


# 7d4374f6 05-Sep-2020 Dimitry Andric <dim@FreeBSD.org>

Turn MALLOC_PRODUCTION into a regular src.conf(5) option

For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has
been used to turn off potentially expensive debug checks and statistics
gathering in the implementation of malloc(3).

It seems more consistent to turn this into a regular src.conf(5) option,
e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then
be toggled similar to any other source build option, and turned on or
off by default for e.g. stable branches.

Reviewed by: imp, #manpages
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26337


# 2a5220e1 24-Aug-2020 Dimitry Andric <dim@FreeBSD.org>

After r364732, we can now enable MK_OPENMP for aarch64 by default.

PR: 248864
MFC after: 2 weeks


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

Add CLANG/LLD/LLD to BROKEN_OPTIONS when building on non-FreeBSD

These tools require a bootstrap llvm-tblgen/clang-tblgen and that cannot
be built with the current make infrastructure: the config header is not
correct for Linux/macOS and we don't include the CMakeLists.txt in contrib
so we can't generate one that would be correct.

Reviewed By: emaste, imp, dim
Differential Revision: https://reviews.freebsd.org/D14245


# 2192efc0 06-Jul-2020 Mitchell Horne <mhorne@FreeBSD.org>

RISC-V boot1.efi and loader.efi support

This implementation doesn't have any major deviations from the other EFI
ports. I've copied the boilerplate from arm and arm64.

I've tested this with the following boot flows:
OpenSBI (M-mode) -> u-boot (S-mode) -> loader.efi -> FreeBSD
OpenSBI (M-mode) -> u-boot (S-mode) -> boot1.efi -> loader.efi -> FreeBSD

Due to the way that u-boot handles secondary CPUs, OpenSBI >= v0.7 is required,
as the HSM extension is needed to bring them up explicitly. Because of this,
using BBL as the SBI implementation will not be possible. Additionally, there
are a few recent u-boot changes that are required as well, all of which will be
present in the upcoming v2020.07 release.

Looks good: emaste
Differential Revision: https://reviews.freebsd.org/D25135


# 252884ae 26-Jun-2020 Stefan Eßer <se@FreeBSD.org>

Import new 2-clause BSD licenced implementation of the bc and dc commands

These implementations of the bc and dc programs offer a number of advantages
compared to the current implementations in the FreeBSD base system:

- They do not depend on external large number functions (i.e. no dependency
on OpenSSL or any other large number library)

- They implements all features found in GNU bc/dc (with the exception of
the forking of sub-processes, which the author of this version considers
as a security issue).

- They are significantly faster than the current code in base (more than
2 orders of magnitude in some of my tests, e.g. for 12345^100000).

- They should be fully compatible with all features and the behavior of the
current implementations in FreeBSD (not formally verified).

- They support POSIX message catalogs and come with localized messages in
Chinese, Dutch, English, French, German, Japanese, Polish, Portugueze,
and Russian.

- They offer very detailed man-pages that provide far more information than
the current ones.

The upstream sources contain a large number of tests, which are not
imported with this commit. They could be integrated into our test
framework at a latter time.

Installation of this version is controlled by the option "MK_GH_BC=yes".
This option will be set to yes by default in 13-CURRENT, but will be off
by default in 12-STABLE.

Approved by: imp
Obtained from: https://git.yzena.com/gavin/bc
MFC after: 4 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D19982


# 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


# 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


# 18983e3b 05-Jun-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: disable BINUTILS_BOOTSTRAP universally

As of r361853 skein_block_asm.S is assembled using Clang's integrated
assembler.

PR: 233611
Sponsored by: The FreeBSD Foundation


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

Disable BINUTILS by default on amd64

The retirement of obsolete binutils 2.17.50 has been in progress for
quite some time. All tools other than GNU as were removed prior to this
commit, and it was built only on amd64 - installed as /usr/bin/as, and
used as a bootstrap tool.

The amd64 exp-run has completed and failures have now been addressed in
the individual ports, so disable it by default.

PR: 233611, 205250 [exp-run]
Sponsored by: The FreeBSD Foundation


# 24930a2b 29-May-2020 Ed Maste <emaste@FreeBSD.org>

Disable BINUTILS by default on i386

The retirement of obsolete binutils 2.17.50 has been in progress for
quite some time. All tools other than GNU as were removed prior to this
commit, and it was built only on two archs:

i386, installed as /usr/bin/as
amd64, installed as /usr/bin/as and as a bootstrap tool

The i386 exp-run has completed and failures have been addressed in the
individual ports, so disable it there.

PR: 233611, 205250 [exp-run]
Sponsored by: The FreeBSD Foundation


# 0e7fa9f9 08-May-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: update BINUTILS options and add comments

BINUTILS is needed only for ports, and will be disabled once the failing
ports are addressed (likely by growing a binutils dependency).

BINUTILS_BOOTSTRAP is needed only on amd64, for skein_block_asm.s. There
is no need to enable it on i386.

This will all be removed before FreeBSD 13.0.


# fe808290 06-May-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: with BINUTILS limited to as it is used on i386 and amd64 only


# 483d953a 04-May-2020 John Baldwin <jhb@FreeBSD.org>

Initial support for bhyve save and restore.

Save and restore (also known as suspend and resume) permits a snapshot
to be taken of a guest's state that can later be resumed. In the
current implementation, bhyve(8) creates a UNIX domain socket that is
used by bhyvectl(8) to send a request to save a snapshot (and
optionally exit after the snapshot has been taken). A snapshot
currently consists of two files: the first holds a copy of guest RAM,
and the second file holds other guest state such as vCPU register
values and device model state.

To resume a guest, bhyve(8) must be started with a matching pair of
command line arguments to instantiate the same set of device models as
well as a pointer to the saved snapshot.

While the current implementation is useful for several uses cases, it
has a few limitations. The file format for saving the guest state is
tied to the ABI of internal bhyve structures and is not
self-describing (in that it does not communicate the set of device
models present in the system). In addition, the state saved for some
device models closely matches the internal data structures which might
prove a challenge for compatibility of snapshot files across a range
of bhyve versions. The file format also does not currently support
versioning of individual chunks of state. As a result, the current
file format is not a fixed binary format and future revisions to save
and restore will break binary compatiblity of snapshot files. The
goal is to move to a more flexible format that adds versioning,
etc. and at that point to commit to providing a reasonable level of
compatibility. As a result, the current implementation is not enabled
by default. It can be enabled via the WITH_BHYVE_SNAPSHOT=yes option
for userland builds, and the kernel option BHYVE_SHAPSHOT.

Submitted by: Mihai Tiganus, Flavius Anton, Darius Mihai
Submitted by: Elena Mihailescu, Mihai Carabas, Sergiu Weisz
Relnotes: yes
Sponsored by: University Politehnica of Bucharest
Sponsored by: Matthew Grooms (student scholarships)
Sponsored by: iXsystems
Differential Revision: https://reviews.freebsd.org/D19495


# 5ffef74b 30-Apr-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: add WITHOUT_OPENSSL dependencies

A number of components require OpenSSL and fail to build if it is not
enabled. As a first phase force these off under WITHOUT_OPENSSL. A
second phase should make these more fine-grained, allowing the component
to build but without OpenSSL.

PR: 245931
Sponsored by: The FreeBSD Foundation


# 12de77b3 19-Apr-2020 Cy Schubert <cy@FreeBSD.org>

Due to popular demand, revert r360102.

Reported by: many


# 4574585e 19-Apr-2020 Cy Schubert <cy@FreeBSD.org>

Conditionally install Kerberos rc files based on MK_KERBEROS_SCRIPTS
instead of MK_KERBEROS. The reason for this change is some users
prefer to build FreeBSD WITHOUT_KERBEROS, wanting to retain the
Kerberos rc scripts to start/stop MIT Kerberos or Heimdal from ports.

PR: 197337
Reported by: Adam McDougall <ebay at looksharp.net>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D24252


# f5b7695d 08-Apr-2020 Xin LI <delphij@FreeBSD.org>

Always install backward compatibility timezones, as they are installed
on all major Linux distributions as well as NetBSD and OpenBSD.

Remove the undocumented ZONEINFO_OLD_TIMEZONES_SUPPORT and the deprecated
OLDTIMEZONES knobs as they are now the default.

Reviewed by: ngie, rgrimes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24306


# 147d7b56 05-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

llvm: add a build knob for enabling assertions

For head/, this will remain eternally default-on to maintain the status quo.
For stable/ branches, it should be flipped to default-off to maintain the
status quo.

There's value in being able to flip it one way or the other easily on head
or stable branches, whether you want to gain some performance back on head/
(for machines there's little chance you'll actually hit an assertion) or
potentially diagnose a problem with the version of llvm on an older branch.

Currently, stable branches get the CFLAGS+= -ndebug line uncommented; going
forward, they will instead have the default of LLVM_ASSERTIONS flipped.

Reviewed by: dim, emaste, re (gjb)
MFC after: 1 week
MFC note: flip the default of LLVM_ASSERTIONS
Differential Revision: https://reviews.freebsd.org/D24264


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

drop GDB_LIBEXEC option (now always true)

In-tree gdb is essentially obsolete. We kept it for sparc64 (because
gdb in ports lacked sparc64 support) and as a fallback for crashinfo.
gdb was installed to /libexec on all archs other than sparc64, where the
WITHOUT_GDB_LIBEXEC option was default, with gdb installed to /usr/bin.
With sparc64's retirement WITH_GDB_LIBEXEC became the default for all
architectures, but it was still possible to set it off and install gdb
into /usr/bin.

As the next step in gdb's retirement, remove the option and install gdb
only into /libexec as the crashinfo fallback. We expect users to install
the gdb port or package for debugging. The in-tree gdb lacks support for
a number of supported architectures and does not support contemporary
DWARF debug info.

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


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

[PowerPC] Switch powerpc and powerpcspe to lld

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

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

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


# 4a4c9a0f 23-Mar-2020 Alex Richardson <arichardson@FreeBSD.org>

Use Clang and LLD as the default toolchain for MIPS

Now that we have updated the in-tree version of LLVM to 10.0, we have all the
necessary LLVM changes to use Clang+LLD as the default toolchain for MIPS.

Relnotes: yes
Reviewed By: emaste, jhb, brooks, kevans
Differential Revision: https://reviews.freebsd.org/D23204


# 980bae69 20-Mar-2020 Warner Losh <imp@FreeBSD.org>

Redo r359164 now that it's baked : Eliminate misuse of $MACHINE for userland things.

Use TARGET_ARCH and/or MACHINE_ARCH exclusively. Change all __TT uses to __T
with appropriate translations. MACHINE/TARGET is to be used only for kernel
things, and this fixes the last few stragglers.


# 5e029bd7 20-Mar-2020 Warner Losh <imp@FreeBSD.org>

Revert r359164.

This was in my staging tree by mistake when I pushed. Revert until it's ready.


# 6f7bbb26 20-Mar-2020 Warner Losh <imp@FreeBSD.org>

Eliminate misuse of $MACHINE for userland things.

Use TARGET_ARCH and/or MACHINE_ARCH exclusively. Change all __TT uses to __T
with appropriate translations. MACHINE/TARGET is to be used only for kernel
things.


# 3b7fd87c 20-Mar-2020 Warner Losh <imp@FreeBSD.org>

Remove sparc support from clang build infrastructure. Any remaining sparc files
will be mopped up in future imports.

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


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

src.opts.mk: remove remaining support for pre-C++11 C++ compilers

Delete the conditions that forcibly disabled GOOGLETEST and LLDB for
pre-C++11 C++ compilers, since we no longer support such compilers.

Also delete the complicated method of defaulting LIBCPLUSPLUS to YES.

Prodded by: kevans
Sponsored by: The FreeBSD Foundation


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

src.opts.mk: drop C++11 compiler conditional from OPENMP

We no longer support older C++ compilers, so do not need to explicitly
test for C++11 support.

After r339946 we stopped running `cc --version` during cleandir/obj
stages, so stopped setting COMPILER_FEATURES. This in turn meant
lib/libomp was excluded from the clean stage in a normal buildworld
(i.e., one without -DNO_CLEAN), and this is what caused recent build
failures with errors about missing ittnotify_static.c.

This commit should obviate the need for the workaround committed in
r359083. Thanks to bdrewery for the insight and for pushing for a
correct fix. There are more cleanups to be done, but this change is
a simplification and an improvement over r359083.

Sponsored by: The FreeBSD Foundation


# 5b51d0c0 09-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Remove WITH_AMD option, missed in r358821


# afc571b1 08-Mar-2020 Simon J. Gerraty <sjg@FreeBSD.org>

veloader use vectx API for kernel and modules

The vectx API, computes the hash for verifying a file as it is read.
This avoids the overhead of reading files twice - once to verify, then
again to load.

For doing an install via loader, avoiding the need to rewind
large files is critical.

This API is only used for modules, kernel and mdimage as these are the
biggest files read by the loader.
The reduction in boot time depends on how expensive the I/O is
on any given platform. On a fast VM we see 6% improvement.

For install via loader the first file to be verified is likely to be the
kernel, so some of the prep work (finding manifest etc) done by
verify_file() needs to be factored so it can be reused for
vectx_open().

For missing or unrecognized fingerprint entries, we fail
in vectx_open() unless verifying is disabled.

Otherwise fingerprint check happens in vectx_close() and
since this API is only used for files which must be verified
(VE_MUST) we panic if we get an incorrect hash.

Reviewed by: imp,tsoome
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D23827


# 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


# 83a08b7c 29-Feb-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: simplify Clang and lld bootstrap defaults

With the retirement of GCC 4.2.1 we can assume the host compiler supports
C++11, and can simplify the Clang and LLD defaults. Clang and lld are now
enabled by default everywhere, and are used as the bootstrap compiler and
linker for all targets except MIPS.

Sponsored by: The FreeBSD Foundation


# 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


# 593d80c4 26-Feb-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: drop MIPS special case for disabling BINUTILS_BOOTSTRAP

Binutils has already been reduced to installing ld only on powerpc32
and as only on amd64. (Also objdump on every arch supported by binutils
2.17.50.) Although BINUTILS_BOOTSTRAP serves no purpose on MIPS there
is no reason to have a special case for it.

Sponsored by: The FreeBSD Foundation


# 47e9f42e 26-Feb-2020 Warner Losh <imp@FreeBSD.org>

Remove sparc64 specific buid-system hacks

Remove all the sparc64 hacks and tweaks to the build system. We don't
need them anymore.


# db1d8f1d 19-Feb-2020 Ed Maste <emaste@FreeBSD.org>

Move GCOV option to default NO

GNU gcov will be removed along with GCC 4.2.1 at the end of the month.
Change the default to NO in preparation.


# 6794d195 09-Feb-2020 Kyle Evans <kevans@FreeBSD.org>

mips: mark GOOGLETEST broken, due to no fault of its own

As explained in the comment; GOOGLETEST cannot currently be compiled on any
mips variant at the moment due to the cross toolchain seemingly using the
wrong spec and not pulling in libgcc. We'll be fine when llvm 10 lands, at
which point this should be reverted most expeditiously.


# 504613f2 04-Feb-2020 Kyle Evans <kevans@FreeBSD.org>

Remove simple_httpd

simple_httpd was granted a reprieve from the picobsd removal based on having
some reported user; it turns out this user isn't actually using the version
in base and merging their changes would be difficult at this point, so the
version in base will simply continue to rot. Retire it now, it may make a
comeback to ports with the improved version.

No notice issued because its current visibility has only been for ~3
months, and a notice has been previously issued about picobsd removal.


# 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


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

src.opts.mk: default BINUTILS_BOOTSTRAP to NO except for x86 and powerpc

x86 needs bootstrap GNU as for assembling a few files, and powerpc needs
GNU ld.bfd for linking 32-bit objects. All other targets either fully
use in-tree Clang and lld, or rely on external toolchain.

Sponsored by: The FreeBSD Foundation


# df502acc 17-Jan-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: force DMAGENT off under WITHOUT_OPENSSL

dma(8) depends on OpenSSL unconditionally.

Reported by: Michael Dexter's Build Options Survey run
MFC after: 1 weeks
Sponsored by: The FreeBSD Foundation


# 0ce9d0af 10-Jan-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: force KERBEROS_SUPPORT off where KERBEROS forced off

Explicitly setting WITHOUT_KERBEROS implies WITHOUT_KERBEROS_SUPPORT,
but previously other cases that forced KERBEROS off (such as
WITHOUT_CRYPT) did not also set KERBEROS_SUPPORT off. Because the
_SUPPORT dependent options (KERBEROS/KERBEROS_SUPPORT) are processed
before other dependencies (CRYPT/KERBEROS) it's not easy to make this
happen automatically. Instead just explicitly set KERBEROS_SUPPORT
off where we set KERBEROS off.

Reported by: Michael Dexter's Build Option Survey run


# f8c319da 09-Jan-2020 Ed Maste <emaste@FreeBSD.org>

Revert r356515 - add LLVM_LIBUNWIND back to sparc64 BROKEN_OPTIONS

r356552 reverted the untested build fix for LLVM libunwind on sparc64,
so mark it broken again.


# 3b957e38 08-Jan-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: Remove sparc64 LLVM_LIBUNWIND BROKEN_OPTIONS

After r356513 it should build.


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

src.opts.mk: enable LLVM_UNWIND by default for all archs

Only sparc64 did not enable LLVM_LIBUNWIND. After r356513 LLVM_LIBUNWIND
should at least build on sparc64. The old DWARF unwinder will be removed
along with GCC 4.2.1 in the near future, so switch sparc64 to use LLVM's
unwinder in advance of the removal. Someone with access to the obsolete
sparc64 hardware supported by FreeBSD will have to test, and investigate
any failures. I will gladly help, but I don't have any suitable hardware
myself.

PR: 233405


# e48503ff 08-Jan-2020 John Baldwin <jhb@FreeBSD.org>

Use clang and lld as the default toolchain for RISCV.

- Enable clang and lld as system toolchains.
- Don't use external GCC for universe by default.
- Re-enable riscv64sf since it builds fine with clang + lld.

Reviewed by: emaste, mhorne
Relnotes: yes
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D23089


# 2138e99b 08-Jan-2020 Michal Meloun <mmel@FreeBSD.org>

Switch 32-bit arm back to LLVM libunwind.
Actual LLVM libunwind passed all testing without issues, switch back to it.

PR: 233664


# d679c719 06-Jan-2020 Kyle Evans <kevans@FreeBSD.org>

Refine fusefs test workaround for mips+llvm

This re-enables building the googletest suite by default on mips and instead
specifically doesn't build fusefs tests for mips+clang builds. clang will
easily spent >= 1.5 hours compiling a single file due to a bug in
optimization (see LLVM PR 43263), so turn these off for now while that's
hashed out.

GCC builds are unaffected and build the fusefs tests as-is. Clang builds
only happen by early adopters attempting to hash out the remaining issues.

The comment has been updated to reflect its new position and use less strong
wording about imposing on people.

Discussed with: ngie, asomers
Reviewed by: ngie


# 6eb84c96 05-Jan-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: disable BINUTILS_BOOTSTRAP on all mips* and sparc64

Extend r356379 to include 32-bit mips and sparc64. Using a decade-old
binutils linker with a contemporary compiler (either Clang or GCC) is
a combination unlikely to be used by anyone else, and it's not going
to be a good use of our time investigating and addressing any issues
that arise. Expect that all architectures newly migrated to external
GCC will also use external binutils.


# a69473e3 05-Jan-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: disable BINUTILS_BOOTSTRAP on mips64*

After GCC was disabled by default in r356367, mips and sparc64 started
relying external GCC. However, the in-tree Binutils ld 2.17.50 is not
compatible with GCC for some mips64 targets, so turn off
BINUTILS_BOOTSTRAP and rely on external binutils (linker) as well.


# 5a0a8597 04-Jan-2020 Ed Maste <emaste@FreeBSD.org>

Do not build GCC 4.2.1 by default for any CPU architecture

By default set to NO:

GCC
GCC_BOOTSTRAP
GNUCXX

As described by imp@ on the freebsd-arch mailing list Aug 13, 2019 with
Subject: Gcc 4.2.1 to be removed before FreeBSD 13, a firm timeline
https://lists.freebsd.org/pipermail/freebsd-arch/2019-August/019674.html

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


# b4f20f20 03-Jan-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: SVNLITE requires FILE

Reported by: Build Options Survey run by Michael Dexter


# 9ed13baa 03-Jan-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: GOOGLETEST requires CXX

Reported by: Build Options Survey run by Michael Dexter


# 78a576cb 03-Jan-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: switch LLD_BOOTSTRAP and LLD_IS_LD to opt-out

More MACHINE_CPUARCH/MACHINE_ARCH cases enable these options than
disable them, and several of them have work in progress to switch over.
Thus, invert the sense of the test and list cases not using LLD as the
exceptions.


# 4ad9b9fa 03-Jan-2020 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: simplify after arm/arm retirement

There were a few special cases for arm v5, such as disabling LLDB due to
the lack of 64-bit atomic operations. Now that arm has been retired (as
of r356263) we can simplify the options logic somewhat.


# cb9da00e 27-Dec-2019 Ed Maste <emaste@FreeBSD.org>

Switch GPL_DTC to default off

We use the BSDL devicetree compiler as long as we have a C++11 compiler.
dtc is not needed as a build tool on the platforms that are still using
GCC 4.2.1 (and it is being disabled very soon, anyhow).

Discussed with: imp, kevans


# d3a54999 27-Dec-2019 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: switch LLVM_LIBUNWIND to opt-out

PowerPC switched to LLVM_LIBUNWIND along with the switch to Clang/LLVM
in r356111. This leaves only 32-bit Arm and sparc64 not using LLVM's
unwinder, so switch the sense to opt-out.

I elected to list the individual arm MACHINE_ARCHs so future changes
are more clear if LLVM_LIBUNWIND is enabled for one or two but not all
32-bit Arm targets (see PR 233664).


# 897dc644 27-Dec-2019 Ed Maste <emaste@FreeBSD.org>

src.opts.mk: switch LLVM toolchain to opt-out

After PowerPC switched in r356111, the list of targets using LLVM as the
default toolchain is much longer than those not using it. Switch the
sense of the test to exclude those not using LLVM.

Targets not using LLVM is currently mips, riscv5, and sparc64; work is
in progress to migrate the first two to LLVM.


# 678da4a2 26-Dec-2019 Justin Hibbits <jhibbits@FreeBSD.org>

Use LLVM as default toolchain for all PowerPC targets

This enables LLVM as the default compiler for powerpc, powerpc64, and
powerpcspe, as well as LLD as the default linker for powerpc64.

LLD is not yet ready for prime time for powerpc and powerpcspe, but work is
continuing on it.

Submitted by: alfredo.junior_eldorado.org.br
Relnotes: YES
Differential Revision: https://reviews.freebsd.org/D20378


# 37516d3b 20-Dec-2019 Ed Maste <emaste@FreeBSD.org>

add LDNS build knob dependency on OPENSSL

Reported by: Michael Dexter's run of the Build Options Survey
MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# 5fa85bcd 11-Dec-2019 Conrad Meyer <cem@FreeBSD.org>

Revert r354348

Switch ARM32 default libunwind back to old GPL2 libgcc version. Reportedly,
the llvm-libunwind code is nonfunctional.

Requested by: mmel


# 96aaefdf 10-Dec-2019 Bryan Drewery <bdrewery@FreeBSD.org>

Fix WITHOUT_CLANG build.

This decouples MK_LLVM_TARGET_ALL from MK_CLANG. It is fine if
LLVM_TARGET_* are set even if MK_CLANG is disabled. It never
made sense to depend MK_LLVM_TARGET_* to MK_CLANG (which I did
in r335706).

PR: 240507
Reported by: kevans, swills
MFC after: 2 weeks


# 678898a2 25-Nov-2019 Ed Maste <emaste@FreeBSD.org>

update comment (about llvm target config) to match r355095


# d5b068fc 25-Nov-2019 Ed Maste <emaste@FreeBSD.org>

remove armv6 LLVM workaround introduced in r341812

r341812 enabled only arm target support in LLVM on arm and armv6,
because ld.bfd 2.17.50 lacked support for range extensions required for
linking such large binaries/libraries. r341812 indicated that the
workaround should be removed once the userland can be linked by lld.

r354289 switched armv6 to use lld by default, so remove the workaround
on armv6. The workaround remains in place for arm (v5), and will
presumably be removed when arm is retired.

Sponsored by: The FreeBSD Foundation


# 5882cf71 20-Nov-2019 Ed Maste <emaste@FreeBSD.org>

disable amd(8) by default

As of FreeBSD 10.1 the autofs(5) is available for automounting, and the
amd man page has indicated that the in-tree copy of amd is obsolete.
Disable it by default for now, with the expectation that it will be
removed before FreeBSD 13.0.

Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22460


# de9950e8 12-Nov-2019 John Baldwin <jhb@FreeBSD.org>

Enable the RISC-V LLVM backend by default.

Reviewed by: dim, mhorne, emaste
MFC after: 1 month
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D22284


# a3b299f0 08-Nov-2019 Ed Maste <emaste@FreeBSD.org>

mark LLVM_LIBUNWIND as broken on sparc64, with PR reference

PR: 233405


# de15a85e 08-Nov-2019 Ed Maste <emaste@FreeBSD.org>

add reference to PR for sparc64 BSD_CRTBEGIN in BROKEN_OPTIONS

We will soon remove the BSD_CRTBEGIN option (and will use the new CRT
files always) as part of the GCC 4.2.1 removal. Right now BSD_CRTBEGIN
works everywhere but sparc64; add a reference to the PR in case anyone
stumbles across this and is looking for more information.


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


# 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


# 6b4e5d6b 04-Nov-2019 Conrad Meyer <cem@FreeBSD.org>

armv6, armv7: Switch to llvm-libunwind by default

This could just be ${__TT} == "arm", except armv5 isn't slated for death
until EOY.

arm tinderbox builds. Let's see what else shakes out.


# 784a4b6b 03-Nov-2019 Conrad Meyer <cem@FreeBSD.org>

armv6: Switch to LLD by default

This could just be ${__TT} == "arm", except armv5 isn't slated for death until
EOY.

arm tinderbox builds. Let's see what else shakes out.


# 6ab18ea6 23-Oct-2019 Dimitry Andric <dim@FreeBSD.org>

Build toolchain components as dynamically linked executables by default

Summary:
Historically, we have built toolchain components such as cc, ld, etc as
statically linked executables. One of the reasons being that you could
sometimes save yourself from botched upgrades, by e.g. recompiling a
"known good" libc and reinstalling it.

In this day and age, we have boot environments, virtual machine
snapshots, cloud backups, and other much more reliable methods to
restore systems to working order. So I think the time is ripe to flip
this default, and link the toolchain components dynamically, just like
almost all other executables on FreeBSD.

Maybe at some point they can even become PIE executables by default! :)

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22061


# 1a13f2e6 07-Oct-2019 Edward Tomasz Napierala <trasz@FreeBSD.org>

Introduce stats(3), a flexible statistics gathering API.

This provides a framework to define a template describing
a set of "variables of interest" and the intended way for
the framework to maintain them (for example the maximum, sum,
t-digest, or a combination thereof). Afterwards the user
code feeds in the raw data, and the framework maintains
these variables inside a user-provided, opaque stats blobs.
The framework also provides a way to selectively extract the
stats from the blobs. The stats(3) framework can be used in
both userspace and the kernel.

See the stats(3) manual page for details.

This will be used by the upcoming TCP statistics gathering code,
https://reviews.freebsd.org/D20655.

The stats(3) framework is disabled by default for now, except
in the NOTES kernel (for QA); it is expected to be enabled
in amd64 GENERIC after a cool down period.

Reviewed by: sef (earlier version)
Obtained from: Netflix
Relnotes: yes
Sponsored by: Klara Inc, Netflix
Differential Revision: https://reviews.freebsd.org/D20477


# f27f39db 01-Oct-2019 Kyle Evans <kevans@FreeBSD.org>

[1/3] Initial infrastructure for SSL root bundle in base

This setup will add the trusted certificates from the Mozilla NSS bundle
to base.

This commit includes:
- CAROOT option to opt out of installation of certs
- mtree amendments for final destinations
- infrastructure to fetch/update certs, along with instructions

A follow-up commit will add a certctl(8) utility to give the user control
over trust specifics. Another follow-up commit will actually commit the
initial result of updatecerts.

This work was done primarily by allanjude@, with minor contributions by
myself.

No objection from: secteam
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16856


# 2d0a92c9 01-Oct-2019 Kyle Evans <kevans@FreeBSD.org>

Move simple_httpd out of picobsd, add HTTPD option (default OFF)

picobsd/tinyware has had this compact HTTPD server for a long time, and some
people do use it. Move it out into usr.sbin well in advance of any action
being taken on picobsd.

This has been gated behind an HTTPD option defaulted to *off*, primarily for
two reasons:
1.) This code likely needs a good audit, as it's been living off in picobsd
land for a long time, and
2.) We don't currently ship an httpd and this may not be a welcome surprise.

Reviewed by: eugen
Differential Revision: https://reviews.freebsd.org/D21724


# 6b3555c3 26-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Enable OpenMP for powerpc64

Summary: When powerpc64 switches to LLVM, use this patch to enable
OpenMP as well. OpenMP on PPC is only for 64-bits, so don't make a
32-bit libomp. A change to openmp files is necesssary (under review on
https://reviews.llvm.org/D67190), because it determines ELF format
version based on endianness, which is incorrect.

Reviewed by: alfredo.junior_eldorado.org.br, #manpages
Differential Revision: https://reviews.freebsd.org/D21532


# 15b53426 17-Sep-2019 Kyle Evans <kevans@FreeBSD.org>

googletest: default-disable on all of MIPS for now

Parts of the fusefs tests trigger a bug in current versions of llvm: IR
representation of some routine for the MIPS targets is a function with a
large number of arguments. This then leads the compiler on an hour+ long
goose chase, which is OK if you build the current tree but less-so if you're
trying external toolchain or doing a universe build involving mips when it
eventually gets switched over to LLVM.

Better, accurate details can be found in LLVM PR43263.


# 59e50df3 03-Sep-2019 Kris Moore <kmoore@FreeBSD.org>

- Retire pc-sysinstall(8)

https://reviews.freebsd.org/D21094

Submitted by: kmoore@FreeBSD.org
Approved by: imp@FreeBSD.org


# 4ee71ec9 14-Aug-2019 Andrew Turner <andrew@FreeBSD.org>

Enable BSD_CRTBEGIN on powerpc

In r342974 jhibbits added support to build crtsavres.o. This was the
blocker for BSD_CRTBEGIN to be enabled there. As such enable this
option again.

Reviewed by: jhibbits
Sponsored by: DARPA, AFRL


# ecdc19b5 07-Aug-2019 Warner Losh <imp@FreeBSD.org>

Enable nvme on aarch64

Don't mark nvme as broken on aarch64. It compiles, at least, and people are
testing it out. This only enables the userland parts of the nvme stack.

Submitted by: greg at unrelenting technologies
Differential Revision: https://reviews.freebsd.org/D21168


# a58383d2 02-Aug-2019 John Baldwin <jhb@FreeBSD.org>

Flip REPRODUCIBLE_BUILD back to off by default in head.

Having the full uname output can be useful on head even with
unmodified trees or trees that newvers.sh fails to recognize as
modified.

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


# 0a0163eb 28-Jun-2019 Leandro Lupori <luporl@FreeBSD.org>

Fix missing powerpc64 in _LLVM_TARGET_FILT

This change was originally in D20378. Making it in a new diff since it's a
bugfix.

Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: emaste, luporl
Differential Revision: https://reviews.freebsd.org/D20756


# f5a95d9a 24-Jun-2019 Warner Losh <imp@FreeBSD.org>

Remove NAND and NANDFS support

NANDFS has been broken for years. Remove it. The NAND drivers that
remain are for ancient parts that are no longer relevant. They are
polled, have terrible performance and just for ancient arm
hardware. NAND parts have evolved significantly from this early work
and little to none of it would be relevant should someone need to
update to support raw nand. This code has been off by default for
years and has violated the vnode protocol leading to panics since it
was committed.

Numerous posts to arch@ and other locations have found no actual users
for this software.

Relnotes: Yes
No Objection From: arch@
Differential Revision: https://reviews.freebsd.org/D20745


# b2689b12 07-Apr-2019 Mitchell Horne <mhorne@FreeBSD.org>

Add option to build LLVM RISC-V target

Reviewed by: emaste, dim
Approved by: markj (mentor)
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D19759


# b0fefb25 02-Apr-2019 Marcin Wojtas <mw@FreeBSD.org>

Create kernel module to parse Veriexec manifest based on envs

The current approach of injecting manifest into mac_veriexec is to
verify the integrity of it in userspace (veriexec (8)) and pass its
entries into kernel using a char device (/dev/veriexec).
This requires verifying root partition integrity in loader,
for example by using memory disk and checking its hash.
Otherwise if rootfs is compromised an attacker could inject their own data.

This patch introduces an option to parse manifest in kernel based on envs.
The loader sets manifest path and digest.
EVENTHANDLER is used to launch the module right after the rootfs is mounted.
It has to be done this way, since one might want to verify integrity of the init file.
This means that manifest is required to be present on the root partition.
Note that the envs have to be set right before boot to make sure that no one can spoof them.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: sjg
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D19281


# ffad9893 26-Mar-2019 John Baldwin <jhb@FreeBSD.org>

Remove the TIMED src option from the list of options.

This was missed in r342139 when timed(8) was removed and fixes a
warning when running makeman to regenerate src.conf.5.

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


# 07302582 19-Mar-2019 Dimitry Andric <dim@FreeBSD.org>

Turn on MK_OPENMP for i386 by default, now that it can build.

Noticed by: jbeich
PR: 236062, 236582
MFC after: 1 month
X-MFC-With: r344779


# b0840a28 16-Mar-2019 Dimitry Andric <dim@FreeBSD.org>

Connect lib/libomp to the build.

* Set MK_OPENMP to yes by default only on amd64, for now.
* Bump __FreeBSD_version to signal this addition.
* Ensure gcc's conflicting omp.h is not installed if MK_OPENMP is yes.
* Update OptionalObsoleteFiles.inc to cope with the conflicting omp.h.
* Regenerate src.conf(5) with new WITH/WITHOUT fragments.

Relnotes: yes
PR: 236062
MFC after: 1 month
X-MFC-With: r344779


# e91609a7 06-Mar-2019 John Baldwin <jhb@FreeBSD.org>

Divorce MK_GDB from MK_BINUTILS.

This permits legacy GDB to still be built and installed if
WITHOUT_BINUTILS is set (e.g. if base/binutils is installed).

Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19480


# 13ea0450 05-Mar-2019 Marcin Wojtas <mw@FreeBSD.org>

Extend libsecureboot(old libve) to obtain trusted certificates from UEFI and implement revocation

UEFI related headers were copied from edk2.

A new build option "MK_LOADER_EFI_SECUREBOOT" was added to allow
loading of trusted anchors from UEFI.

Certificate revocation support is also introduced.
The forbidden certificates are loaded from dbx variable.
Verification fails in two cases:

There is a direct match between cert in dbx and the one in the chain.
The CA used to sign the chain is found in dbx.
One can also insert a hash of TBS section of a certificate into dbx.
In this case verifications fails only if a direct match with a
certificate in chain is found.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: sjg
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D19093


# a92958df 25-Feb-2019 Simon J. Gerraty <sjg@FreeBSD.org>

Enable build of libbearssl

Reviewed by: emaste
Sponsored by: Juniper Networks
Differential Revision: D16337


# 06beea0e 19-Feb-2019 Enji Cooper <ngie@FreeBSD.org>

MK_GOOGLETEST should be enabled/disabled based on MK_TESTS_SUPPORT

Making MK_GOOGLETEST rely on MK_TESTS makes it impossible to rely on in
buildworld, which is not desirable for items like `cddl/usr.sbin/zfsd/tests`.


# 43e25f47 19-Feb-2019 Enji Cooper <ngie@FreeBSD.org>

Add MK_GOOGLETEST option for building/installing gmock/gtest

These libraries don't compile on non-C++-11 capable compilers, e.g., g++ 4.2.1
and its corresponding implementation of the c++ library, i.e., libstdc++.

Blacklist compilation on all non-C++-11 capable compilers and give others the
option of opting out of building/installing gmock/gtest via MK_GOOGLETEST.

This option is controlled by MK_CXX and MK_TESTS, as ATF compilation is.


# 26fcd290 06-Feb-2019 Ed Maste <emaste@FreeBSD.org>

Retire CTM option after r342126


# ca5efb62 31-Jan-2019 Ed Maste <emaste@FreeBSD.org>

Enable lld as the system linker by default on i386

The migration to LLVM's lld linker has been in progress for quite some
time - I opened an LLVM tracking bug (23214) in April 2015 to track
issues using lld as FreeBSD's linker, and requested the first exp-run
using lld as /usr/bin/ld in November 2016.

In 12.0 LLD is the system linker on amd64, arm64, and armv7. i386 was
not switched initially as there were additional ports failures not found
on amd64. Those have largely been addressed now, although there are a
small number of issues that are still being worked on. In some of these
cases having lld as the system linker makes it easier for developers and
third parties to investigate failures.

Thanks to antoine@ for handling the exp-runs and to everyone in the
FreeBSD and LLVM communites who have fixed issues with lld to get us to
this point.

PR: 214864
Relnotes: Yes
Sponsored by: The FreeBSD Foundation


# f871c5d9 06-Jan-2019 Warner Losh <imp@FreeBSD.org>

Create MK_LOADER_VERBOSE and connect it to ELF_VERBOSE in the loader
code.

PR: 18498
Submitted by: mellon at pobox dot com


# fbeb31a2 05-Jan-2019 Matt Macy <mmacy@FreeBSD.org>

MK_ZFS -> {MK_ZFS|MK_LOADER_ZFS}, this is so we can diable userland / kernel
ZFS but keep the boot-loaders when using ZoL port.

MFC after: 1 week
Reviewed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D18739


# 12401698 10-Dec-2018 Dimitry Andric <dim@FreeBSD.org>

For arm and armv6, only enable LLVM target support for arm by default,
to shrink libllvm.a.

This is a workaround for "relocation truncated to fit" errors with BFD
ld 2.17.50 on arm and armv6, when linking executables against it.

The required range extensions are not yet supported by this very old
version of BFD ld. When arm and armv6 userland can be successfully
linked by lld, this workaround can be removed.


# f74c331a 03-Dec-2018 Andrew Turner <andrew@FreeBSD.org>

Disable the BSD CRT code on powerpc and sparc64, they need extra crt*.o
files that haven't been implemented.

Reported by: sbruno
MFC with: r339738
Sponsored by: DARPA, AFRL


# 30c5db2b 23-Nov-2018 Andrew Turner <andrew@FreeBSD.org>

Enable the BSD crtbegin/crtend by default.

It has passed an exp run on amd64 and i386, and has testing on arm64. On
other architectures it is expected to run, however it can be disabled by
building world with -DWITHOUT_BSD_CRTBEGIN.

Sponsored by: DARPA, AFRL


# a0e4ca39 07-Nov-2018 Andrew Turner <andrew@FreeBSD.org>

Add the (untested) mips and sparc64 .init call sequences.

The BSD crtbegin/crtend code now builds on all architectures, however
further work is needed to check if it works correctly.

MFC with: r339738
Sponsored by: DARPA, AFRL


# d83db3fb 04-Nov-2018 Conrad Meyer <cem@FreeBSD.org>

Drop ed(1) "crypto"

You should not be using DES. You should not have been using DES for the
past 30 years.

The ed DES-CBC scheme lacked several desirable properties of a sealed
document system, even ignoring DES itself. In particular, it did not
provide the "integrity" cryptographic property (detection of tampering), and
it treated ASCII passwords as 64-bit keys (instead of using a KDF like
scrypt or PBKDF2).

Some general approaches ed(1) users might consider to replace the removed
DES mode:

1. Full disk encryption with something like AES-XTS. This is easy to
conceptualize, design, and implement, and it provides confidentiality for
data at rest. Like CBC, it lacks tampering protection. Examples include
GELI, LUKS, FileVault2.

2. Encrypted overlay ("stackable") filesystems (EncFS, PEFS?, CryptoFS,
others).

3. Native encryption at the filesystem layer. Ext4/F2FS, ZFS, APFS, and
NTFS all have some flavor of this.

4. Storing your files unencrypted. It's not like DES was doing you much
good.

If you have DES-CBC scrambled files produced by ed(1) prior to this change,
you may decrypt them with:

openssl des-cbc -d -iv 0 -K <key in hex> -in <inputfile> -out <plaintext>

Reviewed by: allanjude, bapt, emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17829


# 43f75d57 30-Oct-2018 Bjoern A. Zeeb <bz@FreeBSD.org>

Introduce an EXPERIMENTAL option for both src.conf(5) and the kernel.

In the last decade(s) we have seen both short term or long term projects
committed to the tree which were considered or even marked "experimental".
While out-of-tree development has become easier than it used to be in
CVS times, there still is a need to have the code shipping with HEAD but
not enabled by default.

While people may think about VIMAGE as one of the recent larger, long term
projects, early protocol implementations (before they are standardised)
are others. (Free)BSD historically was one of the operating systems
which would have running code at early stages and help develop and
influence standardisation and the industry.

Give developers an opportunity to be more pro-active for early adoption
or running large scale code changes stumbling over each others but not
the user's feet. I have not added the option to NOTES in order to avoid
breaking supported option builds, which require constant compile testing.

Discussed with: people in the corridor


# 31d62a73 25-Oct-2018 Andrew Turner <andrew@FreeBSD.org>

Implement a BSD licensed crtbegin/crtend

These are needed for .ctors/.dtors and .jcr handling. The former needs
all the function pointers to be called in the correct order from the
.init/.fini section. The latter just needs to call a gcj specific function
if it exists with a pointer to the start of the .jcr section.

This is currently disabled until __dso_handle support is added.

Reviewed by: emaste
MFC after: 1 month
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17587


# 983a395d 21-Oct-2018 Warner Losh <imp@FreeBSD.org>

Use BROKEN_OPTIONS for NVME, HYPERV, CXGBETOOL and MLX5TOOL instead of
__DEFAULT_YES/NO. These options simply cannot work where we were using
__DEFAULT_NO. The proper thing to do in that case is to use the
BROKEN_OPTIONS knob instead.


# 49f1151f 10-Oct-2018 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Loader GELI support, like lua loader, seems to be broken on PowerPC as
well as on SPARC64 and can cause boot failures even when no encrypted
disks are present. Presumably, the reasons, while unknown, are the same
and most-likely are the result of some endian-unsafe code. Pending
finding the actual problem, extend the blacklist entry for these parts
of loader on SPARC to also cover all PowerPC platforms.

Approved by: re (kib)


# a6691775 03-Oct-2018 Andreas Tobler <andreast@FreeBSD.org>

Set the default loader for powerpc64 back to to forth too.
The commit from r338893 covered only the powerpc build.

Approved by: re (kib)


# 697fb192 22-Sep-2018 Andreas Tobler <andreast@FreeBSD.org>

Set the default loader for powerpc(32- and 64-bit) back to to forth.
There are some issues with the lua-loader. To be on the safe side, use a well
known and working loader.

Approved by: re (glen)


# 5b87c94a 18-Sep-2018 Brooks Davis <brooks@FreeBSD.org>

Only enable HyperV support by default on x86.

Without this we get spurious output during boot as we try to run
nonexistant HyperV scripts on non-x86 models.

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17211


# 657b6006 13-Sep-2018 Ed Maste <emaste@FreeBSD.org>

Enable reproducible builds in advance of 12.0-REL

We want to build the 12.0 release artifacts with reproducible builds
mode enabled. Switch it on in HEAD now to enable testing with upcoming
ALPHA builds. We can revisit the default setting for HEAD after the
branch is created.

This change eliminates the build metadata (user, hostname, timestamp,
etc.) from the kernel and loader. If the src tree is a git, svn or p4
checkout with changes then the metadata is retained.

The WITHOUT_REPRODUCIBLE_BUILD src.conf(5) knob can be used to revert
to the previous behaviour.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation


# f54d801a 22-Aug-2018 Kurt Lidl <lidl@FreeBSD.org>

Turn off LOADER_GELI and LOADER_LUA for sparc64, until those options
are fully debugged. With these options off, the unified "loader"
binary for sparc64 works to boot a kernel from ZFS.

Submitted by: kevans
Reviewed by: imp kevans


# 11302576 16-Aug-2018 Ed Maste <emaste@FreeBSD.org>

Enable LLD_IS_LD by default on armv7

lld should now be a usable linker for armv7, and is already used as the
bootstrap linker (for linking the kernel and userland). Also enable as
the system linker now (/usr/bin/ld) for further testing and evaluation.
(This change will be reverted in case of unexpected fallout.)

Approved by: manu
Sponsored by: The FreeBSD Foundation


# 9d45c24c 14-Aug-2018 Warner Losh <imp@FreeBSD.org>

Create a loader for each interpreter for x86 BIOS and all EFI

Create loader_{4th,lua,simp}{,.efi}. All of these are installed by
default. Create LOADER_DEFAULT_INTERP to specify the default
interpreter when no other is specified. LOADER_INTERP is the current
interpreter language building. Turn building of lua on by default to
match 4th. simploader is a simplified loader build w/o any interpreter
language (but with a simple loader). This is the historic behavir you
got with WITHOUT_FORTH. Make a hard link to the default loader. This
has to be a hard link rather than the more desirable soft link because
older zfsboot blocks don't support symlinks.

RelNotes: Yes
Differential Revision: https://reviews.freebsd.org/D16705


# 89edb881 09-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Add optional LLVM BPF target support

BPF (eBPF) is an independent instruction set architecture which is
introduced in Linux a few years ago. Originally, eBPF execute
environment was only inside Linux kernel. However, recent years there
are some user space implementation (https://github.com/iovisor/ubpf,
https://doc.dpdk.org/guides/prog_guide/bpf_lib.html) and kernel space
implementation for FreeBSD is going on
(https://github.com/YutaroHayakawa/generic-ebpf).

The BPF target support can be enabled using WITH_LLVM_TARGET_BPF, as it
is not built by default.

Submitted by: Yutaro Hayakawa <yhayakawa3720@gmail.com>
Reviewed by: dim, bdrewery
Differential Revision: https://reviews.freebsd.org/D16033


# 800ab3e3 01-Aug-2018 Ed Maste <emaste@FreeBSD.org>

Use lld as the bootstrap linker on armv7 by default

As of r336972 lld is capable linking the armv7 kernel and userland,
so enable it by default.

PR: 229050
Reviewed by: kevans
Tested by: kevans
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16528


# 3f6cd86b 30-Jul-2018 Ed Maste <emaste@FreeBSD.org>

Revert accidental change from r336908

By default ld.lld should be the bootstrap linker (only) on i386 right
now. Once the i386 exp-run with LLD_IS_LD has a good result this will
also be enabled by default.

Reported by: andrew
Pointy hat to: emaste


# 0d849865 30-Jul-2018 Ed Maste <emaste@FreeBSD.org>

Makefile.libcompat: correctly append to make variable

Reported by: hselasky
Pointy hat to: emaste


# f1a0604d 29-Jul-2018 Ed Maste <emaste@FreeBSD.org>

Enable ld.lld as bootstrap linker by default on i386

Akin to r327783 for amd64. lld has been usable for amd64 for quite some
time, but a couple of issues remained that affected i386. These were
recently addressed upstream in lld and merged into FreeBSD or addressed
directly in FreeBSD (r326831, r326879, r326897, r326957, r333401,
r334626, r336664).

Similarly to the intial amd64 commit this change enables lld only as the
bootstrap linker (used to link the kernel and userland libraries and
executables), while GNU ld.bfd is still installed as /usr/bin/ld and
used for ports builds. That will be changed shortly, after an exp-run.

This is a recommit of r327823 after additional lld fixes.

PR: 225128 (exp-run)
Relnotes: Yes
Sponsored by: The FreeBSD Foundation


# 7ddf05ed 26-Jul-2018 Ruslan Bukin <br@FreeBSD.org>

Disable OFED for RISC-V: it does not build.

Sponsored by: DARPA, AFRL


# 513fdd50 25-Jul-2018 John Baldwin <jhb@FreeBSD.org>

Install base gdb in /usr/libexec for 32-bit arm by default.

kgdb in ports now supports 32-bit arm kernels. sparc64 is now the only
remaining architecture which ships base gdb in /usr/bin.

Relnotes: yes


# be3bff32 20-Jul-2018 Konstantin Belousov <kib@FreeBSD.org>

Enable OFED build (without extras) by default.

Reviewed by: bdrewery, hselasky (previous version)
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Release notes: yes
Differential revision: https://reviews.freebsd.org/D16230


# abbe7d5a 20-Jul-2018 Konstantin Belousov <kib@FreeBSD.org>

Move mostly useless examples binaries from OFED, as well as the Subnet
Manager, under the new option WITH_OFED_EXTRA, disabled by default.

Reviewed by: bdrewery, hselasky (previous version)
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16230


# 73ce26a2 19-Jul-2018 Ruslan Bukin <br@FreeBSD.org>

PROFILE, TESTS and CXX build options are no longer broken for RISC-V.

Sponsored by: DARPA, AFRL


# 71cb2dfc 17-Jul-2018 Warner Losh <imp@FreeBSD.org>

Remove special cases for armeb in the build.

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


# c1418270 13-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Extend loader(8) geli support to all architectures and all disk-like devices.

This moves the bulk of the geli support from lib386/biosdisk.c into a new
geli/gelidev.c which implements a devsw-type device whose dv_strategy()
function handles geli decryption. Support for all arches comes from moving
the taste-and-attach code to the devopen() function in libsa.

After opening any DEVT_DISK device, devopen() calls the new function
geli_probe_and_attach(), which will "attach" the geli code to the open_file
struct by creating a geli_devdesc instance to replace the disk_devdesc
instance in the open_file. That routes all IO for the device through the
geli code.

A new public geli_add_key() function is added, to allow arch/vendor-specific
code to add keys obtained from custom hardware or other sources.

With these changes, geli support will be compiled into all variations of
loader(8) on all arches because the default is WITH_LOADER_GELI.

Relnotes: yes
Sponsored by: Microchip Technology Inc
Differential Revision: https://reviews.freebsd.org/D15743


# 6f077571 04-Jul-2018 Sean Bruno <sbruno@FreeBSD.org>

WITHOUT_SERVICESDB:

Add src.conf knob to disable the installation of /var/db/services.db

Default to leaving services.db in place, but allow the removal of the
file and its creation with a src.conf knob.

This file ends up being 2MB in size. For small systems this is a waste
of space but its a tradeoff.

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D9655


# 4e2a4490 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

LLVM_TARGET_ALL: Default LLVM_TARGET_ARM on for aarch64.

This is needed for -m32 support which is used in the kernel cloudabi32 module.

Tweak the style to make it easier to understand.

MFC after: 2 weeks
X-MFC-with: r335706
Reported by: Mark Millard
Sponsored by: Dell EMC


# 8e4ce615 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r335706: Fix LLVM_TARGET_ALL handling to use TARGET_ARCH.

Pointyhat to: bdrewery
MFC after: 2 weeks
X-MFC-with: r335706
Reported by: Mark Millard
Sponsored by: Dell EMC


# 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


# 100fafeb 27-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Use dependent options to auto enable _SUPPORT and CLANG_FULL options.

MFC after: 1 week
Reviewed by: sbruno, dim
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16018


# cbafd263 22-Jun-2018 Dimitry Andric <dim@FreeBSD.org>

Add support for selectively enabling LLVM targets

This makes it possible, through src.conf(5) settings, to select which
LLVM targets you want to build during buildworld. The current list is:

* (WITH|WITHOUT)_LLVM_TARGET_AARCH64
* (WITH|WITHOUT)_LLVM_TARGET_ARM
* (WITH|WITHOUT)_LLVM_TARGET_MIPS
* (WITH|WITHOUT)_LLVM_TARGET_POWERPC
* (WITH|WITHOUT)_LLVM_TARGET_SPARC
* (WITH|WITHOUT)_LLVM_TARGET_X86

To not influence anything right now, all of these are on by default, in
situations where clang is enabled.

Selectively turning a few targets off manually should work. Turning on
only one target should work too, even if that target does not correspond
to the build architecture. (In that case, LLVM_NATIVE_ARCH will not be
defined, and you can only use the resulting clang executable for
cross-compiling.)

I performed a few measurements on one of the FreeBSD.org reference
machines, building clang from scratch, with all targets enabled, and
with only the x86 target enabled. The latter was ~12% faster in real
time (on a 32-core box), and ~14% faster in user time. For a full
buildworld the difference will probably be less pronounced, though.

Reviewed by: bdrewery
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11077


# 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


# f0f8a1af 13-Jun-2018 Warner Losh <imp@FreeBSD.org>

NVME support is only for x86 and powerpc64.

Implement MK_NVME now that the expression for where NVMe is
complicated. Default it to "yes" for x86 and powerpc64 and
no everywhere else. Use it in camcontrol to define WITH_NVME
for those platforms where we support nvme.

This should fix the newly introduced nvme files to camcontrol
which were building everywhere.

Pointy Hat To: imp
Sponsored by: Netflix


# 1bf8f957 30-May-2018 Ed Maste <emaste@FreeBSD.org>

Enable lld as the system linker by default on amd64

The migration to LLVM's lld linker has been in progress for quite some
time - about three years ago I opened an upstream LLVM meta-bug to track
issues using lld as FreeBSD's linker, and about 1.5 years ago requested
the first exp-run with lld as the system linker.

As of r327783 we enabled LLD_BOOTSTRAP by default on amd64, using lld as
the linker to link the kernel and world, but GNU ld was still installed
as /usr/bin/ld.

The vast majority of issues observed when building ports with lld as the
system linker have now been solved, so set LLD_IS_LD by default on amd64
and install lld as /usr/bin/ld. A small number of port failures remain
and these will be addressed in the near future.

Thanks to antoine@ for handling the exp-runs, krion@ for investigating
many port failures and adding LLD_UNSAFE or other fixes or workarounds,
and everyone who helped investigate, fix or tag ports.

PR: 214864 (exp-run)
Sponsored by: The FreeBSD Foundation


# 1069f41b 15-May-2018 Ed Maste <emaste@FreeBSD.org>

Force WITHOUT_FREEBSD_UPDATE when WITHOUT_PORTSNAP is set

freebsd-update depends on phttpget from portsnap. We could move phttpget
out of portsnap and build it as long as WITHOUT_FREEBSD_UPDATE and
WITHOUT_PORTSNAP are not both set, but for now just make the dependency
explicit.

PR: 228220
Reported by: Dries Michiels
Sponsored by: The FreeBSD Foundation


# a2584d1b 03-May-2018 Kyle Evans <kevans@FreeBSD.org>

bsdgrep: annihilate our in-tree TRE, previously disabled by default

It was an old TRE that had plenty of bugs and no performance gain over
regex(3). I disabled it by default in r323615, and there was some confusion
about what the knob does- likely due to poor naming on my part- to the tune
of "well, it sounds like it should speed things up" (mentioned by multiple
people).

To compound this, I have no intention of maintaining a second regex
implementation. If someone would like to step up and volunteer to maintain a
lean-and-mean implementation for grep, this is OK, but we have very few
volunteers to maintain even our primary regex implementation.


# 2dce6bfb 02-May-2018 Ed Maste <emaste@FreeBSD.org>

Build lld as long as we have a C++11 host compiler

As with Clang, build our toolchain components by default when the host
compiler is capable of doing so, to make them available for testing and
experimentation.

Sponsored by: The FreeBSD Foundation


# 54095bf4 06-Apr-2018 Kyle Evans <kevans@FreeBSD.org>

Re-sort LOADER options

These have become unsorted from everything else. This is desync'd from
stable/11 due to some hand-merging that was done there, so the MFC of this
will look slightly different.

MFC after: 3 days


# 1e18e7d2 20-Mar-2018 John Baldwin <jhb@FreeBSD.org>

Add support for MIPS to LLVM's libunwind.

This is originally based on a patch from David Chisnall for soft-float
N64 but has since been updated to support O32, N32, and hard-float ABIs.
The soft-float O32, N32, and N64 support has been committed upstream.
The hard-float changes are still in review upstream.

Enable LLVM_LIBUNWIND on mips when building with a suitable (C+11-capable)
toolchain. This has been tested with external GCC for all ABIs and
O32 and N64 with clang.

Reviewed by: emaste
Obtained from: CheriBSD (original N64 patch)
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D14701


# e808190a 08-Mar-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Add kernel and userspace code to dump the firmware state of supported
ConnectX-4/5 devices in mlx5core.

The dump is obtained by reading a predefined register map from the
non-destructive crspace, accessible by the vendor-specific PCIe
capability (VSC). The dump is stored in preallocated kernel memory and
managed by the mlx5tool(8), which communicates with the driver using a
character device node.

The utility allows to store the dump in format
<address> <value>
into a file, to reset the dump content, and to manually initiate the
dump.

A call to mlx5_fwdump() should be added at the places where a dump
must be fetched automatically. The most likely place is right before a
firmware reset request.

Submitted by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies


# 89257265 07-Mar-2018 Ed Maste <emaste@FreeBSD.org>

Disable LLD_BOOTSTRAP under WITHOUT_CROSS_COMPILER

LLD is a cross toolchain component. It shouldn't be built when
requesting a build without building a cross compiler.

(CROSS_COMPILER is somewhat unfortunately named; in any case, lld
should be treated as GNU binutils here.)

Submitted by: Dan McGregor <dan.mcgregor at usask.ca>
MFC after: 1 week


# f86dd996 01-Mar-2018 Warner Losh <imp@FreeBSD.org>

Create LOADER_UBOOT, and LOADER_OFW. Move these options out of
Makefile.${MACHINE_ARCH} and remove the now-empty files. Generate the
*32 directories on the necessary architectures (well, currently only
amd64) on the fly. Remove LOADER_EFI variable and co-locate it with
EFI.

Differential Review: https://reviews.freebsd.org/D14546


# c1593b9e 27-Feb-2018 Warner Losh <imp@FreeBSD.org>

Doc __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and BROKEN_OPTIONS
in one paragraph to highlight the relationship between them.

Suggested by: kevans@


# 9e74797f 27-Feb-2018 Warner Losh <imp@FreeBSD.org>

Move EFI up to common makefile. There's no need for all these .if's
based on architecture.

Sponsored by: Netflix


# 7cafeaa1 12-Feb-2018 Warner Losh <imp@FreeBSD.org>

Add Lua as a scripting langauge to /boot/loader

liblua glues the lua run time into the boot loader. It implements all
the runtime routines that lua expects. In addition, it has a few
standard 'C' headers that nueter various aspects of the LUA build that
are too specific to lua to be in libsa. Many refinements from the
original code to improve implementation and the number of included lua
libraries. Use int64_t for lua_Number. Have "/boot/lua" be the default
module path. Numerous cleanups from the original GSoC project,
including hacking libsa to allow lua to be built with only one change
outside luaconf.h.

Add the final bit of lua glue to bring in liblua and plug into the
multiple interpreter framework, previously committed.

Add LOADER_LUA option, currently off by default.

Presently, this is an experimental option. One must opt-in to using
this by defining WITH_LOADER_LUA and WITHOUT_FORTH. It's been
lightly tested, so keep a backup copy of your old loader handy.
The menu code, coming in the next commit, hasn't been exhaustively
tested. A LUA boot loader is 60k larger than a FORTH one, which is
80k larger than a no-interpreter one. Subtle changes in size
may tip things past some subtle limit (the binary is ~430k now
when built with LUA). A future version may offer coexistance.

Bump FreeBSD version to 1200058 to mark the milestone.

Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur,
Zakary Nafziger and Wojciech A. Koszek also contributed. Warner Losh
reworked it extensively into its current form.

Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader
Sponsored by: Google Summer of Code
Relnotes: Yes
MFC After: 1 month
Differential Review: https://reviews.freebsd.org/D14295


# 1b49115a 09-Feb-2018 Ed Maste <emaste@FreeBSD.org>

Promote llvm-cov to a standalone option

Introduce WITH_/WITHOUT_LLVM_COV to match GCC's WITH_/WITHOUT_GCOV.
It is intended to provide a superset of the interface and functionality
of gcov.

It is enabled by default when building Clang, similarly to gcov and GCC.

This change moves one file in libllvm to be compiled unconditionally.
Previously it was included only when WITH_CLANG_EXTRAS was set, but the
complexity of a new special case for (CLANG_EXTRAS | LLVM_COV) is not
worth avoiding a tiny increase in build time.

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


# 1383b978 12-Jan-2018 Ed Maste <emaste@FreeBSD.org>

Revert r327823, Enable ld.lld as bootstrap linker by default on i386

There's a report of some regression in ports. Revert for now for an
exp run for this change in isolation (previous lld exp run also included
switching the linker used for ports to lld).

Also revert the src.conf.5 regeneration in r327824.

Reported by: antoine
Sponsored by: The FreeBSD Foundation


# 973c4efb 11-Jan-2018 Ed Maste <emaste@FreeBSD.org>

Enable ld.lld as bootstrap linker by default on i386

Akin to r327783 for amd64. lld has been usable for amd64 for quite some
time, but a couple of issues remained that affected i386. These were
recently addressed upstream in lld and merged into FreeBSD (r326831,
r326879, r326897, r326957), so we can now use ld.lld on i386 as well.

Similarly to amd64 this change enables lld only as the bootstrap linker
(used to link the kernel and userland libraries and executables), while
GNU ld.bfd is still installed as /usr/bin/ld and used for ports builds.

The ports collection is essentially ready to use lld as the system
linker for amd64, but many ports still have trouble with lld on i386,
because lld defaults to -ztext, disallowing relocations against readonly
segments. Thus switching the system linker (WITH_LLD_IS_LD) will happen
later on a per-arch basis.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation


# 93b7a1c1 10-Jan-2018 Ed Maste <emaste@FreeBSD.org>

Enable ld.lld as bootstrap linker by default on amd64

For some time we have been planning to migrate to LLVM's lld linker.
Having a man page was the last blocking issue for using ld.lld to link
the base system kernel + userland, now addressed by r327770. Link the
kernel and userland libraries and binaries with ld.lld by default, for
additional test coverage.

This has been a long time in the making. On 2013-04-13 I submitted an
upstream tracking issue in LLVM PR 23214: [META] Using LLD as FreeBSD's
system linker. Since then 85 individual issues were identified, and
submitted as dependencies. These have been addressed along with two
and a half years of other lld development and improvement.

I'd like to express deep gratitude to upstream lld developers Rui
Ueyama, Rafael Espindola, George Rimar and Davide Italiano. They put in
substantial effort in addressing the issues we found affecting
FreeBSD/amd64.

To revert to using ld.bfd as the bootstrap linker, in /etc/src.conf set

WITHOUT_LLD_BOOTSTRAP=yes

If you need to set this, please follow up with a PR or post to the
freebsd-toolchain mailing list explaining how default WITH_LLD_BOOTSTRAP
failed for your use case.

Note that GNU ld.bfd is still installed as /usr/bin/ld, and will still
be used for linking ports. ld.lld can be installed as /usr/bin/ld by
setting in /etc/src.conf

WITH_LLD_IS_LLD=yes

A followup commit will set WITH_LLD_IS_LD by default, possibly after
Clang/LLVM/lld 6.0 is merged to FreeBSD.

Release notes: Yes
Sponsored by: The FreeBSD Foundation


# 6e050ee6 15-Dec-2017 Warner Losh <imp@FreeBSD.org>

Note GELI-enabled zfsboot issues have been solved. Flip the switch
back to enabling GELI in boot and loader builds.

Sponsored by: Netflix


# 86375a7e 14-Dec-2017 Warner Losh <imp@FreeBSD.org>

Turn loader GELI support in the boot loaders off by default as a
temporary workaround. This fixes zfs booting generally, but breaks all
GELI booting by default. Add note to UPDATING to this effect. When the
GELI issues are resolved, this will be reverted.


# 4728f534 10-Nov-2017 Warner Losh <imp@FreeBSD.org>

Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI

Transition to WITH/WITHOUT_LOADER_GELI to flag support or not of GELI
in the boot loaders. Add HAVE_GELI so components can flag they need
support (since it's too large to include everywhere). Add temporary
warnings for the old forms to ease transition.

Also, update test script to build without GELI on x86.

Sponsored by: Netflix


# a179cd91 10-Nov-2017 Warner Losh <imp@FreeBSD.org>

Replace LOADER_FIREWIRE_SUPPORT variable

Rename LOADER_FIREWIRE_SUPPORT to MK_LOADER_FIREWIRE. Only build
libfirewire when this is "yes". Add note to updating. Fix build script
to build this for x86 so the option doesn't decay. sparc64 supports
ZFS, so also build it MK_ZFS=no.

Sponsored by: Netflix


# 75aaeb57 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Don't override MK_COVERAGE from bsd.opts.mk in the CLANG_IS_CC case


# 1633af78 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Shuffle MK_COVERAGE conditionals around


# 83f4f351 30-Oct-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r320149: Enable GPL_DTC if we're using GCC as the cross-compiler.

This fixes object files landing in the source tree in gnu/usr.bin/dtc
for GCC platforms.

We cannot reliably detect if an external compiler is used here, and the
default YES option does include GCC_BOOTSTRAP which implies that GCC may
be used for the build.

The problem manifests when not using an external compiler, and the host
compiler is clang. When a fresh build is done (no OBJDIR yet) the
'make obj' treewalk is done before 'make cross-tools', so
COMPILER_FEATURES at this point contains 'c++11' since the host compiler
was used for COMPILER_FEATURES. Once cross-tools builds the GCC
bootstrap compiler and then descends into 'make everything',
COMPILER_FEATURES no longer contains 'c++11' and MK_GPL_DTC defaults to
enabled. Now it builds in gnu/usr.bin/dtc without an OBJDIR preset and
drops files into the source tree.

The COMPILER_FEATURES check here is useful for knowing if we can *bootstrap*
C++11 things. Indeed we do bootstrap dtc as a build tool so it is
useful for enabling the BSD dtc for the build, but we end up needing the
GPL dtc for installation anyway.

Reviewed by: manu, emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12817


# 547553fe 30-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Remove redundant DEFAULT_NO_OPTIONS specification for MK_COVERAGE

bsd.opts.mk is already handling it


# 0ab79c3c 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Move MK_COVERAGE fu before .include <bsd.mkopt.mk> so it's actually usable


# dc404c73 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Fix tabs before the style police nags me


# eb5c1cb2 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Every day I'm shuffling (comments) to diff reduce


# 2e5ab586 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

In the search of a perfect knob pairing

Why in the heck is it so dang complicated now?


# 0c095a65 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Fix an omission in a comment

Soft float API support applies to armv7 too after r324340


# e48a1f9c 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Congrats riscv* : you unlike millions of americans will have coverage, even
if the ACA is repealed


# 45c85b61 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Die. Die. Die. Tinderbox failures on mips/powerpc


# 6f2b0ca7 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

mips, you cause me too much grief with make tinderbox. Try this instead


# 171e4ce8 23-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Use BROKEN_OPTIONS for MK_COVERAGE=no so it will be documented in src.conf(5)


# 2d19fcb3 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Let's just nip gcc 4.2.1 in the bud and say MK_COVERAGE=no

Reasoning: gcc 4.2.1 lacks -fprofile-dir support


# 2d457ca3 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Restore gcc 4.8 version check

I accidentally broke it when making changes


# 875ad66b 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Remove BROKEN_OPTIONS/MK_COVERAGE=no for gcc cross-toolchain reliant archs

The cross-toolchain gcc toolchains aren't installing libgcov.a, but the host
toolchain variants are. Don't hack around broken packages in the base system.

PR: 223174


# 17469433 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Do direct comparisons with TARGET for armv6/armv7

This simplifies the conditionals


# cfe42233 21-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Fix typo in prior commit with stray colon after :M


# b0c7b002 21-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Mark MK_COVERAGE broken for arm64/arm*


# 98be9985 10-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Add appropriate safety belts for riscv so it compiles out of the box when MK_COVERAGE ==yes


# aefcb745 10-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Per r324481, remove MK_COVERAGE_SUPPORT


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


# e415aa28 06-Oct-2017 Jeremie Le Hen <jlh@FreeBSD.org>

Remove rcmds.

If they are still needed, you can find them in the net/bsdrcmds port.

This was proposed June, 20th and approved by various committers [1].
They have been marked as deprecated on CURRENT in r320644 [2] on July, 4th.
Both stable/11 and release/11.1 contain the deprecation notice (thanks to
allanjude@).

Note that ruptime(1)/rwho(1)/rwhod(8) were initially thought to be part of
rcmds but this was a mistake and those are therefore NOT removed.

[1] https://lists.freebsd.org/pipermail/freebsd-arch/2017-June/018239.html
[2] https://svnweb.freebsd.org/base?view=revision&revision=320644

Reviewed by: bapt, brooks
Differential Revision: https://reviews.freebsd.org/D12573


# 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


# 76541eb0 29-Sep-2017 Wojciech Macek <wma@FreeBSD.org>

Compile loader as Little-Endian on PPC64/POWER8

Add flag to the makefile to allow loader compilation as
Little-Endian 32-bit executable.
Usage:

make WITH_LOADER_FORCE_LE=yes -C sys/boot all

Submitted by: Wojciech Macek <wma@freebsd.org>
Reviewed by: imp, nwhitehorn
Obtained from: Semihalf
Sponsored by: QCM Technologies
Differential revision: https://reviews.freebsd.org/D12421


# bf51ff56 15-Sep-2017 Kyle Evans <kevans@FreeBSD.org>

bsdgrep: disable TRE implementation by default

Start the phasing out of TRE by disabling it by default. r317254 introduced
a BSD_GREP_FASTMATCH knob (defaulting to on) for testing of bsdgrep with and
without TRE enabled. More bugs have cropped up since then, and
WITHOUT_BSD_GREP_FASTMATCH has shown in testing to be more stable than its
counterpart.

Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D12381


# 38f8fddf 14-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Add limited sandbox capability to "make check"

== Rationale ==

r295380 introduced "make check" and consolidated means for running
test code in an attempt to simplify running tests. One could either
install files/libraries/programs and run "make check", or run "make check"
with an explicit CHECKDIR, e.g., `make check CHECKDIR=$(make -V.OBJDIR)``.

One criticism that was received is that "make check" should be run with
the intent of making dev->test->commit easier, which means that the target
audience's workflow should be developers. One developer pattern available
in other opensource projects is to run test code from a developer sandbox,
instead of installing to a system.

== Method ==

This approach is slightly different from the standard approach, in the sense
that it builds and installs into a deterministic directory under .OBJDIR (as I call it,
the "sandbox"), then runs "make check" against that. In the event the test
run is successful, the deterministic directory is removed to save space.

== Approach ==

bsd.lib.mk, bsd.prog.mk:

To support this functionality, a new variable `HAS_TESTS` is being added.

HAS_TESTS enables appropriate behavior with bsd.lib.mk and bsd.prog.mk, as
follows:
- Add "make check" as an available target from the directory.
- Pass down appropriate variables via ${TESTS_ENV}, i.e.,
${TESTS_LD_LIBRARY_PATH} and ${TESTS_PATH}.

One should add "HAS_TESTS" to directories containing tests in them, e.g. from
bin/sh/Makefile,

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

HAS_TESTS doesn't automatically add the tests subdirectory for flexibility
reasons.

bsd.opts.mk, src.opts.mk:
- The knob ${MK_MAKE_CHECK_USE_SANDBOX} has been added, both to explicitly
direct (internally) when to set a deterministic ${DESTDIR} and to also allow
users to disable this behavior globally, i.e., via src.conf.
- MK_TESTS has been promoted from src.opts.mk to bsd.opts.mk to leverage
syntactic sugar for having MK_TESTS be a dependency for
MK_MAKE_CHECK_USE_SANDBOX, but to also ensure that src.opts.mk isn't required
to use suite.test.mk (which is a dependency of bsd.test.mk).

suite.test.mk:
- beforecheck behavior (when MK_MAKE_CHECK_USE_SANDBOX is enabled) is modified
from a no-op to:
-- Build.
-- Run "make hierarchy" on the sandbox dir.
-- Install the tests/files to the sandbox dir.
- aftercheck behavior (when MK_MAKE_CHECK_USE_SANDBOX is enabled) is modified
from a no-op to:
-- Remove the sandbox dir.

Again, because the dependency order set in bsd.test.mk is
beforecheck -> check -> aftercheck, "make check" will not be run unless
"beforecheck" completes successfully, and "aftercheck" will not be run unless
"beforecheck" and "check" complete successfully.

== Caveats ==

- This target must either be run with MK_INSTALL_AS_USER or as root. Otherwise
it will fail when running "make install" as the default user/group for many
makefiles when calling INSTALL is root/wheel.
- This target must be run from a suitable top-level directory. For example,
running tests from `tests/sys/fs/tmpfs` won't work, but `tests/sys/fs` will,
because `tests/sys/fs/tmpfs` relies on files installed by `tests/sys/fs`.
- Running MK_INSTALL_AS_USER may introduce determinism issues. However, using
it could identify deficiences in tests in terms of needing to be run as
root, which are not properly articulated in the test requirements.
- The doesn't negate the need for running "make installworld" and
"make checkworld", etc. Again, this just is intended to simplify the
dev->test->commit workflow.

== Cleanup done ==
- CHECKDIR is removed; one can use "MK_MAKE_CHECK_USE_SANDBOX=no" to enable
"legacy" (r295380) behavior.

MFC after: 2 months
Relnotes: yes (CHECKDIR removed; "make check" behavior changed)
Requested by: jhb
Reviewed by: arch (silence), testing (silence)
Differential Revision: D11905


# 056dd75b 11-Aug-2017 Ed Maste <emaste@FreeBSD.org>

lldb: enable on i386

It is functional on FreeBSD/i386 as of r322326.

Sponsored by: The FreeBSD Foundation


# 2427dc7d 10-Aug-2017 Ed Maste <emaste@FreeBSD.org>

Mark PROFILE option as broken when targetting mips64

The assembly in sys/mips/include/profile.h will only work for o32 ABI.

Submitted by: Alexander Richardson
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11950


# a1c2413d 02-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Promote MK_TESTS from src.opts.mk to bsd.opts.mk

This knob is needed here to avoid polluting suite.tests.mk with src.opts.mk for
a knob that will be introduced in the following commit.


# edb58145 02-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Allowing MK_NLS_CATALOGS to be enabled if MK_NLS == no doesn't make a whole lot
of sense. Anchor MK_NLS_CATALOGS being enabled off of MK_NLS.

MFC after: 1 month


# c5cba060 05-Jul-2017 Enji Cooper <ngie@FreeBSD.org>

Formalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as
`MK_ZONEINFO_LEAPSECONDS_SUPPORT == yes` and
`MK_ZONEINFO_OLD_TIMEZONES_SUPPORT == yes`.

Keep `LEAPSECONDS` and `OLDTIMEZONES` for backwards compatibility,
but print out a warning notifying users that they should use the new
variables, in an effort to migrate them to the variables. This is being
done mostly for automated build tools, etc, that might rely on these
variables being set. The variables will be removed in the future on
^/head, e.g., after ^/stable/12 is cut.

MFC after: 1 month
Relnotes: yes
Reviewed by: bdrewery
Differential Revision: D11376


# 993d3ded 01-Jul-2017 Ed Maste <emaste@FreeBSD.org>

Do not build clang for all riscv*, not just riscv64

Previous test matching on "riscv64" was invalidated by the addition of
riscv64sf.

Sponsored by: The FreeBSD Foundation


# cf3de641 01-Jul-2017 Jeremie Le Hen <jlh@FreeBSD.org>

Disable RCMDS by default.

This was announced in this thread:
https://lists.freebsd.org/pipermail/freebsd-arch/2017-June/018239.html

Applying plan proposed by ngie@ in:
https://lists.freebsd.org/pipermail/freebsd-arch/2017-June/018249.html

The port has been submitted as net/bsdrcmds in r444814.

Approved by: bapt, roberto, and others


# a793c109 20-Jun-2017 Ed Maste <emaste@FreeBSD.org>

Fall back to GPL dtc(1) when we lack a C++11 compiler

The BSD licensed device tree compiler is written in C++11.

Reported by: jhibbits
Reviewed by: jhibbits, manu
Sponsored by: The FreeBSD Foundation


# 011717d3 19-Jun-2017 Emmanuel Vadot <manu@FreeBSD.org>

Switch back to the BSDL DTC (Device Tree Compiler).
The BSDL dtc has grown the needed features (overlays mostly) and is able to
compile all of our base DTS.
You can use WITH_GPL_DTC is you need the GPL one or DTC= in make.conf(5)
to specify an alternate location for the compiler to use.

Discussed with: emaste, imp


# 174b3709 07-Jun-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Finish removal of groff


# 738919c0 07-Jun-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Remove groff from base

All manpages in base are now compatible with mandoc(1), all roff documentation
will be relocated in the doc tree. man(1) can now use groff from the ports tree
if it needs.

Also remove checknr(1) and colcrt(1) which are only useful with groff.

Approved by: (no objections on the mailing lists)


# c602f5f3 30-Apr-2017 Ed Maste <emaste@FreeBSD.org>

revert r313473 (Disable LLD_IS_LD option combinations that fail)

r316647 corrected the build of tblgen and libllvm as dependencies for
LLD so undo the temporary seat-belt.

We still want to extend the build infrastructure to automatically detect
the case where the host LLD can be used instead of building a bootstrap
LLD, and likely extend libllvmminimal to meet LLD's needs for cases
where the build includes LLD but not Clang.

Sponsored by: The FreeBSD Foundation


# 73ad3fb5 25-Apr-2017 John Baldwin <jhb@FreeBSD.org>

Add a new GDB_LIBEXEC option to install gdb and kgdb to /usr/libexec.

When this option is enabled, only gdb and kgdb are installed to
/usr/libexec for use by crashinfo(8). Other bits of GDB such as
gdbserver and gdbtui are not installed. For this option to be
effective, GDB must be enabled.

Rework r317094 to re-enable GDB on all platforms but enable
GDB_LIBEXEC on platforms for which the GDB in ports is a superset of
functionality.

Reviewed by: emaste, kib
Suggested by: kib
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D10449


# e9e768f7 21-Apr-2017 Ed Maste <emaste@FreeBSD.org>

bsdgrep: disable GNU_GREP_COMPAT by default

The GNU extension bits in the base system are old, no longer faithful
to upstream, and surprising in some regards. Switch to documenting
WITH_GNU_GREP_COMPAT and default GNU_GREP_COMPAT to OFF in the name of
good behavior.

According to http://www.regular-expressions.info, GNU extensions:

- Add missing quantifiers to BREs: \?, \+

- Add branching to BREs: \|

- Add backreferences (\1 through \9) to EREs

- Add \w, \W, \s, and \S corresponding to :alnum:, [^[:alnum:]],
:space:, and [^[:space:]] respectively

- Add word boundaries and anchors:
\b: word boundary
\B: not word boundary
\<: Strt of word
\>: End of word
\`: Start of subject string
\': End of subject string

These extensions are still available in /usr/bin/grep by default today,
as it is still GNU grep. As part of the bsdgrep migration plan these
extensions may be added to bsdgrep's regex support if necessary.

Submitted by: Kyle Evans <kevans91 at ksu.edu>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D10114


# 3f39ffc8 21-Apr-2017 Ed Maste <emaste@FreeBSD.org>

bsdgrep: add BSD_GREP_FASTMATCH knob for built-in fastmatch

Bugs have been found in the fastmatch implementation as used in bsdgrep.
Some have been fixed (r316495) while fixes for others are in review
(D10098).

In comparison with the fastmatch implementation, Kyle Evans found that:

- regex(3)'s performance with literal expressions offers a speed
improvement over fastmatch

- regex(3)'s performance, both with simple BREs and EREs, seems to be
comparable

The regex implementation was imported in r226035, and the commit message
reports:

This is a temporary solution until the whole regex library is
not replaced so that BSD grep development can continue and the
backported code gets some review and testing. This change only
improves scalability slightly, there is no big performance boost
yet but several minor bugs have been found and fixed.

Introduce a WITH_/WITHOUT_BSD_GREP_FASTMATCH knob to support testing
of both approaches.

PR: 175314, 194823
Submitted by: Kyle Evans <kevans91 at ksu.edu>
Reviewed by: bdrewery (in part)
Differential Revision: https://reviews.freebsd.org/D10282


# 609b7b26 19-Apr-2017 Enji Cooper <ngie@FreeBSD.org>

Add a knob, WITH*_RPCBIND_WARMSTART_SUPPORT, to allow the end-user to build
rpcbind(8) with/without warmstart support.

The knob defaults to off to preserve POLA for the feature.

See rpcbind(8) for more details about the warmstart feature.

MFC after: 7 weeks
Relnotes: yes
Sponsored by: Dell EMC Isilon


# 722a4cb4 19-Apr-2017 Ed Maste <emaste@FreeBSD.org>

Remove WITHOUT_GNU and WITHOUT_GNU_SUPPORT src.conf.knobs

These have no effect (and WITHOUT_GNU is documented as having no
effect). I intend to later introduce a WITHOUT_GPL knob to serve a
similar purpose as WITHOUT_GNU's previously documented intent, but with
a more accurate name. To avoid confusion over the transition though just
remove the existing, nonfunctional ones.


# 99b8bccd 18-Apr-2017 John Baldwin <jhb@FreeBSD.org>

Disable in-tree GDB by default on x86, mips, and powerpc.

GDB in ports contains all of the functionality as GDB in base
(including kgdb) for these platforms along with additional
functionality. In-tree GDB remains enabled on ARM and sparc64.
GDB in ports does not currently support kernel debugging on arm,
and ports GDB for sparc64 has not been tested (though it does
include sparc64 support).

Reviewed by: bdrewery, emaste, imp
Relnotes: yes
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D10399


# e5928414 10-Apr-2017 Ed Maste <emaste@FreeBSD.org>

Make WITHOUT_TOOLCHAIN imply WITHOUT_LLD.

LLD is a toolchain component.


# 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


# 75bf90db 11-Mar-2017 Baptiste Daroussin <bapt@FreeBSD.org>

Finish removal of WITHOUT_MANDOCDB


# 54912308 02-Mar-2017 Navdeep Parhar <np@FreeBSD.org>

Add cxgbetool(8) to the base system.

Move cxgbetool from tools/tools to usr.sbin. Compile and install it on
platforms where cxgbe(4) is built by default. Knobs (WITH_CXGBETOOL and
WITHOUT_CXGBETOOL) have been added so that the user can override the
default setting.

Reviewed by: ngie@, gnn@, bdrewery@
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D9854


# 86d99b68 16-Feb-2017 Warner Losh <imp@FreeBSD.org>

Remove EISA bus support for add-in cards. Remove related kernel and
compile options. Remove doxygen pointers to now deleted files. Remove
EISA and VME as examples in bus_space.9.

Retained EISA mode code for IO PIC and MPTABLES because that's not
EISA bus, per se, and some people have abused EISA to mean "EISA-like
behavior as opposed to ISA" rather than using it for EISA add-in
cards.

Relnotes: yes


# e4e5829b 09-Feb-2017 Ed Maste <emaste@FreeBSD.org>

Disable LLD_IS_LD option combinations that fail

If WITH_LLD is disabled LLD is not built and cannot be installed as
/usr/bin/ld, so disable WITH_LLD_IS_LD.

Currently we do not compare the LLD host/in-tree version and LLD
requires the LLVM libraries to be built, so force WITH_SYSTEM_COMPILER
off when WITH_LLD_IS_LD is set.

The logic for bootstrapping LLD requires some tidying later. We should
be able to detect that the host linker is the same version and avoid
building LLD in the same way that WITH_SYSTEM_COMPILER handles Clang.
We also may be able to extend libllvmminimal to meet LLD's needs. For
now this change unbreaks buildworld with default settings except for
WITH_LLD_IS_LD.

Reported by: Shawn Webb
Reviewed by: bdrewery
Tested by: Shawn Webb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9487


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


# dfccd92c 25-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Enable LLD (as ld.lld) on i386 and arm

With this change LLD will be built on the same set of architectures that
use Clang as /usr/bin/cc. It is not yet fully functional as a system
linker for i386 and arm, but is ready for further testing and
investigation.


# 60af5546 25-Jan-2017 Ed Maste <emaste@FreeBSD.org>

Build Clang on all architectures if host compiler is C++11

Recent versions of Clang are becoming usable for non-x86 non-arm FreeBSD
architectures. If the compiler is capable of building Clang, do so in
order to facilitate further testing.

Reviewed by: dim, imp
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8267


# 584d8c63 02-Jan-2017 Enji Cooper <ngie@FreeBSD.org>

rcs was removed in r307351; kill off WITH*_RCS

MFC after: never


# 4301886d 02-Jan-2017 Enji Cooper <ngie@FreeBSD.org>

Move the "MK_* options..." section before the "... MK_*_SUPPORT..." section

For the case that someone set WITHOUT_GSSAPI=, now WITHOUT_KERBEROS_SUPPORT
will be properly set.

This will likely fix the issue for the default case noted in the PR I filed
back in 2011. I am trying to fix the less obvious case documented in the PR
still.

MFC after: 2 weeks
PR: 159745


# a97b7160 19-Dec-2016 Ed Maste <emaste@FreeBSD.org>

Build loaders reproducibly when WITH_REPRODUCIBLE_BUILD

When WITH_REPRODUCIBLE_BUILD=yes is set in src.conf(5), eliminate the
time, user, and host from the loader's version information. This allows
builds to produce bit-for-bit identical output.

Reviewed by: bapt
MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8842


# 58551dc6 10-Dec-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Make WITHOUT_CAPSICUM implying WITHOUT_CASPER

PR: 214562
Reported by: dewayne@heuristicsystems.com.au
MFC after: 2 days


# 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


# 94ff3d03 20-Oct-2016 Ed Maste <emaste@FreeBSD.org>

Add knobs to make GNU diff and GNU grep optional

This is added to facilitate experiments building FreeBSD without
copyleft software.

If WITHOUT_GNU_DIFF is set no /usr/bin/diff or /usr/bin/diff3 will
be built.

If WITHOUT_GNU_GREP is set then BSD grep will be installed as
/usr/bin/bsdgrep or /usr/bin/grep, depending on the WITH_BSD_GREP
knob.

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


# fa0b3585 19-Oct-2016 Ed Maste <emaste@FreeBSD.org>

Force MK_GDB to no if MK_BINUTILS == no

This is currently encoded in conditional blocks in gnu/lib/Makefile and
gnu/usr.bin/Makefile. Set it via src.opts.mk to make GDB's dependency
on binutils more clear.


# d49a5ddd 11-Oct-2016 Warner Losh <imp@FreeBSD.org>

Create libefivar library. This library aims to provide
the same API as the GPL'd version of this library. It implements the common
Linux API for programatically manipulating UEFI environment varibales using
the UEFI Runtime Services the kernel provides. It replaces the old efi
library since it is programmed to a different interface, but retails the
CHAR16 to UTF-8 and vice versa conversion routines. The new name is to match
Linux program's expectations.

Differential Revision: https://reviews.freebsd.org/D8128
Reviewed by: kib@, wblock@, Ganael Laplanche


# 9ce3c6b0 03-Oct-2016 Ed Maste <emaste@FreeBSD.org>

Retire WITHOUT_ELFCOPY_AS_OBJCOPY option

In FreeBSD 11 ELF Tool Chain's elfcopy is installed as objcopy by
default, with the option to switch back to GNU objcopy by setting
WITHOUT_ELFCOPY_AS_OBJCOPY in make.conf.

We plan to remove the outdated in-tree binutils in FreeBSD 12, so
remove the temporary transition aid.

Reviewed by: brooks, imp
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7337


# 3d79fdac 29-Sep-2016 Warner Losh <imp@FreeBSD.org>

SSP is broken on all mips.


# 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


# 5bec6d55 27-Sep-2016 Ruslan Bukin <br@FreeBSD.org>

Mark SSP broken on MIPS.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5


# 93cdeb4a 23-Sep-2016 Ed Maste <emaste@FreeBSD.org>

Force LLVM_LIBUNWIND off if we don't have a C++11 compiler

Tested by: bde
Differential Revision: https://reviews.freebsd.org/D7746


# 0adf2bc8 18-Sep-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Disable GNU rcs by default

All remaining tools using rcs has been switched to directly use diff3(1):
- etcupdate(8)
- freebsd-update(8)

Note that the ident(1) tool is been already replaced long ago with a BSD
licensed version, as such it remains installed.

GNU rcs is still available from ports:
- rcs: newer GPLv3 version
- rcs57: the latest version from base (GPLv2)


# ecf2489b 01-Sep-2016 Ed Maste <emaste@FreeBSD.org>

Build lld by default on amd64 and arm64


# 75bc38b9 31-Aug-2016 Ed Maste <emaste@FreeBSD.org>

Add WITH_/WITHOUT_LLD knobs to enable the lld linker

Use this to control inclusion of the libllvm functionality required
by lld. Enable by default on arm64 and amd64, the two platforms where
lld is most usable for testing.

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


# c472a0f8 23-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Re-enable WITH_SYSTEM_COMPILER with WITH_META_MODE.

This was disabled in r301468 due to -target/--sysroot sometimes being used in
the build and other times not being used. Now that it is always used since
r304681, it is safe to combine the features.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division


# 8a9745b5 22-Aug-2016 Ed Maste <emaste@FreeBSD.org>

Forcibly disable MK_TESTS if building without C++

Several atf components require C++, and the test suite is not usable
if building WITHOUT_CXX.

Reviewed by: bdrewery, jmmv
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7597


# 06b41817 27-Jul-2016 Ed Maste <emaste@FreeBSD.org>

Enable LLVM libunwind by default on amd64 and i386

It is a maintained and updated runtime exception stack unwinder that
should be a drop-in replacement.

It can be disabled by setting WITHOUT_LLVM_LIBUNWIND in src.conf.

PR: 206039 [exp-run]
Sponsored by: The FreeBSD Foundation


# bf16c2e9 24-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_COMPILER: Enable by default

This improves buildworld, toolchain, kernel-toolchain, and universe targets.
See r300354 or src.conf(5) for more details.

Approved by: re (gjb)
Relnotes: yes (r300354)
Sponsored by: EMC / Isilon Storage Division


# 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


# 9c8b82a9 05-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_SYSTEM_COMPILER: Disable with WITH_META_MODE for now.

The WITH_META_MODE build is intended to be a working incremental build.
It spies on the build command to see if things should be rebuilt if the
command changes. If you run buildworld, it builds a cross-compiler,
then do installworld and buildworld again it will invoke the
WITH_SYSTEM_COMPILER logic. This then adds on -target/--sysroot, etc,
and causes rebuilds due to the changed build command even though the
compiler used is technically the same revision. Since the incremental
build is not cleaning anything by default then there is much
less risk to rebuilding the already-existing cross-compiler. Just
disable the combined logic and always use and build the cross-compiler.

An alternative to this would be to always pass -target/--sysroot. Doing
so may occur in the future.

Sponsored by: EMC / Isilon Storage Division


# 95856e14 02-Jun-2016 Kurt Lidl <lidl@FreeBSD.org>

Add basic blacklist build support

Reviewed by: rpaulo
Approved by: rpaulo
Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5913


# 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


# 11e49977 25-Mar-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITHOUT_TOOLCHAIN: Also exclude LLDB.

Sponsored by: EMC / Isilon Storage Division


# ca8b902a 26-Feb-2016 Ed Maste <emaste@FreeBSD.org>

Install elftoolchain elfcopy(1) as objcopy(1) by default

As of r295661 elfcopy supports PE format for EFI boot binaries and is a
viable objcopy implementation for the base system and ports.

The (temporary) src.conf knob WITHOUT_ELFCOPY_AS_OBJCOPY knob may be set
to obtain the GNU version if necessary.

PR: 207091 [exp-run]
Relnotes: Yes
Sponsored by: The FreeBSD Foundation


# b80f3546 08-Jan-2016 Ed Maste <emaste@FreeBSD.org>

Support use of LLVM's libunwind for exception unwinding

It is built in libgcc_s.so and libgcc_eh.a to simplify transition.

It is enabled by default on arm64 (where we previously had no other
unwinder) and may be enabled for testing on other platforms by setting
WITH_LLVM_LIBUNWIND in src.conf(5).

Also add compiler-rt's __gcc_personality_v0 implementation for use with
the LLVM unwinder.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4787


# c42ade60 02-Jan-2016 Warner Losh <imp@FreeBSD.org>

Add new LIBSOFT option. This is similar to the LIB32 option, except
for libraries that follow the soft float ABI. It's only supported on
armv6 as a transition to the new hard float ABI, so mark as broken
everywhere else.


# d0ba16f7 16-Dec-2015 Ed Maste <emaste@FreeBSD.org>

Enable LLDB by default on amd64 and arm64

LLDB is usable for userland core file and live debugging on amd64, and
for userland core file debugging on arm64. In general it works at least
as well on FreeBSD as our in-tree gdb version, so enable it by default
to allow for broader use and testing.

An LLDB tutorial is available at http://lldb.llvm.org/tutorial.html, and
a table mapping GDB commands to LLDB commands can be found at
http://lldb.llvm.org/lldb-gdb.html .

LLDB also has some level of support for FreeBSD on arm, mips, i386,
and powerpc, but is not yet ready to have them enabled by default.

Reviewed by: gnn
Relnotes: Yes


# 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


# 1cee64a8 08-Dec-2015 Ed Maste <emaste@FreeBSD.org>

Add comment explaining aarch64's BROKEN_OPTIONS

In-tree bintuils and GCC do not support aarch64 or other recent
architectures.


# 1765946b 22-Nov-2015 Dag-Erling Smørgrav <des@FreeBSD.org>

Retire the NONE cipher option.


# 8758abd5 23-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Slightly rework the comments and logic for default Clang/GCC.

This is because the previous version was very obscure about the fact
that despite having Clang "on by default" for architectures such as powerpc, it
does not actually build due to the GCC it uses not having C++11 support.
Using an external compiler that supports C++11 does allow this to work.
This whole block should be rethought more given "on by default" is not
really default without extra work which could actually be surprising for
why Clang is showing up when using a newer GCC.

Sponsored by: EMC / Isilon Storage Division


# 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


# edefff7e 16-Aug-2015 Enji Cooper <ngie@FreeBSD.org>

Reap MK_SYSINSTALL

It's no longer in use in the tree (most likely missed when sade/sysinstall
were removed)

MFC after: 1 week


# 9ff63d24 13-Aug-2015 Ed Maste <emaste@FreeBSD.org>

Remove remnant of WITHOUT_ELFTOOLCHAIN_TOOLS missed in r286730


# d912066c 01-Aug-2015 Mark Johnston <markj@FreeBSD.org>

Add a src.conf option to build and install the DTrace test suite.

Reviewed by: gnn, ngie
Differential Revision: https://reviews.freebsd.org/D3195


# 6974dd6f 29-Jul-2015 Ed Maste <emaste@FreeBSD.org>

Use default CLANG build options for ARM

We previously disabled CLANG_FULL on (little-endian) ARM because the
build failed. This is no longer the case and as of Clang 3.5 we cannot
build any part of the in-tree Clang with in-tree GCC, so it's no longer
necessary to disable CLANG_FULL.

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


# 5ea9e83e 29-Jul-2015 Ed Maste <emaste@FreeBSD.org>

Allow ELF Tool Chain elfcopy to be installed as objcopy

ELF Tool Chain elfcopy is nearly a drop-in replacement for GNU objcopy,
but does not currently support PE output which is needed for building
x86 UEFI bits.

Add a src.conf knob to allow installing it as objcopy and set it by
default for aarch64 only, where we don't have a native binutils.

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


# 32c88b52 16-Jun-2015 Warner Losh <imp@FreeBSD.org>

Remove old fmake. It wasn't built by default for some time. Users that
really need it can find it in the devel/fmake port or pkg install fmake.
Note: This commit is orthogonal to the question 'can we fmake buildworld'.

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


# d1f83b46 11-Jun-2015 Andrew Turner <andrew@FreeBSD.org>

Enable clang on armeb, it is now able to build targeting armeb. This is
the last arm platform to move away from gcc.

Tested by: jmg


# 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


# ae3019ca 26-May-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Define SRCTOP in src.sys.mk

Use SRCTOP to replace .../ in MAKSYSPATH (avoid extra :tA)
Use SRCTOP rather than ROOTSRCDIR in src.libnames.mk
Merge from head


# 054f15ac 28-Apr-2015 Enji Cooper <ngie@FreeBSD.org>

Followup to r282083: add GCC_BOOTSTRAP to the list of broken options on arm64

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


# 48d4d838 27-Apr-2015 Andrew Turner <andrew@FreeBSD.org>

Add GCC to the list of broken options on arm64.


# ac99c33f 24-Apr-2015 Ed Maste <emaste@FreeBSD.org>

Add LLDB to BROKEN_OPTIONS for arm prior to armv6

LLVM lacks support on FreeBSD for ARMv4/ARMv5 64-bit atomic operations.

Sponsored by: The FreeBSD Foundation


# 0538aafc 18-Apr-2015 Konstantin Belousov <kib@FreeBSD.org>

The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), and
pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x
kernels which required padding before the off_t parameter. The
fcntl(2) contains compatibility code to handle kernels before the
struct flock was changed during the 8.x CURRENT development. The
shims were reasonable to allow easier revert to the older kernel at
that time.

Now, two or three major releases later, shims do not serve any
purpose. Such old kernels cannot handle current libc, so revert the
compatibility code.

Make padded syscalls support conditional under the COMPAT6 config
option. For COMPAT32, the syscalls were under COMPAT6 already.

Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to
(partially) disable the removed shims.

Reviewed by: jhb, imp (previous versions)
Discussed with: peter
Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# d422e6f9 07-Apr-2015 Andrew Turner <andrew@FreeBSD.org>

Add the start of libc and libstand for arm64. Not all of the machine
dependent functions have been implemented, but this is enough for world.

Differential Revision: https://reviews.freebsd.org/D2132
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation


# 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


# c7b6816f 04-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Add MK_FILE to control whether or not to build file(1), libmagic(3), etc

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 11981695 04-Feb-2015 Enji Cooper <ngie@FreeBSD.org>

Add the following options to enable/disable several features in the base system

WITHOUT_BOOTPARAMD - bootparamd
WITHOUT_BOOTPD - bootpd
WITHOUT_FINGER - finger, fingerd
WITHOUT_FTP - ftp, ftpd
WITHOUT_INETD - inetd
WITHOUT_RBOOTD - rbootd
WITHOUT_TCP_WRAPPERS - tcpd, et al
WITHOUT_TFTP - tftp, tftp-server
WITHOUT_TIMED - timed

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 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


# b3590423 26-Jan-2015 Enji Cooper <ngie@FreeBSD.org>

Add MK_AUTOFS knob for building and installing autofs(4), et al

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 02629e46 25-Jan-2015 Enji Cooper <ngie@FreeBSD.org>

Add MK_BHYVE knob for building and installing bhyve(4), et al

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 4e395054 25-Jan-2015 Enji Cooper <ngie@FreeBSD.org>

Add MK_HAST knob for building and installing hastd(8), et al

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 18cc3172 24-Jan-2015 Enji Cooper <ngie@FreeBSD.org>

Add MK_CCD knob for building and installing ccd(4), ccdconfig, etc

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# e45b569c 24-Jan-2015 Enji Cooper <ngie@FreeBSD.org>

Add MK_BSDINSTALL knob for building and installing bsdinstall

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 3f802165 24-Jan-2015 Enji Cooper <ngie@FreeBSD.org>

Add MK_TALK knob for building the talk and talkd

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# b29d6977 24-Jan-2015 Enji Cooper <ngie@FreeBSD.org>

Add MK_ISCSI knob for building the iscsi initiator, iscsi daemon, kernel
modules, etc

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 79a86daf 24-Jan-2015 Enji Cooper <ngie@FreeBSD.org>

Add MK_EE knob to control installing edit, ee, etc

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 968d62e1 07-Jan-2015 Ed Maste <emaste@FreeBSD.org>

Use a set of ELF Tool Chain tools by default

These tools are now from the ELF Tool Chain project:

* addr2line
* elfcopy (strip)
* nm
* size
* strings

The binutils versions are available by setting in src.conf:
WITHOUT_ELFTOOLCHAIN_TOOLS=yes

Thanks to antoine@ for multiple exp-runs and diagnosing many of the
failures.

PR: 195561 (ports exp-run)
Sponsored by: The FreeBSD Foundation


# c05bafc5 25-Dec-2014 Poul-Henning Kamp <phk@FreeBSD.org>

Deorbit the IEEE-488/GPIB support.


# 1fc86460 12-Dec-2014 Warner Losh <imp@FreeBSD.org>

Fix typo in comments.

Noticed by: brooks@


# 0104753b 10-Dec-2014 Dimitry Andric <dim@FreeBSD.org>

Since clang 3.5.0 and later must be built by a compiler with C++11
support, make this explicit in src.opts.mk, by updating the default
settings.

The defaults become as follows:
* If the host compiler is not C++11 capable, use gcc and disable clang.
* On x86, enable clang, make it the default cc, and disable gcc.
* On little-endian ARM, enable clang, but not the full build, make it
the default cc, and disable gcc.
* On PowerPC, enable clang, but enable gcc and make that the default cc.
* On everything else, use gcc, and disable clang.

This can be amended later, if we get e.g. sparc64 or big-endian ARM
working with clang.

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


# b43a681b 09-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Move MK_BHYVE/MK_HYPERV to architecture specific sections in Makefiles
instead of introducing an architecture specific section in src.opts.mk

Make it clear in the documentation that the options only affect certain
architectures to reduce user confusion if the knobs are tweaked

A better method for abstracting this out will be done in the future in a
different commit

Discussed with/Requested by: imp


# 5df1ec05 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Sort the MK_CLANG* options (should have done this in the previous commit)


# 393232c9 08-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

MK_CLANG == no should really imply MK_CLANG_IS_CC == no


# 21060720 02-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Make ccd(4), et al conditional based on MK_CCD


# c8c7f0b0 02-Dec-2014 Enji Cooper <ngie@FreeBSD.org>

Add knob, MK_MAC_SUPPORT for building items with mac(9) support, like
libugidfw, ugidfw, etc


# 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


# 5edeb665 30-Nov-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Add STALE_STAGED as default no


# e7d836f7 29-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Make nfs server components conditional according to MK_NFS_SERVER


# 65ea0862 29-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Add MK_FILE and MK_SQLITE3

- MK_FILE will conditionalize building lib/libmagic and usr.bin/file
- MK_SQLITE3 will conditionalize building lib/libsqlite3, and will disable
MK_SVN/MK_SVNLITE by proxy


# e0cbf36b 28-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Make ee(1) optional via MK_EE


# a8b303ad 27-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Add WITHOUT_AUTOFS and WITHOUT_BSDCONFIG


# f541dd9b 26-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Implement MK_RADIUS_SUPPORT to make libradius and assorted support optional


# 9f325b1e 26-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Implement knobs for MK_NETGRAPH_SUPPORT


# a3f5edf0 26-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Add MK_TIMED option for optionally building usr.sbin/timed, et al


# 466046ec 26-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Conditionalize a number of components in the tree

- bootparamd
- bootpd
- finger/fingerd
- ftp/ftpd
- hastctl/hastd
- iscsid, et al
- rbootd
- talk/talkd
- tcpd, et al
- tftp/tftpd

Add src.conf entries for the various components and do a best effort
at adding components to tools/build/mk/OptionalObsoleteFiles.inc


# 4be1ca35 25-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Make building/installing bhyve optional via MK_BHYVE on amd64

Disable building/installing bhyve from src.opts.mk on unsupported
architectures (!amd64)


# 1bdede93 25-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Make src.opts.mk the source of truth for whether or not to build hyperv

In particular, according to several Makefiles it can only be built/run on
amd64 and i386/i386. It isn't supported on i386/pc98


# 05bc3dd6 25-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Make inetd optional via MK_INETD


# 41e07276 25-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Make bsdinstall(8) and sade(8) optional components via MK_BSDINSTALL=yes


# 590461a4 18-Nov-2014 Warner Losh <imp@FreeBSD.org>

Acutally, replaces NO_INCS with WITHOUT_INCLUDES and make
WITHOUT_TOOLCHAIN imply it instead.

Sponsored by: Netflix


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


# 289ee3b6 21-Oct-2014 Warner Losh <imp@FreeBSD.org>

For the kernel, we have USB_GADGET_EXAMPLES as defaults to yes. For
userland defaults to no. This caused issues for the automated option
documenation script. Turns out, this isn't used in userland at all, so
just remove it from here.


# ff2cf368 21-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Always use libc++ as the default c++ stack when building with an external gcc 4.8+
While here disable building gcc from base when using gcc 4.8+

Reviewed by: imp


# f8080a99 15-Oct-2014 Warner Losh <imp@FreeBSD.org>

HYPERV isn't available on all architectures, but just on by default
for i386/amd64. Rather, it only works on i386/amd64 and should only be
built there. Rather than change the default based on which
architecutre, do things more directly by only building it on
i386/amd64 and having it always on. This is how we handle other
options that are relevant only for a few architectures.


# 66c5f84b 01-Oct-2014 Andrew Turner <andrew@FreeBSD.org>

Clean up detection of big-endian ARM. In all cases we follow the pattern
arm*eb*. Check we are building for arm and if MACHINE_ARCH follows this
pattern.


# 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


# e72055b7 12-Sep-2014 Xin LI <delphij@FreeBSD.org>

Import HyperV Key-Value Pair (KVP) driver and daemon code by Microsoft,
many thanks for their continued support of FreeBSD.

While I'm there, also implement a new build knob, WITHOUT_HYPERV to
disable building and installing of the HyperV utilities when necessary.

The HyperV utilities are only built for i386 and amd64 targets.

This is a stable/10 candidate for inclusion with 10.1-RELEASE.

Submitted by: Wei Hu <weh microsoft com>
MFC after: 1 week


# b85bd43a 16-Jul-2014 Julio Merino <jmmv@FreeBSD.org>

Enable MK_TESTS by default, take 2.

This is a redo of r267424, which was reverted in r267432 because it broke
"make buildworld" from FreeBSD 9.x. This issue has been resolved and this
change is still "make tinderbox" clean.


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


# 23f02598 09-Jul-2014 Warner Losh <imp@FreeBSD.org>

Now that pc98 no longer needs gcc to compile boot2, remove the special
case and treat it just like i386.


# 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


# 36716419 13-Jun-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Attach the CUSE library and kernel module to the default FreeBSD
builds. Bump the FreeBSD version number.


# 402da360 12-Jun-2014 Glen Barber <gjb@FreeBSD.org>

Revert r267424 and r267425:
More exploration will be needed in order to silence the
tinderbox mails caused by setting WITH_TESTS=1 by default.

Ref: http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-amd64-amd64.full
With hat: re


# a2b2ff60 12-Jun-2014 Julio Merino <jmmv@FreeBSD.org>

Enable MK_TESTS by default.

This was never intended to be off by default but was done this way
because the initial patches broke the build. Things seem stable now
(have been so for a while too) and "make tinderbox" is clean so let's
try again.

Announced in freebsd-current; all reported shortcomings have been
addressed.


# 8febff70 05-Jun-2014 Ed Maste <emaste@FreeBSD.org>

Install VT support files

They can be disabled by setting WITHOUT_VT_SUPPORT=yes in src.conf.

Sponsored by: The FreeBSD Foundation


# 6b14aaa4 16-May-2014 Warner Losh <imp@FreeBSD.org>

Read in SRCCONF early and consistently, if src.sys.mk exists, which is
should for all normal builds. Read /etc/make.conf earlier than before,
but consistently before SRCCONF and local.sys.mk.


# ab2f5451 16-May-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Add SYSROOT


# 525e2a83 15-May-2014 Brooks Davis <brooks@FreeBSD.org>

Revert r261296. This removes the WITHOUT_NCURSESW option.

It was the wrong direction. We will instead remove use of the
non-wide-character supporting libncurses.


# f510ecf0 10-May-2014 Warner Losh <imp@FreeBSD.org>

Optionally allow building the historical FreeBSD make program and
install it as fmake. This defaults to no. This should be viewed as the
first step towards evental migration of this historic code to ports
and removal from the tree.


# 22cac754 09-May-2014 Warner Losh <imp@FreeBSD.org>

Introduce kern.opts.mk to hold all the options for kernel module
builds. Include this in the right places. Make src.opts.mk optional so
that modules can be built outside of the tree in the ports system.

PR: 189520


# f9798cc7 08-May-2014 Warner Losh <imp@FreeBSD.org>

We have to include bsd.opts.mk (included in bsd.own.mk) after
/etc/src.conf so that options set there will affect the options
defined in bsd.opts.mk. Fix a few comments while I'm here.


# 5d420b97 07-May-2014 Warner Losh <imp@FreeBSD.org>

All the NO_foo options processed in src.opts.mk are really bsd.opts.mk
options, so move their processing there. This fixes issues with
Makefiles that define NO_MAN=t and only inlcude bsd.*.mk files. A few
ports fell into this category, and they should be fixed by this change.
Also, for now, disable the warning about NO_foo being deprecated. More
work is needed than anticipated before we can do that, so kill the
noise for now.


# d0312744 05-May-2014 Warner Losh <imp@FreeBSD.org>

Remove support for WITHOUT_BMAKE. bmake is now the only make that can
build world, so it is the only make we build or install. fmake is
still in the tree, but disconnected, and upgrades from older systems
that still have bmake has not been removed, but its state has not been
tested (it should work given how minimal the work to upgrade to bmake
is).


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


# 5e84b765 05-May-2014 Warner Losh <imp@FreeBSD.org>

Move the /usr/src specific options to src.opts.mk. Move inclusion of
/etc/src.conf to this file as well. Now, it will only affect builds of
/usr/src and not others that use the bsd.*.mk files. Specifically
don't install src.opts.mk so we can catch when it 'leaks' into
bsd.*.mk again and have there be errors when this happens. Future
commits will move to including src.opts.mk instead of bsd.own.mk when
all that's needed is one of the MK_FOO options from src.opts.mk.
Future options should be placed here, unless they directly affect a
bsd.*.mk file, in which case they should be placed in bsd.opts.mk.