Mailing List Archive

gcc-config 2.0 development
I've been pretty busy this summer and haven't had much time to devote to
the gcc-config changes we discussed here a couple months back until
yesterday. I created a cvs repository for the development in
gentoo/src/toolchain/gcc-config. Right now, it's barely more than
framework for the code and a README detailing some aspects of the
program (specifically changes from the current 1.3.X line). I'm not
worrying about a migration path right now, but it shouldn't be too
difficult. The only major headache I can think of is someone
downgrading.

The configuration files are in XML. I'm a little apprehensive about
having such a core package depend on an outside library like this, but I
think having the xml configuration files allows a much more robust
configuration. Plus, we can use USE=static. I don't have much
experience dealing with creating dtds or the libxml2 API, so if someone
else would like to help out with implementing that part of the code, I
would appreciate the help... but I'm not expecting that to hold me up
too much if nobody volunteers.

Along with moving to this new gcc-config, we should address the "gcc
upgrade la hell" problem. az and I talked about this a few times, and
we came to the conclusion that deleting the .la files installed by gcc
would be the best option. See bug #75420 comment #34 and
http://ramblings.hudscabin.com/blogs/index.php/2005/05/02/multilib_and_toolchain_thoughts for a little more...

Here's the current README. I welcome comments, criticisms, concerns,
and assistance as I start implementing this.

--Jeremy

gcc-config 2.0

gcc-config 2.0 is incompatible with previous versions of gcc-config. A
migration path has not been implemented yet.

With gcc-config 2.0, the configuration options have expanded. The
wrapper now
uses the configuration find the execuatble to fork off rather than
searching through
the $PATH. Each CHOST has a profile associated with it. The CHOST used
by the wrapper
is determined by the first matching criteria:

1) If the ABI environment variable is set, and CHOST_${ABI} is also set,
it will be
used. This is a deprecated feature and is really only here for
backwards
compatibility. It will be removed once all ebuilds and profiles
relying on this
feature have been removed from portage.
2) If the executable is called with a CHOST prefix, it is used.
3) If the CHOST environment variable is set, it is used.
4) The default CHOST is used.

configuration directory: /etc/gcc-config
All configuration information is stored in this directory. The current
config
format is as follows, but it is subject to change before release.

The selection file (/etc/gcc-config/selection.conf) lists the currently
selected
profiles for each CHOST handled by gcc-config. It is formatted as
follows:
<selections>
<default_chost>##DEFAULT CHOST##</default_chost>
<selection>
<chost>##CHOST##</chost>
<version>##gcc version being used##</version>
<profile>##profile name##</profile>
</selection>
<selection>
...
</selection>
...
</selections>

Configuration file (for each installed gcc package) is
named /etc/gcc-config/<version>.conf formatted as follows:
<gcc_profiles>
<version>##version##</version>
<binpath>##Path containing binaries to execute when using this
profile##</binpath>
<infopath>##Where the info pages are##</infopath>
<manpath>##Where the man pages are##</manpath>
<profile>
<name>##Profile Name##</name>
<chost>##Default CHOST for this profile##</name>
<spec>##GCC specs file to use##</spec>
<ldpath>##Path to add to ld.so.conf##</ldpath>
<cflags>##additional CFLAGS to prepend to the command line##</cflags>
</profile>
<profile>
...
</profile>
...
</gcc_profiles>

Note that the <chost> in <profile> is only used as a way to tell the
user what this profile is used for.
The <chost> set in the <selection> tag determines how the binaries act.
The <default_chost> in the <selections>
tag determines how the binaries 'gcc', 'g++', etc (that is the ones
without a prefix) behave.

Example /etc/gcc-config/master.conf:
<selections>
<default_chost>x86_64-pc-linux-gnu</default_chost>
<selection>
<chost>x86_64-pc-linux-gnu</chost>
<version>x86_64-pc-linux-gnu-3.4.4</version>
<profile>amd64-vanilla</profile>
</selection>
<selection>
<chost>i686-pc-linux-gnu</chost>
<version>x86_64-pc-linux-gnu-3.4.4</version>
<profile>x86-vanilla</profile>
</selection>
<selection>
<chost>pentium4-pc-linux-gnu</chost>
<version>x86_64-pc-linux-gnu-3.4.4</version>
<profile>p4-vanilla</profile>
</selection>
</selections>

