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
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)
(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
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
(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.
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##*/} "$@"