LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   ld: cannot find -lc collect2: ld returned 1 exit status (http://www.linuxquestions.org/questions/linux-from-scratch-13/ld-cannot-find-lc-collect2-ld-returned-1-exit-status-366622/)

ArbuZz 09-24-2005 01:59 PM

ld: cannot find -lc collect2: ld returned 1 exit status
 
I've just compiled glibc and had to check for workability. Runing the test I get:

lfs@ubuntu:/mnt/lfs$ echo 'main(){}' > dummy.c
lfs@ubuntu:/mnt/lfs$ cc dummy.c
/mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
lfs@ubuntu:/mnt/lfs$

???

Whitesocks 09-24-2005 02:32 PM

I recommend that you install LFS from the boot CD.... that problem is clearly caused by path problems and mixing different versions of the tools with the ones on your host system. Not good.

ArbuZz 09-25-2005 04:05 AM

I've checked paths, there is no obvious issue. echo $PATH shows /tools/bin as the first directory in a row. And there is the /tools symlink in a root directory.

However I've found out following:

lfs@ubuntu:/mnt/lfs$ lfs@ubuntu:/lib$ ls -l ld*
-rwxr-xr-x 1 root root 88936 Mar 24 2005 ld-2.3.2.so
lrwxrwxrwx 1 root root 11 Jun 29 22:56 ld-linux.so.2 -> ld-2.3.2.so
lrwxrwxrwx 1 root root 13 Jun 29 23:19 ld-lsb.so.1 -> ld-linux.so.2

My dynamic linker is a symlink in a fact, though it was present in specs file and I changed it just like it was mentioned in the lfs book - with /tools/lib/ld-linux.so.2. BUT! There is no ld-linux.so.2 file in my /tools/lib directory, not even a symlink:

lfs@ubuntu:/lib$ lfs@ubuntu:/mnt/lfs/tools/lib$ ls -l
total 6288
drwxr-xr-x 3 lfs lfs 4096 Sep 6 13:23 gcc
-rw-r--r-- 1 lfs lfs 5044480 Sep 4 20:49 libbfd.a
-rwxr-xr-x 1 lfs lfs 676 Sep 4 20:49 libbfd.la
lrwxrwxrwx 1 lfs lfs 13 Sep 6 13:23 libgcc_s.so -> libgcc_s.so.1
-rw-r--r-- 1 lfs lfs 161432 Sep 6 13:23 libgcc_s.so.1
-rw-r--r-- 1 lfs lfs 796076 Sep 6 13:23 libiberty.a
-rw-r--r-- 1 lfs lfs 390846 Sep 4 20:49 libopcodes.a
-rwxr-xr-x 1 lfs lfs 688 Sep 4 20:49 libopcodes.la
lfs@ubuntu:/mnt/lfs/tools/lib$

???

Have I missed something? Or it is allright?

shotokan 09-27-2005 12:52 AM

It looks like your good.

(I didn't see Error written anywhere)


All times are GMT -5. The time now is 04:30 AM.