Commit Graph

1762 Commits

Author SHA1 Message Date
Jessica Clarke
8d5d329553 Bootstrap libz when cross-building from non-FreeBSD
This is needed now libdwarf depends on libz.

Fixes:		dbf05458e3 ("libdwarf: Support consumption of compressed ELF sections")
MFC after:	1 week
2021-12-06 19:16:28 +00:00
Konstantin Belousov
9b135747a3 kern.pre.mk: allow to use and customize elfdump during kernel build
Reviewed by:	emaste
Discussed with:	jrtc27
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32960
2021-12-06 20:46:49 +02:00
Juraj Lutter
aaa4cd7f3c Makefile.inc1: Silence an error in make packages
Silence an error in "packages" target, like:

eval: /usr/src: Permission denied

on systems without subversion present.

Reviewed by:	emaste
Approved by:	emaste
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D33153
2021-11-30 09:53:20 +01:00
Mark Johnston
7b3642da21 Hoist cddl prebuild lib dependency definitions out of a MK_ZFS block
The compilation of several libraries under cddl/lib is not conditional
on MK_ZFS = "yes", so their dependency on libspl is not conditional
either.  Unbreak buildworld when WITHOUT_ZFS is set.

Reported by:	bz
Fixes:		9e9c651cac ("cddl: fix missing ZFS library dependencies")
MFC after:	1 week
2021-11-26 09:39:09 -05:00
Ed Maste
483a226238 Add ncurses/form to _prebuild_libs to fix build
Reported by:	bz
2021-11-24 14:39:37 -05:00
Warner Losh
8502220db5 Revert "Bootstrap: Prune building from pre-FreeBSD 11 support"
This reverts commit a420a672bc.

kevans pointed out some potential problems here, so reverting until
I can fix them.
2021-11-19 00:10:21 -07:00
Warner Losh
a420a672bc Bootstrap: Prune building from pre-FreeBSD 11 support
We don't need to bootstrap lex or md4 anymore.
Cat doesn't need to be bootstrapped (but is needed for buildkernel)
cruncgen doesn't need to be bootstrapped at all.
kbdcontrol isn't needed

Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/554
2021-11-18 23:13:44 -07:00
Warner Losh
27a04f5964 Add warning that MIPS is being removed in FreeBSD 14.0
MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:	brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D32853
2021-11-18 21:22:56 -07:00
Greg V
9e9c651cac cddl: fix missing ZFS library dependencies
In 9fae47666 zfsd got a libspl dependency to avoid undefined references.
However that workaround did not help external consumers of libzfs_core.

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

Reviewed by:	freqlabs, markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D32521
2021-11-15 09:42:07 -05:00
Konstantin Belousov
e5adb145f0 Remove arm/linux from sysent toplevel target
Sponsored by:	The FreeBSD Foundation
Fixes:	65e485014b
2021-11-10 21:18:53 +02:00
Mateusz Piotrowski
eab5358b90 Makefile.inc1: Remove mentions of removed target "update"
This is follow-up to commits e290182bcf and 1f7d11e636.
2021-10-24 21:07:45 +02:00
Ed Maste
1a724aa972 Makefile.inc1: remove lorder from build/cross tools
As lorder is not used by the base system build there is no need to
include it in bootstrap-tools or NXBDIRS.

Fixes: 		0e1e341b48 ("Stop using lorder and ranlib when...")
Sponsored by:	The FreeBSD Foundation
2021-10-18 19:29:22 -04:00
Kyle Evans
e2e2c622c3 native-xtools: avoid libllvm while populating the sysroot
Prior to 021385aba5, MK_CLANG=no was sufficient to avoid descending
into lib/clang, but the referenced change added a couple of other
enabling knobs. Turn those off, too, to continue avoiding libllvm.

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

Reported by:	bhughes, imp, probably others
Fixes:	021385aba5 ("Add WITH_LLVM_BINUTILS to install LLVM ...")
2021-10-13 04:41:17 -05:00
Warner Losh
c05b382edb Revert "bootstrap: No need to disable shared libraries for bootstrap tools"
This reverts commit e8f26e5dc8.

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

Sponsored by:		Netflix
2021-10-11 11:49:48 -06:00
Warner Losh
e8f26e5dc8 bootstrap: No need to disable shared libraries for bootstrap tools
There's no need to disable shared libraries when building the bootstrap
tools. This was added on 2000 (commit ad879ce955) when the perl
bootstrap was added (libperl and miniperl) and saved a fair amount of
time (perl took a long time to build on 2000-era hardware).

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

Sponsored by:		Netflix
Reviewed by:		arichardson, bapt
Differential Revision:	https://reviews.freebsd.org/D32443
2021-10-11 11:20:07 -06:00
Kyle Evans
4d7876aa70 build: slap a libtinfo dependency on libncurses
This mirrors the SUBDIR_DEPEND in lib/ncurses/Makefile.

Reported by:	jenkins (e.g., riscv64 build #23984)
Fixes:	396851c20a ("ncurses: split libtinfo from libncurses")
2021-10-06 22:03:37 -05:00
Baptiste Daroussin
cbc83e378a ncurses: chase dependency changes in the source tree
Differential Revision:	https://reviews.freebsd.org/D32098
2021-10-04 11:38:24 +02:00
Konstantin Belousov
cf0ee8738e Drop cloudabi
According to https://github.com/NuxiNL/cloudlibc:
CloudABI is no longer being maintained. It was an awesome experiment,
but it never got enough traction to be sustainable.

There is no reason to keep it in FreeBSD.

Approved by:	ed (private mail)
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D31923
2021-09-22 00:18:44 +03:00
Doug Rabson
895545d0e6 Fix spelling of BUILDENV_SHELL 2021-09-11 13:27:11 +01:00
Alex Richardson
021385aba5 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
2021-09-06 09:49:49 +01:00
Jessica Clarke
1e4c802913 Fix bootstrapping to actually build lldb-tblgen for later use
Because MK_LLDB=no is in BSARGS, the bootstrap-tools recursive make does
not add lldb-tblgen to _clang_tblgen, causing it to not be built. This
means that the build currently always uses the host's lldb-tblgen
(which, whilst currently it appears to work, could in future break if
TableGen backends are added or altered) and, if it doesn't exist (either
because the current FreeBSD system was built with it disabled, or you're
building on macOS/Linux), fails. Linux and macOS cross-builds used to
work simply because LLDB was previously in BROKEN_OPTIONS when building
on non-FreeBSD.

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

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

