From owner-freebsd-current@FreeBSD.ORG Wed Mar 19 06:35:47 2014 Return-Path: Delivered-To: freebsd-current@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 CFD30F71 for ; Wed, 19 Mar 2014 06:35:47 +0000 (UTC) Received: from onlyone.friendlyhosting.spb.ru (onlyone.friendlyhosting.spb.ru [46.4.40.135]) by mx1.freebsd.org (Postfix) with ESMTP id 56C7AA7E for ; Wed, 19 Mar 2014 06:35:47 +0000 (UTC) Received: from lion.home.serebryakov.spb.ru (unknown [IPv6:2001:470:923f:1:6953:60be:b581:151f]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.friendlyhosting.spb.ru (Postfix) with ESMTPSA id F00B14AC1C; Wed, 19 Mar 2014 10:35:42 +0400 (MSK) Date: Wed, 19 Mar 2014 10:35:39 +0400 From: Lev Serebryakov Organization: FreeBSD Project X-Priority: 3 (Normal) Message-ID: <996140668.20140319103539@serebryakov.spb.ru> To: John-Mark Gurney Subject: Re: Building with external toolchain was broken 6 months ago with r255187 In-Reply-To: <20140318220140.GA32089@funkthat.com> References: <323697891.20140319013757@serebryakov.spb.ru> <20140318220140.GA32089@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: lev@FreeBSD.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 06:35:48 -0000 Hello, John-Mark. You wrote 19 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2014 =D0=B3., 2:01:40: JMG> Lev Serebryakov wrote this message on Wed, Mar 19, 2014 at 01:37 +0400: >> I did't build my NanoBSD images for almost year, and in this time our >> not-finished and fragile support for using "external" toolchain is rotte= n, >> due to r255187 (and, may meb, some other commits too). >>=20 >> I have very fresh -CURRENT (r263296) >>=20 >> I have these settings for my buildworld & buildkernel targets: >>=20 >> XCC=3D/usr/bin/cc >> XCXX=3D/usr/bin/c++ >> XCPP=3D/usr/bin/cpp >> XAS=3D/usr/bin/as >> XAR=3D/usr/bin/ar >> XLD=3D/usr/bin/ld >> XNM=3D/usr/bin/nm >> XOBJDUMP=3D/usr/bin/objdump >> XRANLIB=3D/usr/bin/ranlib >> XSTRINGS=3D/usr/bin/strings >> COMPILER_TYPE=3Dclang >> WITHOUT_CROSS_COMPILER=3Dyes >> WITHOUT_BINUTILS=3Dyes >> WITHOUT_CLANG=3Dyes >>=20 >> It worked 7 months ago. Now it works for "buildworld" but not for >> "buildkernel: >>=20 >> --- aeskeys_amd64.o --- >> /usr/bin/cc --sysroot=3D/data/obj.nano/gateway.v2/data/src/tmp -B/data/o= bj.nano/gateway.v2/data/src/tmp/usr/bin -O2 -pipe -fno-strict-aliasing -Wer= ror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -includ= e /data/obj.nano/gateway.v2/data/src/sys/D2500CC/opt_global.h -I. -I@ -I@/c= ontrib/altq -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-poi= nter -I/data/obj.nano/gateway.v2/data/src/sys/D2500CC -mno-aes -mno-avx -m= cmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchro= nous-unwind-tables -ffreestanding -fstack-protector -std=3Diso9899:1999 -Qu= nused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-= qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs= -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empt= y-body -Wno-error-parentheses-equality -Wno-unused-function -c /data/sr= c/sys/modules/aesni/../../crypto/aesni/aeskeys_amd64.S >> --- aesni_wrap.o --- >> In file included from /data/src/sys/modules/aesni/../../crypto/aesni/aes= ni_wrap.c:40: >> /data/src/sys/modules/aesni/../../crypto/aesni/aesencdec.h:30:10: fatal = error: 'wmmintrin.h' file not found >> #include >> ^ >> 1 error generated. >> *** [aesni_wrap.o] Error code 1 >>=20 >> It could not find header file with intrinsics from "system" ("external") >> clang. I could disable building of this module with WITHOUT_MODULES=3Dae= sni, >> and it works, but what if I need this module? >>=20 >> Could it be fixed, pleeeeeeease? JMG> Sounds like your tool chain doesn't have the necessary support for JMG> AES-NI... Are you using gcc as cc? If so, do you have the necessary JMG> tool chain work that I did in r255185 in your local tree? I use clang from world based on r263296 (amd64) to build world and kernel from same r263296 (amd64) (as indicated earlier). JMG> Can you compile this test program? Yes, of course. But kernel and modules are built with "-sysroot" option, you know? And my "-sysroot" doesn't contains clang tree (and "/usr/include/clang/3.4"), because it points to fresh world (in OBJDIRPREFIX) and clang was not built for this world, I'm using "system" one. It works for world, GENERIC kernel and all modules but aesni. JMG> ------ tsse.c start ---- JMG> #include JMG> __m128i foo; JMG> ------ tsse.c end ------ JMG> With the command: JMG> ${XCC} -c -maes tsse.c JMG> If you can't, then the problem is your toolchain, and you need to fix I can. JMG> it... Try also w/: JMG> clang -c -maes tsse.c JMG> and it's also helpful to know more info, like: ${XCC} --version > /usr/bin/cc --version FreeBSD clang version 3.4 (tags/RELEASE_34/final 197956) 20140216 Target: x86_64-unknown-freebsd11.0 Thread model: posix --=20 // Black Lion AKA Lev Serebryakov