LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-07-2009, 02:11 AM   #1
phoenix12345
LQ Newbie
 
Registered: Apr 2008
Posts: 15

Rep: Reputation: 1
Glibc compilation errors


So here are the errors. I get these when i'm trying to compile glibc for the toolchain.

Code:
gcc -B/tools/bin/   -shared -static-libgcc -Wl,-O1  -Wl,-z,defs -Wl,-dynamic-linker=/tools/lib/ld-linux.so.2  -B/media/sda8/sources/glibc-build/csu/  -Wl,--version-script=/media/sda8/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/media/sda8/sources/glibc-build -L/media/sda8/sources/glibc-build/math -L/media/sda8/sources/glibc-build/elf -L/media/sda8/sources/glibc-build/dlfcn -L/media/sda8/sources/glibc-build/nss -L/media/sda8/sources/glibc-build/nis -L/media/sda8/sources/glibc-build/rt -L/media/sda8/sources/glibc-build/resolv -L/media/sda8/sources/glibc-build/crypt -L/media/sda8/sources/glibc-build/nptl -Wl,-rpath-link=/media/sda8/sources/glibc-build:/media/sda8/sources/glibc-build/math:/media/sda8/sources/glibc-build/elf:/media/sda8/sources/glibc-build/dlfcn:/media/sda8/sources/glibc-build/nss:/media/sda8/sources/glibc-build/nis:/media/sda8/sources/glibc-build/rt:/media/sda8/sources/glibc-build/resolv:/media/sda8/sources/glibc-build/crypt:/media/sda8/sources/glibc-build/nptl -o /media/sda8/sources/glibc-build/libc.so -T /media/sda8/sources/glibc-build/shlib.lds /media/sda8/sources/glibc-build/csu/abi-note.o /media/sda8/sources/glibc-build/elf/soinit.os /media/sda8/sources/glibc-build/libc_pic.os /media/sda8/sources/glibc-build/elf/sofini.os /media/sda8/sources/glibc-build/elf/interp.os /media/sda8/sources/glibc-build/elf/ld.so -lgcc
/media/sda8/sources/glibc-build/libc_pic.os: In function `__libc_fork':
/media/sda8/sources/glibc-2.8-20080929/posix/../nptl/sysdeps/unix/sysv/linux/i386/../fork.c:76: undefined reference to `__sync_bool_compare_and_swap_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `nscd_getpw_r':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd_getpw_r.c:232: undefined reference to `__sync_fetch_and_add_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `nscd_getgr_r':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd_getgr_r.c:321: undefined reference to `__sync_fetch_and_add_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `nscd_gethst_r':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd_gethst_r.c:400: undefined reference to `__sync_fetch_and_add_4'
/media/sda8/sources/glibc-build/libc_pic.os:/media/sda8/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: more undefined references to `__sync_fetch_and_add_4' follow
/media/sda8/sources/glibc-build/libc_pic.os: In function `__nscd_get_map_ref':
/media/sda8/sources/glibc-2.8-20080929/nscd/nscd_helper.c:406: undefined reference to `__sync_val_compare_and_swap_4'
/media/sda8/sources/glibc-build/libc_pic.os: In function `*__GI___libc_freeres':
/media/sda8/sources/glibc-2.8-20080929/malloc/set-freeres.c:39: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
make[1]: *** [/media/sda8/sources/glibc-build/libc.so] Error 1
make[1]: Leaving directory `/media/sda8/sources/glibc-2.8-20080929'
make: *** [all] Error 2
I should note that i'm using Ubuntu 9.04 and instead of version 2.6.27.4 of the kernel i decided to use a newer release that supports ext4(2.6.29.2).

I read in another post that a solution could be recompiling GCC but i haven't tried it since it takes a lot of time.
 
Old 05-07-2009, 06:58 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
..... could be recompiling GCC ......
Testing if the new gcc is as good as the system one :
That is very easy to find out :
Just make a test compile of glibc, using your system gcc,
/usr/bin/gcc ( 4.3 ), and a different 'configure'.
( From scratch, in a new unique directory in /home/"user"/ ).
....
 
Old 05-07-2009, 11:08 AM   #3
phoenix12345
LQ Newbie
 
Registered: Apr 2008
Posts: 15

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by knudfl View Post
Testing if the new gcc is as good as the system one :
That is very easy to find out :
Just make a test compile of glibc, using your system gcc,
/usr/bin/gcc ( 4.3 ), and a different 'configure'.
( From scratch, in a new unique directory in /home/"user"/ ).
....
Well i did what you suggested and gcc(from the host system) doesn't seem to be able to compile glibc.

The question is what should i do? Should i try to install another version of gcc on the host system(maybe 4.4) and then recompile gcc from the toolchain ?
 
Old 05-07-2009, 01:54 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
I guess, you will have to repeat all steps connected
to glibc. ( Don't try gcc-4.4, (my opinion), gcc-4.3 is OK.)

Else ask in the LFS forum, remember all information :
Host, LFS version, chapter. ( See 1.5.1 ).
http://www.linuxfromscratch.org/lfs/...skforhelp.html
.....

Last edited by knudfl; 05-07-2009 at 01:58 PM.
 
Old 05-09-2009, 11:32 AM   #5
phoenix12345
LQ Newbie
 
Registered: Apr 2008
Posts: 15

Original Poster
Rep: Reputation: 1
Well either Ubuntu is cursed or gcc 4.3 isn't capable of compiling Glibc. But gcc 4.4 compiles glibc fine, so i think i'm gonna switch to it.
 
  


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
glibc-compiling loves to make errors? ok, let me post mine here: glibc 2.9 me-$-on Linux From Scratch 7 04-11-2009 06:22 PM
glibc-2.7 compilation error circul Linux From Scratch 2 01-26-2008 06:30 PM
glibc compilation error newcomer4 Linux - Newbie 1 02-03-2006 02:53 PM
glibc compilation error newcomer4 Linux From Scratch 1 02-03-2006 05:02 AM
Glibc compilation error Krappy Linux From Scratch 0 05-03-2005 12:24 AM

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

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