Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.


  Search this Thread
Old 09-24-2005, 02:59 PM   #1
LQ Newbie
Registered: Sep 2005
Posts: 6

Rep: Reputation: 0
Question 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


Last edited by ArbuZz; 09-24-2005 at 03:00 PM.
Old 09-24-2005, 03:32 PM   #2
Registered: Sep 2005
Posts: 30

Rep: Reputation: 15
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.
Old 09-25-2005, 05:05 AM   #3
LQ Newbie
Registered: Sep 2005
Posts: 6

Original Poster
Rep: Reputation: 0
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
lrwxrwxrwx 1 root root 11 Jun 29 22:56 ->
lrwxrwxrwx 1 root root 13 Jun 29 23:19 ->

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/ BUT! There is no 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
lrwxrwxrwx 1 lfs lfs 13 Sep 6 13:23 ->
-rw-r--r-- 1 lfs lfs 161432 Sep 6 13:23
-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


Have I missed something? Or it is allright?
Old 09-27-2005, 01:52 AM   #4
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Rep: Reputation: 30
It looks like your good.

(I didn't see Error written anywhere)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
tar error - 'Child returned status 1' fabio_listas Linux - Newbie 8 01-16-2011 05:16 AM
collect2: ld returned 1 exit status abirami Linux - Software 0 03-02-2005 02:07 AM
lfs5.1.1 cannot find -lc collect2,returning 1 exit status keyur Linux From Scratch 0 08-17-2004 12:41 PM
konstruct error collect2: ld returned 1 exit status X2O Linux - Software 2 08-11-2004 09:48 PM
popa3d collect2: ld returned 1 exit status datapunk Linux - Software 1 01-02-2004 07:48 PM > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 03:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration