aboutsummaryrefslogtreecommitdiff
path: root/tools/build
diff options
context:
space:
mode:
Diffstat (limited to 'tools/build')
-rw-r--r--tools/build/Makefile13
-rw-r--r--tools/build/cross-build/include/common/sys/types.h12
-rw-r--r--tools/build/cross-build/include/linux/strings.h40
-rwxr-xr-xtools/build/depend-cleanup.sh8
-rw-r--r--tools/build/mk/OptionalObsoleteFiles.inc111
-rw-r--r--tools/build/options/WITHOUT_DTRACE2
-rw-r--r--tools/build/options/WITHOUT_KERBEROS_SUPPORT3
-rw-r--r--tools/build/options/WITHOUT_MACHDEP_OPTIMIZATIONS1
8 files changed, 167 insertions, 23 deletions
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 00f5e3e45337..8c723e8be73c 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -153,6 +153,15 @@ SYSINCS+= ${SRCTOP}/sys/sys/nlist_aout.h
.if ${.MAKE.OS} != "FreeBSD"
.PATH: ${.CURDIR}/cross-build
+
+# Needed by our sys/types.h wrapper
+SYSINCS+= ${SRCTOP}/sys/sys/bitcount.h
+
+# macOS's bitstring lacks FreeBSD-specific additions used by makefs's ZFS code
+# and Linux doesn't have it at all.
+INCS+= ${SRCTOP}/include/bitstring.h
+SYSINCS+= ${SRCTOP}/sys/sys/bitstring.h
+
# dbopen() behaves differently on Linux and FreeBSD so we ensure that we
# bootstrap the FreeBSD db code. The cross-build headers #define dbopen() to
# __freebsd_dbopen() so that we don't ever use the host version
@@ -181,6 +190,8 @@ SRCS+= rpmatch.c
# On Linux, glibc does not provide strlcpy,strlcat or strmode.
.PATH: ${LIBC_SRCTOP}/string
SRCS+= strlcpy.c strlcat.c strmode.c
+# On Linux, glibc provides ffs* but not fls*
+SRCS+= fls.c flsl.c flsll.c
# Compile the fgetln/fgetwln/closefrom fallback code from libbsd:
SRCS+= fgetln_fallback.c fgetwln_fallback.c closefrom.c
CFLAGS.closefrom.c+= -DSTDC_HEADERS -DHAVE_SYS_DIR_H -DHAVE_DIRENT_H \
@@ -240,7 +251,7 @@ DISKINCS+= ${SRCTOP}/sys/sys/disk/bsd.h
# Needed to build config (since it uses libnv)
SYSINCS+= ${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h \
- ${SRCTOP}/sys/sys/dnv.h
+ ${SRCTOP}/sys/sys/dnv.h ${SRCTOP}/sys/sys/nv_namespace.h
# Needed when bootstrapping ldd (since it uses DF_1_PIE)
SYSINCS+= ${SRCTOP}/sys/sys/elf32.h
diff --git a/tools/build/cross-build/include/common/sys/types.h b/tools/build/cross-build/include/common/sys/types.h
index 044ca6bed4f8..0bfe2bac2aea 100644
--- a/tools/build/cross-build/include/common/sys/types.h
+++ b/tools/build/cross-build/include/common/sys/types.h
@@ -68,4 +68,16 @@ typedef unsigned long cap_ioctl_t;
struct cap_rights;
typedef struct cap_rights cap_rights_t;
+
+/*
+ * make.py uses these headers during the bmake bootstrap on Linux only, at
+ * which point sys/bitcount.h won't yet exist, so don't include it there.
+ *
+ * TODO: Untangle this mess.
+ */
+#if __has_include(<sys/bitcount.h>)
+/* Needed for bitstring */
+#include <sys/bitcount.h>
+#endif
+
#endif
diff --git a/tools/build/cross-build/include/linux/strings.h b/tools/build/cross-build/include/linux/strings.h
new file mode 100644
index 000000000000..827ef23f1c82
--- /dev/null
+++ b/tools/build/cross-build/include/linux/strings.h
@@ -0,0 +1,40 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright 2022 Jessica Clarke <jrtc27@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+#pragma once
+#include <sys/cdefs.h>
+
+#include_next <strings.h>
+
+__BEGIN_DECLS
+
+int fls(int) __pure2;
+int flsl(long) __pure2;
+int flsll(long long) __pure2;
+
+__END_DECLS
diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh
index 39b06b45d45f..35066ee7f921 100755
--- a/tools/build/depend-cleanup.sh
+++ b/tools/build/depend-cleanup.sh
@@ -90,3 +90,11 @@ fi
if [ "$MACHINE_ARCH" = "amd64" ]; then
clean_dep lib/libc bcmp c
fi
+
+# 20220524 68fe988a40ca kqueue_test binary replaced shell script
+if stat "$OBJTOP"/tests/sys/kqueue/libkqueue/*kqtest* \
+ "$OBJTOP"/tests/sys/kqueue/libkqueue/.depend.kqtest* >/dev/null 2>&1; then
+ echo "Removing old kqtest"
+ rm -f "$OBJTOP"/tests/sys/kqueue/libkqueue/.depend.* \
+ "$OBJTOP"/tests/sys/kqueue/libkqueue/*
+fi
diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index 85257d41140c..4145859f21cd 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -178,6 +178,15 @@ OLD_FILES+=usr/share/man/man8/autounmountd.8.gz
OLD_DIRS+=etc/autofs
.endif
+.if ${MK_BEARSSL} == no
+OLD_FILES+=usr/lib/libbearssl.a
+OLD_FILES+=usr/lib/libbearssl.so
+OLD_LIBS+=usr/lib/libbearssl.so.5
+OLD_FILES+=usr/lib/libsecureboot.a
+OLD_FILES+=usr/lib/libsecureboot.so
+OLD_LIBS+=usr/lib/libsecureboot.so.5
+.endif
+
.if ${MK_BHYVE} == no
OLD_FILES+=usr/lib/libvmmapi.a
OLD_FILES+=usr/lib/libvmmapi.so
@@ -902,13 +911,9 @@ OLD_FILES+=usr/share/man/man4/ccd.4.gz
OLD_FILES+=usr/share/man/man8/ccdconfig.8.gz
.endif
-.if ${MK_CDDL} == no
-OLD_LIBS+=lib/libavl.so.2
+.if ${MK_DTRACE} == no
OLD_LIBS+=lib/libctf.so.2
OLD_LIBS+=lib/libdtrace.so.2
-OLD_LIBS+=lib/libnvpair.so.2
-OLD_LIBS+=lib/libumem.so.2
-OLD_LIBS+=lib/libuutil.so.2
OLD_FILES+=usr/bin/ctfconvert
OLD_FILES+=usr/bin/ctfdump
OLD_FILES+=usr/bin/ctfmerge
@@ -929,24 +934,12 @@ OLD_FILES+=usr/lib/dtrace/tcp.d
OLD_FILES+=usr/lib/dtrace/udp.d
OLD_FILES+=usr/lib/dtrace/udplite.d
OLD_FILES+=usr/lib/dtrace/unistd.d
-OLD_FILES+=usr/lib/libavl.a
-OLD_FILES+=usr/lib/libavl.so
-OLD_FILES+=usr/lib/libavl_p.a
OLD_FILES+=usr/lib/libctf.a
OLD_FILES+=usr/lib/libctf.so
OLD_FILES+=usr/lib/libctf_p.a
OLD_FILES+=usr/lib/libdtrace.a
OLD_FILES+=usr/lib/libdtrace.so
OLD_FILES+=usr/lib/libdtrace_p.a
-OLD_FILES+=usr/lib/libnvpair.a
-OLD_FILES+=usr/lib/libnvpair.so
-OLD_FILES+=usr/lib/libnvpair_p.a
-OLD_FILES+=usr/lib/libumem.a
-OLD_FILES+=usr/lib/libumem.so
-OLD_FILES+=usr/lib/libumem_p.a
-OLD_FILES+=usr/lib/libuutil.a
-OLD_FILES+=usr/lib/libuutil.so
-OLD_FILES+=usr/lib/libuutil_p.a
OLD_LIBS+=lib/libdtrace.so.2
OLD_FILES+=usr/libexec/dwatch/chmod
OLD_FILES+=usr/libexec/dwatch/errno
@@ -1080,6 +1073,10 @@ OLD_FILES+=etc/periodic/daily/404.status-zfs
OLD_FILES+=etc/periodic/daily/800.scrub-zfs
OLD_FILES+=etc/zfs/exports
OLD_DIRS+=etc/zfs
+OLD_LIBS+=lib/libavl.so.2
+OLD_LIBS+=lib/libnvpair.so.2
+OLD_LIBS+=lib/libumem.so.2
+OLD_LIBS+=lib/libuutil.so.2
OLD_LIBS+=lib/libzfs.so.2
OLD_LIBS+=lib/libzfs.so.3
OLD_LIBS+=lib/libzfs_core.so.2
@@ -1098,6 +1095,18 @@ OLD_FILES+=usr/lib/libbe.a
OLD_FILES+=usr/lib/libbe_p.a
OLD_FILES+=usr/lib/libbe.so
OLD_LIBS+=lib/libbe.so.1
+OLD_FILES+=usr/lib/libavl.a
+OLD_FILES+=usr/lib/libavl.so
+OLD_FILES+=usr/lib/libavl_p.a
+OLD_FILES+=usr/lib/libnvpair.a
+OLD_FILES+=usr/lib/libnvpair.so
+OLD_FILES+=usr/lib/libnvpair_p.a
+OLD_FILES+=usr/lib/libumem.a
+OLD_FILES+=usr/lib/libumem.so
+OLD_FILES+=usr/lib/libumem_p.a
+OLD_FILES+=usr/lib/libuutil.a
+OLD_FILES+=usr/lib/libuutil.so
+OLD_FILES+=usr/lib/libuutil_p.a
OLD_FILES+=usr/lib/libzfs.a
OLD_FILES+=usr/lib/libzfs.so
OLD_FILES+=usr/lib/libzfs_core.a
@@ -2088,6 +2097,11 @@ OLD_FILES+=usr/share/man/man8/strfile.8.gz
OLD_FILES+=usr/share/man/man8/unstr.8.gz
.endif
+.if ${MK_LLVM_BINUTILS} == no
+OLD_FILES+=usr/bin/objdump
+OLD_FILES+=usr/share/man/man1/objdump.1.gz
+.endif
+
.if ${MK_LLVM_COV} == no && !defined(WITH_PORT_BASE_GCC)
OLD_FILES+=usr/bin/gcov
OLD_FILES+=usr/share/man/man1/gcov.1.gz
@@ -2455,6 +2469,52 @@ OLD_FILES+=usr/bin/mkcsmapper
OLD_FILES+=usr/bin/mkesdb
OLD_FILES+=usr/include/_libiconv_compat.h
OLD_FILES+=usr/include/iconv.h
+OLD_LIBS+=usr/lib/i18n/libBIG5.so.5
+OLD_FILES+=usr/lib/i18n/libBIG5.so
+OLD_LIBS+=usr/lib/i18n/libDECHanyu.so.5
+OLD_FILES+=usr/lib/i18n/libDECHanyu.so
+OLD_LIBS+=usr/lib/i18n/libEUC.so.5
+OLD_FILES+=usr/lib/i18n/libEUC.so
+OLD_LIBS+=usr/lib/i18n/libEUCTW.so.5
+OLD_FILES+=usr/lib/i18n/libEUCTW.so
+OLD_LIBS+=usr/lib/i18n/libGBK2K.so.5
+OLD_FILES+=usr/lib/i18n/libGBK2K.so
+OLD_LIBS+=usr/lib/i18n/libHZ.so.5
+OLD_FILES+=usr/lib/i18n/libHZ.so
+OLD_LIBS+=usr/lib/i18n/libISO2022.so.5
+OLD_FILES+=usr/lib/i18n/libISO2022.so
+OLD_LIBS+=usr/lib/i18n/libJOHAB.so.5
+OLD_FILES+=usr/lib/i18n/libJOHAB.so
+OLD_LIBS+=usr/lib/i18n/libMSKanji.so.5
+OLD_FILES+=usr/lib/i18n/libMSKanji.so
+OLD_LIBS+=usr/lib/i18n/libUES.so.5
+OLD_FILES+=usr/lib/i18n/libUES.so
+OLD_LIBS+=usr/lib/i18n/libUTF1632.so.5
+OLD_FILES+=usr/lib/i18n/libUTF1632.so
+OLD_LIBS+=usr/lib/i18n/libUTF7.so.5
+OLD_FILES+=usr/lib/i18n/libUTF7.so
+OLD_LIBS+=usr/lib/i18n/libUTF8.so.5
+OLD_FILES+=usr/lib/i18n/libUTF8.so
+OLD_LIBS+=usr/lib/i18n/libVIQR.so.5
+OLD_FILES+=usr/lib/i18n/libVIQR.so
+OLD_LIBS+=usr/lib/i18n/libZW.so.5
+OLD_FILES+=usr/lib/i18n/libZW.so
+OLD_LIBS+=usr/lib/i18n/libiconv_none.so.5
+OLD_FILES+=usr/lib/i18n/libiconv_none.so
+OLD_LIBS+=usr/lib/i18n/libiconv_std.so.5
+OLD_FILES+=usr/lib/i18n/libiconv_std.so
+OLD_LIBS+=usr/lib/i18n/libmapper_646.so.5
+OLD_FILES+=usr/lib/i18n/libmapper_646.so
+OLD_LIBS+=usr/lib/i18n/libmapper_none.so.5
+OLD_FILES+=usr/lib/i18n/libmapper_none.so
+OLD_LIBS+=usr/lib/i18n/libmapper_parallel.so.5
+OLD_FILES+=usr/lib/i18n/libmapper_parallel.so
+OLD_LIBS+=usr/lib/i18n/libmapper_serial.so.5
+OLD_FILES+=usr/lib/i18n/libmapper_serial.so
+OLD_LIBS+=usr/lib/i18n/libmapper_std.so.5
+OLD_FILES+=usr/lib/i18n/libmapper_std.so
+OLD_LIBS+=usr/lib/i18n/libmapper_zone.so.5
+OLD_FILES+=usr/lib/i18n/libmapper_zone.so
OLD_FILES+=usr/share/man/man1/iconv.1.gz
OLD_FILES+=usr/share/man/man1/mkcsmapper.1.gz
OLD_FILES+=usr/share/man/man1/mkesdb.1.gz
@@ -2468,6 +2528,7 @@ OLD_FILES+=usr/share/man/man3/iconv_open.3.gz
OLD_FILES+=usr/share/man/man3/iconv_open_into.3.gz
OLD_FILES+=usr/share/man/man3/iconvctl.3.gz
OLD_FILES+=usr/share/man/man3/iconvlist.3.gz
+OLD_DIRS+=usr/lib/i18n
OLD_DIRS+=usr/share/i18n
OLD_DIRS+=usr/share/i18n/esdb
OLD_DIRS+=usr/share/i18n/esdb/ISO-2022
@@ -7673,7 +7734,9 @@ OLD_FILES+=etc/periodic/daily/440.status-mailq
OLD_FILES+=etc/periodic/daily/460.status-mail-rejects
OLD_FILES+=etc/periodic/daily/500.queuerun
OLD_FILES+=etc/rc.d/sendmail
+.if ${MK_MAILWRAPPER} == no
OLD_FILES+=bin/rmail
+.endif
OLD_FILES+=usr/bin/vacation
OLD_FILES+=usr/include/libmilter/mfapi.h
OLD_FILES+=usr/include/libmilter/mfdef.h
@@ -7756,12 +7819,14 @@ OLD_FILES+=usr/share/sendmail/cf/feature/access_db.m4
OLD_FILES+=usr/share/sendmail/cf/feature/allmasquerade.m4
OLD_FILES+=usr/share/sendmail/cf/feature/always_add_domain.m4
OLD_FILES+=usr/share/sendmail/cf/feature/authinfo.m4
+OLD_FILES+=usr/share/sendmail/cf/feature/blocklist_recipients.m4
OLD_FILES+=usr/share/sendmail/cf/feature/badmx.m4
OLD_FILES+=usr/share/sendmail/cf/feature/bcc.m4
OLD_FILES+=usr/share/sendmail/cf/feature/bestmx_is_local.m4
OLD_FILES+=usr/share/sendmail/cf/feature/bitdomain.m4
OLD_FILES+=usr/share/sendmail/cf/feature/blacklist_recipients.m4
OLD_FILES+=usr/share/sendmail/cf/feature/block_bad_helo.m4
+OLD_FILES+=usr/share/sendmail/cf/feature/check_cert_altnames.m4
OLD_FILES+=usr/share/sendmail/cf/feature/compat_check.m4
OLD_FILES+=usr/share/sendmail/cf/feature/conncontrol.m4
OLD_FILES+=usr/share/sendmail/cf/feature/delay_checks.m4
@@ -7804,6 +7869,7 @@ OLD_FILES+=usr/share/sendmail/cf/feature/relay_mail_from.m4
OLD_FILES+=usr/share/sendmail/cf/feature/require_rdns.m4
OLD_FILES+=usr/share/sendmail/cf/feature/smrsh.m4
OLD_FILES+=usr/share/sendmail/cf/feature/stickyhost.m4
+OLD_FILES+=usr/share/sendmail/cf/feature/tls_failures.m4
OLD_FILES+=usr/share/sendmail/cf/feature/tls_session_features.m4
OLD_FILES+=usr/share/sendmail/cf/feature/use_client_ptr.m4
OLD_FILES+=usr/share/sendmail/cf/feature/use_ct_file.m4
@@ -8176,11 +8242,8 @@ OLD_FILES+=usr/share/nls/uk_UA.UTF-8/tcsh.cat
.endif
.if ${MK_TELNET} == no
-OLD_FILES+=etc/pam.d/telnetd
OLD_FILES+=usr/bin/telnet
-OLD_FILES+=usr/libexec/telnetd
OLD_FILES+=usr/share/man/man1/telnet.1.gz
-OLD_FILES+=usr/share/man/man8/telnetd.8.gz
.endif
.if ${MK_TESTS} == yes
@@ -9607,6 +9670,14 @@ OLD_FILES+=usr/share/man/man8/lastlogin.8.gz
OLD_FILES+=usr/share/man/man8/utx.8.gz
.endif
+.if ${MK_VERIEXEC} == no
+OLD_FILES+=sbin/veriexec
+OLD_FILES+=usr/share/man/man8/veriexec.8.gz
+OLD_FILES+=usr/lib/libveriexec.a
+OLD_FILES+=usr/lib/libveriexec.so
+OLD_LIBS+=usr/lib/libveriexec.so.5
+.endif
+
.if ${MK_VI} == no
OLD_FILES+=etc/rc.d/virecover
OLD_FILES+=rescue/ex
diff --git a/tools/build/options/WITHOUT_DTRACE b/tools/build/options/WITHOUT_DTRACE
new file mode 100644
index 000000000000..7a246ee5ee3d
--- /dev/null
+++ b/tools/build/options/WITHOUT_DTRACE
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Do not build DTrace framework kernel modules, libraries, and user commands.
diff --git a/tools/build/options/WITHOUT_KERBEROS_SUPPORT b/tools/build/options/WITHOUT_KERBEROS_SUPPORT
index 1a50b28678bc..07516bb272e8 100644
--- a/tools/build/options/WITHOUT_KERBEROS_SUPPORT
+++ b/tools/build/options/WITHOUT_KERBEROS_SUPPORT
@@ -2,6 +2,5 @@
Build some programs without Kerberos support, like
.Xr ssh 1 ,
.Xr telnet 1 ,
-.Xr sshd 8 ,
and
-.Xr telnetd 8 .
+.Xr sshd 8 .
diff --git a/tools/build/options/WITHOUT_MACHDEP_OPTIMIZATIONS b/tools/build/options/WITHOUT_MACHDEP_OPTIMIZATIONS
new file mode 100644
index 000000000000..1c596c998504
--- /dev/null
+++ b/tools/build/options/WITHOUT_MACHDEP_OPTIMIZATIONS
@@ -0,0 +1 @@
+Prefer machine-independent non-assembler code in libc and libm.