Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 164307 - sys-devel/gcc-config doesn't like symlinks to compilers
Summary: sys-devel/gcc-config doesn't like symlinks to compilers
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High enhancement
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-28 20:46 UTC by Nuno Lopes
Modified: 2007-01-30 04:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nuno Lopes 2007-01-28 20:46:49 UTC
making a link to e.g. /usr/bin/gcc (or g++) named something different than gcc leads to errors from gcc-config.
For example linking /usr/bin/gcc -> /cvs/.../mipsel-linux-gcc doesn't work. However if I link to a version specific gcc (e.g. /usr/bin/gcc-4.1.1) it works as expected.

Reproducible: Always
Comment 1 SpanKY gentoo-dev 2007-01-28 22:42:06 UTC
i dont really get what you're trying to do, but i dont see it as being useful/valid in anyway

(linking `gcc` to `mipsel-linux-gcc` ?  fix your code :P)
Comment 2 Nuno Lopes 2007-01-28 23:41:01 UTC
(In reply to comment #1)
> i dont really get what you're trying to do, but i dont see it as being
> useful/valid in anyway
> (linking `gcc` to `mipsel-linux-gcc` ?  fix your code :P)

This look strange yes, but it is *very* useful for running an open-source program that I maintain (http://opensdk.sf.net). It "emulates" a MIPS architecture and so it needs those links.
So although it might not sound useful, I would like to ask you to reconsider this problem again. (I tried this on some other distros and gentoo is the only one that shows this 'broken' behaviour)

Thanks,
Nuno
Comment 3 SpanKY gentoo-dev 2007-01-29 00:24:41 UTC
forcing the native compiler to actually be a cross-compiler is wrong; end of story

i really dont know what broken behavior you're talking about as your description is pretty vague
Comment 4 Nuno Lopes 2007-01-29 18:22:50 UTC
(In reply to comment #3)
> forcing the native compiler to actually be a cross-compiler is wrong; end of
> story
> 
> i really dont know what broken behavior you're talking about as your
> description is pretty vague

I am not creating a cross-compiler. I am just simulating one, to allow the usage of the same makefile for different archs (this is a tricky thing, yes, but really useful for robotics researchers).

So let me explain what's going on (this time I hope I'll be clear enough):
# ls -l
mipsel-linux-g++ -> /usr/bin/g++
mipsel-linux-gcc -> /usr/bin/gcc-4.1.1

# ./mipsel-linux-gcc --version
mipsel-linux-gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3)

# ./mipsel-linux-g++ --version
gcc-config error: Could not run/locate "mipsel-linux-g++"


So linking to a version specific gcc works, but not when linking to the "generic" script.
Comment 5 SpanKY gentoo-dev 2007-01-30 04:24:10 UTC
ok, so your original description is wrong ... you said you were linking gcc to mipsel-linux-gcc, not mipsel-linux-gcc to gcc

the behavior you're seeing is correct and i'm pretty sure we dont want to change it

the reason it works linking to a specific version is because that isnt gcc-config, it's actually a symlink to the actual gcc compiler

the reason it doesnt work when linking to the gcc-config wrapper is because gcc-config utilizes argv[0] to figure out which compiler to actually call

you wouldnt want to have a real cross-compiler that was installed improperly falling back to using the native compiler ... you want it to spit an error because it's wrong

use a shell script instead:
#!/bin/bash
exec ${0##*/} "$@"