From owner-freebsd-hackers@FreeBSD.ORG Wed May 20 01:47:16 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D59F5FE6; Wed, 20 May 2015 01:47:16 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (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 A0F93165E; Wed, 20 May 2015 01:47:16 +0000 (UTC) Received: from [192.168.168.121] (wsip-98-172-74-163.ph.ph.cox.net [98.172.74.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id D7394193656; Wed, 20 May 2015 01:47:14 +0000 (UTC) Message-ID: <555BE7A1.3040808@ignoranthack.me> Date: Tue, 19 May 2015 18:47:13 -0700 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Brooks Davis CC: "freebsd-hackers@freebsd.org" Subject: Re: Trying to use clang/head and XCC References: <555B638E.4020405@ignoranthack.me> <20150519165332.GA36377@spindle.one-eyed-alien.net> <555B91E8.9010309@ignoranthack.me> <20150519202153.GB36377@spindle.one-eyed-alien.net> In-Reply-To: <20150519202153.GB36377@spindle.one-eyed-alien.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2015 01:47:16 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 05/19/15 13:21, Brooks Davis wrote: > On Tue, May 19, 2015 at 12:41:28PM -0700, Sean Bruno wrote: On > 05/19/15 09:53, Brooks Davis wrote: >>>> On Tue, May 19, 2015 at 09:23:42AM -0700, Sean Bruno wrote: >>>> Following the External Tool Chain instructions on the wiki >>>> seem to not work: https://wiki.freebsd.org/ExternalToolchain >>>> >>>> I've gotten about this far: >>>> https://people.freebsd.org/~sbruno/clang_head_build_log.txt >>>> >>>>> You need to delete >>>>> /home/sbruno/bsd/clang/build/bin/../lib/clang/3.7.0/include/std* >>>>> and possibly also limits.h (it's broken for libstand on >>>>> mips). If you use the ports/pkgs they do this. > > This didn't seem to make any difference when xcompiling for AMD64, > but I did run into a buildfailure which might mean I don't know > what I'm doing: > >> rm >> /home/sbruno/bsd/clang/build/bin/../lib/clang/3.7.0/include/limits.h > >> should do get around this one. I hit this one on mips a few >> weeks ago. > >> It's a bug in upstream clang that the bundled limits.h doesn't >> #include_next with -ffreestanding. I've not had a >> chance to submit a review request to fix it. > >> -- Brooks > > > > ===> lib/libstand (all) /home/sbruno/bsd/clang/build/bin/clang > -target x86_64-unknown-freebsd11.0 > --sysroot=/var/tmp/home/sbruno/bsd/fbsd_head/tmp > -B/var/tmp/home/sbruno/bsd/fbsd_head/tmp/usr/ bin -O2 -pipe > -ffreestanding -Wformat -I/home/sbruno/bsd/fbsd_head/lib/libstand > -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -fPIC > -mno-red-zone -DB Z_NO_STDIO -DBZ_NO_COMPRESS -DHAVE_MEMCPY > -I/home/sbruno/bsd/fbsd_head/lib/libstand/../libz -std=gnu99 > -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unuse > d-const-variable -Wno-tautological-compare -Wno-unused-value > -Wno-parentheses-equality -Wno-unused-function > -Wno-enum-conversion -Wno-unused-local-typedef -Wno-switch - > Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses > -Qunused-arguments -c > /home/sbruno/bsd/fbsd_head/lib/libstand/../libc/string/strcspn.c > -o strcspn.o > /home/sbruno/bsd/fbsd_head/lib/libstand/../libc/string/strcspn.c:46:31 : > > error: > use of undeclared identifier 'LONG_BIT' u_long tbl[(UCHAR_MAX + 1) > / LONG_BIT]; ^ > /home/sbruno/bsd/fbsd_head/lib/libstand/../libc/string/strcspn.c:60:9: > > error: use of undeclared identifier 'LONG_BIT' > idx = IDX(*charset); ^ > /home/sbruno/bsd/fbsd_head/lib/libstand/../libc/string/strcspn.c:34:31 : > > note: > expanded from macro 'IDX' #define IDX(c) ((u_char)(c) / LONG_BIT) > ^ > /home/sbruno/bsd/fbsd_head/lib/libstand/../libc/string/strcspn.c:61:9: > > error: use of undeclared identifier 'LONG_BIT' > bit = BIT(*charset); ^ > /home/sbruno/bsd/fbsd_head/lib/libstand/../libc/string/strcspn.c:35:45 : > > note: > expanded from macro 'BIT' #define BIT(c) ((u_long)1 << > ((u_char)(c) % LONG_BIT)) ^ > /home/sbruno/bsd/fbsd_head/lib/libstand/../libc/string/strcspn.c:66:9: > > error: use of undeclared identifier 'LONG_BIT' > idx = IDX(*s1); ^ > /home/sbruno/bsd/fbsd_head/lib/libstand/../libc/string/strcspn.c:34:31 : > > note: > expanded from macro 'IDX' #define IDX(c) ((u_char)(c) / LONG_BIT) > ^ > /home/sbruno/bsd/fbsd_head/lib/libstand/../libc/string/strcspn.c:67:9: > > error: use of undeclared identifier 'LONG_BIT' > bit = BIT(*s1); ^ > /home/sbruno/bsd/fbsd_head/lib/libstand/../libc/string/strcspn.c:35:45 : > > note: > expanded from macro 'BIT' #define BIT(c) ((u_long)1 << > ((u_char)(c) % LONG_BIT)) ^ 5 errors generated. *** Error code 1 > > > >>>> >>>> Two items of note. -- The bootstrap bits *completely* ignore >>>> XCC and build with the host cc/c++ >>>> >>>>> That's expected. In principle clang could be used as the >>>>> cross compiler since it's multi-target, but gcc could never >>>>> work unless the host and target are the same. >>>> >>>> -- No documentation of what CFLAGS are required to build and >>>> ignore warnings. >>>> >>>>> It will change with every clang/gcc release. In practice >>>>> you will need to either fix the warnings wack-a-mole style >>>>> or set NO_WERROR in the environment. >>>> >>>>> -- Brooks >>>> >>>> >>>> Anyone out there have success doing this? >>>> >>>> sean Getting much closer, I think this is fixable, but maybe we need to pass this upstream? ===> sys/boot/i386/boot2 (depend) ln -sf /home/sbruno/bsd/fbsd_head/sys/boot/i386/boot2/../../../i386/include machine /home/sbruno/bsd/clang/build/bin/clang -target x86_64-unknown-freebsd11.0 - --sysroot=/var/tmp/home/sbruno/bsd/fbsd_head/tmp - -B/var/tmp/home/sbruno/bsd/fbsd_head/tmp/usr/bin -fomit-frame-pointer -mrtd -mregparm=3 -DUSE_XREAD -DUFS1_AND_UFS2 -DFLAGS=0x80 - -DSIOPRT=0x3f8 -DSIOFMT=0x3 -DSIOSPD=9600 - -I/home/sbruno/bsd/fbsd_head/sys/boot/i386/boot2/../../common - -I/home/sbruno/bsd/fbsd_head/sys/boot/i386/boot2/../btx/lib -I. -Wall - -Waggregate-return -Wbad-function-cast -Wcast-align - -Wmissing-declarations -Wmissing-prototypes -Wnested-externs - -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings -Winline - -march=i386 -ffreestanding -mno-mmx -mno-3dnow -mno-sse -mno-sse2 - -mno-sse3 -msoft-float -m32 -std=gnu99 -Oz -mstack-alignment=8 - -mllvm -inline-threshold=3 -mllvm -simplifycfg-dup-ret -mllvm - -enable-gvn=false -Qunused-arguments -no-integrated-as -m32 -c /home/sbruno/bsd/fbsd_head/sys/boot/i386/boot2/boot1.S -o boot1.o clang (LLVM option parsing): Unknown command line argument '-enable-gvn=false'. Try: 'clang (LLVM option parsing) -help' clang (LLVM option parsing): Did you mean '-enable-pre=false'? *** Error code 1 Stop. make[6]: stopped in /home/sbruno/bsd/fbsd_head/sys/boot/i386/boot2 *** Error code 1 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJVW+eeXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kYDAH/iWF3lKAdEfOK2VN5IWPhzm2 eIBs5OO8cAOhxp79oQP/668WxzjF2sGcgSLzURNvle25iYDwNbeBmGphxycs+5+A /Bidkq9qBDPo4kz8+2tb1cil+QMT3JnoiuVh66ICnCPCNJSkYibuyTlaaB/y0Gg+ OanQEtvsZ8ZQYfesE0SIhXn4w7EDoyh9FsBVerusKBIvyUze3W/c6tQblHY+qZvM 4HQuOZYZC8qPplG8cREFtIemkdp0M7e1atw8o3gss0JkIRCHzPsEh6ekbwuSxXT+ gUDE0H1odTSO0YsJRbLhi/LWvuyg5oDwiAkP+QmPgO44VeCGybIAhtRKjgzErFA= =XPVp -----END PGP SIGNATURE-----