NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/58119: After system crash at running archiving libraries (ar) on -o log filesystem, remain libfoo.a at next reboot



>Number:         58119
>Category:       lib
>Synopsis:       After system crash at running archiving libraries (ar) on -o log filesystem, remain libfoo.a at next reboot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 06 12:30:01 +0000 2024
>Originator:     Kouichi Hashikawa
>Release:        NetBSD-current, 10
>Organization:
>Environment:
>Description:
After system crash at running ar(1) on filesystem mounted -o log,
at next boot, remain libfoo.a on the filesystem,
then skip ar libfoo.a at next build.sh.
User must remove libfoo.a by hand before next build.sh.

% ls -alrt
...
-rw-r--r--  1 hashikaw  hashikaw        8 Apr  6 20:47 libdns.a <---
drwxr-xr-x  2 hashikaw  hashikaw     4096 Apr  6 20:47 .
-rw-------  1 hashikaw  hashikaw  2031624 Apr  6 20:47 stkUBdTp
% 

>How-To-Repeat:

>Fix:
I think run ar like gcc -shared.

--- bsd.lib.mk-138922	2023-12-01 12:32:41.509694122 +0900
+++ bsd.lib.mk	2024-04-06 21:19:15.174932221 +0900
@@ -542,7 +542,8 @@
 __archivebuild: .USE
 	${_MKTARGET_BUILD}
 	@rm -f ${.TARGET}
-	${AR} ${_ARFL} ${.TARGET} $$(NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT})
+	${AR} ${_ARFL} ${.TARGET}.tmp $$(NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}) && \
+		${MV} ${.TARGET}.tmp ${.TARGET}
 .endif
 
 .if !target(__archiveinstall)



Home | Main Index | Thread Index | Old Index