shithub: front

Download patch

ref: 68c5bc7ad25fc33585846b5121a08f3e141a082d
parent: 4a9c478b992167342863a85a3f614099bc434239
author: mia soweli <mia@soweli.net>
date: Sat Aug 16 14:59:18 EDT 2025

mkfile: use ar vr instead of ar vu

ar vu replaces only if the modification date has changed.  this is
problematic if you can build libc fast enough that the portable code
and architecture specific code end up with a close enough modification
time.

the portable files will not be replaced by the machine specific files,
which means code that uses locks will fail to link.

--- a/sys/src/cmd/cc/mkfile
+++ b/sys/src/cmd/cc/mkfile
@@ -37,7 +37,7 @@
 	date
 
 $LIB:	$LIBOBJ
-	ar vu $LIB $OFILES
+	ar vr $LIB $OFILES
 
 mac.$O: macbody
 
--- a/sys/src/cmd/ip/httpd/mkfile
+++ b/sys/src/cmd/ip/httpd/mkfile
@@ -53,7 +53,7 @@
 	sed 17q /tmp/search
 
 $LIBS:	$LIBSOFILES
-	ar vu $LIBS $newprereq
+	ar vr $LIBS $newprereq
 	rm $newprereq
 	# rm $newmember - cannot do this because of mk race
 
--- a/sys/src/cmd/mklib
+++ b/sys/src/cmd/mklib
@@ -9,7 +9,7 @@
 all:V:	$LIB
 
 $LIB:	$LIBOBJ
-	ar vu $LIB $newmember
+	ar vr $LIB $newmember
 
 %.$O:	$HFILES		# don't combine with following %.$O rules
 
--- a/sys/src/cmd/mksyslib
+++ b/sys/src/cmd/mksyslib
@@ -3,10 +3,10 @@
 all:V:	$LIB
 
 $LIB:V:	$OFILES			# force archive even when not needed
-	ar vu $LIB $newprereq
+	ar vr $LIB $newprereq
 
 &:n:	&.$O
-	ar vu $LIB $stem.$O
+	ar vr $LIB $stem.$O
 
 %.$O:	$HFILES			# don't combine with following %.$O rules
 
--- a/sys/src/libc/9syscall/mkfile
+++ b/sys/src/libc/9syscall/mkfile
@@ -148,7 +148,7 @@
 		}} > $i.s
 		$AS $i.s
 	}
-	ar vu /$objtype/lib/libc.a *.$O
+	ar vr /$objtype/lib/libc.a *.$O
 	rm -f *.$O *.s
 
 nuke clean:V:
--- a/sys/src/libc/port/mkfile
+++ b/sys/src/libc/port/mkfile
@@ -163,6 +163,6 @@
 $EXTRA:		$GEN
 
 extra:V:	$EXTRA
-	ar vu $LIB $prereq
+	ar vr $LIB $prereq
 
 regen:V:	$GEN
--