Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Building with gcc?

41 views
Skip to first unread message

Matthew Fleming

unread,
Nov 24, 2013, 8:28:19 PM11/24/13
to freebsd-hackers
I'm trying to test a change to gcc, and I'd like to do a full
buildworld/buildkernel using the gcc compiler. So I added this to my
/etc/src.conf (and make.conf, since I can't remember under which scenarios
they're different):

WITHOUT_CLANG=YES
WITH_GCC=YES
WITH_GNUCXX=YES

and I started a buildworld. It's currently building clang.

Why is it building clang?

Thanks,
matthew
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hacke...@freebsd.org"

Matthew Fleming

unread,
Nov 24, 2013, 9:00:51 PM11/24/13
to Glen Barber, freebsd-hackers
On Sun, Nov 24, 2013 at 5:31 PM, Glen Barber <g...@freebsd.org> wrote:

> On Sun, Nov 24, 2013 at 05:28:05PM -0800, Matthew Fleming wrote:
> > I'm trying to test a change to gcc, and I'd like to do a full
> > buildworld/buildkernel using the gcc compiler. So I added this to my
> > /etc/src.conf (and make.conf, since I can't remember under which
> scenarios
> > they're different):
> >
> > WITHOUT_CLANG=YES
> > WITH_GCC=YES
> > WITH_GNUCXX=YES
> >
> > and I started a buildworld. It's currently building clang.
> >
> > Why is it building clang?
> >
>
> You also want WITHOUT_CLANG_IS_CC=YES. I have no reasonable explanation
> for why it is different.
>
> You'll also need:
> W_ERROR=
> NO_WERROR=YES



Whoops. I had known about WITH_CLANG_IS_CC back when it wasn't yet the
default. Somehow I didn't make the connection to having to reverse it now.
Seems to be working as I expect now.

Dimitry Andric

unread,
Nov 25, 2013, 7:59:21 AM11/25/13
to Glen Barber, Matthew Fleming, Brooks Davis, freebsd-hackers
On 25 Nov 2013, at 02:31, Glen Barber <g...@freebsd.org> wrote:
> On Sun, Nov 24, 2013 at 05:28:05PM -0800, Matthew Fleming wrote:
>> I'm trying to test a change to gcc, and I'd like to do a full
>> buildworld/buildkernel using the gcc compiler. So I added this to my
>> /etc/src.conf (and make.conf, since I can't remember under which scenarios
>> they're different):
>>
>> WITHOUT_CLANG=YES
>> WITH_GCC=YES
>> WITH_GNUCXX=YES
>>
>> and I started a buildworld. It's currently building clang.
>>
>> Why is it building clang?
>>
>
> You also want WITHOUT_CLANG_IS_CC=YES. I have no reasonable explanation
> for why it is different.

WITHOUT_CLANG and WITHOUT_CLANG_IS_CC were decoupled in r256915 by brooks:

"Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC. This allows
bootstrapping a copy of clang without building clang for the base system
which is useful for nanobsd and similar setups. It's still probably
wrong to conflate what is installed as /usr/bin/cc with the selection
of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another
day."

I would still say that WITHOUT_CLANG implies that you cannot have clang
as cc, so maybe it would be better to error out in this case?

-Dimitry

signature.asc

Ian Lepore

unread,
Nov 25, 2013, 9:58:10 AM11/25/13
to Glen Barber, Matthew Fleming, Brooks Davis, Dimitry Andric, freebsd-hackers
On Mon, 2013-11-25 at 08:36 -0500, Glen Barber wrote:
> Yes, that is what I meant by not having a reasonable explanation why.
> If WITHOUT_CLANG is set, WITHOUT_CLANG_IS_CC should (as it was before)
> be implied.
>
> Glen
>

In a cross-build situation, you should be able to specify
WITH_CLANG_IS_CC and WITHOUT_CLANG and you get a system that is
cross-compiled for the target by clang, but clang itself is not
cross-compiled and installed onto the target. (I'm not sure that
actually works yet, but I think that's the intention.)

The names involved are confusing, but the concept makes sense.

-- Ian

Dewayne Geraghty

unread,
Nov 25, 2013, 12:20:07 PM11/25/13
to freebsd...@freebsd.org
You need, in /etc/make.conf
CC=gcc
Regards, Dewayne.

Brooks Davis

unread,
Nov 26, 2013, 2:00:50 PM11/26/13
to Ian Lepore, Glen Barber, Dimitry Andric, freebsd-hackers, Matthew Fleming
That is the intention as expressed in the commit log. Users of systems
like nanobsd or consumers like NetFlix want to build with the standard
compiler which currently that means bootstrapping clang, but they have
no interest in installing it on the host platform as it's a waste of
space and build time.

> The names involved are confusing, but the concept makes sense.

As the commit log says, it would make sense to break WITH*_CLANG_IS_CC
into WITH*_CLANG_IS_CC and something like WITH*_CROSS_COMPILER_IS_CLANG,
that name also sucks so it wasn't the issue I was trying to address at
the time.

Yes, the names suck, but I didn't invent them. There should probably be
some hierarchy in the names so things that effect _what_ is built (most
of the options) are clearly differentiated from things that effect _how_
things are built.

-- Brooks
0 new messages