git: 18ae2f6f4b0e - stable/13 - depend-cleanup.sh: Handle commit cbdec8db18b5

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 13 Dec 2021 13:28:50 UTC
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=18ae2f6f4b0e4950db3180c2e1806bc24ddb74f3

commit 18ae2f6f4b0e4950db3180c2e1806bc24ddb74f3
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-12-07 16:18:45 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-12-13 13:27:24 +0000

    depend-cleanup.sh: Handle commit cbdec8db18b5
    
    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:          cbdec8db18b5 ("libc: Add pdfork to the list of interposed system calls")
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 187fe192ce0ab1fc9787840ddb4f721a72de5942)
---
 tools/build/depend-cleanup.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh
index ae393c2451f0..6055a6b33647 100755
--- a/tools/build/depend-cleanup.sh
+++ b/tools/build/depend-cleanup.sh
@@ -31,8 +31,11 @@ clean_dep()
 	if [ -e "$OBJTOP"/$1/.depend.$2.pico ] && \
 	    egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.pico; then \
 		echo "Removing stale dependencies for $2.$3"; \
-		rm -f "$OBJTOP"/$1/.depend.$2.* \
-		    "$OBJTOP"/obj-lib32/$1/.depend.$2.*
+		rm -f \
+		    "$OBJTOP"/$1/.depend.$2.* \
+		    "$OBJTOP"/$1/$2.*o \
+		    "$OBJTOP"/obj-lib32/$1/.depend.$2.* \
+		    "$OBJTOP"/obj-lib32/$1/$2.*o
 	fi
 }
 
@@ -72,4 +75,6 @@ if [ -e "$OBJTOP"/lib/ncurses/ncursesw ]; then
 fi
 
 # 20210608  f20893853e8e    move from atomic.S to atomic.c
-clean_dep cddl/lib/libspl      atomic S
+clean_dep   cddl/lib/libspl atomic S
+# 20211207  cbdec8db18b5    switch to libthr-friendly pdfork
+clean_dep   lib/libc        pdfork S