LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-25-2009, 01:48 AM   #1
jaydoc
LQ Newbie
 
Registered: Dec 2006
Distribution: Arch Linux, Ubuntu, Gentoo, Zenwalk
Posts: 26

Rep: Reputation: 16
binutils compile error... chapter 5... newbie need help


I am trying to build an LFS system using Arch Linux as a base system....

I am quite a newbie to advanced distros, but willing to learn.

I followed the LFS book to the letter, except for...

1. Mounting a boot and home partition that will be shared between Arch Linux, Gentoo linux, and an LFS system if I'm successful.

2. Downloading the latest available version of kernel 2.6.27 instead of the version that is mentioned in the book.

3. creating a subdirectory named lfs in the mnt/lfs/sources and keeping all the downloaded tar and patch files in it.

When I got to the stage of compiling the first package, binutils I ran into this error.

Quote:
lfs:/mnt/lfs/tools/binutils-build$ make
make[1]: Entering directory `/mnt/lfs/tools/binutils-build'.....................................................................



$restore $backupdir/* `echo "./bfd.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
make[3]: *** [bfd.info] Error 1
make[3]: Leaving directory `/mnt/lfs/tools/binutils-build/bfd/doc'
Making info in po
make[3]: Entering directory `/mnt/lfs/tools/binutils-build/bfd/po'
( if test 'x/mnt/lfs/sources/lfs/binutils-2.18/bfd/po' != 'x.'; then \
posrcprefix='/mnt/lfs/sources/lfs/binutils-2.18/bfd/'; \
else \
posrcprefix="../"; \
fi; \
rm -f SRC-POTFILES-t SRC-POTFILES \
&& (sed -e '/^#/d' \
-e '/^[ ]*$/d' \
-e "s@.*@ $posrcprefix& \\\\@" < /mnt/lfs/sources/lfs/binutils-2.18/bfd/po/SRC-POTFILES.in \
| sed -e '$s/\\$//') > SRC-POTFILES-t \
&& chmod a-w SRC-POTFILES-t \
&& mv SRC-POTFILES-t SRC-POTFILES )
( rm -f BLD-POTFILES-t BLD-POTFILES \
&& (sed -e '/^#/d' \
-e '/^[ ]*$/d' \
-e "s@.*@ ../& \\\\@" < /mnt/lfs/sources/lfs/binutils-2.18/bfd/po/BLD-POTFILES.in \
| sed -e '$s/\\$//') > BLD-POTFILES-t \
&& chmod a-w BLD-POTFILES-t \
&& mv BLD-POTFILES-t BLD-POTFILES )
cd .. \
&& CONFIG_FILES=po/Makefile.ino/Make-in \
CONFIG_HEADERS= /bin/sh ./config.status
config.status: creating po/Makefile.in
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing bfd_stdint.h commands
config.status: executing default commands
make[3]: Leaving directory `/mnt/lfs/tools/binutils-build/bfd/po'
make[3]: Entering directory `/mnt/lfs/tools/binutils-build/bfd/po'
make[3]: Nothing to be done for `info'.
make[3]: Leaving directory `/mnt/lfs/tools/binutils-build/bfd/po'
make[3]: Entering directory `/mnt/lfs/tools/binutils-build/bfd'
make[3]: Nothing to be done for `info-am'.
make[3]: Leaving directory `/mnt/lfs/tools/binutils-build/bfd'
make[2]: *** [info-recursive] Error 1
make[2]: Leaving directory `/mnt/lfs/tools/binutils-build/bfd'
make[1]: *** [all-bfd] Error 2
make[1]: Leaving directory `/mnt/lfs/tools/binutils-build'
make: *** [all] Error 2
I suspect the problem is that I did not successfully apply the patch file for getting over the texinfo 4.9 problem to the binutils file.
I had indeed applied the patch, but I got an error saying

Quote:
File to patch: binutils-2.18.tar.bz2
patching file binutils-2.18.tar.bz2
Hunk #1 FAILED at 6128.
1 out of 1 hunk FAILED -- saving rejects to file binutils-2.18.tar.bz2.rej
What went wrong here. The output of the script for checking requirements in the host system, seems Ok, except that host binutils version is 2.19 and greater than the recommended 2.18

Quote:
bash, version 3.2.48(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils) 2.19.0.20081119
bison (GNU Bison) 2.4.1
/usr/bin/yacc -> /usr/bin/yacc
bzip2, Version 1.0.5, 10-Dec-2007.
Coreutils: 6.12
diff (GNU diffutils) 2.8.1
find (GNU findutils) 4.4.0
GNU Awk 3.1.6
awk not found
gcc (GCC) 4.3.2
GNU C Library stable release version 2.9,
GNU grep 2.5.3
gzip 1.3.12
Linux version 2.6.28-ARCH (root@T-POWA-LX) (gcc version 4.3.2 (GCC) ) #1 SMP PREEMPT Tue Jan 6 10:26:22 UTC 2009
m4 (GNU M4) 1.4.12
GNU Make 3.81
patch 2.5.9
Perl version='5.10.0';
GNU sed version 4.1.5
tar (GNU tar) 1.21
makeinfo (GNU texinfo) 4.13
Compilation OK
 
Old 01-25-2009, 09:32 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,703
Blog Entries: 1

Rep: Reputation: 219Reputation: 219Reputation: 219
How did you apply the patch? You don't apply the patch to the binutils tarball. You unpack the tarball, change into the binutils source tree, then apply the patch.
 
Old 01-25-2009, 12:33 PM   #3
jaydoc
LQ Newbie
 
Registered: Dec 2006
Distribution: Arch Linux, Ubuntu, Gentoo, Zenwalk
Posts: 26

Original Poster
Rep: Reputation: 16
I am such an ignoramus

I was indeed applying it to the tarred directory instead of applying it to the untarred configure file. This time I corrected the error. And the compile went just fine.

thank you weibullguy....

To help all noobs like me who have trouble patching, here is how i did it.

1. unzipped the binutils tar file that i want to patch

tar -xvjf filename (if its a tar.bz2 file)
tar -zxvf filename (if it is a tar.gz file)

2. This created a directory of the same name as the file. And I copied the patch file into this directory

3. i applied the patch by copying out the command from The Book, into the newly created binutils folder. That way, it won't even ask for a file name,provided you do the patching from within the binutils folder by "cd"ing there. if it does, the name of the file can be seen in the console output.

Last edited by jaydoc; 01-26-2009 at 02:06 AM.
 
Old 01-26-2009, 02:00 AM   #4
jaydoc
LQ Newbie
 
Registered: Dec 2006
Distribution: Arch Linux, Ubuntu, Gentoo, Zenwalk
Posts: 26

Original Poster
Rep: Reputation: 16
weibullguy, could you have a look at this thread please..?
 
Old 01-26-2009, 02:01 AM   #5
jaydoc
LQ Newbie
 
Registered: Dec 2006
Distribution: Arch Linux, Ubuntu, Gentoo, Zenwalk
Posts: 26

Original Poster
Rep: Reputation: 16
sorry to have double-posted the same message

Last edited by jaydoc; 01-26-2009 at 02:03 AM.
 
Old 01-26-2009, 04:35 AM   #6
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,703
Blog Entries: 1

Rep: Reputation: 219Reputation: 219Reputation: 219
Quote:
Originally Posted by jaydoc View Post
unzipped the binutils tar file that i want to patch

tar -xvjf filename (if its a tar.bz2 file)
tar -zxvf filename (if it is a tar.gz file)
Actually if you are using a version of tar that meets the minimum requirements of LFS, you don't need the j or z; tar is smart enough to figure it out on its own.

Quote:
Originally Posted by jaydoc View Post
This created a directory of the same name as the file. And I copied the patch file into this directory
You don't copy the patch into the source tree. If you read the book and follow its instructions, you download all of the source tarballs and patches to $LFS/sources. Unpack the tarball, cd into the top of the source tree (binutils-2.18 in this case) and apply the patch with command in the book.

You'll notice that each patch is applied patch -Np1 -i ../laladada.patch. The ../ means the patch is up one directory level.
 
Old 01-26-2009, 08:44 PM   #7
jaydoc
LQ Newbie
 
Registered: Dec 2006
Distribution: Arch Linux, Ubuntu, Gentoo, Zenwalk
Posts: 26

Original Poster
Rep: Reputation: 16
alright, here is something that WILL help every ignorant Linux Newbie like me...!

.. see those two dots? in a cd command they mean - "not whatever your directory is" as I so mistakenly assumed.

They mean "cd to the parent directory" which as weibullguy pointed out, mean a directory just above where you are.

I must say that if I had learnt this before embarking on this arduous mission, I would not have wasted a lot of time typing out long path names and also ending up with a wrongly adjusted toolchain...!
 
Old 01-27-2009, 04:15 AM   #8
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,703
Blog Entries: 1

Rep: Reputation: 219Reputation: 219Reputation: 219
Quote:
Originally Posted by jaydoc View Post
.. see those two dots? in a cd command they mean - "not whatever your directory is" as I so mistakenly assumed.
According to the book, "Building an LFS system is not a simple task. It requires a certain level of existing knowledge of Unix system administration in order to resolve problems, and correctly execute the commands listed. In particular, as an absolute minimum, the reader should already have the ability to use the command line (shell) to copy or move files and directories, list directory and file contents, and change the current directory. It is also expected that the reader has a reasonable knowledge of using and installing Linux software."
 
  


Reply


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
gcc compile error in chapter 6.12 efus Linux From Scratch 4 03-12-2010 11:27 AM
LFS 6.4 Chapter 5.4. Binutils-2.18 - Pass 1 gazza1z Linux From Scratch 2 01-23-2009 11:16 AM
Linux From Scratch - Chapter 5 - Binutils tompickles Linux From Scratch 25 10-21-2006 02:08 PM
can't compile binutils (chapter 6) alaios Linux From Scratch 2 03-24-2004 04:00 PM
binutils chapter 5 pass 2 qod Linux From Scratch 3 11-03-2003 12:39 PM


All times are GMT -5. The time now is 07:29 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration