[SOLVED] Possible problem with stripping tools LFS8.0
Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616
Rep:
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?
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Original Poster
Rep:
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
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Original Poster
Rep:
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.
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.