Example /etc/gcc-config/x86_64-pc-linux-gnu-3.4.4.conf:
<gcc_profiles>
<version>x86_64-pc-linux-gnu-3.4.4</version>
<binpath>/usr/x86_64-pc-linux-gnu/gcc-bin/3.4.4</binpath>
<infopath>/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4.4/info</infopath>
<manpath>/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4.4/man</manpath>
<profile>
<name>amd64-vanilla</name>
<spec>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/vanilla.specs</spec>
<ldpath>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4</ldpath>
<cflags>-m64</cflags>
</profile>
<profile>
<name>amd64-hardened</name>
<spec>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/hardened.specs</spec>
<ldpath>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4</ldpath>
<cflags>-m64</cflags>
</profile>
<profile>
<name>x86-vanilla</name>
<spec>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/vanilla.specs</spec>
<ldpath>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/32</ldpath>
<cflags>-m32</cflags>
</profile>
<profile>
<name>p4-vanilla</name>
<spec>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/vanilla.specs</spec>
<ldpath>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/32</ldpath>
<cflags>-march=pentium4 -m32</cflags>
</profile>
</gcc_profiles>
Re: gcc-config 2.0 development [ In reply to ]
On Tue, 09 Aug 2005 13:53:25 -0700 Jeremy Huddleston
<eradicator@gentoo.org> wrote:
| The configuration files are in XML. I'm a little apprehensive about
| having such a core package depend on an outside library like this,

As you should be.

| but I think having the xml configuration files allows a much more
| robust configuration.

How so? Using XML doesn't magically make your data files any different.
It simply makes them much harder to parse.

--
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
Re: gcc-config 2.0 development [ In reply to ]
On Tue, 2005-08-09 at 22:19 +0100, Ciaran McCreesh wrote:
> | but I think having the xml configuration files allows a much more
> | robust configuration.
>
> How so? Using XML doesn't magically make your data files any different.
> It simply makes them much harder to parse.

That's a matter of opinion. I see it as a way to abstract away the
configuration and utilize an existing library to handle the parsing. If
we do want to eliminate outside dependencies (which I think is an
extremely valid point and concern), then we could internally implement a
different configuration format that is easier to parse. I'd probably go
for something similar to the samba/gdm config files if we were to go
down this road:

selection.conf:
[global]
default_chost = i686-pc-linux-gnu

[i686-pc-linux-gnu]
version=i686-pc-linux-gnu-3.4.4
profile=vanilla

i686-pc-linux-gnu-3.4.4.conf:
[global]
version=i686-pc-linux-gnu-3.4.4
bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4.4
manpath=blah
infopath=blah

[vanilla]
ldpath=blah
spec=blah

[hardened]
...

So what do people think of these two options?

--Jeremy
Re: Re: gcc-config 2.0 development [ In reply to ]
On Tue, 2005-08-09 at 15:12 -0700, Jeremy Huddleston wrote:
> On Tue, 2005-08-09 at 22:19 +0100, Ciaran McCreesh wrote:
> > | but I think having the xml configuration files allows a much more
> > | robust configuration.
> >
> > How so? Using XML doesn't magically make your data files any different.
> > It simply makes them much harder to parse.
>
> That's a matter of opinion. I see it as a way to abstract away the
> configuration and utilize an existing library to handle the parsing. If
> we do want to eliminate outside dependencies (which I think is an
> extremely valid point and concern), then we could internally implement a
> different configuration format that is easier to parse. I'd probably go
> for something similar to the samba/gdm config files if we were to go
> down this road:

<snip>

I've always been a fan of samba style config files..unlike xml they tend
to be both easy to parse and are human readable. I'd far rather see this
over XML. It's especially attractive as this is also the way that
portage is moving (at the moment) as well.

--Dan

--
gentoo-dev@gentoo.org mailing list
Re: Re: gcc-config 2.0 development [ In reply to ]
On Tue, 09 Aug 2005 15:12:48 -0700 Jeremy Huddleston
<eradicator@gentoo.org> wrote:
| On Tue, 2005-08-09 at 22:19 +0100, Ciaran McCreesh wrote:
| > | but I think having the xml configuration files allows a much more
| > | robust configuration.
| >
| > How so? Using XML doesn't magically make your data files any
| > different. It simply makes them much harder to parse.
|
| That's a matter of opinion.

