Re: [Debian-bootstrap] An apparent need for gcc-<triplet>, cpp-<triplet>, g++-<triplet>, etc.

"P. J. McDermott" <[email protected]>
Newsgroups gmane.linux.debian.devel.embedded
Message-ID <[email protected]>
On 2012-07-02 06:52, Wookey wrote:
> The disadvantage of the way it's currently done is that if a
> knowledgeable user installs gcc-4.7-<triplet> they get a toolchain
> that doesn't work.

AFAICT, this applies to the native compiler packages as well.  A user
can install gcc-4.7 without installing gcc.  However, I think users tend
to install gcc rather than a real versioned package like gcc-4.7.  And
more to the point, build-essential depends on gcc, not on gcc-4.7.

But it's not that the toolchain "doesn't work" per se if a user doesn't
install gcc or gcc-<triplet>.

Basically, a user who installs only a versioned compiler package (e.g.
gcc-4.7) gets only a versioned compiler name (/usr/bin/gcc-4.7).  But
for a user who installs gcc and/or build-essential, things will Just Work.

As I mentioned before [1], I'd like to make this Just Work with
crossbuild-essential-<target> packages [2][3] as well by depending on
gcc-<triplet> and g++-<triplet> rather than gcc-4.7-<triplet> and
g++-4.7-<triplet>.

> My questions are:
> how does it work for native gcc?

src:gcc-defaults builds a number of metapackages (gcc, cpp, g++, ...).
Each of these depends on the default version of a tool and provides a
symbolic link to it.  For example, the gcc package in sid currently
depends on cpp (>= 4:4.7.1-1) and gcc-4.7 (>= 4.7.1-1~) and provides a
link at /usr/bin/gcc to /usr/bin/gcc-4.7.

So when a user runs `gcc foo.c` or natively builds a Debian package that
contains C code, he/she is using a symbolic link provided by a metapackage.

If a user wants to use a version of GCC (e.g. 4.6) other than the
current Debian default, he/she can just run the executable directly
(e.g. `gcc-4.6 foo.c`).  Setting the "CC" variable to the desired
version of the compiler should suffice for building most packages.  In
other cases, manually changing the symbolic link at /usr/bin/gcc is of
course always an option.

> And reason not to do the same thing in cross-world?

None as far as I can tell.  That's why I proposed that we do so. :)

[1]:
http://lists.mister-muffin.de/pipermail/debian-bootstrap/2012-July/000248.html
[2]: http://bootstrap.pehjota.net/build-essential/
[3]: http://bootstrap.pehjota.net/archive/pool/main/c/cross-build-essenti

-- 
P. J. McDermott                                        (_/@\_)    ,--.
http://www.pehjota.net/                           o    < o o >   / oo \
http://www.pehjota.net/contact.html                 o   \ `-/    | <> |.
                                                o o o    "~v    /_\--/_/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.