[RFC] external compiler support
Brooks Davis
brooks at freebsd.org
Wed Feb 27 19:58:08 UTC 2013
On Wed, Feb 27, 2013 at 09:50:06AM -0800, 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.
>
> 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.
Adding the equivalent of Warner's ${__X} (however you spell it) doesn't
seem to hurt anything, but it doesn't seem to help much either. You
quickly end up setting many of the values. I'd be fine with adding
something if it seems generally useful, but I don't think I'd use it at
all in a buildworld/buildkernel type cross build where I want to control
the whole name of the commands without having to hack up a directory of
symlinks to the tools I intend to use (in our case, we're only replacing
the compiler and want to easily switch between 3-4 non-default versions
of clang).
> 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.
This appears to work:
--sysroot /tree/of/headers/and/libraries -B/path/to/binutils
For the whole tree to build it must be part of the value of CC.
Otherwise /rescue fails as do several things in /boot.
-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20130227/f2b0091b/attachment.sig>
More information about the freebsd-arch
mailing list