From owner-svn-src-head@freebsd.org Thu May 26 23:20:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D347EB48294; Thu, 26 May 2016 23:20:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01BE21AEB; Thu, 26 May 2016 23:20:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKbLB070398; Thu, 26 May 2016 23:20:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKbIS070393; Thu, 26 May 2016 23:20:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKbIS070393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300806 - in head: . share/mk sys/sys usr.sbin/crunch/crunchgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:40 -0000 Author: bdrewery Date: Thu May 26 23:20:36 2016 New Revision: 300806 URL: https://svnweb.freebsd.org/changeset/base/300806 Log: WITH_AUTO_OBJ: Fix crunchgen builds. Passing MAKEOBJDIRPREFIX to the main prog build (rescue) would confuse WITH_AUTO_OBJ and cause it to create a recursed object directory that then broke the actual prog build. This is normally not a problem since we do not call 'make -f prog.mk obj' before building anything in it. Crunchgen(1) also assumes that if -o is not passed then if an object directory does not already exist then it should build in the source directories. The normal buildworld process will have already ran 'make obj' in each of the component directories so this is not a problem. With WITH_AUTO_OBJ though this is not the case. So we must tell crunchgen(1) that MK_AUTO_OBJ=yes will create the directory and to not require it be present before generating its Makefile. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/share/mk/bsd.crunchgen.mk head/sys/sys/param.h head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 26 23:20:33 2016 (r300805) +++ head/Makefile.inc1 Thu May 26 23:20:36 2016 (r300806) @@ -1570,9 +1570,15 @@ _dd= bin/dd # r277259 crunchide: Correct 64-bit section header offset # r281674 crunchide: always include both 32- and 64-bit ELF support -# r285986 crunchen: use STRIPBIN rather than STRIP .if ${BOOTSTRAPPING} < 1100078 -_crunch= usr.sbin/crunch +_crunchide= usr.sbin/crunch/crunchide +.endif + +# r285986 crunchen: use STRIPBIN rather than STRIP +# 1100113: Support MK_AUTO_OBJ +.if ${BOOTSTRAPPING} < 1100078 || \ + (${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} < 1100114) +_crunchgen= usr.sbin/crunch/crunchgen .endif .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 @@ -1661,7 +1667,8 @@ bootstrap-tools: .PHONY usr.bin/xinstall \ ${_gensnmptree} \ usr.sbin/config \ - ${_crunch} \ + ${_crunchide} \ + ${_crunchgen} \ ${_nmtree} \ ${_vtfontcvt} \ usr.bin/localedef Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:33 2016 (r300805) +++ head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:36 2016 (r300806) @@ -39,6 +39,10 @@ OUTC= ${PROG}.c OUTPUTS=${OUTMK} ${OUTC} ${PROG}.cache CRUNCHOBJS= ${.OBJDIR} CRUNCH_GENERATE_LINKS?= yes +# Don't let the prog.mk use MK_AUTO_OBJ, but do let the component builds use +# it. +CRUNCHENV+= MK_AUTO_OBJ=no +CRUNCH_BUILDOPTS+= MK_AUTO_OBJ=${MK_AUTO_OBJ} CLEANFILES+= ${CONF} *.o *.lo *.c *.mk *.cache *.a *.h @@ -103,12 +107,13 @@ ${CONF}: Makefile .endfor CRUNCHGEN?= crunchgen -CRUNCHENV?= MK_TESTS=no \ +CRUNCHENV+= MK_TESTS=no \ _RECURSING_CRUNCH=1 .ORDER: ${OUTPUTS} objs ${OUTPUTS:[1]}: .META ${OUTPUTS}: ${CONF} - MAKE=${MAKE} ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ + MAKE=${MAKE} ${CRUNCHENV:NMK_AUTO_OBJ=*} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ + MK_AUTO_OBJ=${MK_AUTO_OBJ} \ ${CRUNCHGEN} -fq -m ${OUTMK} -c ${OUTC} ${CONF} # Avoid redundantly calling 'make objs' which we've done by our # own dependencies. @@ -117,13 +122,14 @@ ${OUTPUTS}: ${CONF} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. ${PROG}: ${OUTPUTS} objs - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ + ${CRUNCHENV} \ CC="${CC} ${CFLAGS} ${LDFLAGS}" \ CXX="${CXX} ${CXXFLAGS} ${LDFLAGS}" \ ${MAKE} -f ${OUTMK} exe objs: ${OUTMK} - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f ${OUTMK} objs + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ + ${MAKE} -f ${OUTMK} objs # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu May 26 23:20:33 2016 (r300805) +++ head/sys/sys/param.h Thu May 26 23:20:36 2016 (r300806) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100113 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100114 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Thu May 26 23:20:33 2016 (r300805) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Thu May 26 23:20:36 2016 (r300806) @@ -670,8 +670,13 @@ fillin_program(prog_t *p) * an object directory already exists. */ if (!makeobj && !p->objdir && p->srcdir) { + char *auto_obj; + + auto_obj = NULL; snprintf(line, sizeof line, "%s/%s", objprefix, p->realsrcdir); - if (is_dir(line)) { + if (is_dir(line) || + ((auto_obj = getenv("MK_AUTO_OBJ")) != NULL && + strcmp(auto_obj, "yes") == 0)) { if ((p->objdir = strdup(line)) == NULL) out_of_memory(); } else