LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-02-2010, 05:10 AM   #1
bigaurian
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Rep: Reputation: 0
Glibc won't compile in chapter 5.7.1 of the LFS 6.6 book


Glibc won't compile in chapter 5.7.1 of the LFS 6.6 book
What's going wrong?

$ make
Code:
mv -f /mnt/lfs/sources/glibc-build/shlib.ldsT /mnt/lfs/sources/glibc-build/shlib.lds
i686-lfs-linux-gnu-gcc   -shared -static-libgcc -Wl,-O1  -Wl,-z,defs -Wl,-dynamic-linker=/toolss/lib/ld-linux.so.2  -B/mnt/lfs/sources/glibc-build/csu/  -Wl,--version-script=/mnt/lfs/sources/glibc-build/libc.map -Wl,-soname=libc.so.6 -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -nostdlib -nostartfiles -e __libc_main -L/mnt/lfs/sources/glibc-build -L/mnt/lfs/sources/glibc-build/math -L/mnt/lfs/sources/glibc-build/elf -L/mnt/lfs/sources/glibc-build/dlfcn -L/mnt/lfs/sources/glibc-build/nss -L/mnt/lfs/sources/glibc-build/nis -L/mnt/lfs/sources/glibc-build/rt -L/mnt/lfs/sources/glibc-build/resolv -L/mnt/lfs/sources/glibc-build/crypt -L/mnt/lfs/sources/glibc-build/nptl -Wl,-rpath-link=/mnt/lfs/sources/glibc-build:/mnt/lfs/sources/glibc-build/math:/mnt/lfs/sources/glibc-build/elf:/mnt/lfs/sources/glibc-build/dlfcn:/mnt/lfs/sources/glibc-build/nss:/mnt/lfs/sources/glibc-build/nis:/mnt/lfs/sources/glibc-build/rt:/mnt/lfs/sources/glibc-build/resolv:/mnt/lfs/sources/glibc-build/crypt:/mnt/lfs/sources/glibc-build/nptl -o /mnt/lfs/sources/glibc-build/libc.so -T /mnt/lfs/sources/glibc-build/shlib.lds /mnt/lfs/sources/glibc-build/csu/abi-note.o /mnt/lfs/sources/glibc-build/elf/soinit.os /mnt/lfs/sources/glibc-build/libc_pic.os /mnt/lfs/sources/glibc-build/elf/sofini.os /mnt/lfs/sources/glibc-build/elf/interp.os /mnt/lfs/sources/glibc-build/elf/ld.so -lgcc
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__libc_fork':
/mnt/lfs/sources/glibc-2.11.2/posix/../nptl/sysdeps/unix/sysv/linux/i386/../fork.c:79: undefined reference to `__sync_bool_compare_and_swap_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/mnt/lfs/sources/glibc-2.11.2/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `nscd_getpw_r':
/mnt/lfs/sources/glibc-2.11.2/nscd/nscd_getpw_r.c:233: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/mnt/lfs/sources/glibc-2.11.2/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `nscd_getgr_r':
/mnt/lfs/sources/glibc-2.11.2/nscd/nscd_getgr_r.c:322: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/mnt/lfs/sources/glibc-2.11.2/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os:/mnt/lfs/sources/glibc-2.11.2/nscd/nscd_gethst_r.c:415: more undefined references to `__sync_fetch_and_add_4' follow
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__nscd_get_map_ref':
/mnt/lfs/sources/glibc-2.11.2/nscd/nscd_helper.c:433: undefined reference to `__sync_val_compare_and_swap_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `*__GI___libc_freeres':
/mnt/lfs/sources/glibc-2.11.2/malloc/set-freeres.c:39: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
make[1]: *** [/mnt/lfs/sources/glibc-build/libc.so] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.11.2'
make: *** [all] Error 2

configure
Code:
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 2.6.18... 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) no
checking for sys/types.h... (cached) no
checking for sys/stat.h... (cached) no
checking for stdlib.h... (cached) no
checking for string.h... (cached) no
checking for memory.h... (cached) no
checking for strings.h... (cached) no
checking for inttypes.h... (cached) no
checking for stdint.h... (cached) no
checking for unistd.h... (cached) no
checking cpuid.h usability... no
checking cpuid.h presence... yes
configure: WARNING: cpuid.h: present but cannot be compiled
configure: WARNING: cpuid.h:     check for missing prerequisite headers?
configure: WARNING: cpuid.h: see the Autoconf documentation
configure: WARNING: cpuid.h:     section "Present But Cannot Be Compiled"
configure: WARNING: cpuid.h: proceeding with the preprocessor's result
configure: WARNING: cpuid.h: in the future, the compiler will take precedence
checking for cpuid.h... yes
checking if -g produces usable source locations for assembler-with-cpp... yes
checking for SSE4 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: config.h is unchanged
config.status: executing default commands
 
Old 09-02-2010, 05:17 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

First thing I noticed: Why are you using glibc-2.11.2 instead of glibc-2.11.1? I do hope you adjusted this part: --build=$(../glibc-2.11.1/scripts/config.guess) accordingly.

Hope this helps.
 
Old 09-02-2010, 05:40 AM   #3
bigaurian
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Original Poster
Rep: Reputation: 0
first i tried to compile glibc-2.11.1 but i have same error, then i tried to compile glibc-2.11.2
 
Old 09-02-2010, 05:54 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

The 2 most common reason why building LFS fails are:
- A host that is not compliant (vii. Host System Requirements),
- Deviating from the book.

The 6.6 stable LFS book works and there is no reason to change anything (especially true if you are new at this).

I would suggest starting from scratch and following the book to the letter. Do not continue after an error until you fixed it.

If you do come across a problem: First retrace your steps to see if you made any typo's or possibly forgot/misinterpreted one or more of the previous steps.

Hope this helps.
 
Old 09-02-2010, 11:22 AM   #5
bigaurian
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Ok, Thank You. I will try again.

Last edited by bigaurian; 09-02-2010 at 11:26 AM.
 
Old 09-10-2010, 01:14 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,455

Rep: Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353
i686-lfs-linux-gnu-gcc -shared -static-libgcc -Wl,-O1 -Wl,-z,defs -Wl,-dynamic-linker=/toolss/lib/ld-linux.so.2 -B/mnt/lfs/sources/glibc-build/csu/ -Wl,--version-script=/mnt[SNIP]


Have I spotted a typo? :-). Always an afetrnoon sport when dealing with LFS queries. FWIW, I've done several, and if glibc isn't fairly happy, forget it and download the autobuilding install CD which has a workable toolchain.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] error chapter 5.23 LFS book 6.6 charlie_lab Linux From Scratch 5 04-18-2010 05:06 AM
[SOLVED] Question about moving to Chapter 6 in the LFS book. BrandonJ Linux From Scratch 2 04-05-2010 11:48 AM
LFS Book Chapter 6 - 1st step (chroot to /mnt/lfs) doens't work bauld Linux From Scratch 11 03-15-2006 12:31 AM
LFS 6.0 Chapter 6: compiling glibc problem Sakur Linux From Scratch 3 08-13-2005 11:39 PM
LFS 3.3 - chapter 6 - glibc error fend88 Linux From Scratch 5 04-28-2002 11:06 PM

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

All times are GMT -5. The time now is 05:16 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