Commit graph

1489 commits

Author SHA1 Message Date
Ed Maste 0e34d09930 Add WITHOUT_LLVM_BINUTILS src.conf description
Before FreeBSD 15 I plan to switch to LLVM_BINUTILS by default.  Add the
src.conf description now, for the benefit of downstream branches and
testing/CI.

PR:		258872 [exp-run]
Sponsored by:	The FreeBSD Foundation
2024-06-10 11:50:32 -04:00
Warner Losh b661d9e64d Revert "checkstyle9.pl: Add check for missing space between ) {"
This reverts commit 6bad7d2486.

Turns out this special case wasn't necessary, and this was already
detected and due to another error (running the script got dropped
from my experimental scripts), I hadn't noticed.

Sponsored by:		Netflix
2024-05-29 11:18:00 -06:00
Warner Losh 6bad7d2486 checkstyle9.pl: Add check for missing space between ) {
Sponsored by:		Netflix
2024-05-29 09:59:27 -06:00
Warner Losh 0e03402139 cross-build: This is not glibc specific, but Linux specific
Neither glibc nor musl define these interfaces, so provide them for all
Linux builds.

Sponsored by:		Netflix
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45355
2024-05-26 11:39:27 -06:00
Warner Losh 3c5f0da510 cross-build: Define __*int*_t and include sys/cdefs.h
FreeBSD assumes that sys/types.h includes sys/cdefs.h, so add it here.
FreeBSD also needs __*int*_t defined for software we bootstrap (a lot of
it). GLIBC defines these, but musl does not, so we have to define them
here, even though it looks backwards. There's no good #define to key off
of, so use !defined GLIBC since on Linux defacto there's only two libc
implementations.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45354
2024-05-26 11:39:18 -06:00
Warner Losh 27326f895e cross-build: string.h uses mode_t, so we need sys/types.h
string.h defines strmode with a mode_t argument. POSIX states that one
must include sys/types.h to get mode_t, so do that here. This makes musl
happier. We know that sys/types.h will include sys/cdefs.h, so just
replace the latter with the former.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45353
2024-05-26 11:39:10 -06:00
Warner Losh 76efd90ab0 cross-build: Include sys/types.h from sys/param.h
FreeBSD has a style(9) enforced assumption that sys/param.h includes
sys/types.h. However, Linux under musl doesn't do this so go ahead and
explicitly include it here. It won't hurt on the glibc systems, and
helps musl.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45352
2024-05-26 11:39:02 -06:00
Warner Losh 4300e05361 build: Include sys/cdefs.h in our fcntl.h shim
On Linux with musl, sys/cdefs.h isn't included with fcntl.h, so when we
use __BEGIN_DECL and __END_DECL in this file, it fails. There's no harm
in unconditionally including sys/cdefs.h here, so do that to avoid
encoding exactly where it is or isn't needed so we don't have to know
too much about the internal state of other libc implementations.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45351
2024-05-26 11:38:55 -06:00
Warner Losh 917c0541e4 cross-tools: Document a rather bizarre looking construct
On Linux, stddef.h will define __size_t to something when size_t is
defined. On FreeBSD, __size_t is an actual typedef which we need for
other parts of the system. If __size_t isn't defined, that tells us we
need to define the fallback __size_t typedef (if it is defined, then we
can't easily redefine it without issues because glob.h will define it to
something different than stddef.h defines it). Add a comment to this
effect.

Sponsored by:		Netflix
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45350
2024-05-26 11:38:46 -06:00
Warner Losh 364c014d9b cross-tools: fts has different types for cmp routine
fts has different types for its compare rotuine. Other systems, not
4.4BSD based, have a non-const version. Before we tested against
__GLIBC__, but now we test against __linux__ because that's Linux's API
and musl doesn't define __GLIBC__.

In addition, link against libftl on this platform since musl doesn't
include ftl routines in libc, but rather in libftl.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45349
2024-05-26 11:38:30 -06:00
Val Packett 59aa64914a cross: Move Solaris API64 defines to common
off64_t is needed for both Linux (musl) and MacOS, so move them to the
common area. Somehow glibc provides the definition, but defining it
doesn't hurt and hels in the musl case.

Reviewed by: allanjude, jrtc27
Pull Request: https://github.com/freebsd/freebsd-src/pull/1066
2024-05-23 20:03:18 -06:00
Warner Losh 0115ad61d8 autofs: Fix cross-threading on file to delete
We want to delete the new file, which is installed in man4 not man5.

Noticed by:	Gary Jennejohn
Fixes:		a03e8a40d4
Sponsored by:	Netflix
2024-05-22 15:10:08 -06:00
Andrew Turner 82854693ae arm64: Allow userspace to be built with PAC and BTI
Add the WITH/WITHOUT_BRANCH_PROTECTION build flags. This can be used
to enable the use of pointer authentication (FEAT_PAuth) and branch
target identification (FEAT_BTI) in userspace.

The kernel already handles both of these is userspace, we just need
to enable it.

Leave disabled for a short period for this to settle before enabling.

Reviewed by:	emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42596
2024-05-22 17:02:26 +00:00
Brooks Davis 6edb14c006 Make WITHOUT_UNDEFINED_VERSION the default
Link with --no-undefined-version by default.  Will detect and prevent
the accidental removal of symbols from versioned libraries.

(cherry picked from commit 4510f2ca91)
This reverts commit b25ceb97ed.

Reviewed by:	arichardson, kib, dim, emaste
Differential Revision:	https://reviews.freebsd.org/D44216
2024-05-20 15:40:19 +01:00
Ed Maste 65fd76b5f5 makeman: extend duplicate option warning to OPT_ options
In a local tree I accidentally had OPT_INIT_ALL defaulting to zero in
userland and none in kernel.  This resulted in the INIT_ALL text
appearing twice in src.conf.5.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45184
2024-05-16 13:30:37 -04:00
Alexander Ziaee 1a720cbec5 man filesystems: fix xrefs after move to section 4
Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
2024-05-16 10:25:29 -06:00
Alexander Ziaee a03e8a40d4 man filesystems: ObsoleteFiles after move to sec 4
Reported by: imp
Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
2024-05-16 10:25:13 -06:00
Kyle Evans 9bfd3b4076 Add a build knob for _FORTIFY_SOURCE
In the future, we will Default to _FORTIFY_SOURCE=2 if SSP is enabled,
otherwise default to _FORTIFY_SOURCE=0.  For now we default it to 0
unconditionally to ease bisect across older versions without the new
symbols, and we'll put out a call for testing.

include/*.h include their ssp/*.h equivalents as needed based on the
knob. Programs and users are allowed to override FORTIFY_SOURCE in their
Makefiles or src.conf/make.conf to force it off.

Reviewed by:	des, markj
Relnotes:	yes
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32308
2024-05-13 00:23:50 -05:00
Warner Losh 758d02fb30 checkstyle9: Relax sob line requirement 2024-05-04 07:56:36 -06:00
Brooks Davis b25ceb97ed Revert "Make WITHOUT_UNDEFINED_VERSION the default"
This is causing failures on gcc13 CI builds so those need to be fixed
or worked around.

This reverts commit 4510f2ca91.
2024-05-02 22:55:08 +01:00
Brooks Davis 4510f2ca91 Make WITHOUT_UNDEFINED_VERSION the default
Link with --no-undefined-version by default.  Will detect and prevent
the accidental removal of symbols from versioned libraries.

Reviewed by:	arichardson, kib, dim, emaste
Differential Revision:	https://reviews.freebsd.org/D44216
2024-05-02 18:13:39 +01:00
Ed Maste b07689d1f2 beinstall: retire mergemaster support
Mergemaster has been deprecated for some time, and will be retired.

Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41799
2024-05-01 19:02:00 -04:00
Mateusz Piotrowski 42255af64a checkstyle9: Allow a space between "*" and _*restrict
Before the change, we would get errors like this:

    ERROR: "foo * bar" should be "foo *bar"
    #369: FILE: foobar.c:369:
    +barbaz(char * __restrict s,

Reviewed by:		des, imp
Sponsored by:		Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D44911
2024-04-25 11:51:25 +02:00
Warner Losh ea6f2d7797 checkstyle9.pl: Warn if there's no SOB line
If there's no Signed-off-by: line, complain.

Sponsored by:		Netflix
2024-04-23 14:04:08 -06:00
John Baldwin ee3187f6fa 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
2024-04-23 11:47:44 -07:00
Ed Maste 91d35fb663 Remove WITHOUT_CAPSICUM build support
Capsicum is non-optional as of c24c117b96 ("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
2024-04-23 08:26:28 -04:00
Cy Schubert f7f570eb97 tools: Remove stray "then"
Fixes:		26a09db3ad
2024-04-18 08:10:14 -07:00
Brooks Davis 26a09db3ad Fix incremental build with WITH_NVME newly enabled
rescue.mk doesn't get updated when options change so nvme_util.o is now
missing on architectures were NVME was previously marked BROKEN.

Reviewed by:	imp
Fixes:		2fda3ab0ac WITH_NVME: Remove from broken.
Differential Revision:	https://reviews.freebsd.org/D44826
2024-04-18 14:58:17 +01:00
Mark Johnston 11c79f9e35 arm64: Connect bhyve and libvmmapi to the build
Reviewed by:	corvink, andrew, jhb, emaste
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41742
2024-04-10 11:17:56 -04:00
Dimitry Andric cb14a3fe51 Merge llvm-project main llvmorg-18-init-15692-g007ed0dccd6a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-15692-g007ed0dccd6a.

PR:		276104
MFC after:	1 month
2024-04-06 22:13:06 +02:00
Dimitry Andric 5f757f3ff9 Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-15088-gd14ee76181fb.

PR:		276104
MFC after:	1 month
2024-04-06 22:11:55 +02:00
Olivier Cochard a927571469 OptionalObsoleteFiles: add missed cuda wrappers include files
Files introduced since clang 17.0.2.

Approved by:	dim
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D44597
2024-04-02 22:59:28 +02:00
Dag-Erling Smørgrav 125c4560bc usr.bin: Make lorder conditional on MK_TOOLCHAIN.
MFC after:	1 week
Reviewed by:	allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D44558
2024-04-01 15:18:35 +02:00
Brooks Davis d9108adbc0 lib{c,sys}: really fix incremental builds
Reported by:	andrew
Fixes:		a650ec0e55 lib{c,sys}: fix incremental builds
2024-03-18 18:52:42 +00:00
Baptiste Daroussin a42d6f7601 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
2024-03-15 09:22:16 +01:00
Brooks Davis a650ec0e55 lib{c,sys}: fix incremental builds
I removed lib/libsys/{aarch64,arm,riscv}/syscall.S in favor of an
idential generated version.  We need to clean out the .ddepend files to
ensure the generated version is actually generated.

The guard here is technically too strict, but should be fine in practice
and I've verified both the breakage and fix on an armv7 build.

Reported by:	imp
Fixes:		e6ffc7669a Remove pointless MD syscall(2)
Fixes:		0ee0ae2373 Remove pointless MD syscall(2)
Fixes:		7b3836c281 Remove pointless MD syscall(2)
2024-03-08 19:14:24 +00:00
Brooks Davis 2956f5885c Add an UNDEFINED_VERSION option
When enabled (current default) link with --undefined-version to allow
symbol maps to contain symbols not defined by libraries.  When disabled,
link with --no-undefined-version to disallow these bugs.

WITHOUT_UNDEFINED_VERSION is currently broken.  Once it is fixed it
should be made the default and this option should likely be removed.

Reviewed by:	dim, emaste
Differential Revision:	https://reviews.freebsd.org/D44169
2024-03-01 23:22:11 +00:00
Warner Losh 63e9c97664 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
2024-02-17 23:29:07 -07:00
Dimitry Andric 73ff7384e0 Optionally create full debuginfo for llvm-related executables
Commit de6feefdb7 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
2024-02-17 00:15:32 +01:00
Warner Losh 22d12caad6 checkstyle9.pl: Differentiate errors and warnings
Use ::error and ::warning as appropriate to give better meaning to the
messages.

Sponsored by:		Netflix
2024-02-02 00:24:32 -07:00
Warner Losh ac9abe93e8 checkstyle9.pl: Another correction to github workflow
Remove extra space...

Sponsored by:		Netflix
2024-02-01 23:27:37 -07:00
Warner Losh c2f5306c64 checkstyle9.pl: Correct github output
Change the : between file and line to a ,. This should fix this...

Sponsored by:		Netflix
2024-02-01 23:15:13 -07:00
Warner Losh 0949b237bb checkstyle9.pl: Add --github to output for github workflows
If you add "::error file=foo/bar.c:line=123:" before the error message,
it will appear inline.

Sponsored by:		Netflix
2024-02-01 22:50:19 -07:00
Gregory Neil Shapiro 1b6a5580c1 New sendmail 8.18.1 cf file 2024-02-01 00:13:58 +00:00
Jessica Clarke b771d5705f tools/build/make.py: Avoid Python 3.7+ subprocess.run capture_output
This is just a convenient alias for setting stdout and stderr to PIPE,
so substitute it for that to be compatible with Python 3.6.

Fixes:	69cfdc81ea ("tools/build/make.py: Keep bootstrapped bmake binary up-to-date")
2024-01-31 19:45:59 +00:00
Jessica Clarke edec803c5b tools/build/make.py: Add missing comma to fix tinderbox and worlds
The missing comma meant this was interpreted as a single target called
"tinderboxworlds", and so neither tinderbox nor worlds were recognised
as being MI targets (i.e. still required TARGET(_ARCH) to be given).

Fixes:	5157b451c6 ("tools/build/make.py: Grow the list of MI targets")
2024-01-20 22:07:48 +00:00
Warner Losh 57623b3b74 checkstyle9.pl: Soften the single line braces requirement
We inherited the error for single line statements needing braces from
the original script. Style(9) allow that, and could be read to encourage
that, but does not require that.

Sponsored by:		Netflix
2024-01-15 17:57:28 -07:00
Kyle Evans 5d1ecf0b61 build: only inspect the first word of toolchain tools
CC/CXX/CPP/LD may all have arguments supplied in various circumstances,
which break the logic here.  We only need to determine which of these
tools we're expecting to invoke from PATH, which just requires
examination of the first word.  Limit our scope to exactly that.

Patch suggested by:	jrtc27
Reviewed by:		imp, jrtc27
Differential Revision:	https://reviews.freebsd.org/D43372
2024-01-08 22:22:25 -06:00
Warner Losh 4748db6ffd checkstyle9.pl: Don't use $root if not defined
$root is only defined when given on the command line. Don't try to use
its value when it's not defined.

Sponsored by:		Netflix
2024-01-07 09:51:49 -07:00
Warner Losh 1e81724578 checkstyle9: Remove irrelevant stuff from qemu
Remove some qemu project specific things we don't care about

o Remove python interpreter check
o Remove linux header check
o Remove trace file specail treatment
o Add $FreeBSD$ tag additions
o Remove some experiemntal code we won't need
o Remove commented out initializer code that we don't explicitly have a
  rule for.

Sponsored by:		Netflix
2024-01-07 09:51:49 -07:00