Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
../glibc-2.14.1/configure --prefix=/tools --host=$LFS_TGT --build=$(../glibc-2.14.1/scripts/config.guess) --disable-profile --enable-add-ons --enable-kernel=2.6.25 --with-headers=/tools/include libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes && make && make check && make install
I press enter
Then I get this error:
Code:
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c: In function ‘__vsyslog_chk’:
../misc/syslog.c:144:9: warning: variable ‘prioff’ set but not used [-Wunused-but-set-variable]
../misc/syslog.c:123:1: sorry, unimplemented: inlining failed in call to ‘syslog’: function body not available
../misc/syslog.c:155:9: sorry, unimplemented: called from here
make[2]: *** [/mnt/lfs/glibc-build/misc/syslog.o] Error 1
make[2]: Leaving directory `/mnt/lfs/glibc-2.14.1/misc'
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/glibc-2.14.1'
make: *** [all] Error 2
case `uname -m` in
i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;;
esac
I see a few possible problems with the way you try to do it:
- The content is not saved to the configparms file,
- The content is exported, so it will be used by other chapters as well.
Give what is given in the book a try. Do remember to remove the build and source directory and start with a clean unpacked glibc.
Well, after trying it exactly as it was in the book, I still got some different errors, which look like this:
Code:
../sysdeps/i386/fpu/s_frexp.S: Assembler messages:
../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression
make[2]: *** [/mnt/lfs/glibc-build/math/s_frexp.os] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/mnt/lfs/glibc-2.14.1/math'
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/glibc-2.14.1'
make: *** [all] Error 2
So I tried it a different way; parts I altered are in bold (this is after extracting a fresh glibc from tarball):
Code:
atieno-Satellite-U405 glibc-2.14.1 # patch -Np1 -i ../glibc-2.14.1-sort-1.patch && patch -Np1 -i ../glibc-2.14.1-cpuid-1.patch && patch -Np1 -i ../glibc-2.14.1-fixes-1.patch && patch -Np1 -i ../glibc-2.14.1-gcc_fix-1.patch
patching file Makeconfig
patching file elf/Makefile
patching file elf/dl-open.c
patching file elf/tst-relsort1.c
patching file elf/tst-relsort1mod1.c
patching file elf/tst-relsort1mod2.c
patching file sysdeps/i386/configure
patching file elf/dl-close.c
patching file elf/dl-deps.c
patching file elf/dl-libc.c
patching file elf/rtld.c
patching file include/link.h
patching file resolv/res_query.c
patching file nptl/sysdeps/pthread/pt-initfini.c
patching file sysdeps/unix/sysv/linux/i386/sysdep.h
atieno-Satellite-U405 glibc-2.14.1 # case `uname -m` in
>
> i?86) echo "CFLAGS += -march=i686 -mtune=native -O3 -pipe" > configparms ;;
>
> esac
atieno-Satellite-U405 glibc-build # ../glibc-2.14.1/configure --prefix=/tools --host=$LFS_TGT --build=$(../glibc-2.14.1/scripts/config.guess) --disable-profile --enable-add-ons --enable-kernel=3.2.11 --with-headers=/tools/include libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
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 how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
configure: running configure fragment for add-on libidn
configure: running configure fragment for add-on nptl
checking for assembler gnu_indirect_function symbol type support... yes
checking whether .text pseudo-op must be used... yes
checking for assembler global-symbol directive... .globl
checking for assembler .type directive prefix... @
checking sysdep dirs... sysdeps/i386/elf nptl/sysdeps/unix/sysv/linux/i386/i686 sysdeps/unix/sysv/linux/i386/i686 nptl/sysdeps/unix/sysv/linux/i386 sysdeps/unix/sysv/linux/i386 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv/i386 nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/i386 nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/i386/i686/fpu sysdeps/i386/i686/multiarch nptl/sysdeps/i386/i686 sysdeps/i386/i686 sysdeps/i386/i486 nptl/sysdeps/i386/i486 sysdeps/i386/fpu nptl/sysdeps/i386 sysdeps/i386 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether as is GNU as... yes
checking whether ld is GNU ld... yes
checking for as... as
checking version of as... 2.21.53.20110810, ok
checking for ld... ld
checking version of ld... 2.21.53.20110810, ok
checking for pwd... /bin/pwd
checking for gcc... gcc
checking version of gcc... 4.6.1, ok
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 3.81, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.18.1, ok
checking for makeinfo... no
checking for sed... sed
checking version of sed... 4.2.1, ok
checking for autoconf... autoconf
checking whether autoconf works... yes
configure: WARNING:
*** These auxiliary programs are missing or incompatible versions: makeinfo
*** some features will be disabled.
*** Check the INSTALL file for required versions.
checking LD_LIBRARY_PATH variable... ok
checking whether GCC supports -static-libgcc... -static-libgcc
checking for bash... /bin/bash
checking for gawk... gawk
checking for perl... /usr/bin/perl
checking for install-info... /usr/sbin/install-info
checking for bison... /usr/bin/bison
checking for signed size_t type... no
checking for libc-friendly stddef.h... yes
checking whether we need to use -P to assemble .S files... no
checking for .set assembler directive... yes
checking for assembler gnu_unique_object symbol type... yes
checking for .symver assembler directive... yes
checking for ld --version-script... yes
checking for .previous assembler directive... yes
checking for .protected and .hidden assembler directive... yes
checking whether __attribute__((visibility())) is supported... yes
checking for broken __attribute__((visibility()))... no
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking for .preinit_array/.init_array/.fini_array support... yes
checking for libunwind-support in compiler... no
checking for -z nodelete option... yes
checking for -z nodlopen option... yes
checking for -z initfirst option... yes
checking for -z relro option... yes
checking for -Bgroup option... yes
checking for libgcc_s suffix...
checking for --as-needed option... yes
checking whether --noexecstack is desirable for .S files... yes
checking for -z combreloc... yes
checking for -z execstack... yes
checking for -fpie... yes
checking for --hash-style option... yes
checking for -fno-toplevel-reorder -fno-section-anchors... yes
checking for -fstack-protector... yes
checking for -fgnu89-inline... yes
checking whether cc puts quotes around section names... no
checking for assembler .weak directive... yes
checking whether CFI directives are supported... yes
checking for ld --no-whole-archive... yes
checking for gcc -fexceptions... yes
checking for __builtin_expect... yes
checking for __builtin_memset... yes
checking for redirection of built-in functions... yes
checking for __thread... yes
checking for tls_model attribute... yes
checking for libgd... no
checking for is_selinux_enabled in -lselinux... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /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 size of long double... 12
running configure fragment for sysdeps/i386/elf
checking for i386 TLS support... yes
running configure fragment for nptl/sysdeps/pthread
checking for forced unwind support... (cached) yes
checking for C cleanup handling... (cached) yes
running configure fragment for sysdeps/pthread
running configure fragment for sysdeps/unix/sysv/linux
checking for grep that handles long lines and -e... (cached) /bin/grep
checking for egrep... (cached) /bin/grep -E
checking installed Linux kernel header files... 2.0.10 or later
checking for kernel header at least 3.2.11... ok
checking for symlinks in /tools/include... ok
running configure fragment for sysdeps/i386
checking for grep that handles long lines and -e... (cached) /bin/grep
checking for egrep... (cached) /bin/grep -E
checking for ANSI C header files... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking for strings.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for unistd.h... (cached) yes
checking for cpuid.h... yes
checking if -g produces usable source locations for assembler-with-cpp... yes
checking for SSE4 support... yes
checking for assembler -mtune=i686 support... yes
checking for AVX support... yes
checking for -mno-vzeroupper support... yes
checking for old glibc 2.0.x headers... no
checking whether -fPIC is default... no
configure: creating ./config.status
config.status: creating config.make
config.status: creating Makefile
config.status: creating config.h
config.status: executing default commands
And here is where I get errors (the -j2 is since I have two cores). After running
Code:
make -j2 && make check -j2 && make install -j2
I get the errors:
Code:
/glibc-build/misc/mmap64.o -MD -MP -MF /mnt/lfs/glibc-build/misc/mmap64.o.dt -MT /mnt/lfs/glibc-build/misc/mmap64.o
../misc/syslog.c:123:1: sorry, unimplemented: inlining failed in call to ‘syslog’: function body not available
../misc/syslog.c:155:9: sorry, unimplemented: called from here
make[2]: *** [/mnt/lfs/glibc-build/misc/syslog.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/mnt/lfs/glibc-2.14.1/misc'
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/glibc-2.14.1'
make: *** [all] Error 2
Does anybody know where I went wrong and/or what I should fix?
First of all: No changes are needed to make things work, all that is mentioned in the particular chapters should be used as-is.
I do see a new error message:
Quote:
make[2]: *** Waiting for unfinished jobs....
This could point to 2 things:
1) The use of MAKEFLGS='-j X, where X is 2 or larger. I noticed that not all packages like this and I don't use it when building gcc, binutils and glibc.
Chapter 4.5 does mention the use of -j 2 but I would advise not to use compiler and make flags for now, unless mentioned in the chapter.
2) Your host doesn't meet the Host System Requirements. Could you post the output of the script mentioned here: version-check.sh.
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c: In function ‘__vsyslog_chk’:
../misc/syslog.c:144:9: warning: variable ‘prioff’ set but not used [-Wunused-but-set-variable]
../misc/syslog.c:123:1: sorry, unimplemented: inlining failed in call to ‘syslog’: function body not available
../misc/syslog.c:155:9: sorry, unimplemented: called from here
make[2]: *** [/mnt/lfs/glibc-build/misc/syslog.o] Error 1
make[2]: Leaving directory `/mnt/lfs/glibc-2.14.1/misc'
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/glibc-2.14.1'
make: *** [all] Error 2
Unfortunately, after updating the two required parts of my system (bash and textinfo) AND doing a fresh install with by-the-book commands, I am still getting an error message:
Code:
F /mnt/lfs/glibc-build/misc/syslog.o.dt -MT /mnt/lfs/glibc-build/misc/syslog.o
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c: In function ‘__vsyslog_chk’:
../misc/syslog.c:144:9: warning: variable ‘prioff’ set but not used [-Wunused-but-set-variable]
../misc/syslog.c:123:1: sorry, unimplemented: inlining failed in call to ‘syslog’: function body not available
../misc/syslog.c:155:9: sorry, unimplemented: called from here
make[2]: *** [/mnt/lfs/glibc-build/misc/syslog.o] Error 1
make[2]: Leaving directory `/mnt/lfs/glibc-2.14.1/misc'
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/glibc-2.14.1'
make: *** [all] Error 2
However, thank you druuna and LQ for your continued help and support. I hope we will soon find a solution which can also help other people with similar problems.
There are still some other issue's with your host:
Quote:
Originally Posted by Andy45
bash, version 4.2.10(1)-release /bin/sh -> /bin/dash # mentioned before, should be fixed
Binutils: (GNU Binutils for Ubuntu) 2.21.53.20110810
bison (GNU Bison) 2.4.1 /usr/bin/yacc -> /usr/bin/bison.yacc -> Should be: /usr/bin/yacc -> /usr/bin/bison
bzip2, Version 1.0.5, 10-Dec-2007.
Coreutils: 8.5
diff (GNU diffutils) 3.0
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 (Ubuntu EGLIBC 2.13-20ubuntu5.1) 2.13 -> EGLIBC? Not sure if that will work.
grep (GNU grep) 2.9
gzip 1.3.12
Linux version 3.0.0-16-generic (buildd@zirconium) (gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #29-Ubuntu SMP Tue Feb 14 12:49:42 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.12.4';
GNU sed version 4.2.1
tar (GNU tar) 1.25 version-check.sh: line 33: makeinfo: command not found # mentioned before, should be fixed.
Texinfo: [/i]
xz (XZ Utils) 5.0.0
gcc compilation OK
Ubuntu is notoriously hard to use as host for LFS and with newer versions I see more and more that needs fixing to make it a good host. I'm not even sure if the EGLIBC problem can be fixed (with or without wrecking Ubuntu's functionality).
My advise: Use a different distro as host. Debian and Slackware come to mind, I used both to build LFS and minor changes were needed to make them meet the system requirements LFS needs.
Thank you Druuna, I will go ahead and try a different distro and mark this thread as solved. One question I have, however, is about makeinfo, because I can't find a package for that, so how can I fix that?
There might actually be an easier solution for you problem which worked for me. Due to bug #10375 in glibc, compilation fails if -U_FORTIFY_SOURCE is not in your CFLAGS. For me it worked to simply add this to configparms (in the glibc-build directory):
echo "CFLAGS += -U_FORTIFY_SOURCE" >> configparms
Thanks for your suggestion Pat, but I will have to go ahead and use a Debian VM because I still get the following error:
Code:
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c: In function ‘__vsyslog_chk’:
../misc/syslog.c:144:9: warning: variable ‘prioff’ set but not used [-Wunused-but-set-variable]
../misc/syslog.c:123:1: sorry, unimplemented: inlining failed in call to ‘syslog’: function body not available
../misc/syslog.c:155:9: sorry, unimplemented: called from here
make[2]: *** [/mnt/lfs/glibc-build/misc/syslog.o] Error 1
make[2]: Leaving directory `/mnt/lfs/glibc-2.14.1/misc'
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/glibc-2.14.1'
make: *** [all] Error 2
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.