LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Glibc won't compile in chapter 5.7.1 of the LFS 6.6 book (https://www.linuxquestions.org/questions/linux-from-scratch-13/glibc-wont-compile-in-chapter-5-7-1-of-the-lfs-6-6-book-829911/)

bigaurian 09-02-2010 05:10 AM

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


druuna 09-02-2010 05:17 AM

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.

bigaurian 09-02-2010 05:40 AM

first i tried to compile glibc-2.11.1 but i have same error, then i tried to compile glibc-2.11.2

druuna 09-02-2010 05:54 AM

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.

bigaurian 09-02-2010 11:22 AM

Ok, Thank You. I will try again.

business_kid 09-10-2010 01:14 PM

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.


All times are GMT -5. The time now is 03:09 AM.