tech-toolchain archive

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

Deterministic C++ files



Hi all,
attached patch allows optionally creating deterministic C++ builds.
The patch has three rough corners:
(1) The build command gets quite a bit longer.
(2) BUILD_SEED and CXXSEED might not be the best variable names.
(3) It makes the output still depend on src and obj location.

If you have suggestions for (2), I'd like to hear them.
For (1) and (3) I am considering to replace ${NETBSDSRCDIR} with
^top/ and ${OBJDIR} with ^obj/ or something like that. It should make
the pathes shorter and still allow unique seeds per object file.

Missing part is an option for build.sh to set BUILD_SEED.

What do you think?

Joerg
Index: sys.mk
===================================================================
RCS file: /data/repo/netbsd/src/share/mk/sys.mk,v
retrieving revision 1.97
diff -u -p -r1.97 sys.mk
--- sys.mk      6 May 2008 22:19:11 -0000       1.97
+++ sys.mk      15 Jul 2008 20:49:31 -0000
@@ -51,7 +51,9 @@ LINK.c?=      ${CC} ${CFLAGS} ${CPPFLAGS} ${L
 CXX?=          c++
 CXXFLAGS?=     
${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-std=gnu99}
 
-COMPILE.cc?=   ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+CXXSEED?=      
${BUILD_SEED:D-frandom-seed=${BUILD_SEED:Q}/${.ALLSRC:O:Q}/${.TARGET:Q}}
+
+COMPILE.cc?=   ${CXX} ${CXXSEED} ${CXXFLAGS} ${CPPFLAGS} -c
 LINK.cc?=      ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
 
 OBJC?=         ${CC}


Home | Main Index | Thread Index | Old Index