Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] emerge -u portage distroyed my gcc
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
ohaleck
n00b
n00b


Joined: 26 Mar 2003
Posts: 46
Location: Krakow, Poland

PostPosted: Tue Aug 31, 2004 3:32 pm    Post subject: [solved] emerge -u portage distroyed my gcc Reply with quote

I did emerge -u portage after a long time of using my Gentoo 1.4.
It crashed during the installation of gawk 3.1.3-r1 and config.log gave me the following info:
Code:
configure:1847: checking for i686-pc-linux-gnu-gcc
configure:1873: result: gcc
configure:2155: checking for C compiler version
configure:2158: gcc --version </dev/null >&5
gcc-config error: Could not run/locate "gcc"
configure:2161: $? = 1
configure:2163: gcc -v </dev/null >&5
gcc-config error: Could not run/locate "gcc"
configure:2166: $? = 1
configure:2168: gcc -V </dev/null >&5
gcc-config error: Could not run/locate "gcc"
configure:2171: $? = 1
configure:2195: checking for C compiler default output
configure:2198: gcc -O3 -mcpu=pentium3 -funroll-loops -pipe   conftest.c  >&5
gcc-config error: Could not run/locate "gcc"
configure:2201: $? = 1
configure: failed program was:
| #line 2174 "configure"
| /* confdefs.h.  */
|
| #define PACKAGE_NAME "GNU Awk"
| #define PACKAGE_TARNAME "gawk"
| #define PACKAGE_VERSION "3.1.3"
| #define PACKAGE_STRING "GNU Awk 3.1.3"
| #define PACKAGE_BUGREPORT "bug-gawk@gnu.org"
| #define PACKAGE "gawk"
| #define VERSION "3.1.3"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2240: error: C compiler cannot create executables
See `config.log' for more details.


After that I couldn't even run emerge or man as the system could not locate libstdc++.so.5 and libgcc_s.so.1 so made links to /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/ and got at least these up and running.
Unfortunately I can't compile a thing because gcc gives me
Code:
gcc-config error: Could not run/locate gcc
error

They are probably somewere but I have no idea how to link them.
Any help? Please!!


Last edited by ohaleck on Fri Sep 03, 2004 12:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
Halcy0n
Developer
Developer


Joined: 17 Sep 2003
Posts: 1682
Location: Freehold, NJ

PostPosted: Tue Aug 31, 2004 4:11 pm    Post subject: Reply with quote

I'm guessing you have gcc 3.3.4 now and that's the reason. Try:
Code:
gcc-config /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/
and see if that loads up the new profile.
_________________
Mark Loeser
http://www.halcy0n.com
Back to top
View user's profile Send private message
ohaleck
n00b
n00b


Joined: 26 Mar 2003
Posts: 46
Location: Krakow, Poland

PostPosted: Wed Sep 01, 2004 6:38 pm    Post subject: Reply with quote

I wish it was so simple. I have gcc 3.3.3. I tried this with it and had another error like this:
Code:
# gcc-config /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/
 * /usr/bin/gcc-config: Profile does not exist!

Do you think installing from a package would help?
Back to top
View user's profile Send private message
spb
Retired Dev
Retired Dev


Joined: 02 Jan 2004
Posts: 2135
Location: Cambridge, UK

PostPosted: Wed Sep 01, 2004 6:39 pm    Post subject: Reply with quote

Code:
gcc-config i686-pc-linux-gnu-3.3.4
Back to top
View user's profile Send private message
ohaleck
n00b
n00b


Joined: 26 Mar 2003
Posts: 46
Location: Krakow, Poland

PostPosted: Wed Sep 01, 2004 6:52 pm    Post subject: Reply with quote

I have gcc 3.3.3, not 3.3.4 :(
Actually launching gcc-config with any parameters causes it to return "Profile does not exist" message. And I have absolutely no idea how to create or recover it.
Back to top
View user's profile Send private message
ohaleck
n00b
n00b


Joined: 26 Mar 2003
Posts: 46
Location: Krakow, Poland

PostPosted: Thu Sep 02, 2004 12:53 pm    Post subject: Reply with quote

Is there any way to recover the gcc or just the links without recompiling?
Back to top
View user's profile Send private message
spb
Retired Dev
Retired Dev


Joined: 02 Jan 2004
Posts: 2135
Location: Cambridge, UK

PostPosted: Thu Sep 02, 2004 2:34 pm    Post subject: Reply with quote

(1) 'gcc-config -l'. Do you have *any* active gcc profiles?
(2) If you have gentoolkit installed, 'qpkg -I -v gcc'. Do you have it installed? If you don't have gentoolkit, 'emerge -p gcc'.
(3) 'which gcc'. Does that tell you anything useful?
(4) ls -l /usr/bin/gcc. Does it exist? If so, is it a link to anything else?
(5) If you've got to this point, I'm guessing you really don't have gcc installed. Go here and download a binary of whichever version you need. Then cd to / and unpack it (tar xvjpf /path/to/gcc-version.tbz2-- the p is important). Then try to emerge gcc. If that works, you're set, and if not, you're screwed. ;)
Back to top
View user's profile Send private message
ohaleck
n00b
n00b


Joined: 26 Mar 2003
Posts: 46
Location: Krakow, Poland

PostPosted: Thu Sep 02, 2004 3:10 pm    Post subject: Reply with quote

thebell wrote:
(1) 'gcc-config -l'. Do you have *any* active gcc profiles?

No.
Code:
* /usr/bin/gcc-config: Profile does not exist!


Quote:
(2) If you have gentoolkit installed, 'qpkg -I -v gcc'. Do you have it installed? If you don't have gentoolkit, 'emerge -p gcc'.

Gives me this:
Code:
sys-devel/gcc-3.3.3-r6 *
sys-devel/gcc-config-1.3.5 *

Quote:
(3) 'which gcc'. Does that tell you anything useful?

Just the regular: /usr/bin/gcc :(
Quote:
(4) ls -l /usr/bin/gcc. Does it exist? If so, is it a link to anything else?

It exists but is not a link:
Code:
-rwxr-xr-x    1 root     root         7400 Aug 31 00:39 /usr/bin/gcc

Quote:
(5) If you've got to this point, I'm guessing you really don't have gcc installed. Go here and download a binary of whichever version you need. Then cd to / and unpack it (tar xvjpf /path/to/gcc-version.tbz2-- the p is important). Then try to emerge gcc. If that works, you're set, and if not, you're screwed. ;)

I've done it exactly the way you said and... nothing changed. gcc-config -l still shows no profiles and gcc says it cannot find gcc!!
Back to top
View user's profile Send private message
spb
Retired Dev
Retired Dev


Joined: 02 Jan 2004
Posts: 2135
Location: Cambridge, UK

PostPosted: Thu Sep 02, 2004 3:23 pm    Post subject: Reply with quote

OK, what happens if you make a simple .c file in your home directory, like
Code:
#include <stdio.h>
int main()
{
    printf("Hello, world.\n");
    return 0;
}
and try to compile it by
Code:
gcc hello.c -o hello
?
Back to top
View user's profile Send private message
ohaleck
n00b
n00b


Joined: 26 Mar 2003
Posts: 46
Location: Krakow, Poland

PostPosted: Thu Sep 02, 2004 3:40 pm    Post subject: Reply with quote

As usual:
Code:
gcc-config error: Could not run/locate "gcc"
Back to top
View user's profile Send private message
spb
Retired Dev
Retired Dev


Joined: 02 Jan 2004
Posts: 2135
Location: Cambridge, UK

PostPosted: Thu Sep 02, 2004 3:45 pm    Post subject: Reply with quote

OK, sounds like your gcc-config might be screwed. Go to the link I gave above and download the gcc-config binary. Unpack that over /, and see whether it can find a gcc this time.
Back to top
View user's profile Send private message
ohaleck
n00b
n00b


Joined: 26 Mar 2003
Posts: 46
Location: Krakow, Poland

PostPosted: Thu Sep 02, 2004 4:18 pm    Post subject: Reply with quote

There's some progress :? Now instead of
Code:
gcc-config error: Could not run/locate "gcc"
I get
Code:
Could not run/locate "gcc"
when I run gcc, try to compile etc.
Back to top
View user's profile Send private message
ohaleck
n00b
n00b


Joined: 26 Mar 2003
Posts: 46
Location: Krakow, Poland

PostPosted: Thu Sep 02, 2004 4:25 pm    Post subject: Reply with quote

Might /etc/make.profile have anything to do with it? I did not have it and emerge said it would be better to make a link to /usr/portage/profiles so I linked it to /usr/portage/profiles/default-x86-1.4/ and it seemed to work...
Back to top
View user's profile Send private message
spb
Retired Dev
Retired Dev


Joined: 02 Jan 2004
Posts: 2135
Location: Cambridge, UK

PostPosted: Thu Sep 02, 2004 4:55 pm    Post subject: Reply with quote

Hmm...a lack of make.profile might do something to it-- I'm no expert on how gcc-config works. Better than default-x86-1.4 is to link it to /usr/portage/profiles/default-linux/x86/2004.2 though-- you get a newer profile and in the new stacked format.
Back to top
View user's profile Send private message
ohaleck
n00b
n00b


Joined: 26 Mar 2003
Posts: 46
Location: Krakow, Poland

PostPosted: Thu Sep 02, 2004 6:06 pm    Post subject: Reply with quote

It didn't help either :(
Back to top
View user's profile Send private message
ohaleck
n00b
n00b


Joined: 26 Mar 2003
Posts: 46
Location: Krakow, Poland

PostPosted: Fri Sep 03, 2004 12:48 pm    Post subject: Reply with quote

It was sooo simple but how could I know?
I edited /etc/env.d/gcc/config and changed CURRENT=i686-pc-linux-gnu-3.2.3 to CURRENT=i686-pc-linux-gnu-3.3.3.
Now gcc-config can see the profile and gcc can compile.
Great thanks to you thebell!!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum