Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] GCC can't compile anything
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
ggaaron
Apprentice
Apprentice


Joined: 10 May 2007
Posts: 217

PostPosted: Wed Jun 24, 2009 2:59 pm    Post subject: [solved] GCC can't compile anything Reply with quote

Hi,
when I run GCC I get this:
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.3.3/cc1: error while loading shared libraries: libmpfr.so.: cannot open shared object file: No such file or directory
I can't compile anything, even recompile GCC. GCC has worked this morning and I have only updated X.Org since then. /usr/lib/libmpfr.so is present, so I don't know why GCC is complaining. Anyone has any ideas how to fix my system?=/

Thanks in advance
ggaaron


Last edited by ggaaron on Thu Jun 25, 2009 8:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10427
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Jun 24, 2009 3:08 pm    Post subject: Reply with quote

Looks like a symlink might have gotten hosed. Look at the output of
Code:
ls -l /usr/lib/libmpfr.so*
(Post it if you'd like detailed help.) Make a symlink in that directory named libmpfr.so to the latest version. You should have a file in /usr/lib named something like libmpfr.so.1.2.0 that should be the target of the symlink.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
vincent-
Retired Dev
Retired Dev


Joined: 13 Jan 2007
Posts: 415
Location: Valencia (Spain)

PostPosted: Wed Jun 24, 2009 3:14 pm    Post subject: Reply with quote

Try a revdep-rebuild.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10427
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Jun 24, 2009 3:17 pm    Post subject: Reply with quote

Compiler has to be working first. :P

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
ggaaron
Apprentice
Apprentice


Joined: 10 May 2007
Posts: 217

PostPosted: Wed Jun 24, 2009 3:25 pm    Post subject: Reply with quote

$ ls -l /usr/lib/libmpfr.so*
lrwxrwxrwx 1 root root 16 2009-03-19 19:23 /usr/lib/libmpfr.so -> libmpfr.so.1.2.0
lrwxrwxrwx 1 root root 16 2009-03-19 19:23 /usr/lib/libmpfr.so.1 -> libmpfr.so.1.2.0
-rwxr-xr-x 1 root root 327744 2009-03-19 19:23 /usr/lib/libmpfr.so.1.2.0

revdep-rebuild says that I have to recompile GCC but configure fails on not working GCC. Significant revdep-rebuild line:
broken /usr/libexec/gcc/x86_64-pc-linux-gnu/4.3.3/cc1 (requires libmpfr.so.)
Back to top
View user's profile Send private message
Ahenobarbi
Retired Dev
Retired Dev


Joined: 02 Apr 2009
Posts: 345
Location: Warsaw, PL

PostPosted: Wed Jun 24, 2009 3:27 pm    Post subject: Reply with quote

Code:
ln -s /usr/lib/libmpfr.so.1.2.0 /usr/lib/libmpfr.s
?
Back to top
View user's profile Send private message
ggaaron
Apprentice
Apprentice


Joined: 10 May 2007
Posts: 217

PostPosted: Wed Jun 24, 2009 3:31 pm    Post subject: Reply with quote

Ahenobarbi wrote:
Code:
ln -s /usr/lib/libmpfr.so.1.2.0 /usr/lib/libmpfr.s
?

No, that didn't work...
Back to top
View user's profile Send private message
vincent-
Retired Dev
Retired Dev


Joined: 13 Jan 2007
Posts: 415
Location: Valencia (Spain)

PostPosted: Wed Jun 24, 2009 4:44 pm    Post subject: Reply with quote

Did you updated gcc?

Show us the output of:
Code:
gcc-config -l


And:
Code:
find /var/db/pkg/ -type d -name gcc*


The profile must be match with gcc version.
You can change the profile doing:
Code:
gcc-config -f <profile>


For example, on my machine:
Code:
peratu@fujitsu ~ $ gcc-config -l
 [1] x86_64-pc-linux-gnu-4.3.2 *
peratu@fujitsu ~ $ gcc-config -f x86_64-pc-linux-gnu-4.3.2
 * gcc-config: Must be root.


If I were root, that would work :-)
Back to top
View user's profile Send private message
ggaaron
Apprentice
Apprentice


Joined: 10 May 2007
Posts: 217

PostPosted: Wed Jun 24, 2009 4:52 pm    Post subject: Reply with quote

I didn't update GCC. The thing that might have caused it was a hard reset, because before I could compile just fine.

