Hello,
I am trying to understand Linux better. Since the aimless using of Linux Mint brought me nowhere, I thought that LFS would be a good way of digging deeper in a structured way.
Unfortunately I am facing troubles installing the package File 5.38.
Code:
make all-recursive
make[1]: Entering directory '/mnt/lfs/sources/file-5.38'
Making all in src
make[2]: Entering directory '/mnt/lfs/sources/file-5.38/src'
sed -e "s/X.YY/$(echo 5.38 | tr -d .)/" < ../src/magic.h.in > magic.h
make all-am
make[3]: Entering directory '/mnt/lfs/sources/file-5.38/src'
CC file.o
CC seccomp.o
CC buffer.lo
CC magic.lo
CC apprentice.lo
CC softmagic.lo
CC ascmagic.lo
CC encoding.lo
CC compress.lo
CC is_csv.lo
CC is_json.lo
CC is_tar.lo
CC readelf.lo
CC print.lo
CC fsmagic.lo
CC funcs.lo
CC apptype.lo
CC der.lo
CC cdf.lo
CC cdf_time.lo
CC readcdf.lo
CC strlcpy.lo
CC strlcat.lo
CC fmtcheck.lo
CCLD libmagic.la
/mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib64/libbz2.a(bzlib.o): relocation R_X86_64_32S against symbol `BZ2_crc32Table' can not be used when making a shared object; recompile with -fPIC
/mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib64/libbz2.a(compress.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib64/libbz2.a(decompress.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib64/libbz2.a(blocksort.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:499: recipe for target 'libmagic.la' failed
make[3]: *** [libmagic.la] Error 1
make[3]: Leaving directory '/mnt/lfs/sources/file-5.38/src'
Makefile:380: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/mnt/lfs/sources/file-5.38/src'
Makefile:400: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/mnt/lfs/sources/file-5.38'
Makefile:332: recipe for target 'all' failed
make: *** [all] Error 2
I googled for the string:
Code:
can not be used when making a shared object; recompile with -fPIC
and found an interesting result:
https://stackoverflow.com/questions/...with-fpic?rq=1
My problem is, that I don't know how to apply the suggestion of:
"Extending the compiler flags within the major CMakeLists.txt as required."
Is this the right approach for my problem?
I would be glad, if someone could give me a hint.
Thanks!