> Gesendet: Freitag, 24. Mai 2019 um 02:30 Uhr
> Von: "Ken Moffat via blfs-support" <[email protected]>
> An: "BLFS Support List" <[email protected]>
> Cc: "Ken Moffat" <[email protected]>
> Betreff: Re: [blfs-support] gcc -V?
>
> On Fri, May 24, 2019 at 01:22:56AM +0200, Gerhard Gedigk via blfs-support 
> wrote:
> > I somehow ruined my build system.
> > 
> > I moved the gcc compiler and some related files to a new directory and
> > replaced the executables with symlinks to the respective files in the
> > directory.
> > 
> > Now every configure crashes with
> > 
> > checking for gcc... gcc
> > checking whether the C compiler works... no
> > configure: error: in `/usr/src/upower-0.9.23':
> > configure: error: C compiler cannot create executables
> > 
> > config.log shows
> > 
> > configure:3653: gcc -V >&5
> > gcc: error: unrecognized command line option '-V'
> > gcc: fatal error: no input files
> > compilation terminated.
> > 
> Whenever you get "C compiler cannot create executables", the next
> thing to do is to look for *that* message in config.log, and then
> look at the detailed messages which accompany configure's attempt to
> run the test which produced that original error message.
> 
> There will be many other tests run by configure which report
> apparent errors, all that matters at this point is the ability to
> create executables.
> 
> FYI, on a running system the second message you have quoted here is
> normal:
> 
> ken@terror ~ $gcc -V
> gcc: error: unrecognized command line option ‘-V’
> gcc: fatal error: no input files
> compilation terminated.
> 
> So, two suggestions:
> 
> 1. Find the original 'cannot create executables' message and look at
> the messages which accompany it.  I will guess that one of the gcc
> object files can no-longer be found.  Possibly, a few more symlinks
> can eventually fix the breakage (i.e. fix the first file, retry,
> repeat).  If that seems to fix it for C programs, repeat for
> something using C++ if upower doesn't use that.
> 
> 2. Move gcc back to where it was (ideally, recover from a backup).
> You may wish to remove the symlinks first (copying a file during a
> recovery might follow the symlink).
> 
> > I have installed rust to /opt as recommended. Meanwhile I removed
> > /opt/rust/bin from my path and started a new shell, not better.
> > 
> > Every help is appreciated.
> > Thanks
> > Gerhard
> > 
> 
> In general, moving an installed gcc to a new location is a
> non-trivial task.
> 
> Depending on where you moved gcc to, and how it looks for things
> (I've long forgotten many details) you might also be able to put
> that at the start of your PATH, i.e. PATH=/some/new/bin:$PATH but I
> have never tried that and don't know if it would just be a waste of
> your time.
> 
> ĸen
> -- 


Wow, what an answer!

You are right in every aspect.
The fatal error was further down.
The missing program is cc1, which is located in 
/usr/libexec/gcc/<omitted>/cc1.

Since libexec is not in the path this can only be found with 
../libexec/<omitted>. Yes, I read a long time ago that gcc hardcodes 
some names and paths in the program.

I had already copied back the executables, but not all of them. 
There where so many instances of gcc (? 7) that I removed some and 
replaced them with symlinks. Since the way to find is via ../libexec 
the symlink must point to the same directory. One symlink corrected, 
and everything was back to normal. Needless to say that I will correct 
my installation completely. 

You also pointed out that to move an installed gcc is no trivial task. 
It is nearly impossible, so I will recompile gcc and save some 
instructions until I have an {8,7,6} one day. 

Thank you very much!
Gerhard

And yes, I also calculate 2 GB of memory per core on 4 cores.



> Before the universe began, there was a sound. It went: "One, two, ONE,
> two, three, four" [...] The cataclysmic power chord that followed was
> the creation of time and space and matter and it does Not Fade Away.
>  - wiki.lspace.org/mediawiki/Music_With_Rocks_In
> 
> 
> -- 
> http://lists.linuxfromscratch.org/listinfo/blfs-support
> FAQ: http://www.linuxfromscratch.org/blfs/faq.html
> Unsubscribe: See the above information page
>
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to