Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge gcc broke portage. I need help! [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
spitzwegerich
l33t
l33t


Joined: 04 Mar 2003
Posts: 697
Location: Lower Bavaria, Central Europe

PostPosted: Fri Feb 06, 2004 12:43 pm    Post subject: emerge gcc broke portage. I need help! [solved] Reply with quote

Hello!

I have a serious problem: I did a
Code:
emerge gcc
to update gcc, which seemed to have run without an error.

But now I get this:
Code:
root # emerge
/usr/bin/python: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

Code:
root # updatedb

Code:
root # locate libstdc++.so.5
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5.0.3

Code:
root # gcc-config i686-pc-linux-gnu-3.2.3
 * /usr/bin/gcc-config: Could not get portage CHOST!
/usr/bin/gcc-config: line 116: return: can only `return' from a funciont or sourced script
 * Switching to i686-pc-linux-gnu-3.2.3 compiler ...            [ ok ]


I looked into /etc/make.conf. It contains the line
Code:
CHOST="i686-pc-linux-gnu"


Further on:
Code:
root # source /etc/profile

Code:
root # env-update
/usr/bin/python: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

Code:
root # emerge
/usr/bin/python: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory


The problem seems to me that gcc-config cannot get the CHOST setting. But why?

Please help me out of this mess. I am clueless.

~michael
_________________
"Work is the curse of the drinking classes."
-Oskar Wilde


Last edited by spitzwegerich on Sat Feb 07, 2004 11:53 am; 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: Fri Feb 06, 2004 2:29 pm    Post subject: Reply with quote

Try:
Code:
ldconfig

There have been some threads on this before :)
_________________
Mark Loeser
http://www.halcy0n.com
Back to top
View user's profile Send private message
robmoss
Retired Dev
Retired Dev


Joined: 27 May 2003
Posts: 2634
Location: Jesus College, Oxford

PostPosted: Fri Feb 06, 2004 3:30 pm    Post subject: Reply with quote

Code:
REAL_CHOST="i686-pc-linux-gnu" gcc-config 1

_________________
Reality is for those who can't face Science Fiction.

emerge -U will kill your Gentoo
ecatmur, Lord of Portage Bash Scripts
Back to top
View user's profile Send private message
spitzwegerich
l33t
l33t


Joined: 04 Mar 2003
Posts: 697
Location: Lower Bavaria, Central Europe

PostPosted: Fri Feb 06, 2004 4:39 pm    Post subject: Reply with quote

HaLCy0n wrote:
Try:
Code:
ldconfig

There have been some threads on this before :)

I already tried that, but forgot to mention it here. ldconfig does not help. I read the threads about similar problems, but the solutions did not work for me.



Code:
root # REAL_CHOST="i686-pc-linux-gnu" gcc-config 1
 * /usr/bin/gcc-config: Could not get portage CHOST!
/usr/bin/gcc-config: line 116: return: can only `return' from a function of sourced script
 * /usr/bin/gcc-config: Profile does not exist!


Did not work either :(
_________________
"Work is the curse of the drinking classes."
-Oskar Wilde
Back to top
View user's profile Send private message
robmoss
Retired Dev
Retired Dev


Joined: 27 May 2003
Posts: 2634
Location: Jesus College, Oxford

PostPosted: Fri Feb 06, 2004 4:43 pm    Post subject: Reply with quote

Hmmm, I have had this problem before... maybe I backed up gcc-config and replaced any instance of where gcc-config used REAL_CHOST with i686-pc-linux-gnu? In fact, yes, I'm almost sure I did that, although I think it was only one instance that needed replacing.

Change this line:

Code:
export REAL_CHOST="$(/usr/lib/portage/bin/portageq envvar CHOST)"


to this:

Code:
export REAL_CHOST="i686-pc-linux-gnu"

_________________
Reality is for those who can't face Science Fiction.

emerge -U will kill your Gentoo
ecatmur, Lord of Portage Bash Scripts
Back to top
View user's profile Send private message
spitzwegerich
l33t
l33t


Joined: 04 Mar 2003
Posts: 697
Location: Lower Bavaria, Central Europe

PostPosted: Fri Feb 06, 2004 5:37 pm    Post subject: Reply with quote

I tried you suggestion. I changed
Code:
REAL_CHOST="$(/usr/bin/python -c 'import portage; print portage.settings["CHOST"];' 2> /dev/null)"

to
Code:
REAL_CHOST="i686-pc-linux-gnu"

and got rid of the
Code:
/usr/bin/gcc-config: Could not get portage CHOST!

message.

But
Code:
/usr/bin/python: error while loading shared libraries: libstdc++.so.5: cannot open shared

was not affected.


But i was able to solve the problem this way: I changed in /etc/ld.so.conf the line
Code:
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2

to
Code:
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3


Then i did
Code:
root # ldconfig
root # env-update


and now portage works again!!

Many thanks for your hints!


I have a final question: Does anyone know why this error occured? One month ago I updated gcc on 3 boxes without problems. Is it a bug in the current ebuils?
_________________
"Work is the curse of the drinking classes."
-Oskar Wilde
Back to top
View user's profile Send private message
robmoss
Retired Dev
Retired Dev


Joined: 27 May 2003
Posts: 2634
Location: Jesus College, Oxford

PostPosted: Sat Feb 07, 2004 12:04 am    Post subject: Reply with quote

Ooops! Sorry, I forget to mention that bit!

I don't know why there's a problem other than I can tell you that glibc symlink updates are not handled well at all. Things shouldn't follow symlinks to find the actual file to link, they should link against the symlink - so blame the programmer(s).
_________________
Reality is for those who can't face Science Fiction.

emerge -U will kill your Gentoo
ecatmur, Lord of Portage Bash Scripts
Back to top
View user's profile Send private message
TamusJRoyce
n00b
n00b


Joined: 05 Sep 2005
Posts: 1

PostPosted: Mon Sep 05, 2005 3:13 am    Post subject: Thank you for figuring that problem out! ldconfig saved me Reply with quote

I wanted to say thank you for solving that problem. ldconfig worked perfectly. I thought I would have to re-bootstrap linux. Two day's plus the amount of basic system compiling this saved me.

Thanks...
Back to top
View user's profile Send private message
mlybarger
Guru
Guru


Joined: 04 Sep 2002
Posts: 463

PostPosted: Fri Sep 23, 2005 10:38 am    Post subject: Reply with quote

i just got bit ty this thing myself. i found the following guide:

http://mzz.mine.nu/faq/python%20libstdc%2B%2B

and tried it three times, but it didn't work. i changed the real_chost variable and did the steps again, and portage seems to now find the libs it needs. i encountered this after setting up an internal catalyst server and installed binaries on my system. somehow the chost from the catalyst build must have been different than on the client machine. strange.
Back to top
View user's profile Send private message
adamtheo
Tux's lil' helper
Tux's lil' helper


Joined: 03 Sep 2002
Posts: 123
Location: Tallahassee, Florida USA

PostPosted: Sun Feb 19, 2006 7:08 pm    Post subject: Reply with quote

Just to let you all know that I just ran into this problem. I had just installed a Gentoo 2005.1-r1 system, and "emerge -D world" to update my system. According to Bug 84961, it is bad to unmerge the old gcc before recompiling everything that linked to it. But I don't consider this my fault since I had no control over portage unmerging the old gcc, and was certainly not warned about this before starting the emerge. Now I have a broken system.
_________________
* Theoretic Solutions "The Internet's Open Think-Tank" - http://www.theoretic.com
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2805
Location: Oceanside, Ca

PostPosted: Sun Feb 19, 2006 7:28 pm    Post subject: Reply with quote

You got hit by the gcc-3.4 upgrade. at the top this forum is a thread about what to do Upgrading your system to gcc 3.4(.4)
_________________
An A-Z Index of the Linux BASH command line
Back to top
View user's profile Send private message
adamtheo
Tux's lil' helper
Tux's lil' helper


Joined: 03 Sep 2002
Posts: 123
Location: Tallahassee, Florida USA

PostPosted: Sun Feb 26, 2006 1:06 pm    Post subject: Reply with quote

I have followed this thread, as well as the Gentoo Linux GCC Upgrade Guide. My system still broke.

It broke right after the first step: "emerge -uav gcc" It seems the second command on the guide of "gcc-config i686-pc-linux-gnu-3.4.*" breaks the system, because python has not been recompiled for the new gcc yet.

Quote:
/usr/bin/python: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory


Yep, now any action that involves python in any way (such as emerging *anything* ) gets this error.

This seems absolutely absurd, and I'm now very frustrated. I've been using Gentoo for years for both desktop and server, and it seems that ever since it switched over to installing binary packages during install instead of allowing the old stage1 way that I used, I've continually run into problems. For the first time since joining Gentoo, I'm considering switching to another distro.
_________________
* Theoretic Solutions "The Internet's Open Think-Tank" - http://www.theoretic.com
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2805
Location: Oceanside, Ca

PostPosted: Sun Feb 26, 2006 5:25 pm    Post subject: Reply with quote

Try running gcc-config with the little L switch. that should give you a list of gcc's wtih a number beside eash one. Run gcc-config again with the number of your gcc-3.4.4, no dash
Code:
 gcc-config -l  (thats an L)
gcc-config #
env-update && . /etc/profile


And
Quote:
since it switched over to installing binary packages during install
this is incorrect stage1 and stage3 are both precompiled and to run they have to be binaries. When update or rebuld either one it downloads the source files and compiles them. The main advantage in useing a stage3 is that when update, -uD, or rebuild it, -e, It is far less likely to run into a circular dependence. If you stil want to do a stage1you can. This has been thrashed and bashed extensivly here What exactly happened to stage 1? And bootstrapping? So go add your 2 cents there most of use already have :wink:
_________________
An A-Z Index of the Linux BASH command line
Back to top
View user's profile Send private message
WL(inux)
n00b
n00b


Joined: 15 Jan 2004
Posts: 64
Location: Vienna

PostPosted: Sun Feb 26, 2006 10:14 pm    Post subject: Reply with quote

I am having, lets say the "same" problem.

After bootstrapping my new system i get:
Code:
/usr/bin/python: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

i have ONLY gcc 3.4.4 on my system .. i really dont know what to do ...
i have NOT unmerged any gcc version by hand :-(
DAMN

HELP please ... help
_________________
http://www.ViennaLinux.at - Linux User Group Wien
please look @ http://Forum.ViennaLinux.at
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2805
Location: Oceanside, Ca

PostPosted: Sun Feb 26, 2006 10:26 pm    Post subject: Reply with quote

WL(inux) you have a different problem. Look here Gentoo Linux GCC Upgrade Guide
_________________
An A-Z Index of the Linux BASH command line
Back to top
View user's profile Send private message
soigres
l33t
l33t


Joined: 09 Dec 2004
Posts: 648
Location: Milano, Italy

PostPosted: Tue Feb 28, 2006 10:53 am    Post subject: Reply with quote

when i type env-update i still have the same error
Code:
/usr/bin/python: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
i have emerged gcc 3.4.5 but unmerged gcc 3.3.6 before the update of system and world.... what to do?
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Tue Feb 28, 2006 11:15 pm    Post subject: Reply with quote

Moved from Portage & Programming to Duplicate Threads in favour of this FAQ: Error while loading shared libraries: libstdc++.so.5.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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