Visit Jeremy's Blog.
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 11-25-2012, 10:46 AM   #1
Registered: Oct 2012
Posts: 51

Rep: Reputation: Disabled
LFS: Error during Binutils-2.22 - Pass 1 (Section 5.4, LFS 7.2)

I'm new to LFS, and started building version 7.2, by following the book. Everything worked fine until I reached section 5.2, where it starts installing Binutils-2.22-Pass 1. I'm currently logged in as the user lfs, which has the home directory in /home/lfs as the book suggests. If I run the following command as lfs user I get the following error:

patch -Np1 -i ../binutils-2.22-build_fix-1.patch
patch: **** Can't open patch file ../binutils-2.22-build_fix-1.patch : No such file or directory

The point that confuses me is the part before binutils which is ../
So, why should I use it? What's the point of it? Or should I change it to something?
But if I use the following command instead:

patch -Np1 -i $LFS/sources/binutils-2.22-build_fix-1.patch

Then, I get these lines:

can't find file to patch at input line 11
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
|Submitted By: Matt Burgess <matthew_at_linuxfromscratch_dot_org>
|Date: 2012-03-27
|Initial Package Version: 2.22
|Upstream Status: From Upstream
|Description: Fixes a build failure when using -O3 compiler flag
|diff -Naur binutils-2.22.orig/opcodes/ChangeLog binutils-2.22/opcodes/ChangeLog
|--- binutils-2.22.orig/opcodes/ChangeLog 2011-11-21 09:29:39.000000000 +0000
|+++ binutils-2.22/opcodes/ChangeLog 2012-03-27 19:49:36.299866714 +0000
File to patch:

And it is waiting me to enter a file to patch. If someone can help me, I would be glad.
Old 11-25-2012, 10:57 AM   #2
LQ Veteran
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392
You should read more carefully

This from: 5.3. General Compilation Instructions

To re-emphasize the build process:

Place all the sources and patches in a directory that will be accessible from the chroot environment such as /mnt/lfs/sources/. Do not put sources in /mnt/lfs/tools/.

Change to the sources directory.

For each package:

Using the tar program, extract the package to be built. In Chapter 5, ensure you are the lfs user when extracting the package.

Change to the directory created when the package was extracted.

Follow the book's instructions for building the package.

Change back to the sources directory.

Delete the extracted source directory and any <package>-build directories that were created in the build process unless instructed otherwise.
Old 11-25-2012, 10:59 AM   #3
Senior Member
Registered: Jan 2011
Distribution: /LFS/Debian
Posts: 2,416
Blog Entries: 1

Rep: Reputation: 387Reputation: 387Reputation: 387Reputation: 387

Before you start do make sure your host is compliant.
That said where did you put the patch file it should be in /mnt/lfs/sources.
Unpack binutils tar then cd into binutils-2.22 dir before running commands
Old 11-25-2012, 01:16 PM   #4
Registered: Oct 2012
Posts: 51

Original Poster
Rep: Reputation: Disabled
Thanks guys, it solved the problem!
Old 11-26-2012, 01:26 PM   #5
Keith Hedger
Senior Member
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,684

Rep: Reputation: 669Reputation: 669Reputation: 669Reputation: 669Reputation: 669Reputation: 669
Originally Posted by erkant View Post
...The point that confuses me is the part before binutils which is ../
So, why should I use it? What's the point of it? Or should I change it to something?...
FYI the "../" means go up one level from the current directory.

If your problem was solved don't forget to mark the thread SOLVED ... It's good manners.

Last edited by Keith Hedger; 11-26-2012 at 01:27 PM.


binutils, lfs

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
[SOLVED] lfs 6.7 book ch 5.4 binutils 2.20.1 pass 1 error:error: ppl_c.h: No such file or directory frank zhu Linux From Scratch 6 03-04-2011 11:23 AM
LFS 6.5 -- Binutils-2.19.1 - Pass 2 gives error: cannot run C compiled programs kamleshk1 Linux From Scratch 7 11-16-2010 08:57 AM
[SOLVED] LFS 6.6 Binutils install error Pass 1 on Ubuntu Jaunty Krol_:) Linux From Scratch 3 06-03-2010 10:53 AM
error using lfs while compiling lfs book's 6.12 (gcc-4.1.2) section aditya_gpch Linux From Scratch 3 04-24-2008 04:23 PM
LFS binutils-build error : Pass 1 ramlnx Linux From Scratch 1 07-12-2006 07:06 AM > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 07:44 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration