Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2013 12:28:22 -0800
From:      "Simon J. Gerraty" <sjg@juniper.net>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: [RFC] external compiler support
Message-ID:  <20130227202822.8F53B58096@chaos.jnpr.net>
In-Reply-To: <20130227195807.GA19255@lor.one-eyed-alien.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> <20130227195807.GA19255@lor.one-eyed-alien.net>

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

On Wed, 27 Feb 2013 13:58:07 -0600, Brooks Davis writes:
>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

The advantage of Warner's approach is that it can work from anywhere in
the tree rather than only from top-level.

One of my goals is that I should be able to [cross-]build bin/cat just
as easily from src/bin/cat as from top-level.
Warner's approach fits better in that regard.

There is of course a lot more needed.
Being able to add machine and even target specific flags for example.
These can be just as easily dealt with in share/mk:

# add machine/taget flags in order of least to most specific
CFLAGS+= ${CFLAGS.${MACHINE}} \
	 ${CFLAGS.${.TARGET:T:R}} \
	 ${CFLAGS.${.TARGET:T}}

etc.  I also find it handy to have 

CFLAGS_LAST+= ${CFLAGS_LAST.${MACHINE}} \
         ${CFLAGS_LAST.${.TARGET:T:R}} \
         ${CFLAGS_LAST.${.TARGET:T}}

and add ${CFLAGS_LAST} to CFLAGS after Makefile has been read
so for example when you don't have proper sysroot support you can add
the equivalent of -I/tree/of/headers/include to the end of the -I list.

>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.

No, they just need to be part of the compiler command line.

>Otherwise /rescue fails as do several things in /boot.

That would presumably be bugs in the relevant makefiles no?



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