LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Stripping Segmentation fault (https://www.linuxquestions.org/questions/linux-from-scratch-13/stripping-segmentation-fault-4175704479/)

bayou self 12-04-2021 08:12 AM

Stripping Segmentation fault
 
LFS 11.0
8.77 Stripping

On the final for loop I got a Segmentation fault, and the prompt is now -bash-5.1#

I have not entered the last command.
Quote:

unset BIN LIB save_usrlib online_usrbin online_usrlib
Q1. On the very next page the book has me logging out and back into chroot, so how serious is the Segfault?
Q2. Do I need to re-enter chroot, do the unset command, then go to 8.78 Cleaning Up?

bayou self 12-04-2021 03:11 PM

I went back to 7.4 Entering the Chroot Environment, got my (lfs chroot) root:/# back, and this time I copied/pasted all the code in the Stripping page instead of typing it...no Segmentation fault!
Even though I was as careful as I know how to be, checking every line, there must have been a typo somewhere. Now, I want to see if I can find it!

bayou self 12-11-2021 11:19 AM

Is it advisable to enter a block of separate commands with a single pasting action, such as
Code:

echo 'int main(){}' > dummy.c
cc dummy.c -v -Wl,--verbose &> dummy.log
readelf -l a.out | grep ': /lib'

or would it be better to paste them one at a time?

wiigelec 12-11-2021 07:36 PM

nothing wrong in my experience with entering the commands as a block

if they are root commands i use the following:

sudo -- bash -c “block of commands”

TheRealGrogan 12-17-2021 06:14 PM

The reason why the strip command would have segfaulted, is probably because you used the same strip binary in the bin directory you were stripping. Before that step, there was a step that changed the path to the strip command so you don't strip things that are in use. You may have missed that the first time or something.

I haven't built the current iterations of LFS (I keep building on mine for years) but last time I did it was something like:

Code:

strip --strip-debug /tools/lib/*
/usr/bin/strip --strip-unneeded /tools/{,s}bin/*



All times are GMT -5. The time now is 12:56 PM.