Commit Graph

33 Commits

Author SHA1 Message Date
Warner Losh
d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Dimitry Andric
d5af300a69 Fix incremental builds after GoogleTest update
At the moment, several Makefiles under tests/ do not correctly generate
.depend files, which can lead to link errors when doing incremental
(e.g. WITHOUT_CLEAN) builds:

  ld: error: undefined symbol: testing::internal::g_linked_ptr_mutex
  >>> referenced by gtest-port.h:2137 (/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-port.h:2137)
  >>>               mockfs.o:(testing::internal::linked_ptr_internal::depart())
  >>> referenced by gtest-port.h:2139 (/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-port.h:2139)
  >>>               mockfs.o:(testing::internal::linked_ptr_internal::depart())
  >>> referenced by gtest-port.h:2139 (/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-port.h:2139)
  >>>               mockfs.o:(testing::internal::linked_ptr_internal::depart())
  >>> referenced 3 more times

For the time being, put in a depend-cleanup.sh workaround for this.

Reported by:	des
Reviewed by:	emaste
Fixes:		28f6c2f292
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D41476
2023-08-16 19:39:22 +02:00
Jessica Clarke
81805ec300 depend-cleanup.sh: Generalise lib32 code and avoid duplication
By passing through _ALL_libcompats we can avoid hard-coding the list of
libcompats in depend-cleanup.sh. This cleanup also makes clean_dep
shorter by using a loop instead of handling each case explicitly (at the
expense of slightly tweaked logging).

Reviewed by:	brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D41187
2023-07-27 05:10:47 +01:00
Kyle Evans
e74bc7757a lib/libc/string/ffs*.c: fix problems introduced with D40730
Remove stale dependencies on the remaining old assembly
ffs*/fls* implementations.

Sponsored by:	FreeBSD Foundation
Reported by:	jlduran@gmail.com, jhb
Fixes:		ee8b0c43 (D40730)
Approved by:	jhb
Differential Revision: https://reviews.freebsd.org/D40966
2023-07-14 22:23:31 +02:00
Jessica Clarke
1ec7cb1b5d depend-cleanup: Add verbose (-v) and pretend/dry-run (-n) flags
These are useful for testing new additions to the script. Whilst here,
harden the script a little and improve error messages.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D31007
2023-07-11 01:53:04 +01:00
Jessica Clarke
c70dd03a7f Make sure MACHINE(_ARCH) are exported for depend-cleanup.sh
We run depend-cleanup.sh twice during the build. The second time is the
normal run, where we run it under WMAKEENV and thus have CROSSENV's
MACHINE(_ARCH)=${TARGET(_ARCH)} in the environment. However, the first
time is for bootstrap-tools, where it's run under BMAKEENV and we don't
have any assignments to MACHINE(_ARCH) in the environment, meaning the
script sees them as unset. In practice this doesn't matter since the
only use doesn't apply to bootstrap-tools, but it could be a future
issue. Thus, explicitly export them for depend-cleanup.sh and have the
script verify they're set.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D40968
2023-07-11 01:53:04 +01:00
Jessica Clarke
f3674213e3 depend-cleanup.sh: Fix whitespace
Fixes:	45c4ff15e3 ("depend-cleanup.sh: Handle libc bcmp.S moving to bcmp.c on amd64.")
2023-07-11 00:18:15 +01:00
Dimitry Andric
ce4846ae75 depend-cleanup.sh: cleanup stale ffs.S dependencies for arm and i386
Now that depend-cleanup.sh handles 32-bit dependencies a bit better, get
rid of the stale ffs.S ones, otherwise an incremental build on amd64
will fail with:

  cc: error: no such file or directory: '/usr/src/lib/libc/i386/string/ffs.S'

Fixes:		ee8b0c436d
2023-07-11 00:57:33 +02:00
Dimitry Andric
7ba8cc9b7b depend-cleanup.sh: handle 32-bit dependencies having no 64-bit equivalent
For example with the recent removal of ffs.S for 32-bit arm and i386,
the egrep in clean_dep() did not find any files to remove, even if you
added a "clean_dep lib/libc ffs S" line. This is because it will never
find the ffs.S filename in the 64-bit .depend files for libc.

Split the searching and removing of 32-bit dependencies and objects into
a separate part to cope with this. This can be used similarly later on,
for other bitnesses.

MFC after:	3 days
2023-07-11 00:57:33 +02:00
Ed Maste
229d643c4d depend-cleanup: apply big hammer for OpenSSL 3.0 update
If we find an object corresponding to a source file that existed in
OpenSSL 1.1.1 but not in 3.0 just remove all of the OpenSSL objdirs.

Reviewed by:	dhw
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40750
2023-06-24 19:46:09 -04:00
John Baldwin
77d2a2d065 depend-cleanup.sh: Handle kqueue1() becoming a wrapper around kqueuex().
For a brief period kqueue1() was a system call and stale dependencies
cause it to not be re-built.
2023-04-24 14:05:18 -07:00
Kyle Evans
ee3872a714 tools: cleanup stale dependencies from further config(8) C++ification
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D38276
2023-02-08 23:19:09 -06:00
Dag-Erling Smørgrav
0dfaefa975 depend-cleanup.sh: Simplify the logic, and clean bootstrap tools.
* There's no need to check if the file exists before grepping it; if it does not exist, grep will fail, which is what we want.  Just redirect the error message to /dev/null.
* There's no need to split the .o and .pico cases; the bodies are identical, so combine the conditions.  Use a glob to avoid a false negative if one exists but not the other.
* Also run depend-cleanup.sh on the bootstrap build tree.  This unbreaks the build after 29c5f8bf9a.

Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D38447
2023-02-08 23:59:13 +01:00
Kyle Evans
4e86369417 tools: cleanup stale dependencies from recent config(8) change
mkmakefile.c moved to mkmakefile.cc, let's preemptively handle it.

Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D38275
2023-02-08 00:09:57 -06:00
Dag-Erling Smørgrav
4a158fc030 depend-cleanup.sh: handle zic moving one level up.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38044
2023-01-14 18:17:22 +01:00
John Baldwin
838a061417 depend-cleanup.sh: Handle rs(1) moving to C++.
To support changes in filenames for programs (and not just libraries),
update clean_dep() to check .depend.foo.o files as well as
.depend.foo.pico files.
2022-11-15 21:17:28 -08:00
John Baldwin
a985fad6e0 depend-cleanup.sh: Handle kqtest being renamed to kqueue_test.
bmake will not think that object files such as read.o are out of date
due to common.h changing since the dependency is only recorded in
.depend.kqtest.read.o in an old object directory.

Reviewed by:	markj
Fixes:		68fe988a40 kqueue tests: Simplify the test runner
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35820
2022-07-14 13:03:59 -07:00
Mateusz Guzik
abb5b512bb depend-cleanup.sh: Handle libc bcmp.c moving back to bcmp.S on amd64 2022-03-26 09:11:31 +00:00
John Baldwin
45c4ff15e3 depend-cleanup.sh: Handle libc bcmp.S moving to bcmp.c on amd64.
Reviewed by:	emaste
Fixes:		5fc3cc2713 ("amd64: make bcmp in libc just call memcmp")
Differential Revision:	https://reviews.freebsd.org/D34676
2022-03-25 11:03:18 -07:00
John Baldwin
dda9847275 depend-cleanup.sh: Handle stale libc++.so ldscripts.
libc++ was moved from /usr/lib to /lib, but the libc++.so linker
script is not regenerated when the value of SHLIB changes.

Reported by:	cy
2021-12-30 14:25:47 -08:00
Mark Johnston
73db11a4d1 depend-cleanup.sh: Make the output message more precise
Sponsored by:	The FreeBSD Foundation
2021-12-07 13:01:05 -05:00
Mark Johnston
187fe192ce depend-cleanup.sh: Handle commit cbdec8db18
That commit changed libc to use the MI pdfork implementation, but with
an incremental build the object file for the pdfork.S stub lingers and
causes a linker error.

Cleaning the depend file is not enouch, so modify clean_deps() to remove
object files as well, and add a call to ensure that pdfork.*o is
cleaned.  The new file is _pdfork.o.

Reported by:	jhb
Reviewed by:	emaste
Fixes:		cbdec8db18 ("libc: Add pdfork to the list of interposed system calls")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33322
2021-12-07 12:59:35 -05:00
Warner Losh
dbbf7cb21c libspl: fix NO_CLEAN build
atomic.S moved to atomic.c, update the cleaup script to remove stale
dependencies for this.

Sponsored by:		Netflix
2021-06-08 17:56:15 -06:00
Kyle Evans
14a16fd3e7 build: add WITHOUT_CLEAN workaround for 821aa63a09
The *w variants of ncurses directories went away, and the remaining names
build the widechar variants instead of non-widechar variants. As such, the
entire ncurses tree should be regenerated.

Key off of lib/ncurses/ncursesw being present and remove the whole ncurses
hierarchy if it is.

Reviewed by:	emaste (IRC)
2021-01-08 10:43:53 -06:00
Kristof Provost
c38e59ce1b pfctl: Fix NOCLEAN build
We've created a new pf_ruleset.c file for pfctl and no longer use the
kernel vrsion, but the build system doesn't handle this dependency
change correctly. Delete the dependency file if it contains the kernel
version of the file.

MFC after:	2 weeks
2021-01-06 22:07:46 +01:00
Kyle Evans
fe815331bb build: provide a default WARNS for all in-tree builds
The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by:	emaste, brooks, ngie (all earlier version)
Reviewed by:	emaste, arichardson (depend-cleanup.sh change)
Differential Revision:	https://reviews.freebsd.org/D26455
2020-09-18 17:17:46 +00:00
Ed Maste
1fde305191 retire an old NO_CLEAN dependency cleanup hack
We have some hacks to remove stale dependency files for NO_CLEAN
builds that are missed by make's dependency handling.  These are
intended to upport ongoing NO_CLEAN builds, and are no longer needed
after a sufficient amount of time elapses.
2020-09-08 00:15:18 +00:00
Ed Maste
6a5646afe5 Apply a big hammer for stale pre-OpenZFS files
-DNO_CLEAN builds have had trouble across the OpenZFS import.  It's not
worth the effort to try to address this with any granularity; instead,
just trigger on a .depend file indicating a tree from before the import,
and remove the whole cddl object tree.

Reviewed by:	mmacy, kevans
Differential Revision:	https://reviews.freebsd.org/D26189
2020-08-26 04:01:06 +00:00
Ed Maste
0bdf7b18d1 depend-cleanup.sh: add a note about removing old entries 2020-08-26 03:41:29 +00:00
Kyle Evans
7d03e08112 Mark closefrom(2) COMPAT12, reimplement in libc to wrap close_range
Include a temporarily compatibility shim as well for kernels predating
close_range, since closefrom is used in some critical areas.

Reviewed by:	markj (previous version), kib
Differential Revision:	https://reviews.freebsd.org/D24399
2020-04-14 18:07:42 +00:00
Kyle Evans
18041d4ec5 depend-cleanup: fix typo, ^/lib/libc/sys/Makefile.inc generates .S stubs
Pointy hat:	kevans
2020-04-13 20:00:44 +00:00
Kyle Evans
6fe257c780 Move shm_open dependency cleanup into a new home
r359461 introduced this nifty script to centralize these things, so add
shm_open.c there to remove a total of one (1) bad example from
Makefile.inc1.

Looked over by:	emaste
2020-04-13 19:50:47 +00:00
Ed Maste
4dad87a498 add shell script for stale dependency hack
It's rather awkward to debug issues with the dependency cleanup hacks
when implemented via make.  Add a cleanup shell script and move the
libomp hack there as an initial example.

Reviewed by:	brooks
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24228
2020-03-30 20:20:15 +00:00