Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Broken GCC [SOLVED]
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
mgwmgwmgw
n00b
n00b


Joined: 27 Dec 2006
Posts: 56

PostPosted: Tue Nov 10, 2009 8:28 pm    Post subject: Broken GCC [SOLVED] Reply with quote

Something made GCC not work anymore.

Is it possible to tell emerge to emerge GCC
without assuming that there is a working
compiler in place? How can I do that?

I have not been able to figure out
where I can download the GCC binaries from.

Thanks,

Mary-Anne


Last edited by mgwmgwmgw on Wed Nov 18, 2009 4:49 am; edited 1 time in total
Back to top
View user's profile Send private message
bonzai.it
n00b
n00b


Joined: 09 Oct 2009
Posts: 47
Location: Somewhere in the Apennines

PostPosted: Tue Nov 10, 2009 9:22 pm    Post subject: Reply with quote

Please post gcc-config -l and emerge --info.
_________________
" ... I have became comfortably dumb ... "
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Tue Nov 10, 2009 9:22 pm    Post subject: Reply with quote

mgwmgwmgw,

You can get binary tarballs from tinderbox.dev.gentoo.org.

Put the tarball in your / (root) dir and untar it there. Ignore the warning at the end of the tar operation.
Use gcc-config to select a gcc, then build gcc for yourself.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
few
Guru
Guru


Joined: 03 Mar 2008
Posts: 448

PostPosted: Tue Nov 10, 2009 10:02 pm    Post subject: Reply with quote

Before using a binary tell us first what happened to your gcc or what the symptoms are in case you don't know the former.

If you use the binary, don't untar it. Put it in /usr/portage/packages and add -K to the emerge options.
Back to top
View user's profile Send private message
mgwmgwmgw
n00b
n00b


Joined: 27 Dec 2006
Posts: 56

PostPosted: Wed Nov 11, 2009 11:09 pm    Post subject: Reply with quote

I was doing emerge world and I ran out of disk,
so I did emerge --depclean.
After this gcc and similar refused to work.
So then I went to /usr/bin and renamed all the gcc to badgcc etc.
Then I tried to emerge gcc again
and it had no way to compile without an existing compiler.
So I renamed them back.
I tried putting a CD into my machine
and the machine froze up.
I tried to ssh in and it would not respond.
Then I power-cycled.
Now the machine came up but X refuses to work.
Then I tried revdep-rebuild
and I got a lot of complaints about missing libstdc++
so I emerged libstdc++ and that worked,
but it seems to be the wrong version, 5 instead of 6.
I also got a lot of complaints about missing libdb,
and I saw some discussion which says I need to
rebuild each thing that complains about that,
but it is a LOT more than the three in the discussion.

So now I am trying again to emerge gcc so I can tell you
very exactly what the error message is.
This is what I get when I save the emacs buffer
and transfer it to another machine.
I think the color codings got mangled. Sorry.
Code:
checking whether ln -s works... yes
checking for i686-pc-linux-gnu-gcc... i686-pc-linux-gnu-gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
 *
 * ERROR: sys-devel/gcc-4.3.4 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 4879:  Called toolchain_src_compile
 *             environment, line 5405:  Called gcc_src_compile
 *             environment, line 3077:  Called gcc_do_configure
 *             environment, line 2790:  Called die
 * The specific snippet of code:
 *       "${S}"/configure "$@" || die "failed to run configure";
 *  The die message:
 *   failed to run configure
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/log/portage/sys-devel:gcc-4.3.4:20091111-224947.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-4.3.4/temp/environment'.
 *

>>> Failed to emerge sys-devel/gcc-4.3.4, Log file:

>>>  '/var/log/portage/sys-devel:gcc-4.3.4:20091111-224947.log'

Also, when I run gcc with no parameters from the command-line, as root, I get the error
Quote:
gcc-config: error: could not run/locate 'gcc'


So...I am wondering whether the best solution
is to download the gcc binaries.
What do you think?
What other information would be helpful?

Mary-Anne
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Wed Nov 11, 2009 11:50 pm    Post subject: Reply with quote

Yep, fetch a sys-devel/gcc from tinderbox and untar it on /

run
    env-update && source /etc/profile
    and
    gcc-config -l

and set your gcc if it isn't set correctly
then
    emerge -e system
Back to top
View user's profile Send private message
mgwmgwmgw
n00b
n00b


Joined: 27 Dec 2006
Posts: 56

PostPosted: Thu Nov 12, 2009 6:00 am    Post subject: Still no success Reply with quote

Thank-you very much for the help.
I have still not succeeded.

I got the file here
http://tinderbox.dev.gentoo.org/default-linux/x86/sys-devel/
and its name was gcc-config not gcc.
My system did not have a /usr/portage/packages.
I had to mkdir it.
Where emerge looks is the value of the $PKGDIR environment variable,
which was already set to /usr/portage/packages

I emerged using
emerge -k gcc-config.
and the emerge died with the message
compiler wrapper.
So then I tried
emerge -ek system
and that failed on
emake || die
So then I unzipped the file manually with
cd /
bzp2 -cd /usr/portage/packages/gcc-config-1.4.1.tbz2 | tar xvf -
followed by
env-update
source /etc/profile
gcc-config -l
and that said
gcc-config: Active gcc profile is invalid!
[1] i386-pc-linux-gnu-3.4.4
[2] i386-pc-linux-gnu-3.4.4.hardened
[3] i386-pc-linux-gnu-3.4.4.hardenednopie
[4] i386-pc-linux-gnu-3.4.4.hardenednopiessp
[5] i386-pc-linux-gnu-3.4.4.hardenednossp

So then I tried to set my gcc with
gcc-config -f i386-pc-linux-gnu-3.4.4
and I got the error
gcc-config: Could not locate 'i386-pc-linux-gnu-gcc-3.4.4' in '/etc/env.d/gcc' !
which is strange because ls shows it there.
So then I tried
emerge -e system
to see whether that would fix the problem
while portage seemed to compile okay,
but zlib died on
emake || die
So then I tried to set my gcc with
gcc-config i386-pc-linux-gnu-3.4.4
and I got the error
gcc-config: Could not locate 'i386-pc-linux-gnu-gcc-3.4.4' in '/etc/env.d/gcc' !
So then I tried
gcc-config config-i686-pc-linux-gnu
and got the error
gcc-config: Profile does not exist or invalid setting for /etc/envd/gcc/config-i686-pc-linux-gnu
Switching native-compiler to config-i686-pc=linux-gnu ...
ls: cannot access /etc/env.d/gcc/i686-pc-linux-gnu-*: No such file or directory.

Your gcc has a big with GCC_SPECS.
Please re-emerge gcc.
https://bugs.gentoo.org/68395

/usr/bin/gcc-config: line 154: ///gcc: No such file or directory
>>> Regenerating /etc/ld.so.cache...
If you intend to use the gcc from the new profile in an already
running shell, please remember to do:
# source /etc/profile

So I went to the referenced bug report
and it said to do
unset GCC_SPECS
emerge gcc
So I tried that,
and the emerge died with the message
failed to run configure.

So...what did I miss?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Thu Nov 12, 2009 7:54 pm    Post subject: Reply with quote

mgwmgwmgw,

You fetched the wrong version of gcc from the tinderbox. i386...3.4.* is very old. It will not work with a current glibc.
You need a i686...4.x.x version.

It looks like you did all the right things but with the wrong tarball.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mgwmgwmgw
n00b
n00b


Joined: 27 Dec 2006
Posts: 56

PostPosted: Thu Nov 12, 2009 9:10 pm    Post subject: Reply with quote

Thanks again.

There are no i686 binaries that look like the correct choice.
I tried some and none of them work.
What URL do I get them from?

Mary-Anne
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Fri Nov 13, 2009 9:01 pm    Post subject: Reply with quote

mgwmgwmgw,

gcc is there.
Thats the i686 gcc.

