mtime of object file on ufs generated by as(1) is not updated
if touch(1) is run to the object file before as(1) running.
This phenomenon is exposed in S7+106541-15 and later however
it does not occur in S7+106541-14.
The test case consists of the following two files,
----------------------------------------------------------------
# cat a.s
.section ".text"
.global func
.align 4
func:
mov 0, %o0
retl
nop
----------------------------------------------------------------
# cat test.sh
#!/bin/csh
rm a.o
/usr/ccs/bin/as -o a.o -Qy -q a.s
ls -l a.o
sleep 60
/bin/touch a.o
ls -l a.o
sleep 60
/usr/ccs/bin/as -o a.o -Qy -q a.s
ls -l a.o
----------------------------------------------------------------
Log of reproduction test is below,
Solaris7 KU20 ================================================================
# uname -a
SunOS xxx 5.7 Generic_106541-20 sun4u sparc SUNW,Ultra-60
# ./test.sh
-rw-r--r-- 1 root other 452 5 30 14:39 a.o
-rw-r--r-- 1 root other 452 5 30 14:40 a.o
-rw-r--r-- 1 root other 452 5 30 14:40 a.o
Solaris7 KU15 ================================================================
# uname -a
SunOS xxx 5.7 Generic_106541-15 sun4u sparc SUNW,Ultra-60
# ./test.sh
-rw-r--r-- 1 root other 452 5 30 11:23 a.o
-rw-r--r-- 1 root other 452 5 30 11:24 a.o
-rw-r--r-- 1 root other 452 5 30 11:24 a.o
#
Solaris7 KU14 ================================================================
# uname -a
SunOS xxx 5.7 Generic_106541-14 sun4u sparc SUNW,Ultra-2
# ./test.sh
-rw-r--r-- 1 root other 452 5 30 11:23 a.o
-rw-r--r-- 1 root other 452 5 30 11:24 a.o
-rw-r--r-- 1 root other 452 5 30 11:25 a.o
#
Work Around
Run sync(1M) command after touch(1) command.
xxxxx@xxxxx.com 2003-07-09
usr /usr/ccs/bin/as from a Solaris 9 FCS system or later.
If you're using the make(1S) command for re-building object files, simply issue a "sync" before the "make". Whether you replace make with a shellscript that issues 'sync; make', shell-alias 'make' to "sync; make", or re-define $(MAKE) in your Makefiles doesn't matter - this problem always has a trivial workaround.