Error installing file 5.38: how to recompile with -fPIC
by isochor from LinuxQuestions.org on (#4Z3GY)
Hello,
I am trying to understand Linux better. Since an aimless using 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:configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating magic/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating python/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
lfs@rosariohp:/mnt/lfs/sources/file-5.38$ make
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 2As far as I understand, there is an issue regarding a static or a dynamic library. I should recompile with fPIC as stated in the error message:
Quote:
But how can I do this?
Thank you for your support!


I am trying to understand Linux better. Since an aimless using 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:configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating magic/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating python/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
lfs@rosariohp:/mnt/lfs/sources/file-5.38$ make
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 2As far as I understand, there is an issue regarding a static or a dynamic library. I should recompile with fPIC as stated in the error message:
Quote:
can not be used when making a shared object; recompile with -fPIC |
Thank you for your support!