Commit graph

1762 commits

Author SHA1 Message Date
Dimitry Andric 0e1e0ce556 Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the
last commit before the upstream release/17.x branch was created.

PR:		273753
MFC after:	1 month

(cherry picked from commit 06c3fb2749)
2024-01-08 00:04:38 +01:00
Alfredo Dal'Ava Junior f252e69e93 build target triple variable from sys/conf/newvers.sh
Retrieve FreeBSD revision number directly from sys/conf/newvers.sh
when building the compiler target triple value, avoiding manual
intervention on other files every new release.

Reviewed by:	imp
MFC after:	2 months
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D34429

(cherry picked from commit f9ee415674)
2024-01-08 00:04:32 +01:00
Dag-Erling Smørgrav fd5db125e7 Fix prebuild race between libpam and libtacplus.
Fixes:		21850106fd
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D40702

(cherry picked from commit bd9049eeff)
2023-12-13 17:08:13 +01:00
Baptiste Daroussin ff38a8c780 pkgbase: create package with SRCRELDATE not OSRELDATE as OSVERSION
In 188fe88ec5 OSVERSION has been set
to OSRELDATE which is the RELDATE of the building OS while we wanted
to use SRCRELDATE which is the RELDATE of the target system

(cherry picked from commit 051d69d6f8)
2023-12-04 11:38:33 +01:00
Baptiste Daroussin ee89da102b pkgbase: force OSVERSION
This is used to the package annotation helping pkg to know about
backward compatibility is set to the version of the packages not
the version of the host building the packages

(cherry picked from commit 188fe88ec5)
2023-12-04 11:38:33 +01:00
Baptiste Daroussin 8bc5e4f54b pkgbase: set a default set of kernel for when PACKAGE_BUILDING=1
PACKAGE_BUILDING is already known in the ports tree as a variable
use to defined when the packages is being actually built in an
automation process, reuse that variable to define the default set
of kernel we plan to build for the default pkgbase.

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

(cherry picked from commit df6e7e11c5)
2023-12-04 11:38:05 +01:00
Baptiste Daroussin 0a586dc5ed pkgbase: compress packages with zstandard
MFC After:	3 days
Reviewed by:	manu
Differential Revision: https://reviews.freebsd.org/D42375

(cherry picked from commit 820fbcf25b)
2023-12-04 11:37:51 +01:00
Ed Maste 227980df39 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

(cherry picked from commit 4e224e4be7)
(cherry picked from commit 4dbac528db)
(cherry picked from commit 54247ce1f9)
2023-10-10 09:36:10 -04:00
Ed Maste f098b537c9 Speed up *-old-* make targets by using sed instead of xargs
Targets like 'list-old-files' used "xargs -n1" to produce a list with
one file per line.  Using xargs resulted in one fork+exec for each
Argument, resulting in rather long runtime.  Instead, use sed to split
the list.  On one machine `make list-old-files` took 30s wall clock time
with xargs and less than 1s with sed.

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

(cherry picked from commit a8267ecc3d)
2023-10-10 09:36:10 -04:00
Warner Losh 023fc80ee3 Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit d0b2dbfa0e)
2023-08-23 11:43:30 -06:00
Jessica Clarke e7f1ba7f67 Makefile.inc1: Support building with macOS Ventura's AMFI Launch Constraints
As of macOS Ventura, Apple-signed binaries cannot be run if copied away from
their system location. This security feature doesn't really make sense for
boring things like sh(1), more so for applications with special entitlements,
but it's universally present, and results in the following error:

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

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

MFC after:	1 week

(cherry picked from commit dda4d97289)
2023-08-01 21:42:53 +01:00
Jessica Clarke f20cf1e5dc Makefile.inc1: Fix -DNO_ROOT distributeworld certctl usage
Currently for distributeworld we pass DESTDIR to certctl.sh as an
environment variable, which sets the default value in the script.
However, for -DNO_ROOT builds, CERTCTLFLAGS has METALOG_INSTALLFLAGS
which includes -D ${DESTDIR}, overriding the custom DESTDIR pointing at
the base dist directory.

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

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

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

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

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

(cherry picked from commit 7e45839aca)
2023-08-01 21:42:52 +01:00
Dimitry Andric 255d6c9fe5 Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR:		265425
MFC after:	2 weeks

(cherry picked from commit 81ad626541)
2023-04-09 16:54:45 +02:00
Alex Richardson 3eb107dd59 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

(cherry picked from commit 5cf6f1c4bc)
2023-03-22 08:22:07 -07:00
Jessica Clarke 3901be6a14 Makefile.inc1: Print the right PATH for missing install tool error
We override PATH for which but then go and print the non-overridden
PATH, which leads to rather confusing messages.

Fixes:	5bb9250e0a ("Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD")
(cherry picked from commit 4ebd18cf35)
2023-01-31 10:44:19 +01:00
Dag-Erling Smørgrav 93cc70bf9c Bring our tzcode up to date.
* Replay 2010[acflm] which had been merged but not recorded.
* Merge 2010n.
* Reorganize (unsplit) the code to match the upstream layout.
* Merge 2022[cdefg].

MFC after:      1 week
Sponsored by:   Klara, Inc.

(cherry picked from commit bc42155199)

tzcode: Address some compiler warnings.

MFC after:	1 week
Sponsored by:	Klara, Inc.

(cherry picked from commit d5c85ac652)

tzcode: Move configuration into separate header.

MFC after:	1 week
Sponsored by:	Klara, Inc.

(cherry picked from commit 394cf6719a)

tzcode: Remove access() again, cf. 02ba1d993f.

Reported by:	Coverity (CID 1250126)
MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38035

(cherry picked from commit 3e2e5eebfa)

tzcode: Avoid memory leak if pthread_setspecific() fails.

Reported by:	Coverity (CID 1018472, 1018474)
MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38036

(cherry picked from commit 96e68c393f)

tzcode: Fully initialize structs before use.

Reported by:	Coverity (CID 1502542, 1502548)
MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38037

(cherry picked from commit 55572cff58)

tzcode: Silence warnings.

* Ignore failure to remove our temp file.
* Avoid a minor memory leak in the -D case.

Reported by:	Coverity (CID 1502534, 1502535, 1502538)
MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38038

(cherry picked from commit 2aad7570f4)

depend-cleanup.sh: handle zic moving one level up.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38044

(cherry picked from commit 4a158fc030)

libc: Update mktime(3) / timegm(3) tests.

Sponsored by:	Klara, Inc.
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D38177

(cherry picked from commit d8c9f80891)

zoneinfo: On amd64, include 32-bit data.

While there, drop the unnecessary posixrules option.

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

(cherry picked from commit 783c318fd1)

tzcode: Document zic's -D option.

Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D38141

(cherry picked from commit a7b1b73935)

zoneinfo: Always produce fat zoneinfo files.

These aren't just needed for compatibility with i386 binaries (which need
the 32-bit section), but potentially also for compatibility with older
binaries on all platforms.

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

(cherry picked from commit f1021d27f7)

Fix cross-build from STABLE or older CURRENT.

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

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

(cherry picked from commit 7a4a520064)

Makefile.inc1: Restore adding tzsetup to _basic_bootstrap_tools

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

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

This partially reverts commit 7a4a520064.

Fixes:	7a4a520064 ("Fix cross-build from STABLE or older CURRENT.")
(cherry picked from commit d4fdfd3f90)
2023-01-31 10:44:19 +01:00
Colin Percival 3ec68505d6 13.2: update stable/13 to -PRERELEASE to start the release cycle
Approved by:	re (implicit)
Sponsored by:	https://www.patreon.com/cperciva
2023-01-27 16:59:24 -08:00
Ed Maste 689a5b1944 build: Use rm -fv for BATCH_DELETE_OLD_FILES
It's possible to have files with odd permissions in the tmproot (or
sysroot), causing rm to prompt for each one during e.g. buildworld.
Add -f to forcibly delete these.

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

(cherry picked from commit 470fb726f3)
2022-11-19 14:10:48 -05:00
Brooks Davis c9f9dc96d9 installworld: improve portability of ldd use
b3b462229f added a case statement to ignore lines containing strings
in square brackets such as "[vdso]" and "[preloaded]". On MacOS
Monterey where /bin/sh may be zsh, this fails with:

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

Invoke grep in the pipeline to remove such lines instead.

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

(cherry picked from commit bda5d2a45c)
2022-08-12 16:06:26 +01:00
Dimitry Andric b9ba9906b8 Bootstrap crunchgen after removing -dc from linker invocation
In ec81497cc7 crunchgen was updated to remove -dc from the linker
invocations in its generated makefile output, as this flag is no longer
necessary, and is going to be an error with lld 15.

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

Fixes:		ec81497cc7
MFC after:	3 days

(cherry picked from commit 93f5ab129a)
2022-07-17 20:36:31 +02:00
John Baldwin 84d246823e check/delete-old: Auto-generate lib32 entries for libraries.
- Add usr/lib32/libfoo.so.N for lib/libfoo.so.N.

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

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

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

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

(cherry picked from commit 77da558ceb)
2022-07-13 08:55:04 -07:00
John Baldwin 454aedb165 Use MOVED_LIBS for libraries moved between /usr/lib and /lib.
Add a MOVED_LIBS variable similar to OLD_LIBS except that MOVED_LIBS
is used for the cases that a library's name doesn't change, but it
just moves between /usr/lib and /lib.  This will be used by a future
change to auto-generate lib32 old files entries for which these cases
need to be ignored (a moved library remains in /usr/lib32).

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

(cherry picked from commit 57ba3f00f5)
2022-07-13 08:44:02 -07:00
John Baldwin e3f9397aea Add list-old-{dirs,files,libs} targets.
These targets generate a raw list of the candidate old files roughly
corresponding to the values of OLD_DIRS, OLD_FILES, and OLD_LIBS.
Currently list-old-files also includes uncompressed manpages in
addition to compressed manpages.

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

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

(cherry picked from commit 21baf42c57)
2022-07-13 08:22:24 -07:00
Dimitry Andric 74ff3f6395 Merge llvm-project release/14.x llvmorg-14-init-18315-g190be5457c90
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18315-g190be5457c90.

PR:		261742
MFC after:	2 weeks

(cherry picked from commit 1838bd0f48)
2022-06-04 13:59:32 +02:00
Kyle Evans 3afe1c2e18 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 ...")

(cherry picked from commit e2e2c622c3)
2022-05-19 10:05:53 -05:00
Ed Maste e10026a406 installworld: handle ldd including preloaded objects
The installworld target makes a temporary copy of binaries to be used
during the install.  Libraries that they depend on are also included,
found by using `ldd`.

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

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

(cherry picked from commit b3b462229f)
2022-04-03 20:40:31 -04:00
Glen Barber 9134a39850 13.1: update stable/13 to -PRERELEASE to start the release cycle
Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-02-23 23:21:49 -05:00
Ed Maste bc49561db7 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

(cherry picked from commit 1a724aa972)
2022-02-09 16:23:53 -05:00
Jessica Clarke c4290130df Makefile.inc1: Bootstrap libcrypt on non-FreeBSD for libroken
After f0a6ab51e6, we need libroken's dependencies to be present; in
particular, libcrypt is not present on macOS, and so needs to be
bootstrapped. We include this on Linux too for consistency and to avoid
future compatibility issues, even if strictly unnecessary currently.

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

(cherry picked from commit 8f7eb330f7)
2022-01-24 23:59:26 +00:00
Jessica Clarke 6318e220e3 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

(cherry picked from commit 8d5d329553)
2022-01-24 23:59:14 +00:00
Emmanuel Vadot d3546083b4 pkgbase: Track pkg 1.17
With pkg 1.17 the extention is always .pkg, packing_format is also now deprecated.

(cherry picked from commit 6cafdee71d)
2022-01-14 14:50:41 +01:00
Ed Maste 8402f6341e Build libclang also if LLDB is enabled
LLDB depends on libclang as it uses Clang as the expression parser.
Previously setting WITHOUT_CLANG but leaving LLDB enabled (as default)
resulted in a build failure.

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

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

(cherry picked from commit adc88b9c01)
2022-01-09 19:25:11 -05:00
Konstantin Belousov 1ca5b76438 kern.pre.mk: allow to use and customize elfdump during kernel build
(cherry picked from commit 9b135747a3)
2021-12-13 02:58:22 +02:00
Juraj Lutter ae39c0b6bc 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

(cherry picked from commit aaa4cd7f3c)
2021-12-07 08:43:51 +01:00
Marcin Wojtas a515ae8b63 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

(cherry picked from commit c6081dea59)
2021-12-06 17:08:16 -05:00
Alex Richardson a5186406ac 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

(cherry picked from commit 021385aba5)
2021-12-05 21:42:14 +01:00
Mark Johnston d364adc09c 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")

(cherry picked from commit 7b3642da21)
2021-11-29 09:27:49 -05:00
Greg V 4022f3eec4 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

(cherry picked from commit 9e9c651cac)
2021-11-29 09:26:35 -05:00
Warner Losh 8d5fd8e04f 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

(cherry picked from commit 27a04f5964)
2021-11-21 17:45:28 -07:00
Mateusz Piotrowski 49f3ad056e Makefile.inc1: Remove mentions of removed target "update"
This is follow-up to commits e290182bcf and 1f7d11e636.

(cherry picked from commit eab5358b90)
2021-10-31 20:29:51 +01:00
John Baldwin 16aa4787ca 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

(cherry picked from commit e290182bcf)
2021-10-19 16:53:24 -07:00
Jessica Clarke e515dd81ff 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

(cherry picked from commit 1e4c802913)
2021-09-07 13:08:18 +01:00
Jessica Clarke 92f73068bf 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

(cherry picked from commit ab3a18095f)
2021-09-07 13:08:18 +01:00
Bryan Drewery b2ea668b8f Fix native-xtools build
Fixes		https://github.com/freebsd/poudriere/issues/894
Fixes:		d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line")
X-MFC-With:	d0c737e18

(cherry picked from commit b60770fceb)
2021-09-07 13:06:46 +01:00
Alex Richardson ba91a76793 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")
(cherry picked from commit cc1345056b)
2021-08-18 09:34:11 +01:00
Mitchell Horne 952226eedb 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

(cherry picked from commit 61ed578ee6)
2021-08-11 13:56:28 -03:00
Mitchell Horne 19cbaf34a3 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

(cherry picked from commit bcd2f41f7d)
2021-08-11 13:53:16 -03:00
Alex Richardson 1d7c196d11 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

(cherry picked from commit 2de949cf85)
2021-08-05 10:00:56 +01:00
Alex Richardson b7440d235e Don't build lldb-tablegen if MK_LLDB=no
Split out from D31060.

Reviewed by:	emaste

(cherry picked from commit c5d1d88a35)
2021-08-05 10:00:28 +01:00
Mitchell Horne b44f0bd410 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

(cherry picked from commit 689c7e7975)
2021-07-29 12:01:10 -03:00