LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-25-2017, 10:12 AM   #1
pheyde
LQ Newbie
 
Registered: Jul 2017
Posts: 3

Rep: Reputation: Disabled
LFS 8.0 - 6.40 Compiler Error


Hello,

Having an issue compiling Perl 5.24.1 per LFS 8.0 CH 6.40. Everything up to this point has compiled and passed the prescribed checks.

When I attempt to compile perl 5.24.1, I get the following errors at the end of the output:

Code:
/usr/bin/ld: /usr/local/lib/libbz2.a(bzlib.o): relocation R_X86_64_32S against symbol `BZ2_crc32Table' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libbz2.a(compress.o): relocation R_X86_64_32 agaisnt `.rodata.str1.8' can note be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libbz2.a(decompress.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libbz2.a(blocksort.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:484: ../../lib/auto/Compress/Raw/Bzip2/Bzip2.so] Error 1
make[1]: Leaving directory '/sources/8.0/perl-5.24.1/cpan/Comperss-Raw-Bzip2'
make[1]: Entering directory '/sources/8.0/perl-5.24.1/cpan/Compress-Raw-Bzip2'
rm -f ../../lib/auto/Compress/Raw/Bzip2/Bzip2.so
cc -shared -O2 -L/usr/local/lib -fstack-protector-strong -fPIC BZIP2.o -o ../../lib/auto/Compress/Raw/Bzip2/Bzip2.so \
-L/sources/8.0/perl-5.24.1/cpan/Compress-Raw-Bzip2/bzip2-src -lbz2 

/usr/bin/ld: /usr/local/lib/libbz2.a(bzlib.o): relocation R_X86_64_32S against symbol `BZ2_crc32Table' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libbz2.a(compress.o): relocation R_X86_64_32 agaisnt `.rodata.str1.8' can note be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libbz2.a(decompress.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libbz2.a(blocksort.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:484: ../../lib/auto/Compress/Raw/Bzip2/Bzip2.so] Error 1
make[1]: Leaving directory '/sources/8.0/perl-5.24.1/cpan/Comperss-Raw-Bzip2'
Unsuccessful make(cpan/Compress-Raw-Bzip2): code=512 at make_ext.pl line 569.
make: *** [makefile:599: lib/auto/Compress/Raw/Bzip2/Bzip2.so] Error 2
After googling and searching the last week I found a couple posts that suggest that a recompiling of the bzip package and re-installation should clean up this issue, but it hasn't solved it for me. I performed all the steps in 6.18 again, ran the check scripts with no errors, and verified that all of the installed files are located and linked in the right places (according to the instructions).

If I remove the two environmental build flags (BUILD_ZLIB=false;BUILD_BZIP2=0) then it will compile without error. This again (i think) points to the bzip library as flawed. Does anyone have any input on what I can try next to solve this issue?

Last edited by pheyde; 07-25-2017 at 10:13 AM.
 
Old 07-25-2017, 10:54 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,296

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Usually the first line that says error is the show stopper
Code:
/usr/bin/ld: /usr/local/lib/libbz2.a(blocksort.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Have you tried to recompile with -fPIC?
 
Old 07-25-2017, 10:57 AM   #3
pheyde
LQ Newbie
 
Registered: Jul 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Lol, yes. I should have mentioned that. I added the fPIC flags to Perl to no avail. Then I went back and re-re-compiled the bzip library with the fPIC flags and then tried Perl without and then with the flags again. It hasn't helped.
 
Old 07-25-2017, 12:24 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,296

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I'll back out here. It's been too long since I did LFS myself for me to be much use to you. I did LFS-3.3 & 5.0 back in the day, but that was a l-o-n-g time ago. I even did a HLFS, when such existed, and then diverted to Kevux, when that existed. All part of the learning curve.

EDIT: Maybe I have thought of something. libbz2.a is a static lib, and hardly is linked to perl. I did the basic check 'ldd /usr/bin/perl |grep libbz2 and it didn't show. I would go looking for it in blocksort.o or blocksort.* (blocksort.c probably), wherever that is, and see if it's there. There's always the possibility of a typo screwing you over in unbelievable ways with LFS. Maybe in the top source dir, try 'find -name 'blocksort.*'

Last edited by business_kid; 07-25-2017 at 12:48 PM.
 
Old 07-25-2017, 08:27 PM   #5
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
The build instructions for the basic system are CORRECT dont change them from the ones in the book you will cause problems later, also you should not be using '/usr/local ...' for building the system you have gone wrong back up and check what you have done.
 
1 members found this post helpful.
Old 07-26-2017, 07:00 AM   #6
pheyde
LQ Newbie
 
Registered: Jul 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
I went back and reviewed my work from the beginning of chapter 6 and did not find any errors in what I had accomplished to this point. Unless I'm daft, I think my system is correct to this point.

Since you pointed out that it shouldn't be using /usr/local I dug into the cpan/Compress-Raw-Bzip2/ folder and edited the Makefile to redirect references to /usr/local to just /usr. This allowed it to compile properly and pass the self checks as described in the instructions.

Thank you for the help!
 
  


Reply

Tags
lfs error, perl, solved



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 7.9 - GMP, section 6.14 - configure error (C++ compiler not available) lasanha Linux From Scratch 3 09-09-2016 12:28 AM
LFS 7.4 in Fedora 19 C++ compiler not found error engineer Linux From Scratch 5 12-13-2013 09:36 AM
checking for C compiler default output... configure: error: C compiler cannot create clubbing80s Linux - Software 3 07-05-2010 08:17 PM
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 12:35 PM
Compiler optimizations for LFS-5.1.1 ginobili_20 Linux From Scratch 2 09-24-2004 02:34 PM

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

All times are GMT -5. The time now is 08:50 AM.

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