LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-17-2015, 10:06 PM   #1
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Rep: Reputation: Disabled
error while installing Bzip2(LFS-7.7,pg-111,section-6.18)


i saw this error while compiling the Bzip2
this error comes when i used the following command :
Code:
make -f Makefile-libbz2_so
ERROR is
Code:
/usr/bin/ld: blocksort.o: relocation R_X86_64_32 against `.rodata.str1.1'
can not be used when making a shared object; recompile with -fPIC
blocksort.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile-libbz2_so:38: recipe for target 'all' failed
make: *** [all] Error 1
Please help.. ASAP

Last edited by Sarthak; 11-17-2015 at 10:08 PM.
 
Old 11-26-2015, 07:48 AM   #2
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Please anyone answer i m in a big trouble..
 
Old 11-26-2015, 09:41 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Impossible to know what you are doing. The other commands were not shown.
No errors here, a random 32bits OS, and a random Ubuntu 64bits. (15.04).
* Your OS is unknown. Must be specified by every question, like Ubuntu 14.04.3 - 64bit.

Suggest : Download a new bzip2-1.0.6.tar.gz
http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
(and a new patch, bzip2-1.0.6-install_docs-1.patch)

$ tar xvf bzip2-1.0.6.tar.gz && cd bzip2-1.0.6/
$ patch -Np1 -i ../bzip2-1.0.6-install_docs-1.patch
$ sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
$ sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
$ make -f Makefile-libbz2_so
$ make clean
$ make


-

Last edited by knudfl; 11-26-2015 at 09:43 AM.
 
Old 11-26-2015, 10:16 AM   #4
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Suggest : Download a new bzip2-1.0.6.tar.gz
http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
(and a new patch, bzip2-1.0.6-install_docs-1.patch)

$ tar xvf bzip2-1.0.6.tar.gz && cd bzip2-1.0.6/
$ patch -Np1 -i ../bzip2-1.0.6-install_docs-1.patch
$ sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
$ sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
$ make -f Makefile-libbz2_so
after this make command the error comes is
Quote:
gcc -fpic -fPIC -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -c blocksort.c
gcc: error while loading shared libraries: /lib/libc.so.6: invalid ELF header
Makefile-libbz2_so:47: recipe for target 'blocksort.o' failed
make: *** [blocksort.o] Error 127
please help and i am using ubuntu 15.04
 
Old 11-26-2015, 10:27 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #4.

Ubuntu 15.04 : There is more than one version. Read post #3.


Your errors : Looks like you have a corrupt glibc : /lib/libc.so.6: invalid ELF header.



-
 
Old 11-26-2015, 10:34 AM   #6
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
so now what should you recommend ?
should i start from scratch?
 
Old 11-26-2015, 01:19 PM   #7
kcirick
Member
 
Registered: Dec 2006
Distribution: Slackware 14.1; LFS 7.9-Systemd; Debian Jessie
Posts: 169

Rep: Reputation: 55
Quote:
Originally Posted by Sarthak View Post
so now what should you recommend ?
should i start from scratch?
If I was in your shoes, I would start fresh, since noone knows what the problem is. The time spent on finding out where you (potentially) went wrong may not result in anything useful.

Since you have done the steps leading up to here, it should take you less time to do it the second time.

It's okay to have to redo things. Just be extra careful and pay closer attention to everything you do.
 
2 members found this post helpful.
Old 11-26-2015, 06:33 PM   #8
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Suggestion for next time: If you use a virtual machine to create your LFS, take a snapshot at each step.
If not, a backup. Or perhaps an LVM snapshot works as well.
 
1 members found this post helpful.
Old 12-06-2015, 08:26 AM   #9
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
can anyone tell me what we have to do about the directories created in /sources/ directory after the 5th chapter of the book is completed. As it is written in the book that remove the extracted tarballs and the build directories.
presently, I am inside the chroot environment can i remove them now from the chroot environment?
please help
 
Old 12-06-2015, 11:19 AM   #10
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by Sarthak

I am inside the chroot environment can i remove them now from the chroot environment?
Yes. The "5.3. General Compilation Instructions" remain valid to the end of the book.
 
Old 12-08-2015, 04:13 AM   #11
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Hey stoat I reboot my system and again login to the chroot environment as instructed by the book but now after removing the extracted sources which we use in 5th chapter and now compiling the 6th chapter it is showing core dumped segmentation fault
 
Old 12-08-2015, 06:23 AM   #12
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi did you make sure /dev was mounted chapter 6.2.2 and ch 6.2.3
 
Old 12-09-2015, 04:47 AM   #13
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
hey can anyone tell me what if i skip the bzip2 package installation as it is only for compression and decompression
 
Old 06-28-2016, 09:38 PM   #14
kopcarl
LQ Newbie
 
Registered: Jun 2016
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Sarthak View Post
i saw this error while compiling the Bzip2
this error comes when i used the following command :
Code:
make -f Makefile-libbz2_so
ERROR is
Code:
/usr/bin/ld: blocksort.o: relocation R_X86_64_32 against `.rodata.str1.1'
can not be used when making a shared object; recompile with -fPIC
blocksort.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile-libbz2_so:38: recipe for target 'all' failed
make: *** [all] Error 1
Please help.. ASAP
make clean and make will save you

Reason: the first pass you compile is not with -fPIC (not supposed to be as part of shared lib), and you do not remove at the second pass. So, make clean and recompile will solve.
 
Old 06-29-2016, 01:03 AM   #15
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
Quote:
Originally Posted by Sarthak View Post
hey can anyone tell me what if i skip the bzip2 package installation as it is only for compression and decompression
Never skip anything in LFS. It'll come back and bite you.
 
  


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
[SOLVED] LFS: Error during Linux-3.5.2 kernel compilation (LFS 7.2, Section 8.3) erkant Linux From Scratch 10 11-30-2012 02:44 PM
[SOLVED] LFS: Error during GCC-4.7.1-Pass 1 (LFS 7.2, Section 5.5) erkant Linux From Scratch 7 11-28-2012 06:03 AM
[SOLVED] LFS: Error during changing ownership (LFS 7.2, Section 5.34) erkant Linux From Scratch 2 11-27-2012 11:25 AM
[SOLVED] LFS: Error during Binutils-2.22 - Pass 1 (Section 5.4, LFS 7.2) erkant Linux From Scratch 4 11-26-2012 01:26 PM
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

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

All times are GMT -5. The time now is 11:39 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