Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 May 2015 12:41:28 -0700
From:      Sean Bruno <sbruno@ignoranthack.me>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Trying to use clang/head and XCC
Message-ID:  <555B91E8.2050803@ignoranthack.me>
In-Reply-To: <20150519165332.GA36377@spindle.one-eyed-alien.net>
References:  <555B638E.4020405@ignoranthack.me> <20150519165332.GA36377@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

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:


===> 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
>> _______________________________________________ 
>> freebsd-hackers@freebsd.org mailing list 
>> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To
>> unsubscribe, send any mail to
>> "freebsd-hackers-unsubscribe@freebsd.org"
>> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQF8BAEBCgBmBQJVW5HgXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx
MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kXuIH/ia5UTjDxWfc6JdjkSbGgA1n
JFsY/d0VpFdtXVtcSFQ6hYn2SMqhKCFSKxMkeByTclM0xJddljwHiyMBM4z692wv
B9ozMK9sgiiuNFiVRTHELmcxbR5rFd2sP6g5WaafcBopvk/RpsRUpkrEWbe7uj9B
n8Ox7AbNiG7oWK2ki1/ngl9HBe4Iml7E4Obj01tBegYIx6YeZ9LD4VRTLgXtpLDy
1ZeG+gFNQQ237+3VxS78mFXDZRkyxnrWH5ltQ9zcTjI5zOmSmMOngquoK/8Jin2y
xCSgV4C/ce31JSSeW/AA3I6WixswjoKU9lTpKKK7aZgcIxBrN8oLN10I8E4NL8o=
=Ro9f
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?555B91E8.2050803>