Fixes:		31ba4ce889 ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after:	1 week
Reviewed by:	dim, emaste, imp
Differential Revision:	https://reviews.freebsd.org/D31531
2021-08-24 15:04:25 +01:00
Jessica Clarke
ab3a18095f Makefile.inc1: Make sure sub-makes see MK_CLANG_BOOTSTRAP=no when XCC is a path
Currently we override MK_CLANG_BOOTSTRAP to no so we don't build a
bootstrap compiler, but subdirectories don't see that and so the hack in
bsd.sys.mk to prefer our includes over Clang's resource dir for external
toolchains is not enabled unless you use -DWITHOUT_CLANG_BOOTSTRAP
explicitly on top of XCC (which tools/build/make.py does not do),
causing duplicate definition errors when building rtld-elf due to the
use of -ffreestanding (Clang's stdint.h will use the system one when
hosted, but its own when freestanding, and only has glibc's preprocessor
guards, not FreeBSD's).

This broke when dropping CLANG_BOOTSTRAP from BROKEN_OPTIONS.

Fixes:		31ba4ce889 ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after:	1 week
Reviewed by:	imp, arichardson
Differential Revision:	https://reviews.freebsd.org/D31529
2021-08-24 15:04:25 +01:00
Bjoern A. Zeeb
298ee47e19 localedef: unbreak WITHOUT_LOCALES
After 0fa5403d49 ("pkgbase: move locales into their own package") we
need usr.bin/localedef as a bootstrap tool independent on where
WITHOUT_LOCALE was specified as we ALWAYS process C.UTF-8.

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

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D31589
2021-08-19 12:38:17 -05:00
Bryan Drewery
4b7bf84248 bootstrap-tools: Don't copy host tools with make -n 2021-08-17 12:26:03 -07:00
Bryan Drewery
a3ddd7c92b _worldtmp: Fix some sub-makes not working with make -n 2021-08-17 12:06:40 -07:00
Alex Richardson
cc1345056b Add missing lex/yacc dependency for mkesdb/mkcsmapper bootstrap
This causes build failures on macOS where the build can end up invoking
an incompatible m4 binary.

Fxies:		2de949cf85 ("Remove mkcsmapper_static and mkesdb_static from build-tools")
2021-08-16 09:57:33 +01:00
Ed Maste
54247ce1f9 Makefile.inc1: Avoid hanging if pkg is not installed
For `pkg --version`, Redirect stdin from /dev/null to avoid waiting on
/usr/sbin/pkg's bootstrap prompt if the pkg package is not installed.
Also redirect stderr to /dev/null to discard the warning message in
this case.

Reported by:	mjg
Fixes:		4e224e4be7 ("pkgbase: accommodate pkg < 1.17")
Sponsored by:	The FreeBSD Foundation
2021-08-07 23:13:40 -04:00
Mitchell Horne
61ed578ee6 Prefer MK_SSP=no to SSP_CFLAGS=
It is more idiomatic. CFLAGS is only augmented with $SSP_CFLAGS when
$MK_SSP != "no".

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31401
2021-08-04 15:23:22 -03:00
Mitchell Horne
bcd2f41f7d mk: format some option lists
Alphabetize and give each option its own line, ahead of making another
change to these lists. This makes future diffs easier to read.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31399
2021-08-04 15:23:22 -03:00
Bryan Drewery
b60770fceb Fix native-xtools build
Fixes		https://github.com/freebsd/poudriere/issues/894
Fixes:		d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line")
X-MFC-With:	d0c737e18
2021-08-03 10:00:28 -07:00
Bryan Drewery
2482ea42fb Revert "Fix native-xtools build"
This reverts commit 36269b8231.

This had an unintended change included.
2021-08-03 10:00:28 -07:00
Bryan Drewery
36269b8231 Fix native-xtools build
Fixes		https://github.com/freebsd/poudriere/issues/894
Fixes:		d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line")
X-MFC-With:	d0c737e18
2021-08-03 08:22:14 -07:00
Alex Richardson
2de949cf85 Remove mkcsmapper_static and mkesdb_static from build-tools
Build them as part of the bootstrap-tools phase instead.

Reviewed by:	emaste (no objections)
Differential Revision: https://reviews.freebsd.org/D28181
2021-08-02 14:33:25 +01:00
Alex Richardson
7bc797e3f3 Add build system support for ASAN+UBSAN instrumentation
This adds two new options WITH_ASAN/WITH_UBSAN that can be set to
enable instrumentation of all binaries with AddressSanitizer and/or
UndefinedBehaviourSanitizer. This current patch is almost sufficient
to get a complete buildworld with sanitizer instrumentation but in
order to actually build and boot a system it depends on a few more
follow-up commits.

Reviewed By:	brooks, kib, markj
Differential Revision: https://reviews.freebsd.org/D31043
2021-08-02 14:33:24 +01:00
Wolfram Schneider
bbd16236e9 add the time(1) command to the list of install tools
Reported by:	dhw
Approved by:	dhw
Differential Revision:	https://reviews.freebsd.org/D31373
2021-08-01 13:25:00 +00:00
Wolfram Schneider
99feb137f5 `make buildworld' with time logging for each stage
PR:	 	257141
Reviewed by:	sjg,emaste
Approved by:	emaste
Differential Revision:	https://reviews.freebsd.org/D31154
2021-08-01 09:10:49 +00:00
Ed Maste
4dbac528db pkgbase: improve pkg --version parsing
In some cases `pkg --version` might produce unexpected or additional
output.  Use a regex /^[0-9.]+$/ to match only the line containing the
version number.

Reported by:	Michael Butler on freebsd-current@
Fixes:		4e224e4be7 ("pkgbase: accommodate pkg < 1.17")
Sponsored by:	The FreeBSD Foundation
2021-07-28 17:14:33 -04:00
Ed Maste
4e224e4be7 pkgbase: accommodate pkg < 1.17
6cafdee71d adapted the pkgbase build for 1.17, but broke Cirrus-CI's
use of PKG_FORMAT=tar (the quarterly package set still has pkg 1.16).
Because of this I disabled the pkgbase build and test in 2bfba2a04b.

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

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

PR:		257422
Reviewed by:	manu
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31324
2021-07-27 14:50:06 -04:00
Emmanuel Vadot
6cafdee71d pkgbase: Track pkg 1.17
With pkg 1.17 the extention is always .pkg, packing_format is also now deprecated.
2021-07-22 10:19:02 +02:00
Alex Richardson
c5d1d88a35 Don't build lldb-tablegen if MK_LLDB=no
Split out from D31060.

Reviewed by:	emaste
2021-07-19 15:05:22 +01:00
John Baldwin
0333fad1b7 Remove svnlite.
Reviewed by:	bcr, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D30737
2021-06-11 14:56:41 -07:00
John Baldwin
e290182bcf Remove 'make update'.
In the CVS days this used be a wrapper around either CVS or CVSup and
used to support updating src, doc, and ports checkouts.  With the move
to subversion this only supported updating src and was itself a
wrapper around 'svn update'.  With Git, users are probably better off
using appropriate Git commands directly to update without needing an
explicit make target as a wrapper.

Reviewed by:	bcr, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D30736
2021-06-11 14:56:28 -07:00
Mitchell Horne
689c7e7975 libpmc: always generate libpmc_events.c
The jevents build tool will create an empty table if it doesn't find any
events, so we can remove the extra $MACHINE_CPUARCH checks.

Reviewed by:	gnn, ray, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30531
2021-05-31 17:39:05 -03:00
Marcin Wojtas
c6081dea59 Add elfctl to toolchain.
Add elfctl program to toolchain to allow modifying ELF feature flags
during system build.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D29552
2021-05-21 15:32:42 +02:00
Glen Barber
50179c5ec7 Makefile.inc1: unbreak bootstrap when kbdcontrol does not exist
Reviewed by:		arichardson
MFC after:		12 hours
MFC target:		stable/13, releng/13.0
Differential Review:	https://reviews.freebsd.org/D29200
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2021-03-23 20:47:14 -04:00
Baptiste Daroussin
4a847a6ccd Revert "bootstrap: add tic to the bootstrap tools"
Since we don't build and install the terminfo db anymore this is not
needed

This reverts commit b6a51d39e3.
This reverts commit e5e4845959.
This reverts commit 0af562d7e1.
2021-03-18 16:05:20 +01:00
Alex Richardson
e5e4845959 Makefile.inc1 "Avoid duplicate script for target" warning
This happens if -DBOOTSTRAP_ALL_TOOLS or when building on non-FreeBSD.
2021-03-01 13:22:15 +00:00
Baptiste Daroussin
b6a51d39e3 bootstrap: fix a last edit typo
Reported by:	cy
2021-02-25 14:53:00 +01:00
Baptiste Daroussin
0af562d7e1 bootstrap: add tic to the bootstrap tools
tic is necessary early in the build to be able to build the terminfo
database later on.

Tested by:	manu, jbeich
2021-02-25 14:25:28 +01:00
Alex Richardson
5cf6f1c4bc 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
2021-02-01 09:32:07 +00:00