Not really. It's pretty easy to prove that a full XML parser is
computationally more complicated (and hence slower and more bug prone)
than most 'obvious' flat text file formats.

| I see it as a way to abstract away the
| configuration and utilize an existing library to handle the parsing.
| If we do want to eliminate outside dependencies (which I think is an
| extremely valid point and concern), then we could internally
| implement a different configuration format that is easier to parse.

Interacting with an XML library is around the same degree of difficulty
as writing a simple flat text parser. Remember that if you're using
XML, you have to be able to handle *all* the fancy XML nonsense,
including DTD voodoo and processor directives.

The only 'advantages' to XML are that you can partially validate the
syntax (but not the contents) of a file and that by writing a really
complicated XSLT mess you can transform it into a different XML file.
The former is a duff argument because a) the only reason you need
validation is because XML's syntax is so complicated and b) you can't
validate CDATA things anyway. The latter is silly because you can use
sed, grep, cut etc on any sane textfile format, and it's far easier
than XSLT.

| I'd probably go for something similar to the samba/gdm config files
| if we were to go down this road:
<snip>

Much saner.

--
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
Re: Re: gcc-config 2.0 development [ In reply to ]
On Wednesday 10 August 2005 00:12, Jeremy Huddleston wrote:
> I'd probably go
> for something similar to the samba/gdm config files if we were to go
> down this road:
Such a format would be also simpler to parse in C, for example using
libconfuse (that's *really* simple to use, and quite small), and KDE too has
a way to parse it automatically.
Probably that's the best way to go.

--
Diego "Flameeyes" Pettenò
Gentoo Developer - http://dev.gentoo.org/~flameeyes/
(Gentoo/FreeBSD, Video, Gentoo/AMD64, Sound, PAM)
Re: Re: gcc-config 2.0 development [ In reply to ]
On Tue, 2005-08-09 at 18:14 -0400, Daniel Ostrow wrote:
> On Tue, 2005-08-09 at 15:12 -0700, Jeremy Huddleston wrote:
> > On Tue, 2005-08-09 at 22:19 +0100, Ciaran McCreesh wrote:
> > > | but I think having the xml configuration files allows a much more
> > > | robust configuration.
> > >
> > > How so? Using XML doesn't magically make your data files any different.
> > > It simply makes them much harder to parse.
> >
> > That's a matter of opinion. I see it as a way to abstract away the
> > configuration and utilize an existing library to handle the parsing. If
> > we do want to eliminate outside dependencies (which I think is an
> > extremely valid point and concern), then we could internally implement a
> > different configuration format that is easier to parse. I'd probably go
> > for something similar to the samba/gdm config files if we were to go
> > down this road:
>
> <snip>
>
> I've always been a fan of samba style config files..unlike xml they tend
> to be both easy to parse and are human readable. I'd far rather see this
> over XML. It's especially attractive as this is also the way that
> portage is moving (at the moment) as well.

<AOL>
me too
</AOL>

I highly prefer the samba style config file over an XML file. It is easy
to read, parse, and edit by both human and machine.

Regards,
Paul
--
gentoo-dev@gentoo.org mailing list
Re: Re: gcc-config 2.0 development [ In reply to ]
On Tuesday 09 August 2005 06:37 pm, Paul Varner wrote:
> On Tue, 2005-08-09 at 18:14 -0400, Daniel Ostrow wrote:
> > On Tue, 2005-08-09 at 15:12 -0700, Jeremy Huddleston wrote:
> > > On Tue, 2005-08-09 at 22:19 +0100, Ciaran McCreesh wrote:
> > > > | but I think having the xml configuration files allows a much more
> > > > | robust configuration.
> > > >
> > > > How so? Using XML doesn't magically make your data files any
> > > > different. It simply makes them much harder to parse.
> > >
> > > That's a matter of opinion. I see it as a way to abstract away the
> > > configuration and utilize an existing library to handle the parsing.
> > > If we do want to eliminate outside dependencies (which I think is an
> > > extremely valid point and concern), then we could internally implement
> > > a different configuration format that is easier to parse. I'd probably
> > > go for something similar to the samba/gdm config files if we were to go
> > > down this road:
> >
> > <snip>
> >
> > I've always been a fan of samba style config files..unlike xml they tend
> > to be both easy to parse and are human readable. I'd far rather see this
> > over XML. It's especially attractive as this is also the way that
> > portage is moving (at the moment) as well.
>
> <AOL>
> me too
> </AOL>
>
> I highly prefer the samba style config file over an XML file. It is easy
> to read, parse, and edit by both human and machine.

arent 'samba style configs' just glorified ini files ? :)
-mike
--
gentoo-dev@gentoo.org mailing list
Re: Re: gcc-config 2.0 development [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 9 Aug 2005, Jeremy Huddleston wrote:
==========
SNIP
==========

> That's a matter of opinion. I see it as a way to abstract away the
> configuration and utilize an existing library to handle the parsing. If
> we do want to eliminate outside dependencies (which I think is an
> extremely valid point and concern), then we could internally implement a
> different configuration format that is easier to parse. I'd probably go
> for something similar to the samba/gdm config files if we were to go
> down this road:
>
> selection.conf:
> [global]
> default_chost = i686-pc-linux-gnu
>
>
=========
=========
> So what do people think of these two options?
>
> --Jeremy
>

I prefer the samba/gdm style. I can more quickly see what is going on by
looking at it.

Regards,
Ferris

- --
Ferris McCormick (P44646, MI) <fmccor@gentoo.org>
Developer, Gentoo Linux (sparc, devrel)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC+TKKQa6M3+I///cRAsQbAJ9sT3BPflBdF/arl+dU9MskhDOAUQCggxLj
putJPpW4Y2nDAe1BnF2+PS8=
=VORe
-----END PGP SIGNATURE-----
--
gentoo-dev@gentoo.org mailing list
Re: Re: gcc-config 2.0 development [ In reply to ]
On Tue, 9 Aug 2005 18:43:54 -0400 Mike Frysinger <vapier@gentoo.org>
wrote:
| arent 'samba style configs' just glorified ini files ? :)

