From owner-svn-src-head@freebsd.org Mon Apr 18 18:14:00 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 32CBAB13D3E; Mon, 18 Apr 2016 18:14:00 +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 034D0152A; Mon, 18 Apr 2016 18:13:59 +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 u3IIDxtt059253; Mon, 18 Apr 2016 18:13:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3IIDwHo059248; Mon, 18 Apr 2016 18:13:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604181813.u3IIDwHo059248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 18 Apr 2016 18:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298218 - in head/gnu: lib/csu lib/libgcc lib/libgcov usr.bin/cc/cc_tools 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.21 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: Mon, 18 Apr 2016 18:14:00 -0000 Author: bdrewery Date: Mon Apr 18 18:13:58 2016 New Revision: 298218 URL: https://svnweb.freebsd.org/changeset/base/298218 Log: Follow-up r297842: Rework header generation to fix always rebuilding. This reworks the handling of common headers to just include the needed logic rather than invoke MAKE. This avoids the problem listed in r297842 and avoids other dependency tracking issues. Pointyhat to: bdrewery Reported by: Nikolai Lifanov Sponsored by: EMC / Isilon Storage Division Added: head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs (contents, props changed) Modified: head/gnu/lib/csu/Makefile head/gnu/lib/libgcc/Makefile head/gnu/lib/libgcov/Makefile head/gnu/usr.bin/cc/cc_tools/Makefile Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Mon Apr 18 18:12:12 2016 (r298217) +++ head/gnu/lib/csu/Makefile Mon Apr 18 18:13:58 2016 (r298218) @@ -7,10 +7,11 @@ GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs CCDIR= ${.CURDIR}/../../usr.bin/cc .include "${CCDIR}/Makefile.tgt" +.include "${CCDIR}/cc_tools/Makefile.hdrs" .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR} -SRCS= crtstuff.c tconfig.h tm.h options.h +SRCS= crtstuff.c ${COMMONHDRS} OBJS= crtbegin.o crtend.o crtbeginT.o SOBJS= crtbeginS.o crtendS.o CSTD?= gnu89 @@ -70,8 +71,7 @@ crtendS.o: ${ENDSRC} ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \ -c -o ${.TARGET} ${.ALLSRC:N*.h} -CLEANFILES+= tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h -tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile .PHONY - (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) +COMMONHDRS+= tm.h tconfig.h options.h +CLEANFILES+= ${COMMONHDRS} optionlist cs-tconfig.h cs-tm.h .include Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Mon Apr 18 18:12:12 2016 (r298217) +++ head/gnu/lib/libgcc/Makefile Mon Apr 18 18:13:58 2016 (r298218) @@ -3,6 +3,7 @@ PACKAGE= clibs GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs +CCDIR= ${.CURDIR}/../../usr.bin/cc COMPILERRTDIR= ${.CURDIR}/../../../contrib/compiler-rt UNWINDINCDIR= ${.CURDIR}/../../../contrib/llvm/projects/libunwind/include UNWINDSRCDIR= ${.CURDIR}/../../../contrib/llvm/projects/libunwind/src @@ -17,7 +18,8 @@ SHLIBDIR?= /lib # MK_SSP= no -.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" +.include "${CCDIR}/Makefile.tgt" +.include "${CCDIR}/cc_tools/Makefile.hdrs" .if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI @@ -29,7 +31,7 @@ CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_F -DHAVE_GTHR_DEFAULT \ -I${GCCLIB}/include \ -I${GCCDIR}/config -I${GCCDIR} -I. \ - -I${.CURDIR}/../../usr.bin/cc/cc_tools + -I${CCDIR}/cc_tools LDFLAGS+= -nodefaultlibs LIBADD+= c @@ -340,13 +342,6 @@ ${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS .endfor -#----------------------------------------------------------------------- -# -# Generated headers -# -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY - (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) - CLEANFILES += ${COMMONHDRS} CLEANFILES += cs-*.h option* Modified: head/gnu/lib/libgcov/Makefile ============================================================================== --- head/gnu/lib/libgcov/Makefile Mon Apr 18 18:12:12 2016 (r298217) +++ head/gnu/lib/libgcov/Makefile Mon Apr 18 18:13:58 2016 (r298218) @@ -4,17 +4,20 @@ MK_PROFILE= no MK_SSP= no .include -.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs +CCDIR= ${.CURDIR}/../../usr.bin/cc +.include "${CCDIR}/Makefile.tgt" +.include "${CCDIR}/cc_tools/Makefile.hdrs" + .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR} LIB= gcov CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED CFLAGS+= -D_PTHREADS -DGTHREAD_USE_WEAK -CFLAGS+= -I${.CURDIR}/../../usr.bin/cc/cc_tools \ +CFLAGS+= -I${CCDIR}/cc_tools \ -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. .if ${TARGET_CPUARCH} == "arm" @@ -45,9 +48,6 @@ CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DS COMMONHDRS= tm.h tconfig.h gcov-iov.h options.h CLEANFILES+= ${COMMONHDRS} cs-tm.h cs-tconfig.h options.h optionlist -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY - (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) - ${OBJS} beforedepend: ${COMMONHDRS} ${OBJS_T}: libgcov.c Modified: head/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile Mon Apr 18 18:12:12 2016 (r298217) +++ head/gnu/usr.bin/cc/cc_tools/Makefile Mon Apr 18 18:13:58 2016 (r298218) @@ -5,6 +5,9 @@ CFLAGS+= -I. .include "../Makefile.inc" +# Some of the logic needed in here is defined in Makefile.hdrs as it is shared +# with gnu/lib. +.include "Makefile.hdrs" CFLAGS+= -g CFLAGS+= -DGENERATOR_FILE -DHAVE_CONFIG_H @@ -21,51 +24,6 @@ LIBIBERTY= libiberty.a # # The list of headers to go into tm.h # -TARGET_INC+= options.h -.if ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= i386/biarch64.h -.endif -.if ${TARGET_CPUARCH} != "arm" -TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h -.endif -.if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= ${GCC_CPU}/unix.h -TARGET_INC+= ${GCC_CPU}/att.h -.endif -TARGET_INC+= dbxelf.h -TARGET_INC+= elfos-undef.h -TARGET_INC+= elfos.h -TARGET_INC+= freebsd-native.h -TARGET_INC+= freebsd-spec.h -TARGET_INC+= freebsd.h -.if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64" -. if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h) -TARGET_INC+= ${GCC_CPU}/sysv4.h -. endif -.endif -.if ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= ${GCC_CPU}/x86-64.h -.endif -.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips" -TARGET_INC+= ${GCC_CPU}/elf.h -.endif -.if ${TARGET_CPUARCH} == "arm" -TARGET_INC+= ${GCC_CPU}/aout.h -TARGET_INC+= ${GCC_CPU}/bpabi.h -.endif -.if ${TARGET_ARCH} == "powerpc64" -TARGET_INC+= ${GCC_CPU}/biarch64.h -TARGET_INC+= ${GCC_CPU}/default64.h -.endif -TARGET_INC+= ${GCC_CPU}/freebsd.h -.if ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= ${GCC_CPU}/freebsd64.h -.endif -.if ${TARGET_CPUARCH} == "arm" -TARGET_INC+= ${GCC_CPU}/arm.h -.endif -TARGET_INC+= defaults.h - .for H in ${TARGET_INC} .for D in ${GCCDIR}/config ${GCCDIR} ${.CURDIR} .if exists($D/$H) @@ -155,31 +113,6 @@ TREE_DEF_FILES= TREE_DEF_FILES+= cp/cp-tree.def .endif -# -# Option files. -# -OPT_FILES= c.opt common.opt - -.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt) -OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt -.endif - -.if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt) -OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt -.endif - -.if ${TARGET_CPUARCH} == "powerpc" -OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt -.endif - -.if ${TARGET_CPUARCH} == "sparc64" -OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt -.endif - -.if exists(${.CURDIR}/freebsd.opt) -OPT_FILES+= ${.CURDIR}/freebsd.opt -.endif - #----------------------------------------------------------------------- # Build rules for header files and generator tools @@ -207,41 +140,13 @@ GENSRCS+= bconfig.h CLEANFILES+= cs-bconfig.h # tconfig.h -tconfig.h: - TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ - HEADERS="auto-host.h ansidecl.h" \ - DEFINES="USED_FOR_TARGET" \ - /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} - GENSRCS+= tconfig.h CLEANFILES+= cs-tconfig.h # Options -optionlist: ${OPT_FILES} - LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET} - -options.h: optionlist - LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ - -f ${GCCDIR}/opth-gen.awk \ - < ${.ALLSRC} > ${.TARGET} - -options.c: optionlist - LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ - -f ${GCCDIR}/optc-gen.awk \ - -v header_name="config.h system.h coretypes.h tm.h" \ - < ${.ALLSRC} > ${.TARGET} GENONLY+= optionlist options.h options.c # Target machine config -tm.h: - TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ - HEADERS="${TARGET_INC}" \ - DEFINES="" \ - /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} -.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def) - echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET} -.endif - GENSRCS+= tm.h CLEANFILES+= cs-tm.h @@ -294,9 +199,6 @@ gtyp-gen.h: ${GTFILES} GENSRCS+= gtyp-gen.h # Version header for gcov -gcov-iov.h: - echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET} - GENSRCS+= gcov-iov.h # Multilib config file @@ -346,20 +248,8 @@ gstdint.h: GENSRCS+= gstdint.h # Linked headers -gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA - ln -sf ${.ALLSRC} ${.TARGET} - GENSRCS+= gthr-default.h -.if ${TARGET_CPUARCH} == "arm" -unwind.h: ${GCCDIR}/config/arm/unwind-arm.h -.else -unwind.h: ${GCCDIR}/unwind-generic.h -.endif - -unwind.h: .NOMETA - ln -sf ${.ALLSRC} ${.TARGET} - GENSRCS+= unwind.h # Added: head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs Mon Apr 18 18:13:58 2016 (r298218) @@ -0,0 +1,132 @@ +# $FreeBSD$ +# +# This is logic for common headers shared inside of gnu/lib. It used to +# live in gnu/usr.bin/cc/cc_tools/Makefile. + +.if !defined(TARGET_CPUARCH) || !defined(GCC_CPU) +.error ${.CURDIR}: Must include gnu/usr.bin/cc/Makefile.tgt first. +.endif + +# +# The list of headers to go into tm.h +# +TARGET_INC+= options.h +.if ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= i386/biarch64.h +.endif +.if ${TARGET_CPUARCH} != "arm" +TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h +.endif +.if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= ${GCC_CPU}/unix.h +TARGET_INC+= ${GCC_CPU}/att.h +.endif +TARGET_INC+= dbxelf.h +TARGET_INC+= elfos-undef.h +TARGET_INC+= elfos.h +TARGET_INC+= freebsd-native.h +TARGET_INC+= freebsd-spec.h +TARGET_INC+= freebsd.h +.if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64" +. if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h) +TARGET_INC+= ${GCC_CPU}/sysv4.h +. endif +.endif +.if ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= ${GCC_CPU}/x86-64.h +.endif +.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips" +TARGET_INC+= ${GCC_CPU}/elf.h +.endif +.if ${TARGET_CPUARCH} == "arm" +TARGET_INC+= ${GCC_CPU}/aout.h +TARGET_INC+= ${GCC_CPU}/bpabi.h +.endif +.if ${TARGET_ARCH} == "powerpc64" +TARGET_INC+= ${GCC_CPU}/biarch64.h +TARGET_INC+= ${GCC_CPU}/default64.h +.endif +TARGET_INC+= ${GCC_CPU}/freebsd.h +.if ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= ${GCC_CPU}/freebsd64.h +.endif +.if ${TARGET_CPUARCH} == "arm" +TARGET_INC+= ${GCC_CPU}/arm.h +.endif +TARGET_INC+= defaults.h + +# +# Option files. +# +OPT_FILES= c.opt common.opt + +.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt) +OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt +.endif + +.if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt) +OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt +.endif + +.if ${TARGET_CPUARCH} == "powerpc" +OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt +.endif + +.if ${TARGET_CPUARCH} == "sparc64" +OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt +.endif + +.if exists(${.CURDIR}/freebsd.opt) +OPT_FILES+= ${.CURDIR}/freebsd.opt +.endif + + +# Options +optionlist: ${OPT_FILES} + LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET} + +options.h: optionlist + LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ + -f ${GCCDIR}/opth-gen.awk \ + < ${.ALLSRC} > ${.TARGET} + +options.c: optionlist + LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ + -f ${GCCDIR}/optc-gen.awk \ + -v header_name="config.h system.h coretypes.h tm.h" \ + < ${.ALLSRC} > ${.TARGET} + +# Target machine config +tm.h: + TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ + HEADERS="${TARGET_INC}" \ + DEFINES="" \ + /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} +.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def) + echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET} +.endif + +# tconfig.h +tconfig.h: + TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ + HEADERS="auto-host.h ansidecl.h" \ + DEFINES="USED_FOR_TARGET" \ + /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} + +# Version header for gcov +gcov-iov.h: + echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET} + +# Linked headers +gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA + ln -sf ${.ALLSRC} ${.TARGET} + +.if ${TARGET_CPUARCH} == "arm" +unwind.h: ${GCCDIR}/config/arm/unwind-arm.h +.else +unwind.h: ${GCCDIR}/unwind-generic.h +.endif + +unwind.h: .NOMETA + ln -sf ${.ALLSRC} ${.TARGET} +