Snif! :''-( i can't compile anymore

Chris Lingard chris at stockwith.co.uk
Mon Nov 15 11:54:54 PST 2004


dienadel wrote:

> Hello,
> 
> Ok, i've made a stupid thing: try to build a lfs as root, instead of an
> normal user, to avoid fatal crashes. Now, i pay for it, as i can't build
> nothing from source. At least, the system works fine, except for that
> thing.
> 
> I've removed the symlink /tools ---> /mnt/lfs/tools, and, /mnt/lfs isn't
> mounted automatically when the PC is booted up. So, the system is
> basically the same as before starting to build the new lfs.
> 
> Here is the error running a typical configure script:
> checking whether the C compiler works... configure: error: cannot run C
> compiled programs.
> If you meant to cross compile, use `--host'
> 
> I don't know exactly the problem, but this, perhaps help you:
> 
> I do:
> # echo 'main(){}' > dummy.c
> # cc dummy.c
> # readelf -l a.out
> 
> And the horrible result:
> ......
> [Requesting program interpreter: /tools/lib/ld-linux.so.2]
> ......
> 
> I suposse i'd be /lib/ld-linux.so.2

Yes; you need to change gcc's spec file on your base system

First find your specs file
find /usr/lib  -name specs

Go to the directory containing specs, and make a copy of it
cd /usr/lib/gcc/.......
cp specs specs.bak

Now you need to remove the "/tools"
cat specs.bak | sed 's?/tools/lib/ld-linux?/lib/ld-linux?g' > specs

Now check that it worked by recompiling your test program.

Chris





More information about the lfs-support mailing list