Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2013 15:26:32 -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:  <20130227232632.74C2F58096@chaos.jnpr.net>
In-Reply-To: <20130227220520.GB19594@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> <20130227202822.8F53B58096@chaos.jnpr.net> <20130227220520.GB19594@lor.one-eyed-alien.net>

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

On Wed, 27 Feb 2013 16:05:20 -0600, Brooks Davis writes:
>I like the end goal, but it doesn't feel like taking this route gets me
>any less code in Makefile.inc1 in the short term.

Makefile.inc1 are perhaps necessary for the short term.
I'm not using them at all, but also not yet building the entire
universe.

>I don't like that for now it forces me to use traditional names for
>all these tools (they must match the name of the native tools) and to
>install them next to each other (or create a link farm to do that).

Sorry, I might be caffeine deficient, can you elabortate?
I don't see how that follows.
Anything done via *.mk can be overridden via Makefile.inc1
and if need be you can always use extra variables.

>This seems to make it unnecessarily difficult to perform any kind of
>casual compiler testing across the whole tree.

You are presumably wanting to separately control the basename of the
compiler as well as its location ?

Separate variables?
Presumably by changing compiler you also need to control CFLAGS...
eg. I found it necessary to add

CFLAGS_LAST.clang += -isystem ${STAGE_OBJTOP}/usr/include/clang/3.2
CXXFLAGS_LAST += ${CFLAGS_LAST.${COMPILER_TYPE}}

You could get carried away with indirection...

CLANG_NAME?= clang32
GCC_NAME?= gcc42

COMPILER_TYPE.c ?= gcc
COMPILER_TYPE.cc ?= clang

COMPILER.c ?= ${${COMPILER_TYPE.c:tu}_NAME}

CC ?= ${COMPILER_PATH.${COMPILER.c}}${COMPILER.c}

which lets you indivitually control the type of compiler its name is
path etc 

>> >Otherwise /rescue fails as do several things in /boot.
>>=20
>> That would presumably be bugs in the relevant makefiles no?
>
>The problem in both cases is that they need tight control of C(XX)FLAGS
>in order to generate small or static binaries.  There are any number

Again can you elaborate - I just took a quick look and didn't see 
anything under rescue/ that wasn't a simple addition to CFLAGS.

>Making the options part of CC works today and avoids needing to modify
>many makefiles whose products I can't test easily or in many cases at
>all.  Notionally I feel it's equivalent to creating a wrapper script
>around each tool to change a couple defaults without the overhead or
>hassle.

So long as you don't have to do it via Makefile.inc1 that may be so.

>While I could test the /rescue case, fixing it involves modifying
>cruchgen and my first attempt to look at it lead me to run away quickly. :)

I'm obviously missing something, so before you dive into that
let's get on the same page ;-)



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