From owner-freebsd-current@freebsd.org Tue Nov 3 15:30:05 2015 Return-Path: Delivered-To: freebsd-current@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 EBA45A251F2 for ; Tue, 3 Nov 2015 15:30:05 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (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 CC8C71CD8 for ; Tue, 3 Nov 2015 15:30:05 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 3 Nov 2015 15:29:03 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tA3FTqra044966; Tue, 3 Nov 2015 08:29:53 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1446564592.91534.336.camel@freebsd.org> Subject: Re: Quick test building a module cross all targets and architectures From: Ian Lepore To: Hans Petter Selasky , John Baldwin Cc: freebsd-current@freebsd.org Date: Tue, 03 Nov 2015 08:29:52 -0700 In-Reply-To: <5638A766.40108@selasky.org> References: <562DEE4F.5010203@selasky.org> <5888922.UHSgpdyTWY@ralph.baldwin.cx> <562F3EA1.9020708@selasky.org> <4276722.e5fJFDHm8P@ralph.baldwin.cx> <562FA376.1060403@selasky.org> <5638A766.40108@selasky.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2015 15:30:06 -0000 On Tue, 2015-11-03 at 13:24 +0100, Hans Petter Selasky wrote: > On 10/27/15 17:16, Hans Petter Selasky wrote: > > On 10/27/15 16:49, John Baldwin wrote: > > > With MAKE_JUST_WORLDS you would only build > > > a "generic" module once per architecture. That savings is likely > > > far > > > more > > > than the cost of the additional tools. > > > > I will try it out. Thanks for your hints and tips. > > > > Hi, > > Running: > > make buildworld TARGET=arm TARGET_ARCH=armv6 MAKE_JUST_WORLDS=yes > SUBDIR_OVERRIDE=sys/modules MODULES_OVERRIDE=linuxkpi -DNO_CLEAN > > I get: > > > -------------------------------------------------------------- > > > > > stage 4.4: building everything > > -------------------------------------------------------------- > > cd /usr/img/freebsd; MAKEOBJDIRPREFIX=/usr/obj/arm.armv6 > > MACHINE_ARCH=armv6 MACHINE=arm CPUTYPE= > > GROFF_BIN_PATH=/usr/obj/arm.armv6/usr/img/freebsd/tmp/legacy/usr/bi > > n > > GROFF_FONT_PATH=/usr/obj/arm.armv6/usr/img/freebsd/tmp/legacy/usr/ > > share/groff_font > > GROFF_TMAC_PATH=/usr/obj/arm.armv6/usr/img/freebsd/tmp/legacy/usr/ > > share/tmac _LDSCRIPTROOT= INSTALL="sh > > /usr/img/freebsd/tools/install.sh" > > PATH=/usr/obj/arm.armv6/usr/img/freebsd/tmp/legacy/usr/sbin:/usr/o > > bj/arm.armv6/usr/img/freebsd/tmp/legacy/usr/bin:/usr/obj/arm.armv6/ > > usr/img/freebsd/tmp/legacy/bin:/usr/obj/arm.armv6/usr/img/freebsd/t > > mp/usr/sbin:/usr/obj/arm.armv6/usr/img/freebsd/tmp/usr/bin:/sbin:/b > > in:/usr/sbin:/usr/bin CC="cc " CXX="c++ " DEPFLAGS="" CPP="cpp " > > AS="as" AR="ar" LD="ld" NM=nm OBJDUMP=objdump OBJCOPY="objcopy" > > RANLIB=ranlib STRINGS= SIZE="size" make -f Makefile.inc1 > > DESTDIR=/usr/obj/arm.armv6/usr/img/freebsd/tmp par-all > > ===> sys/modules (all) > > ===> sys/modules/linuxkpi (all) > > cc -O -pipe -mfloat-abi=softfp -Werror -D_KERNEL -DKLD_MODULE > > -nostdinc > > -I/usr/img/freebsd/sys/modules/linuxkpi/../../compat/linuxkpi/commo > > n/include -I. -I/usr/img/freebsd/sys/modules/linuxkpi/../.. -fno > > -common -funwind-tables -ffreestanding -fwrapv -Wall -Wredundant > > -decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes > > -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign > > -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs > > -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error > > -tautological-compare -Wno-error-empty-body -Wno-error-parentheses > > -equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno > > -error-shift-negative-value -mllvm -arm-use-movt=0 -mfpu=none > > -std=iso9899:1999 -c > > /usr/img/freebsd/sys/modules/linuxkpi/../../compat/linuxkpi/common/ > > src/linux_compat.c -o linux_compat.o > > In file included from > > /usr/img/freebsd/sys/modules/linuxkpi/../../compat/linuxkpi/common/ > > src/linux_compat.c:38: > > In file included from > > /usr/img/freebsd/sys/modules/linuxkpi/../../sys/proc.h:66: > > In file included from > > /usr/img/freebsd/sys/modules/linuxkpi/../../sys/_vm_domain.h:34: > > In file included from > > /usr/img/freebsd/sys/modules/linuxkpi/../../sys/seq.h:70: > > ./machine/cpu.h:22:9: error: implicit declaration of function > > 'cp15_pmccntr_get' is invalid in C99 > > [-Werror,-Wimplicit-function-declaration] > > return cp15_pmccntr_get(); > > ^ > > 1 error generated. > > *** Error code 1 > > And when running: > > make -DNO_CLEAN -j6 universe MAKE_JUST_KERNELS=yes > MODULES_OVERRIDE=linuxkpi > > With my "sys/conf/kern.post.mk" patch, it passes all the variants. > > > Is this the expected behaviour or a bug somewhere? > > > --HPS The only way that error can happen is if _KERNEL is defined and __ARM_ARCH is not >= 6 at that point in the compile. The __ARM_ARCH symbol is set by the compiler and/or acle-compat.h (acle-compat translates old gcc-style arm arch symbols to new-style). Hmm, and looking at that output some more, we have CC="cc " CXX="c++ " etc, so it's not using the cross-compiler and __ARM_ARCH will be zero. Why it's using the wrong compiler is a question I'll leave for Warner or someone else who understands module building better. -- Ian