| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
This attribute can be used to annotate char arrays that are not supposed to
be terminated with a NUL char and is needed to silence clang's new
-Wunterminated-string-initialization warning. The name matches linuxkpi.
Reviewed by: emaste, jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D52565
|
| |
|
|
|
|
|
|
|
| |
This is required when including stdckdint.h and doesn't seem to be
provided by older clang.
Reviewed by: emaste
Fixes: 7233893e9496 ("lib{c,openbsd}: use ckd_mul() for overflow checking in re(c)allocarray")
Differential Revision: https://reviews.freebsd.org/D52933
|
| |
|
|
| |
Fixes: 2e0caa7c7e14 ("libutil: Really fix expand_number(3)")
|
| |
|
|
|
|
| |
This is required to build libkrb5support.
Fixes: 7e35117eb07f ("Makefile: Hook MIT KRB5 into the build")
|
| |
|
|
|
|
|
|
|
| |
with enough glue to make libc/gen/err.c compilable.
Reported by: jhb
Reviewed by: jhb, jrtc27
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D51217
|
| |
|
|
|
|
| |
These will be needed by future changes to continue to allow building
makefs as a bootstrap tool on Linux and macOS. This also requires
defining __sbintime_t in our cross-build sys/_types.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are used by mtree and makefs, so in order to be able to set schg
on /var/empty in METALOG and set schg on various files and directories
in the resulting disk images we need to have a real implementation
rather than always giving no flags.
Ideally mtree wouldn't rely on round-tripping the textual flags field
via the "native" flags encoding using these functions, and ideally
makefs wouldn't rely on the "native" flags encoding matching FreeBSD's,
but in practice macOS's schg is the same and we can pretend Linux has
the same.
This fixes Linux-produced disk images lacking schg on any files or
directories, and Linux-produced distribution tarballs lacking schg on
/var/empty (note though that they do set schg on files, as install
already preserves file flags on Linux).
Reviewed by: emaste, markj
Differential Revision: https://reviews.freebsd.org/D50080
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
macOS added a native strchrnul in 15.4. There is not an easy way to
detect it at compile time, so use a macro to rename our local inline
version to avoid conflicts while also forcing its use during
bootstrap. The local version can be removed once macOS versions older
than 15.4 are no longer supported as build hosts.
Co-authored by: jrtc27
Reported by: kib
Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D49893
|
| |
|
|
|
|
|
|
|
|
| |
Add it to tools/build/Makefile with a short note of where it's needed,
rather than hamfistedly copying it into the tools/build hierarchy.
Reported by: jrtc27
Reviewed by: jrtc27
Fixes: aad507854efd13c43 ("Fix the cross-build after recent commits")
Differential Revision: https://reviews.freebsd.org/D46854
|
| |
|
|
|
|
|
|
|
|
|
| |
This creates a circular dependency for OpenZFS's libspl in sys/uio.h,
and it shouldn't be needed since the system limits.h already defines
IOV_MAX, so delete it, and unconditionally assert that to be the case.
Otherwise the re-include of libspl's sys/uio.h tries to use PAGESIZE
before it has been defined by OpenZFS's own sys/param.h.
Fixes: 7a7741af18d6 ("zfs: merge openzfs/zfs@b10992582")
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
| |
- Provide a sys/md4.h in the cross-build environment to fix bootstrap
of libmd.
- flua now exposes WTRAPPED which isn't incredibly common- make it
conditional, we probably won't be using it in any bootstrap context
any time soon.
Fixes: 442e0975ee4b3 ("Consolidate md4 implementations written in C")
Fixes: c2caf3b3313fe ("flua: posix: add more useful functions [...]")
|
| |
|
|
|
|
|
|
|
|
| |
The error was always returned, even after handling the sysctl, breaking
installworld under Linux.
Sponsored by: https://www.patreon.com/valpackett
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1376
|
| |
|
|
|
|
|
|
|
|
| |
GLIBC defines these, but MUSL does not. FreeBSD's bootstrap code uses
these defines, so define them if they aren't yet defined.
Co-authored-by: Val Packett <val@packett.cool>
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/1066
Differential Revision: https://reviews.freebsd.org/D45375
|
| |
|
|
|
|
|
|
|
|
|
| |
The logic in the makefile ensures this is only present on Linux, so no
ifdef is needed. I overlooked comments to the effect in the original
pull request somehow.
Fixes: 0e03402139da
Suggested by: arichards, jrtc27
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D45374
|
| |
|
|
|
|
|
|
|
|
|
| |
Move the cdefs.h inclusion to the Linux specific file. Either place will
work, but it makes more sense to do it in the Linux specific file since
it's a Linux specific workaround.
Fixes: 4300e053618f
Suggested by: arichards, jrtc27
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D45373
|
| |
|
|
|
|
|
| |
We build arc4random.c on non-FreeBSD, which now wants the header for
__ssp_real.
Fixes: d0b7445904f5 ("include: ssp: fortify <stdlib.h>")
|
| |
|
|
|
|
|
| |
This is a residual of the $FreeBSD$ removal.
MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
This is needed for kldxref, which will shortly become a bootstrap tool.
Linux can use the same one as FreeBSD (provided the cross-building
sys/cdefs.h is augmented appropriately), whilst macOS needs its own
Mach-O-specific implementation.
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D43049
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
| |
Ubuntu 23.10 uses glibc 2.38. This adds strlcpy and strlcmp so we need
to remove them from the cross build environment.
Reviewed by: jrtc27 (earlier version), arichardson
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42303
|
| |
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
|
| |
When building tar for linux, just disable HAVE_READPASSPHRASE
in config_freebsd.h and libarchive will provide for readpassphrase
Otherwise the two conflict.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Reviewed by: arichardson
Fixes: 68ca8363c7a1 ("libc: Use secure_getenv(3) where appropriate")
Differential Revision: https://reviews.freebsd.org/D39295
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit d6327ae8c11b73765f100981baca49166b558b70.
Before version 2.25, glibc's unistd.h would define the POSIX subset of
getopt.h by defining __need_getopt, including getopt.h (which would
disable the header guard) and then undefining it so later including
getopt.h explicitly would define the extensions. However, we wrap
getopt, and so the wrapper's #pragma once breaks that. Thus getopt.h was
included before the real unistd.h to ensure we get all the extensions.
However, with clang 12 that causes problems where we get a function
mismatch (since getopt can throw exceptions). If we include it after
unistd.h, it will get the full definitions since glibc no longer does
the subsetting thing. This will result in matching definitions and fix
clang 12.
Reviewed by: imp, jrtc27 (OK'd on irc)
Pull Request: https://github.com/freebsd/freebsd-src/pull/668
|
| |
|
|
|
|
|
| |
Now that make.py no longer has the described hack on Linux we can drop
this ugly workaround.
This reverts commit fba998a3d897e6297baca74068e4ec1db7adaeec.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Currently make.py has a hack to add the cross-build headers to the
include search path when bootstrapping bmake on Linux (but not macOS).
This is a bit of an abuse of these headers, and e9ba1fd5eda2 was not
prepared for this, since sys/bitcount.h won't exist in that instance (it
gets copied into WORLDTMP during the legacy build). Work around this
until we can wean the bmake bootstrap off using these headers by not
including sys/bitcount.h when it doesn't exist.
Fixes: e9ba1fd5eda2 ("tools/build: Provide FreeBSD's bitstring API when cross-building")
|
| |
|
|
|
|
|
|
|
| |
flsll is needed for makefs's new ZFS support, and the others are added
for completeness.
Reviewed by: emaste, arichardson
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Differential Revision: https://reviews.freebsd.org/D36134
|
| |
|
|
|
|
|
|
|
| |
This is needed for building makefs as a cross-tool since the ZFS code
uses these APIs.
Reviewed by: emaste
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Differential Revision: https://reviews.freebsd.org/D36133
|
| |
|
|
|
|
|
|
|
| |
Whilst the commit message documented some of the details, I had intended
to include this comment in the actual header, but failed to amend the
commit properly.
Fixes: 9e5b0d9eac5b ("cross-build: Fix bmake bootstrap with glibc 2.34")
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
As of glibc 2.34, our unistd.h wrapper's inclusion of stdlib.h exposes
fragility in glibc's sys/wait.h and corresponding part of stdlib.h,
leading to "error: use of undeclared identifier 'WNOHANG'" and similar
errors when bootstrapping bmake.
Work around this by wrapping sys/wait.h to force stdlib.h's inclusion
first before it's implicitly included during the problematic window in
sys/wait.h.
MFC after: 1 week
|
| |
|
|
|
| |
Fixes: 3aa0bc89c6a1 ("libdwarf: Add a weak uncompress() symbol")
MFC after: 1 week
|
| |
|
|
|
|
|
|
| |
Linux's pwd.h does not define _PASSWORD_EFMT1 (macOS's does), so we need
to define it in order to be able to bootstrap libcrypt (crypt-des.c uses
it) on non-FreeBSD, which will be done in a subsequent commit.
MFC after: 1 week
|
| |
|
|
|
|
|
|
| |
This is where it's defined in the base system, so is where libcrypt
expects it to exist when being built, and will be needed when being
bootstrapped in a subsequent commit.
MFC after: 1 week
|
| |
|
|
| |
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
There's two identical gid_from_group lines in a row. We only need one.
Ditto for uid_from_user().
Sponsored by: Netflix
Reviewed by: bapt, jrtc27
Differential Revision: https://reviews.freebsd.org/D32442
|
| |
|
|
|
|
|
| |
Add alignment macros to cross-build's sys/cdefs.h
Pull Request: https://github.com/freebsd/freebsd-src/pull/531
MFC after: immediately (build fix)
|
| |
|
|
|
|
|
|
|
|
| |
There is a __used member in glibc's posix_spawn_file_actions_t in
spawn.h, so we must temporarily undefine __used when including it,
otherwise Support/Unix/Program.inc fails to build. This is based on
similar handling for __unused in other headers.
Fixes: 31ba4ce8898f ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
This is needed to bootstrap llvm-tblgen on Linux since LLVM calls
`::open(...)` which does not work if open is a statement macro.
Also stop defining O_SHLOCK/O_EXLOCK and update the only bootstrap tools
user of those flags to deal with missing definitions.
Reviewed By: jrtc27
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31226
|
| |
|
|
|
|
|
| |
To match the libc changes.
Reviewed by: imp@
Pull Request: https://github.com/freebsd/freebsd-src/pull/493
|
| |
|
|
|
| |
This is already defined by the ncurses headers, so just undef it before
defining it again.
|