Untar it to your / (root)
Code:
 tar -xjpf gcc-4.3.4.tbz2 -C /
the p option is essential to preserve the permissions, or the execute permission will be removed. Its just like a minature stage3 tarball.

When thats done, use
Code:
gcc-config
to select your new gcc. Lastly use gcc to emerge gcc, so you are back where yu expected to be.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Sat Nov 14, 2009 9:34 am    Post subject: Reply with quote

few wrote:
If you use the binary, don't untar it. Put it in /usr/portage/packages and add -K to the emerge options.

That's the best one can do with gentoo package files (tbz2). BTW, it's a capital K.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Sat Nov 14, 2009 2:27 pm    Post subject: Reply with quote

Without gcc, you cannot always use emerge. Not even emerge -K

If you don't have /usr/portage/packages, it needs a lot more than putting the tarball there to use emerge -K
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mgwmgwmgw
n00b
n00b


Joined: 27 Dec 2006
Posts: 56

PostPosted: Sun Nov 15, 2009 4:21 am    Post subject: Reply with quote

Excellent progress.
I did what was suggested in the previous post
and gcc successfully emerged.
I was not able to get revdep-rebuild to work
until I removed some of the extra gcc libraries
I had untarred and until I manually unmasked
some things.
Revdep-rebuild is running, and taking a long time.
After it is done I plan to
emerge -sync
and emerge ... world.
I'll post again when I know whether that works too.

Thanks again for all the help.

Mary-Anne
Back to top
View user's profile Send private message
mgwmgwmgw
n00b
n00b


Joined: 27 Dec 2006
Posts: 56

PostPosted: Wed Nov 18, 2009 4:49 am    Post subject: Success! Reply with quote

It took a while, but it worked.

Thanks again.
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Wed Nov 18, 2009 4:53 am    Post subject: Reply with quote

Awesome, glad you got that working. :)
Back to top
View user's profile Send private message
MLongmire
n00b
n00b


Joined: 25 Apr 2005
Posts: 4
Location: New Hampshire, USA

PostPosted: Mon Jan 21, 2013 11:55 pm    Post subject: Reply with quote

For me, I just had to set the current gcc.
Code:
gcc-config x86_64-pc-linux-gnu-4.6.3
Then compiles worked fine.

I think the last emerge that upgraded gcc caused this.
Back to top
View user's profile Send private message
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 309
Location: Finland

PostPosted: Sun Feb 08, 2015 3:27 pm    Post subject: Reply with quote

MLongmire wrote:
For me, I just had to set the current gcc.


Just had same error and this worked for me also.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Sun Feb 08, 2015 5:34 pm    Post subject: Reply with quote

P.Kosunen, MLongmire,

Its not the upgrade of gcc that casues this, its the --depclean afterwards.

The process goes like this ... emerge -uD @world pulls in a new gcc.
emerge --depclean remeves the old but still active gcc.
You notice that emerge/gcc no longer works.
This is because your new gcc is not active until you select it..
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
krenshala
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jan 2006
Posts: 85
Location: Austin TX, NorAm, Sol III

PostPosted: Mon Sep 12, 2016 8:08 pm    Post subject: Reply with quote

NeddySeagoon wrote:
mgwmgwmgw,

gcc is there.
Thats the i686 gcc.

Untar it to your / (root)
Code:
 tar -xjpf gcc-4.3.4.tbz2 -C /
the p option is essential to preserve the permissions, or the execute permission will be removed. Its just like a minature stage3 tarball.

When thats done, use
Code:
gcc-config
to select your new gcc. Lastly use gcc to emerge gcc, so you are back where yu expected to be.


Just wanted to post that the final step above (running gcc-config then emerge gcc) fixed the broken gcc I was sufferring from after trying to upgrade java (iced-tea a while ago). So nice to not see gcc say it can't configure stuff.

gcc-config informed me I had an invalid gcc config selected, which is probably why this was all I had to do. I'm guessing Neddy's post above is what I suffered from as well. Damn PEBKAC errors. :)
_________________
krenshala
:wq
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