Source-Changes-HG archive

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

[src/trunk]: src/share/mk Build seed fixes:



details:   https://anonhg.NetBSD.org/src/rev/74848759a83b
branches:  trunk
changeset: 320516:74848759a83b
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jul 10 16:53:16 2018 +0000

description:
Build seed fixes:
    - use MKREPRO_TIMESTAMP as the seed if available.
    - skip relative paths that cannot be normalized if it is not
XXX: pullup-8

diffstat:

 share/mk/sys.mk |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 5988d1844874 -r 74848759a83b share/mk/sys.mk
--- a/share/mk/sys.mk   Tue Jul 10 16:49:09 2018 +0000
+++ b/share/mk/sys.mk   Tue Jul 10 16:53:16 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: sys.mk,v 1.134 2018/07/09 09:22:55 martin Exp $
+#      $NetBSD: sys.mk,v 1.135 2018/07/10 16:53:16 christos Exp $
 #      @(#)sys.mk      8.2 (Berkeley) 3/21/94
 #
 # This file contains the basic rules for make(1) and is read first
@@ -54,11 +54,20 @@
 # Remove -Wsystem-headers because C++ headers aren't clean of warnings
 CXXFLAGS?=     
${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu[0-9][0-9]:N-Wold-style-definition:N-Wno-format-zero-length:N-Wsystem-headers}
 
+.if defined(MKREPRO_TIMESTAMP) && !empty(MKREPRO_TIMESTAMP)
+# Use the timestamp as a seed
+__INITSEED=${MKREPRO_TIMESTAMP}
+.else
+# Use the sources, as the seed... Normalize all paths...
 __ALLSRC1=     ${empty(DESTDIR):?${.ALLSRC}:${.ALLSRC:S|^${DESTDIR}|^destdir|}}
 __ALLSRC2=     ${empty(MAKEOBJDIR):?${__ALLSRC1}:${__ALLSRC1:S|^${MAKEOBJDIR}|^obj|}}
 __ALLSRC3=     ${empty(NETBSDSRCDIR):?${__ALLSRC2}:${__ALLSRC2:S|^${NETBSDSRCDIR}|^src|}}
 __ALLSRC4=     ${empty(X11SRCDIR):?${__ALLSRC3}:${__ALLSRC3:S|^${X11SRCDIR}|^xsrc|}}
-__BUILDSEED=   ${BUILDSEED}/${__ALLSRC4:O}/${.TARGET}
+# Skip paths that contain relative components and can't be normalized, sort..
+__INITSEED=    ${__ALLSRC4:N*/../*:O}
+.endif
+
+__BUILDSEED=   ${BUILDSEED}/${__INITSEED}/${.TARGET}
 _CXXSEED?=     ${BUILDSEED:D-frandom-seed=${__BUILDSEED:hash}}
 
 COMPILE.cc?=   echo "random-seed is ${__BUILDSEED}"; ${CXX} ${_CXXSEED} ${CXXFLAGS} ${DTRACE_OPTS} ${CPPFLAGS} -c



Home | Main Index | Thread Index | Old Index