LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-14-2005, 08:55 PM   #1
zonk
Newbie
 
Registered: Jul 2005
Posts: 7

Rep: Reputation: 0
LFS 6.1 step 5.7: "ld: no input file" when compiling dummy.c


i am trying to install LFS 6.1 and have not deviated from the handbook

the host system is slackware 10.1 with the following specs:
Code:
cat /proc/version
Linux version 2.6.10 (root@laptop) (gcc version 3.3.4) #4 Sun Jul 3 21:41:36 EDT 2005
when trying to compile the dummy.c for test purposes in chapter 5.7, i receive the following error:

Code:
cc -v dummy.c

Reading specs from /mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --prefix=/tools --libexecdir=/tools/lib --with-local-prefix=/tools --disable-nls --enable-shared --enable-languages=c
Thread model: posix
gcc version 3.4.3
 /mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/cc1 -quiet -v -iprefix /mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/ dummy.c -quiet -dumpbase dummy.c -mtune=pentiumpro -auxbase dummy -version -o /tmp/ccznT62h.s
ignoring nonexistent directory "/mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/include"
ignoring duplicate directory "/tools/lib/gcc/i686-pc-linux-gnu/3.4.3/include"
ignoring nonexistent directory "/tools/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/include
 /tools/include
 /usr/include
End of search list.
GNU C version 3.4.3 (i686-pc-linux-gnu)
	compiled by GNU C version 3.4.3.
GGC heuristics: --param ggc-min-expand=62 --param ggc-min-heapsize=60208
 /mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o /tmp/ccmhWJQo.o /tmp/ccznT62h.s
GNU assembler version 2.15.94.0.2.2 (i686-pc-linux-gnu) using BFD version 2.15.94.0.2.2 20041220
 /mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/collect2 --eh-frame-hdr -m elf_i386
/mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/bin/ld: no input files
collect2: ld returned 1 exit status
here's the environment of the user attempting to compile:

Code:
export

declare -x HOME="/home/lfs"
declare -x LC_ALL="POSIX"
declare -x LFS="/mnt/lfs"
declare -x OLDPWD="/mnt/lfs"
declare -x PATH="/tools/bin:/bin:/usr/bin"
declare -x PS1="\\u:\\w\$ "
declare -x PWD="/mnt/lfs/sources"
declare -x SHLVL="1"
declare -x TERM="linux"
now, here's something weird i noticed:
Code:
which cc
/tools/bin/cc

cat `cc --print-file specs` | grep ld
%{rdynamic:-export-dynamic} 	%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} 	%{static:-static}}}

cc -dumpspecs | grep ld
%{!static:--eh-frame-hdr} -m elf_i386 %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static: 	%{rdynamic:-export-dynamic} 	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} 	%{static:-static}}}
i edited the specs file changed the path for finding the non-host ld, but the compiler doesn't seem to take it?

google searches have brought up a similar error on LFS 5.2 with fedora 2 as a host, the problem was solved by using a different version of binutils. but since i am using the exact version from the handbook, i am not sure which way i should go (newer or older version), if that would indeed solve the problem.

any help would be appreciated, thank you very much in advance.
 
Old 08-11-2005, 01:20 AM   #2
shotokan
Member
 
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Rep: Reputation: 30
That's not an 'Error'. Errors will usually say Error next to them.
 
Old 08-21-2005, 03:07 AM   #3
tomave
LQ Newbie
 
Registered: Aug 2005
Posts: 5

Rep: Reputation: 0
zonk, i get exactly the same problem. I used the LFS live cd. The book says if this cc dummy.c doesnt work, then you have a serious problem so i stopped. How did you solve it? I got the same message "no input files" and i dont get any message when i issue the command readelf -l a.out | grep ': /tools' Is that correct?
 
Old 08-22-2005, 01:03 AM   #4
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
did either of you do as the book suggests.........
Quote:
First, perform the sanity check again, using gcc instead of cc. If this works, then the /tools/bin/cc symlink is missing.
AND did you type out the commands to amend the SPECS file or did you copy/paste as the book suggests??
Quote:
Another option is that something may have gone wrong with the specs file amendment above. In this case, redo the specs file amendment, being careful to copy-and-paste the commands.
 
Old 08-22-2005, 10:59 AM   #5
tomave
LQ Newbie
 
Registered: Aug 2005
Posts: 5

