Date: Wed, 27 Feb 2013 11:37:05 -0700 From: Warner Losh <imp@bsdimp.com> To: "Simon J. Gerraty" <sjg@juniper.net> Cc: Brooks Davis <brooks@freebsd.org>, freebsd-arch@freebsd.org Subject: Re: [RFC] external compiler support Message-ID: <AC205A9A-A904-4B98-BA48-030E8EEE33FE@bsdimp.com> In-Reply-To: <20130227175006.A604A58096@chaos.jnpr.net> References: <20130227003517.GB7348@lor.one-eyed-alien.net> <28404C12-67F3-44F0-AB28-02B749472873@bsdimp.com> <51BB3E17-128A-4989-B272-D8B40D4B854B@bsdimp.com> <20130227175006.A604A58096@chaos.jnpr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Feb 27, 2013, at 10:50 AM, Simon J. Gerraty wrote:
>
> On Wed, 27 Feb 2013 09:08:05 -0700, Warner Losh writes:
>>> I think this will work, but it is kludgy. I had created a __X=<prefix-path>
>>
>> I also am having trouble finding my full patch, but a partial patch can be fou
>
> I prefer this approach too, but would use a more explicit variable than
> __X (which I could easily imagine someone thinking they could safely use
> within their own makefile for some purpose).
> Eg. we currently have stuff like:
>
> CC?= ${BUILD_TOOL_PREFIX}/${CROSS_TARGET_PREFIX}gcc
>
> since these aren't variables that anyone needs to manipulate regularly
> a little verbosity doesn't hurt.
That stray / will kill you :)
The __X thing (which I'll grant could be better named, but it is in a file that needs to be very pure and I don't know if POSIX allows __ prefix for purely internal things on make or not) was intended to encompass everything you'd need, whether that is just /usr/local/arm-freebsd/bin or something more complicated like /usr/local/bin/arm-linux-gnueabi- whatever.
> Further, having them composed from other bits can also be useful
> (eg. most dev machines here use nfs mounted toolchains, but others use
> local toolchains).
>
> So (probably taking things too far - I didn't come up with all this ;-)
>
> BUILD_TOOL_PREFIX?= ${TOOLCHAIN_PREFIX}/${TOOLCHAIN_${MACHINE}}/bin
> CROSS_TARGET_PREFIX?= ${CROSS_TARGET}-
> CROSS_TARGET?= ${CROSS_TARGET_${MACHINE}}
>
> and a toolchain.mk sets CROSS_TARGET_* for all the supported machines.
Yea, that likely does take things a bit far.
> Of course as you note:
>
>> I've also started looking into using clang --mumble to doing cross builds too,
>
> can simplify things (for some value of "--mumble); I managed to get
> clang to produce i386 apps on amd64, but the "--mumble" wasn't obvious
> or documented (that I could find) and infact the man page implied other
> things that don't work.
Yea, they only half work right now. '-ccc-host-triple arm-none-freebsd -msoft-float -march armv5' might be a typical --mumble that one would want to do. It generates the right .s file, but uses the wrong assembler.
Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AC205A9A-A904-4B98-BA48-030E8EEE33FE>
