From owner-freebsd-stable@FreeBSD.ORG Fri Jan 31 19:53:31 2014 Return-Path: Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F2A82F8; Fri, 31 Jan 2014 19:53:31 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37022132F; Fri, 31 Jan 2014 19:53:30 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1W9K9Z-0000V1-IR; Fri, 31 Jan 2014 19:53:29 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s0VJrPMe060361; Fri, 31 Jan 2014 12:53:26 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/eqz4FWOyD1bTsDwyCAGFb Subject: Re: building stable/8 on stable/10 host: is it supported? From: Ian Lepore To: Dmitry Morozovsky In-Reply-To: References: <20140130175317.6c854f50@X220.alogt.com> <20140130.191854.1571220137154550209.hrs@allbsd.org> Content-Type: multipart/mixed; boundary="=-l8aceLeNDO9lFJx2kg10" Date: Fri, 31 Jan 2014 12:53:25 -0700 Message-ID: <1391198005.13026.14.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: erichsfreebsdlist@alogt.com, freebsd-stable@FreeBSD.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2014 19:53:31 -0000 --=-l8aceLeNDO9lFJx2kg10 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thu, 2014-01-30 at 17:51 +0400, Dmitry Morozovsky wrote: > On Thu, 30 Jan 2014, Dmitry Morozovsky wrote: > > > Hiroki-san, > > [snip] > > > > Currently stable/8 does not build on a box running 10 or later > > > because several commits to fix build errors at the toolchain > > > bootstrapping stages due to the toolchain migration were not MFC'd > > > yet. For stable/8, try the following patch: > > > > > > http://people.allbsd.org/~hrs/FreeBSD/stable-8-patch.diff > > > > Thanks a lot, will try and report! > > amd64 world/kernel built successfully, thanks again. > > However, cross-build to TARGET=i386 chokes on aicasm module: > > ./aicasm -nostdinc -I. -I/FreeBSD/pristine/src.8/sys > -I/FreeBSD/pristine/src.8/sys/contrib/altq > -I/FreeBSD/pristine/src.8/sys/contrib/ipfilter > -I/FreeBSD/pristine/src.8/sys/contrib/pf -I/FreeBSD/pristine/src.8/sys/dev/ath > -I/FreeBSD/pristine/src.8/sys/dev/ath/ath_hal > -I/FreeBSD/pristine/src.8/sys/contrib/ngatm > -I/FreeBSD/pristine/src.8/sys/dev/twa > -I/FreeBSD/pristine/src.8/sys/gnu/fs/xfs/FreeBSD > -I/FreeBSD/pristine/src.8/sys/gnu/fs/xfs/FreeBSD/support > -I/FreeBSD/pristine/src.8/sys/gnu/fs/xfs -I/FreeBSD/pristine/src.8/sys/dev/cxgb > -I/FreeBSD/pristine/src.8/sys/dev/cxgbe -I/FreeBSD/pristine/src.8/sys/cam/scsi > -I/FreeBSD/pristine/src.8/sys/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p > aic79xx_reg_print.c -i /FreeBSD/pristine/src.8/sys/dev/aic7xxx/aic79xx_osm.h > /FreeBSD/pristine/src.8/sys/dev/aic7xxx/aic79xx.seq > ./aicasm: Stopped at file /FreeBSD/pristine/src.8/sys/dev/aic7xxx/aic79xx.seq, > line 53 - Undefined symbol code referenced > ./aicasm: Removing aic79xx_seq.h due to error > ./aicasm: Removing aic79xx_reg.h due to error > *** Signal 11 > > Stop in /usr/obj/i386/FreeBSD/pristine/src.8/sys/GENERIC. > *** Error code 1 > > Stop in /FreeBSD/pristine/src.8. > *** Error code 1 > > Stop. > make: stopped in /FreeBSD/pristine/src.8 Some time in 2013 the build process for aicasm got broken for the cross-build case (it builds with the wrong compiler and header files). I fixed it late in 2013 with a series of botched attempts that fixed it in some case and broke it for some other case. Eventually it got fixed for all cases except apparently the old-school kernel compile method of running make from the sys/config dir. Now it has been fixed on head by just nuking aicasm and checking in some firmware binary blob instead. I'm not sure whether it makes sense to mfc that binary-blob fix to stable branches or not. I've distilled the end result of my build mechanism changes down to a patch against stable-8, I'll attach it to this mail. It lets me build amd64 and arm on this i386 machine, so I think it'll let you build i386 on an amd64 host. -- Ian --=-l8aceLeNDO9lFJx2kg10 Content-Disposition: attachment; filename="aicasm_stab8.diff" Content-Type: text/x-patch; name="aicasm_stab8.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit Index: Makefile.inc1 =================================================================== --- Makefile.inc1 (revision 261326) +++ Makefile.inc1 (working copy) @@ -250,6 +250,21 @@ XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ -DWITHOUT_GDB +# kernel-tools stage +KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ + PATH=${BPATH}:${PATH} \ + WORLDTMP=${WORLDTMP} \ + VERSION="${VERSION}" \ + COMPILER_TYPE=${COMPILER_TYPE} +KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \ + ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ + DESTDIR= \ + BOOTSTRAPPING=${OSRELDATE} \ + SSP_CFLAGS= \ + -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ + -DNO_PIC -DNO_PROFILE -DNO_SHARED \ + -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD + # world stage WMAKEENV= ${CROSSENV} \ _SHLIBDIRPREFIX=${WORLDTMP} \ @@ -403,6 +418,7 @@ _cross-tools: @echo ">>> stage 3: cross tools" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools + ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools _includes: @echo @echo "--------------------------------------------------------------" @@ -776,20 +792,7 @@ buildkernel: @echo "--------------------------------------------------------------" @echo ">>> stage 2.3: build tools" @echo "--------------------------------------------------------------" - cd ${KRNLOBJDIR}/${_kernel}; \ - PATH=${BPATH}:${PATH} \ - MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ - -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile -# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. -.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) -.for target in obj depend all - cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ - PATH=${BPATH}:${PATH} \ - MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target} -.endfor -.endif + ${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools .if !defined(NO_KERNELDEPEND) @echo @echo "--------------------------------------------------------------" @@ -1003,10 +1006,6 @@ bootstrap-tools: # # build-tools: Build special purpose build tools # -.if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules) -_aicasm= sys/modules/aic7xxx/aicasm -.endif - .if !defined(NO_SHARE) _share= share/syscons/scrnmaps .endif @@ -1027,7 +1026,6 @@ build-tools: lib/ncurses/ncurses \ lib/ncurses/ncursesw \ ${_share} \ - ${_aicasm} \ usr.bin/awk \ lib/libmagic \ usr.sbin/sysinstall @@ -1047,6 +1045,23 @@ build-tools: .endfor # +# kernel-tools: Build kernel-building tools +# +kernel-tools: .MAKE + mkdir -p ${MAKEOBJDIRPREFIX}/usr + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ + -p ${MAKEOBJDIRPREFIX}/usr >/dev/null +.for _tool in \ + sys/dev/aic7xxx/aicasm + ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ + cd ${.CURDIR}/${_tool} && \ + ${MAKE} DIRPRFX=${_tool}/ obj && \ + ${MAKE} DIRPRFX=${_tool}/ depend && \ + ${MAKE} DIRPRFX=${_tool}/ all && \ + ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install +.endfor + +# # cross-tools: Build cross-building tools # .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035 Index: sys/modules/aic7xxx/ahc/Makefile =================================================================== --- sys/modules/aic7xxx/ahc/Makefile (revision 261326) +++ sys/modules/aic7xxx/ahc/Makefile (working copy) @@ -15,13 +15,10 @@ REG_PRINT_OPT= -p aic7xxx_reg_print.c .endif BEFORE_DEPEND = ${GENSRCS} -../aicasm/aicasm: ${.CURDIR}/../../../dev/aci7xxx/aicasm/*.[chyl] - ( cd ${.CURDIR}/../aicasm; ${MAKE} aicasm; ) - ${GENSRCS}: \ ${.CURDIR}/../../../dev/aic7xxx/aic7xxx.{reg,seq} \ - ${.CURDIR}/../../../cam/scsi/scsi_message.h ../aicasm/aicasm - ../aicasm/aicasm ${INCLUDES} -I${.CURDIR}/../../../cam/scsi \ + ${.CURDIR}/../../../cam/scsi/scsi_message.h + aicasm ${INCLUDES} -I${.CURDIR}/../../../cam/scsi \ -I${.CURDIR}/../../../dev/aic7xxx \ -o aic7xxx_seq.h -r aic7xxx_reg.h \ ${REG_PRINT_OPT} \ Index: sys/modules/aic7xxx/ahd/Makefile =================================================================== --- sys/modules/aic7xxx/ahd/Makefile (revision 261326) +++ sys/modules/aic7xxx/ahd/Makefile (working copy) @@ -15,13 +15,10 @@ REG_PRINT_OPT= -p aic79xx_reg_print.c .endif BEFORE_DEPEND= ${GENSRCS} -../aicasm/aicasm: ${.CURDIR}/../../../dev/aic7xxx/aicasm/*.[chyl] - ( cd ${.CURDIR}/../aicasm; ${MAKE} aicasm; ) - ${GENSRCS}: \ ${.CURDIR}/../../../dev/aic7xxx/aic79xx.{reg,seq} \ - ${.CURDIR}/../../../cam/scsi/scsi_message.h ../aicasm/aicasm - ../aicasm/aicasm ${INCLUDES} -I${.CURDIR}/../../../cam/scsi \ + ${.CURDIR}/../../../cam/scsi/scsi_message.h + aicasm ${INCLUDES} -I${.CURDIR}/../../../cam/scsi \ -I${.CURDIR}/../../../dev/aic7xxx \ -o aic79xx_seq.h -r aic79xx_reg.h \ ${REG_PRINT_OPT} \ Index: sys/modules/aic7xxx/Makefile =================================================================== --- sys/modules/aic7xxx/Makefile (revision 261326) +++ sys/modules/aic7xxx/Makefile (working copy) @@ -1,6 +1,6 @@ # $FreeBSD$ -SUBDIR= aicasm ahc ahd +SUBDIR= ahc ahd .include Index: sys/conf/files =================================================================== --- sys/conf/files (revision 261326) +++ sys/conf/files (working copy) @@ -9,44 +9,39 @@ acpi_quirks.h optional acpi \ compile-with "${AWK} -f $S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \ no-obj no-implicit-rule before-depend \ clean "acpi_quirks.h" -aicasm optional ahc | ahd \ - dependency "$S/dev/aic7xxx/aicasm/*.[chyl]" \ - compile-with "CC='${CC}' ${MAKE} -f $S/dev/aic7xxx/aicasm/Makefile MAKESRCPATH=$S/dev/aic7xxx/aicasm" \ - no-obj no-implicit-rule \ - clean "aicasm* y.tab.h" aic7xxx_seq.h optional ahc \ - compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \ + compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \ no-obj no-implicit-rule before-depend local \ clean "aic7xxx_seq.h" \ - dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" + dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h" aic7xxx_reg.h optional ahc \ - compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \ + compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \ no-obj no-implicit-rule before-depend local \ clean "aic7xxx_reg.h" \ - dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" + dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h" aic7xxx_reg_print.c optional ahc \ - compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \ + compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \ no-obj no-implicit-rule local \ clean "aic7xxx_reg_print.c" \ - dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" + dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h" aic7xxx_reg_print.o optional ahc ahc_reg_pretty_print \ compile-with "${NORMAL_C}" \ no-implicit-rule local aic79xx_seq.h optional ahd pci \ - compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \ + compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \ no-obj no-implicit-rule before-depend local \ clean "aic79xx_seq.h" \ - dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" + dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h" aic79xx_reg.h optional ahd pci \ - compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \ + compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \ no-obj no-implicit-rule before-depend local \ clean "aic79xx_reg.h" \ - dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" + dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h" aic79xx_reg_print.c optional ahd pci \ - compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \ + compile-with "aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \ no-obj no-implicit-rule local \ clean "aic79xx_reg_print.c" \ - dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" + dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h" aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \ compile-with "${NORMAL_C}" \ no-implicit-rule local Index: sys/dev/aic7xxx/aicasm/Makefile =================================================================== --- sys/dev/aic7xxx/aicasm/Makefile (revision 261326) +++ sys/dev/aic7xxx/aicasm/Makefile (working copy) @@ -15,7 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSRCS} CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} DPADD= ${LIBL} LDADD= -ll -WARNS?= 6 +WARNS?= 0 # Correct path for kernel builds # Don't rely on the kernel's .depend file @@ -24,13 +24,7 @@ LDADD= -ll DEPENDFILE= .depend_aicasm .endif -.if ${CC} == "icc" -CFLAGS+= -restrict -NOSTDINC= -X -.else -NOSTDINC= -nostdinc -.endif -CFLAGS+= ${NOSTDINC} -I/usr/include -I. +CFLAGS+= -I${.CURDIR} .ifdef MAKESRCPATH CFLAGS+= -I${MAKESRCPATH} .endif @@ -44,4 +38,8 @@ YFLAGS+= -t -v LFLAGS+= -d .endif +BINDIR=/usr/bin + +build-tools: ${PROG} + .include --=-l8aceLeNDO9lFJx2kg10--