Closed LostGhost1 closed 2 years ago
/tools/lib/gcc/x86_64-mlfs-linux-musl/10.3.1/../../../../
based on above, looks like file-5.40
is being built with gcc from /tools
and not GCC installed in /usr
Right, because compiling GCC for the final system is step 23, and I'm on step 14. Or am I missing something? @dslm4515
Sorry, i forgot its file
before system gcc
.
Its an issue with bzip2 built in /tools. Try rebuilding bzip2 while in chroot:
patch -Np1 -i ../patches/bzip2-void/install_docs-1.patch
patch -Np0 -i ../patches/bzip2-void/soname.patch
sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
CFLAGS="-fPIC" make -f Makefile-libbz2_so && make clean
CFLAGS="-fPIC" make
cp -v libbz2.so.1.0.8 /tools/lib/
Clear Linux has patches to convert the build system of bzip2 from Makefile to autotools (i.e. configure script)... I may add those patches to make it easier to build and install bzip2
Rebuilt bzip2 without any issues, but when I try recompiling file 5.40 (after make clean, from scratch) same issue. However, if I configure it with --disable-shared it starts complaining about there being no lzma instead, if that's worth anything. Is file that essential, can I build it later?
make[3]: Entering directory '/tmp/file-5.40/src'
CCLD libmagic.la
CCLD file
make[3]: Leaving directory '/tmp/file-5.40/src'
make[2]: Leaving directory '/tmp/file-5.40/src'
Making all in magic
make[2]: Entering directory '/tmp/file-5.40/magic'
../src/file -C -m magic
Error loading shared library liblzma.so.5: No such file or directory (needed by ../src/file)
Error relocating ../src/file: lzma_end: symbol not found
Error relocating ../src/file: lzma_code: symbol not found
Error relocating ../src/file: lzma_auto_decoder: symbol not found
make[2]: *** [Makefile:843: magic.mgc] Error 127
make[2]: Leaving directory '/tmp/file-5.40/magic'
make[1]: *** [Makefile:459: all-recursive] Error 1
make[1]: Leaving directory '/tmp/file-5.40'
make: *** [Makefile:368: all] Error 2
This to be precise
I'm not sure. File
is used in build scripts for some packages.
Even after rebuilding the bzip2 library, same exact error when building file-5.40
?
Yup. Tried reconfiguring with CFLAGS="-fPIC" LDFLAGS="-fPIC", same issue
check the symbols for libbz2.so.1.0.8. Does it match below? Below is from a 32-bit machine
$ readelf -s libbz2.so.1.0.8 | grep BZ2_crc32Table
58: 00011020 1024 OBJECT GLOBAL DEFAULT 20 BZ2_crc32Table
171: 00011020 1024 OBJECT GLOBAL DEFAULT 20 BZ2_crc32Table
(mlfs chroot) root:/tools/lib# readelf -s libbz2.so.1.0.8 | grep BZ2_crc32Table
57: 00000000000191c0 1024 OBJECT GLOBAL DEFAULT 21 BZ2_crc32Table
114: 00000000000191c0 1024 OBJECT GLOBAL DEFAULT 21 BZ2_crc32Table
(mlfs chroot) root:/tools/lib#
oops. i meant to rebuild libbz2.a
....but copying libbz2.so.1.0.8
should work too.
rebuild bzip2 like above but copy libbz2.a
to /tools/lib
a correctly built bzip2 library should look like this:
$ readelf -s /tools/lib/libbz2.a | grep BZ2_crc32Table
1: 0000000000000000 1024 OBJECT GLOBAL DEFAULT 2 BZ2_crc32Table
12: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND BZ2_crc32Table
$ readelf -s /tools/lib/libbz2.so.1.0.8 | grep BZ2_crc32Table
58: 0000000000219060 1024 OBJECT GLOBAL DEFAULT 20 BZ2_crc32Table
105: 0000000000219060 1024 OBJECT GLOBAL DEFAULT 20 BZ2_crc32Table
hmmm.... in a chroot environment, it should be clean.... what is your output if you run env
?
For me:
$ env
PWD=/sources/linux-5.13.0
HOME=/root
TERM=xterm
SHLVL=1
PS1=(mlfs chroot) \u:\w\$
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin
OLDPWD=/
_=/bin/env
(mlfs chroot) root:/# env
PWD=/
HOME=/root
TERM=xterm-256color
SHLVL=1
PS1=(mlfs chroot) \u:\w\$
EXTRA_CONFIG= --enable-targets=x86_64-pep
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin
OLDPWD=/tools/lib
_=/tools/bin/env
(mlfs chroot) root:/#
I forgot to ask, what distro are you using?
Closing due to inactivity.
Compilation log for file-5.40
Stage 3, final system, step 014. Haven't had any issues during the previous steps. Any ideas?