Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2013 14:06:36 -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:  <09800C62-25DA-4BE4-B87B-8B2F0E1C0AF9@bsdimp.com>
In-Reply-To: <20130227202822.8F53B58096@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> <20130227195807.GA19255@lor.one-eyed-alien.net> <20130227202822.8F53B58096@chaos.jnpr.net>

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

On Feb 27, 2013, at 1:28 PM, Simon J. Gerraty wrote:

>=20
> 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
>=20
> The advantage of Warner's approach is that it can work from anywhere =
in
> the tree rather than only from top-level.
>=20
> 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.
>=20
> 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:
>=20
> # add machine/taget flags in order of least to most specific
> CFLAGS+=3D ${CFLAGS.${MACHINE}} \
> 	 ${CFLAGS.${.TARGET:T:R}} \
> 	 ${CFLAGS.${.TARGET:T}}
>=20
> etc.  I also find it handy to have=20
>=20
> CFLAGS_LAST+=3D ${CFLAGS_LAST.${MACHINE}} \
>         ${CFLAGS_LAST.${.TARGET:T:R}} \
>         ${CFLAGS_LAST.${.TARGET:T}}
>=20
> 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.

Yes. We don't really have proper sysroot support in our build tree, or =
at least didn't for the longest time, so our build doesn't depend on it. =
I'm OK making it depend on it, so long as we have this sort of fallback =
for includes and libraries...

>> This appears to work:
>>=20
>> --sysroot /tree/of/headers/and/libraries -B/path/to/binutils
>>=20
>> For the whole tree to build it must be part of the value of CC.
>=20
> No, they just need to be part of the compiler command line.

Correct.  I said in email a second ago I wanted to do CC?=3D"${__X}cc =
${__Y}" but what I really want is a CFLAGS=3D"${__Y}..." instead. Again, =
for properly named __X and __Y...

>> Otherwise /rescue fails as do several things in /boot.
>=20
> That would presumably be bugs in the relevant makefiles no?

Yea, since I've build the whole tree with 'make xdev'-built external =
tools with at least some version of the stuff I build. There was no =
problem with /boot and only minor issues with /rescue which were long =
ago fixed.

Warner=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?09800C62-25DA-4BE4-B87B-8B2F0E1C0AF9>