Rep: Reputation: 0
Thanks for trying to help freakyg. Yes I did the sanity check and got the same result. I didnt understand how to issue the command "SPECFILE=´gcc --print...........etc" Do i have to type it all at once, in a single line? what means the symbol "\" at the end of the second line? I just searched for the file specs into the tools directory and modified lib/ld-linux.so.2 with /tools/lib/ld-linux.so.2
Just 2 more questions:

How do i copy and paste?
Is it worth so much time,effort, patiente....etc to build LFS? Will it really be faster than mandriva, gentoo, red hat......etc?

Thanks in advance again
 
Old 09-03-2005, 03:53 PM   #6
hoes
Member
 
Registered: Sep 2005
Distribution: debian, linux from scratch
Posts: 190

Rep: Reputation: 51
First some info about the command(s)
Basically the command described in the book does the following:
1: It retrieves the location of the specfile of the Linux From Scratch gcc and puts it in the environment variable SPECFILE
2. It reads the file and replaces every instance of /lib/ld-linux.so.2 with /tools/lib/ld-linux.so.2
and writes the result to a temporary file
3. It replaces the original file with the new one
4. It deletes the SPECFILE variable

Now your questions:

>Thanks for trying to help freakyg. Yes I did the sanity check and got the same result. I didnt
>understand how to issue the command "SPECFILE=´gcc --print...........etc" Do i have to type
>it all at once, in a single line?

The way it is edited you can type each line and give and enter after typing.
You are then supposed to give the next line and give and enter and continue that way until you have typed the last line. After giving an enter one the last line all commands will be executed.

>what means the symbol "\" at the end of the second line?

The \ means the command is longer than one line and you want to continue writing your command on the next line. Therefore you need to push enter after typing \ .
But If your command is short enough for one line, you can also choose to type it on one line and dismiss the \ . Also it is possible to just type without \ and just type your command as long as it is, you can even type it longer than one line. \ is used to make scripts better readable for humans actually.

Beside \ another set of signs occurs in the script.
The && are used to let your computer now that it has to wait for another, new command before executing the one you just typed.

>How do i copy and paste?

I don't know how you use LFS. I just run X11 while compiling.
I use the graphical environment to read LFS with firefox.
If you to the same than a very easy way is just to select the lines,
copy them and past them in a text-editor and save it somewhere.
(Make sure you have got enters at the right places.)
Then make sure it's executable by lfs.
and then just run it.
But I don't think it's useful to run it now since you already edited your specfile

>Is it worth so much time,effort, patiente....etc to build LFS? Will it really be faster than mandriva, gentoo, red hat......etc?

I haven't got the faintest idea whether it will be faster. The reason I make a LFS-system is because it's a great way to become to know your system inside out and I'm just hoping it will run better than the Debian I now run.
It is supposed to be faster though. The reason is that a normal distribution has made its executables for a lot of platforms thus all having unnecessary code, which makes them larger and slower. However I don't no if it's worth all the trouble. If you have got a fairly new system than the answer will probably be no, because the most applications you run are small so the tiny speed increment will not be noticed.

One last thing: I think the best thing you could do is check whether you really edited the specfile in the right way and if the ld-linux.so.2 really exists.
Running the script will add nothing in your situation I reckon.

I wish you good luck and hope you succeed just as I have.
 
Old 09-05-2005, 01:51 AM   #7
tomave
LQ Newbie
 
Registered: Aug 2005
Posts: 5

Rep: Reputation: 0
Hoes, you´ve saved my life with lfs. I was just going to give up but with your answer it was impossible to fail. You´ve given an accurate explanation of the command and have answered my questions one by one giving me the possibility to solve the problem in several ways. Thank you very much indeed, I owe you one.¡¡¡
 
  


Reply



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
LFS-6.1 error in File-4.13, "cannot find zlib.h" Dhaval Motghare Linux From Scratch 1 11-15-2005 05:14 AM
ld reports "no input file" at first sanity check (chapter 5.7) garba Linux From Scratch 1 07-23-2005 06:54 PM
DVDbackup "NEW COPY PROTECTION?" Dummy Sectors? elyk1212 Linux - Software 25 07-01-2005 01:06 PM
LFS 4.1: Stalled at Perl, "missing seperator" error from "make" SparceMatrix Linux From Scratch 1 06-07-2003 03:31 PM
<input type="button" disabled="true" > does not work in ns4.7 or 4.9 cybercop12us Programming 2 11-29-2002 08:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 09:17 PM.

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