Avoid half-written sys.o files
Avoid half-written sys.o files

Use .SECONDARY instead of temporary names to auto-delete incomplete sys.o

backport of 74d1669 and 24a7f2c
for #8518