Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 2015 04:52:34 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        sbruno@freebsd.org
Cc:        Brooks Davis <brooks@freebsd.org>, dim@freebsd.org, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Trying to use clang/head and XCC
Message-ID:  <20150520045234.GA83978@spindle.one-eyed-alien.net>
In-Reply-To: <555BE7A1.3040808@ignoranthack.me>
References:  <555B638E.4020405@ignoranthack.me> <20150519165332.GA36377@spindle.one-eyed-alien.net> <555B91E8.9010309@ignoranthack.me> <20150519202153.GB36377@spindle.one-eyed-alien.net> <555BE7A1.3040808@ignoranthack.me>

next in thread | previous in thread | raw e-mail | index | archive | help

--HlL+5n6rz5pIUxbD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 19, 2015 at 06:47:13PM -0700, Sean Bruno wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>=20
> 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:=20
> >>>> Following the External Tool Chain instructions on the wiki
> >>>> seem to not work: https://wiki.freebsd.org/ExternalToolchain
> >>>>=20
> >>>> I've gotten about this far:=20
> >>>> https://people.freebsd.org/~sbruno/clang_head_build_log.txt
> >>>>=20
> >>>>> You need to delete=20
> >>>>> /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.
> >=20
> > 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:
> >=20
> >> 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.
> >=20
> >> It's a bug in upstream clang that the bundled limits.h doesn't=20
> >> #include_next <limits.h> with -ffreestanding.  I've not had a
> >> chance to submit a review request to fix it.
> >=20
> >> -- Brooks

> >>>>=20
> >>>> Two items of note. -- The bootstrap bits *completely* ignore
> >>>> XCC and build with the host cc/c++
> >>>>=20
> >>>>> 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.
> >>>>=20
> >>>> -- No documentation of what CFLAGS are required to build and
> >>>> ignore warnings.
> >>>>=20
> >>>>> 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.
> >>>>=20
> >>>>> -- Brooks
> >>>>=20
> >>>>=20
> >>>> Anyone out there have success doing this?
> >>>>=20
> >>>> sean
>=20
>=20
>=20
> Getting much closer, I think this is fixable, but maybe we need to
> pass this upstream?
> =3D=3D=3D> 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=3D/var/tmp/home/sbruno/bsd/fbsd_head/tmp
> - -B/var/tmp/home/sbruno/bsd/fbsd_head/tmp/usr/bin -fomit-frame-pointer
>  -mrtd  -mregparm=3D3  -DUSE_XREAD  -DUFS1_AND_UFS2  -DFLAGS=3D0x80
> - -DSIOPRT=3D0x3f8  -DSIOFMT=3D0x3  -DSIOSPD=3D9600
> - -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=3Di386 -ffreestanding -mno-mmx -mno-3dnow -mno-sse -mno-sse2
> - -mno-sse3 -msoft-float -m32 -std=3Dgnu99    -Oz -mstack-alignment=3D8
> - -mllvm -inline-threshold=3D3 -mllvm -simplifycfg-dup-ret -mllvm
> - -enable-gvn=3Dfalse -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=3Dfalse'.  Try: 'clang (LLVM option parsing) -help'
> clang (LLVM option parsing): Did you mean '-enable-pre=3Dfalse'?
> *** Error code 1

IIRC -enable-gvn=3Dfalse is a local option Dimitry added to our clang.  I d=
on't
remember the suggested workaround off hand.

-- Brooks

--HlL+5n6rz5pIUxbD
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJVXBMSAAoJEKzQXbSebgfAyG4H/jAy//hjfmvVTjoGh/3xXLfk
gCSwO1or7JdY4JqTpXALQZe9o+OHlCrxITxZjRs3pAf/KCk1yKiibdV78YN54tAb
XATzC+L0BOFAGyCmHcSwdArCswOfmWmROGYb0CkbJzSybU3QUpE6Th3/416KY7+a
+PDI613yTKYYd0V6iTxa1Bfz3BRf3+01OUp47UC/mxTU1K4yjy5iGO3JL6T42IGX
Ep8R+8BQqNoLX43FESqKaXQAwWLMf6olJHMDwpTD5Xv5bAM+aA8ZahYcVGTA135F
4grCl4DgvDGvkGIdm5NO20hZMROb+sXs8HUn/D+eKuyoAmcfKeXzYah++h6U6q0=
=VXvd
-----END PGP SIGNATURE-----

--HlL+5n6rz5pIUxbD--



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