LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 09-07-2017, 08:13 AM   #1
aeroplane380
LQ Newbie
 
Registered: Sep 2017
Posts: 1

Rep: Reputation: Disabled
Unhappy Compilation of File-5.31 Error with Linux From Scratch 8.1


I am currently building Linux From Scratch from the book for version 8.1 I have arrived at section 6.12 where I am installing File-5.3.1 after chrooting into my new system. However, the make command is producing errors.

Configure gives:
Quote:
root:/sources/file-5.31# ./configure --prefix=/usr
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /tools/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for builtin ELF support... yes
checking for ELF core file support... yes
checking for zlib support...
checking for file formats in man section 5... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for gcc option to accept ISO Standard C... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /tools/bin/grep
checking for egrep... /tools/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether byte ordering is bigendian... no
checking whether ln -s works... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /tools/bin/sed
checking for fgrep... /tools/bin/grep -F
checking for ld used by gcc... /tools/x86_64-pc-linux-gnu/bin/ld
checking if the linker (/tools/x86_64-pc-linux-gnu/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /tools/bin/nm -B
checking the name lister (/tools/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /tools/x86_64-pc-linux-gnu/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /tools/bin/nm -B output from gcc object... ok
checking for sysroot... no
./configure: line 7592: /usr/bin/file: No such file or directory
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/tools/x86_64-pc-linux-gnu/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether the -Werror option is usable... yes
checking for simple visibility declarations... yes
checking for ANSI C header files... (cached) yes
checking whether sys/types.h defines makedev... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for stdint.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for unistd.h... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking xlocale.h usability... no
checking xlocale.h presence... no
checking for xlocale.h... no
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for sys/stat.h... (cached) yes
checking for sys/types.h... (cached) yes
checking sys/utime.h usability... no
checking sys/utime.h presence... no
checking for sys/utime.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for sig_t... yes
checking for an ANSI C-conforming const... yes
checking for off_t... yes
checking for size_t... yes
checking for struct stat.st_rdev... yes
checking for struct tm.tm_gmtoff... no
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking for tm_zone in struct tm... yes
checking whether tzname is declared... yes
checking for tzname... yes
checking for tm_isdst in struct tm... yes
checking whether daylight is declared... yes
checking for daylight... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for mbstate_t... yes
checking for struct option in getopt... yes
checking for pid_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for int32_t... yes
checking for uint64_t... yes
checking for int64_t... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking whether mbrtowc and mbstate_t are properly declared... yes
checking for gcc compiler warnings... yes
checking for strerror... yes
checking for strndup... yes
checking for strtoul... yes
checking for mkstemp... yes
checking for mkostemp... yes
checking for utimes... yes
checking for utime... yes
checking for wcwidth... yes
checking for strtof... yes
checking for newlocale... yes
checking for uselocale... yes
checking for freelocale... yes
checking for setlocale... yes
checking for getopt_long... yes
checking for asprintf... yes
checking for vasprintf... yes
checking for strlcpy... no
checking for strlcat... no
checking for getline... yes
checking for ctime_r... yes
checking for asctime_r... yes
checking for localtime_r... yes
checking for gmtime_r... yes
checking for pread... yes
checking for strcasestr... yes
checking for fmtcheck... no
checking for dprintf... yes
checking for gzopen in -lz... yes
checking that generated files are newer than configure... done
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
Running make then gives:
Quote:
root:/sources/file-5.31# make
make all-recursive
make[1]: Entering directory '/sources/file-5.31'
Making all in src
make[2]: Entering directory '/sources/file-5.31/src'
sed -e "s/X.YY/$(echo 5.31 | tr -d .)/" < ../src/magic.h.in > magic.h
make all-am
make[3]: Entering directory '/sources/file-5.31/src'
CC magic.lo
CC apprentice.lo
CC softmagic.lo
CC ascmagic.lo
CC encoding.lo
CC compress.lo
CC is_tar.lo
CC readelf.lo
CC print.lo
CC fsmagic.lo
fsmagic.c: In function 'file_fsmagic':
fsmagic.c:220:13: warning: In the GNU C Library, "major" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "major", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"major", you should undefine it after including <sys/types.h>.
COMMA, (long)major(sb->st_rdev),
^~~~~~~~~~~~~~~~~~~~~~~~~~~
fsmagic.c:221:13: warning: In the GNU C Library, "minor" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "minor", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"minor", you should undefine it after including <sys/types.h>.
(long)minor(sb->st_rdev)) == -1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
fsmagic.c:254:13: warning: In the GNU C Library, "major" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "major", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"major", you should undefine it after including <sys/types.h>.
COMMA, (long)major(sb->st_rdev),
^~~~~~~~~~~~~~~~~~~~~~~~~~~
fsmagic.c:255:13: warning: In the GNU C Library, "minor" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "minor", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"minor", you should undefine it after including <sys/types.h>.
(long)minor(sb->st_rdev)) == -1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
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
/tools/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/../lib/libz.a(inflate.o): relocation R_X86_64_32S against hidden symbol `zcfree' can not be used when making a shared object
/tools/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/../lib/libz.a(inftrees.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/tools/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/../lib/libz.a(zutil.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/tools/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/../lib/libz.a(crc32.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/tools/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/../lib/libz.a(inffast.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/tools/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:431: libmagic.la] Error 1
make[3]: Leaving directory '/sources/file-5.31/src'
make[2]: *** [Makefile:361: all] Error 2
make[2]: Leaving directory '/sources/file-5.31/src'
make[1]: *** [Makefile:399: all-recursive] Error 1
make[1]: Leaving directory '/sources/file-5.31'
make: *** [Makefile:331: all] Error 2
I'm building this system with Ubuntu as my host system.
 
Old 09-09-2017, 01:18 PM   #2
sr_ls_boy
Member
 
Registered: Apr 2015
Posts: 105

Rep: Reputation: Disabled
You are trying to create a shared (.so) library by linking in a static (.a) library.

Try reading this for tips.
 
Old 09-14-2017, 10:02 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,562
Blog Entries: 19

Rep: Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445
I think something went wrong when you built zlib. Are you sure you moved and relinked the dynamic library as described?
 
Old 09-14-2017, 10:23 AM   #4
sr_ls_boy
Member
 
Registered: Apr 2015
Posts: 105

Rep: Reputation: Disabled
I would uninstall zlib and rebuild it again
with the switch --disable-static .
 
Old 09-14-2017, 10:40 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,562
Blog Entries: 19

Rep: Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445Reputation: 4445
With LFS, it's generally not a good idea to put in extra configuration switches. They tend to cause trouble further down the line. The OP should check whether the zlib dynamic library and its symbolic link are in the right places; if not, he forgot to carry out those final steps. He should go back to the zlib stage (just after finishing the installation of glibc) and redo it exactly as described.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration