LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   cannot find a.out file in 6.10 re-adjusting toolchain (http://www.linuxquestions.org/questions/linux-from-scratch-13/cannot-find-a-out-file-in-6-10-re-adjusting-toolchain-4175448464/)

jalazmi 02-03-2013 10:15 AM

cannot find a.out file in 6.10 re-adjusting toolchain
 
hi all,


I'm facing an error after I run this command in 6.10 Re-adjusting the toolchain

Quote:

echo 'main(){}' > dummy.c
cc dummy.c -v -Wl,--verbose &> dummy.log
readelf -l a.out | grep ': /lib'
what I got is:

Quote:

readelf: Error: 'a.out': No such file
I dunno where is my mistake.. can anyone help plz

jalazmi 02-03-2013 10:19 AM

may this will explain or help to answer my question


Quote:

root:/sources/gcc-build# cat dummy.log
Reading specs from /tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/specs
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/tools/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.6.1/configure --prefix=/tools --with-local-prefix=/tools --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap --disable-libgomp --without-ppl --without-cloog --with-mpfr-include=/mnt/lfs/sources/gcc-build/../gcc-4.6.1/mpfr/src --with-mpfr-lib=/mnt/lfs/sources/gcc-build/mpfr/src/.libs
Thread model: posix
gcc version 4.6.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
/tools/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/cc1 -quiet -v -isystem /usr/include dummy.c -quiet -dumpbase dummy.c -mtune=generic -march=x86-64 -auxbase dummy -version -o /tmp/cc5uGyrQ.s
GNU C (GCC) version 4.6.1 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=97 --param ggc-min-heapsize=126588
ignoring nonexistent directory "/tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include
/tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/include
/tools/include
/tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/include-fixed
End of search list.
GNU C (GCC) version 4.6.1 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=97 --param ggc-min-heapsize=126588
Compiler executable checksum: 1b36e51b4ec14d4a4f9a820ee2ee0bf8
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
/tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../x86_64-unknown-linux-gnu/bin/as --64 -o /tmp/ccGFbVEe.o /tmp/cc5uGyrQ.s
COMPILER_PATH=/tools/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/:/tools/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/:/tools/libexec/gcc/x86_64-unknown-linux-gnu/:/tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/:/tools/lib/gcc/x86_64-unknown-linux-gnu/:/tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../x86_64-unknown-linux-gnu/bin/
LIBRARY_PATH=/tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/:/tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../x86_64-unknown-linux-gnu/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
/tools/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/crt1.o /usr/lib/crti.o /tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/crtbegin.o -L/tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1 -L/tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../x86_64-unknown-linux-gnu/lib /tmp/ccGFbVEe.o --verbose -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/crtend.o /usr/lib/crtn.o
collect2: cannot find 'ld'

druuna 02-04-2013 08:08 AM

Quote:

Originally Posted by jalazmi (Post 4883593)
may this will explain or help to answer my question
Quote:

root:/sources/gcc-build# cat dummy.log
Reading specs from /tools/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/specs
COLLECT_GCC=cc
.
.
.
unknown-linux-gnu/4.6.1/crtend.o /usr/lib/crtn.o
collect2: cannot find 'ld'

ld seems to be missing.

You either made a mistake when installing 5.8. Binutils-2.22 - Pass 2 and/or something went wrong while adjusting the toolchain, specifically these parts:
Quote:

mv -v /tools/bin/{ld,ld-old}
mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
mv -v /tools/bin/{ld-new,ld}
ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld

jalazmi 02-04-2013 08:19 AM

I did this part with no error

and redo it now please check:

Quote:

root:/sources/gcc-build# mv -v /tools/bin/{ld,ld-old}
mv: cannot stat `/tools/bin/ld': No such file or directory
root:/sources/gcc-build# mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
`/tools/x86_64-unknown-linux-gnu/bin/ld' -> `/tools/x86_64-unknown-linux-gnu/bin/ld-old'
root:/sources/gcc-build# mv -v /tools/bin/{ld-new,ld}
mv: cannot stat `/tools/bin/ld-new': No such file or directory
root:/sources/gcc-build# ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
`/tools/x86_64-unknown-linux-gnu/bin/ld' -> `/tools/bin/ld'
check this

Quote:

root:/sources/gcc-build# ls -l /tools/bin/ | grep 'ld-old'
-rwxr-xr-x 1 root root 1323856 Feb 3 06:14 ld-old

jalazmi 02-04-2013 08:34 AM

I think I did everything correctly in 5.8. Binutils-2.22 - Pass 2 but in case what I did it was not correct should I simply repeat that step only or what should be the action that I need to follow

plz advice

druuna 02-04-2013 08:52 AM

Quote:

Originally Posted by jalazmi (Post 4884061)
I did this part with no error

and redo it now please check:
Code:

root:/sources/gcc-build# mv -v /tools/bin/{ld,ld-old}
 mv: cannot stat `/tools/bin/ld': No such file or directory
 root:/sources/gcc-build# mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
 `/tools/x86_64-unknown-linux-gnu/bin/ld' -> `/tools/x86_64-unknown-linux-gnu/bin/ld-old'
 root:/sources/gcc-build# mv -v /tools/bin/{ld-new,ld}
 mv: cannot stat `/tools/bin/ld-new': No such file or directory
 root:/sources/gcc-build# ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
 `/tools/x86_64-unknown-linux-gnu/bin/ld' -> `/tools/bin/ld'


Did you just copy/paste those commands a second time? I do hope that is not the case.... You might want to try and understand what these commands are supposed to do. You just created a bigger problem.....

Anyway, this doesn't look good no matter what you did: mv: cannot stat `/tools/bin/ld': No such file or directory

Because you already executed parts of 6.10 I would suggest to start from scratch and not just re-install binutils.

jalazmi 02-04-2013 09:06 AM

Oooops.. but it just moving files right..!! and the old ld is already exists with name ld-old..!!

but it seems that really should start from scratch..

thx for your advice.. will come back to you again in case same issue happen to me.. plz accept that.

jalazmi 02-08-2013 03:02 AM

re-build from scratch but this time with 32bit instead of 64bit as LFS advice and it seems everything working fine.


now I'm in 6.17.1 gcc 4.7.1 thx drunna for your help and advice.


All times are GMT -5. The time now is 01:22 PM.