LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   C hapter 10.3 make mrproper (https://www.linuxquestions.org/questions/linux-from-scratch-13/c-hapter-10-3-make-mrproper-4175719665/)

rsmereka 12-11-2022 11:53 AM

C hapter 10.3 make mrproper
 
Hi,

I am trying to build i686 lfs 11.2 on a Lenovo x61s using an MX 21 host on a USB stick.

My mrproper command is:
Code:

(lfs chroot) root:/sources/linux-5.19.2# make mrproper
/usr/libexec/gcc/i686-pc-linux-gnu/12.2.0/cc1: error while loading shared libraries: /usr/lib/libz.so.1: file too short

So I look up zlib:
Code:

(lfs chroot) root:/sources/linux-5.19.2# ls -l /usr/lib/libz*
lrwxrwxrwx 1 root root    14 Dec  5 13:18 /usr/lib/libz.so -> libz.so.1.2.13
lrwxrwxrwx 1 root root    14 Dec  5 13:18 /usr/lib/libz.so.1 -> libz.so.1.2.13
-rwxr-xr-x 1 root root      0 Dec 10 13:31 /usr/lib/libz.so.1.2.13

I built version 1.2.13 of zlib as per the 11.2 errata. The sym links are from Dec 5 and the actual library is zero bytes from Dec 10. So I try to rebuild zlib:
Code:

(lfs chroot) root:/sources# tar -xvf zlib-1.2.13.tar.xz
(lfs chroot) root:/sources# cd zlib-1.2.13
(lfs chroot) root:/sources/zlib-1.2.13# ./configure --prefix=/usr
Checking for gcc...
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.

Now this is getting too weird for me.

BTW: all commands are entered into the chroot environment and I have built many lfs systems mostly i686 non-graphical servers (LAMP)

Any ideas?
TIA,
Rick

Keith Hedger 12-11-2022 01:22 PM

try manually removing all the zlib bits, delete the zlib archive and source folder, re-download zlib and try again.

bryan_S 12-12-2022 03:38 AM

I think you may have broken your system running the stripping commands. In the expanded notes on the errata page:
Quote:

NOTE: When upgrading zlib-1.2.13, update the stripping commands in Chapter 8 to use libz.so.1.2.13 instead of libz.so.1.2.12. This will prevent your system from breaking after running the stripping commands.
If that's what's happened the only way to fix it is to obtain that library 'somewhere else'. If you have a saved temporary system you could restored that to a temporary partition and build the zlib library and copy it over.

rsmereka 12-12-2022 11:04 AM

Thanks Keith, but,

On a hunch thinking that the compiler is now broken after reading lots about the too harsh error message, I picked a package at random (something simple), gawk and tried to build that, starting from untarring then:
Code:

(lfs chroot) root:/sources# cd gawk-5.1.1
(lfs chroot) root:/sources/gawk-5.1.1# sed -i 's/extras//' Makefile.in
(lfs chroot) root:/sources/gawk-5.1.1# ./configure --prefix=/usr
checking for a BSD-compatible install... ./build-aux/install-sh -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/sources/gawk-5.1.1':
configure: error: C compiler cannot create executables
See `config.log' for more details

The lines I focused on were:
Code:

checking whether the C compiler works... no
and
Code:

configure: error: C compiler cannot create executables
Spot on IMHO bryan,
I remember reading that note in the errata but when it came time to strip, I forgot all about it. Also I, of course, thinking that I had no need to do a backup with my experience, plowed straight through.

Nice catch.

Oh well back to the drawing board.

bryan_S 12-13-2022 07:11 AM

I know because a similar thing happend to me before using those stripping commands with a wrong library name. I think it was some other library than zlib, but you take some risk when you don't use released book versions.

Another way i broke gcc was by upgrading ISL which gcc linked to. The only way to fix gcc after the upgrade was copy the old ISL lib from another LFS (lucky i had it). Then I rebuilt gcc and it linked against the new ISL, then I could remove that old ISL library.


All times are GMT -5. The time now is 05:49 PM.