# gcc-config -l
[1] x86_64-pc-linux-gnu-4.3.3 *

# find /var/db/pkg/ -type d -name gcc*
gives empty output

# gcc-config -f x86_64-pc-linux-gnu-4.3.3
* Switching native-compiler to x86_64-pc-linux-gnu-4.3.3...
>>> Regenerating /etc/ld.so.cache...

And nothing changes=/
Back to top
View user's profile Send private message
vincent-
Retired Dev
Retired Dev


Joined: 13 Jan 2007
Posts: 415
Location: Valencia (Spain)

PostPosted: Wed Jun 24, 2009 5:32 pm    Post subject: Reply with quote

The find command gives you an empty output? Uhm..., please run this command and then repeat the find command:
Code:
regenworld
Back to top
View user's profile Send private message
ggaaron
Apprentice
Apprentice


Joined: 10 May 2007
Posts: 217

PostPosted: Wed Jun 24, 2009 5:39 pm    Post subject: Reply with quote

Ok, now it is:
Code:
# find /var/db/pkg/ -type d -name gcc*
/var/db/pkg/sys-devel/gcc-4.3.3-r2
/var/db/pkg/sys-devel/gcc-config-1.4.1
Back to top
View user's profile Send private message
vincent-
Retired Dev
Retired Dev


Joined: 13 Jan 2007
Posts: 415
Location: Valencia (Spain)

PostPosted: Wed Jun 24, 2009 5:42 pm    Post subject: Reply with quote

And you have the same error?

Try another revdep-rebuild
Back to top
View user's profile Send private message
chuck_theobald
n00b
n00b


Joined: 08 Apr 2005
Posts: 36

PostPosted: Wed Jun 24, 2009 5:50 pm    Post subject: Reply with quote

What does:

ldd /usr/lib/libmpfr.so.1.2.0

give you? In my experience, you can get a "No such file or directory" if a secondary dependency is missing.
Back to top
View user's profile Send private message
ggaaron
Apprentice
Apprentice


Joined: 10 May 2007
Posts: 217

PostPosted: Wed Jun 24, 2009 6:01 pm    Post subject: Reply with quote

Code:
# ldd /usr/lib/libmpfr.so.1.2.0
        linux-vdso.so.1 =>  (0x00007fffa97fe000)
        libgmp.so.3 => /usr/lib/libgmp.so.3 (0x00007fc3a129f000)
        libc.so.6 => /lib/libc.so.6 (0x00007fc3a0f44000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc3a177c000)


revdep-rebuild behaves the same as before
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14572

PostPosted: Thu Jun 25, 2009 2:45 am    Post subject: Reply with quote

Using unquoted globs with find expressions is asking for incorrect results. It probably produced wrong output the first time because the glob expanded to some pattern which is not present in the package database. It worked the second time because nothing matched the glob, so the shell passed through the glob. Depending on shell options, failed glob expansions may just cancel execution of the command entirely.

The easiest way out of this would be to replace libmpfr.so with a known good copy, either by reinstalling from a tbz2 or by rebuilding it. Unfortunately, you seem not to have any older gcc versions installed that could be used to build a working libmpfr.so. If you have another Gentoo amd64 system, you may be able to take the mpfr from it.
Back to top
View user's profile Send private message
ggaaron
Apprentice
Apprentice


Joined: 10 May 2007
Posts: 217

PostPosted: Thu Jun 25, 2009 4:28 pm    Post subject: Reply with quote

Ok, after doing nothing beside restarts it just works again. That's great news for me, but has anyone any idea what happened?

Thanks for help
ggaaron
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10427
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Jun 25, 2009 4:37 pm    Post subject: Reply with quote

Yes. The environment of the shell you were in was probably out of date because of the recent emerge. Probably the following two (very quick) commands would've fixed your issue:
Code:
env-update
source /etc/profile
Almost made the suggestion before; sorry. :oops:

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
ggaaron
Apprentice
Apprentice


Joined: 10 May 2007
Posts: 217

PostPosted: Thu Jun 25, 2009 8:35 pm    Post subject: Reply with quote

john_r_graham wrote:
Yes. The environment of the shell you were in was probably out of date because of the recent emerge. Probably the following two (very quick) commands would've fixed your issue:
Code:
env-update
source /etc/profile
Almost made the suggestion before; sorry. :oops:

- John



I've tried in fresh shells too then, and it didn't work. Anyway marking as solved and thanks again!

ggaaron
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