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 04-29-2017, 10:24 AM   #1
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
Possible problem with stripping tools LFS8.0


I seem to have run into a minor problem, building the 8.0 tool chain, all compiles fine no errors, get to the striping here:
http://www.linuxfromscratch.org/lfs/...stripping.html

This
Code:
/usr/bin/strip --strip-unneeded /tools/{,s}bin/*
Is fine but the other strip command
Code:
strip --strip-debug /tools/lib/*
Seems to strip to much from the libs and makes the tool chain unusable, eg compiling the test program again gives
Code:
echo 'int main(){}' > dummy.c
/media/LFSJane/tools/bin/x86_64-lfs-linux-gnu-gcc  dummy.c
/media/LFSJane/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/6.3.0/../../../../x86_64-lfs-linux-gnu/bin/ld: /media/LFSJane/tools/lib/../lib64/crt1.o(.text+0x26): unresolvable R_X86_64_NONE relocation against symbol `__libc_start_main@@GLIBC_2.2.5'
/media/LFSJane/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/6.3.0/../../../../x86_64-lfs-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Or in chroot:
Code:
I have no name!:/# echo 'int main(){}' > dummy.c
I have no name!:/# cc dummy.c 
/tools/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /tools/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../lib64/crt1.o(.text+0x26): unresolvable R_X86_64_NONE relocation against symbol `__libc_start_main@@GLIBC_2.2.5'
/tools/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Compiling from host as above or in chroot gives the same error, without the strip all is fine.

I use LFS 7.8 as host
x86_64 quod core intel
Anyone else had this problem?
 
Old 04-29-2017, 03:54 PM   #2
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
I've had no issues with it across multiple builds. Something else is wrong, likely in the linker configuration.

--strip-debug does just as it implies: removes debugging symbols and nothing else. That command has been used in LFS on libraries for a long time.

Given that you list section 5.36, I am going to assume your next usage of GCC is in section 6. Now look at your attempt to compile:

Quote:
echo 'int main(){}' > dummy.c
/media/LFSJane/tools/bin/x86_64-lfs-linux-gnu-gcc dummy.c
/media/LFSJane/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/6.3.0/../../../../x86_64-lfs-linux-gnu/bin/ld: /media/LFSJane/tools/lib/../lib64/crt1.o(.text+0x26): unresolvable R_X86_64_NONE relocation against symbol `__libc_start_main@@GLIBC_2.2.5'
/media/LFSJane/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/6.3.0/../../../../x86_64-lfs-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
"/media/LFSJane/tools/bin/x86_64-lfs-linux-gnu-gcc dummy.c" does not look like it was run from within chroot. If that were the case it would be "/tools/bin/x86_64-lfs-linux-gnu-gcc dummy.c".

Did you forget to chroot? Or perhaps even install a Glibc that wasn't built within chroot?

Last edited by Luridis; 04-29-2017 at 03:56 PM.
 
Old 04-29-2017, 04:55 PM   #3
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Original Poster
Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
the second code section was run from chroot sorry if that wasnt clear
 
Old 04-29-2017, 05:00 PM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Original Poster
Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
i have used the strip command on all my builds and never come across this before either, i wonder know if my host system has been corrupted somehow as thats where the strip command resides, i didnt think to try strip from within chroot i will do so tomorrow and report back, just to re-iterate there were NO problems building the tools
 
Old 04-29-2017, 05:54 PM   #5
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
I've found that printenv from inside the chroot is good for seeing if anything has leaked in from the host.
 
Old 04-30-2017, 08:20 AM   #6
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Original Poster
Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Just checked the strip in a chroot and everything is fine, so I'm guessing my hosts strip is fubar'ed somehow, though I must admit whilst doing some init stuff I have crashed my host a fair bit lately and had to do a few repairs so it's probably that.
 
Old 04-30-2017, 07:27 PM   #7
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
Yea, there's so much that its easy to miss something, even if you've done it hundreds of times. About 1 in 5 I end up hosing up something during the build.
 
  


Reply

Tags
8.0, error, strip, toolchain



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] little more help with grub boot lfs8 end Linux From Scratch 3 04-05-2017 11:03 AM
[SOLVED] Stripping Out Source enorbet Slackware 6 10-03-2015 07:06 PM
Stripping k84834 Linux From Scratch 3 09-29-2012 08:35 AM
stripping ubuntu, problem with removing GDM cynicalpsycho Linux - Newbie 2 12-29-2009 09:27 PM
Stripping lines versus stripping bytes in a bash subshell. poorman_installer Programming 9 10-21-2009 08:36 AM

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

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