Linux doesn't have .ini files!

--
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
Re: Re: gcc-config 2.0 development [ In reply to ]
On Wednesday 10 August 2005 00:43, Mike Frysinger wrote:
> arent 'samba style configs' just glorified ini files ? :)
they are

--
Diego "Flameeyes" Pettenò
Gentoo Developer - http://dev.gentoo.org/~flameeyes/
(Gentoo/FreeBSD, Video, Gentoo/AMD64, Sound, PAM)
Re: gcc-config 2.0 development [ In reply to ]
On Wed, 2005-08-10 at 00:34 +0200, Diego 'Flameeyes' Pettenò wrote:
> On Wednesday 10 August 2005 00:12, Jeremy Huddleston wrote:
> > I'd probably go
> > for something similar to the samba/gdm config files if we were to go
> > down this road:
> Such a format would be also simpler to parse in C, for example using
> libconfuse (that's *really* simple to use, and quite small), and KDE too has
> a way to parse it automatically.
> Probably that's the best way to go.

Ok, then I'll run with the samba style config. I'll take a look at
libconfuse too, but I'd really like to avoid outside dependencies... but
we could go the USE=static route or just include it in gcc-config
itself...
Re: gcc-config 2.0 development [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeremy Huddleston wrote:
| I've been pretty busy this summer and haven't had much time to devote to
| the gcc-config changes we discussed here a couple months back until
| yesterday. I created a cvs repository for the development in
| gentoo/src/toolchain/gcc-config. Right now, it's barely more than
| framework for the code and a README detailing some aspects of the
| program (specifically changes from the current 1.3.X line). I'm not
| worrying about a migration path right now, but it shouldn't be too
| difficult. The only major headache I can think of is someone
| downgrading.

While you're doing this, it would be very helpful if you could keep the
possibility of non-gcc compilers in mind, e.g. icc/ifc and tcc. Even if
you don't make it possible to switch to them now, it would be helpful to
architect it in some way that the work wouldn't be as difficult for
someone later on.

Thanks,
Donnie
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC+VN2XVaO67S1rtsRAg8lAKDNFVJycKTaBO0iRy2ijsbml6/BQACg7kyS
UWG5p4mVSDqVKP28h6EpRXE=
=T7Nr
-----END PGP SIGNATURE-----
--
gentoo-dev@gentoo.org mailing list