LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 03-23-2009, 04:56 AM   #1
me-$-on
Member
 
Registered: May 2007
Posts: 64

Rep: Reputation: 15
glibc-compiling loves to make errors? ok, let me post mine here: glibc 2.9


EROR WHILE ""make" of glibc
INFORMATION:

---LFS-6.3
- host system slackware 12.2, system:amd athlon thunderbird 900 mhz,
using other sources for lfs:
--------------------------------------------------------------------------

- binutils 2.19
- glibc 2.9
- Kernel 2.6.28.8
- gcc 4.3.3




The last important output while make:

Code:
/mnt/lfs/source/glibc_build/libc_pic.os: In function `nscd_getpw_r':
/mnt/lfs/source/glibc-2.9/nscd/nscd_getpw_r.c:232: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `__nscd_drop_map_ref':
/mnt/lfs/source/glibc-2.9/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `nscd_getgr_r':
/mnt/lfs/source/glibc-2.9/nscd/nscd_getgr_r.c:321: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `__nscd_drop_map_ref':
/mnt/lfs/source/glibc-2.9/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `nscd_gethst_r':
/mnt/lfs/source/glibc-2.9/nscd/nscd_gethst_r.c:400: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/source/glibc_build/libc_pic.os:/mnt/lfs/source/glibc-2.9/nscd/nscd-client.h:320: more undefined references to `__sync_fetch_and_add_4' follow
/mnt/lfs/source/glibc_build/libc_pic.os: In function `__nscd_get_map_ref':
/mnt/lfs/source/glibc-2.9/nscd/nscd_helper.c:431: undefined reference to `__sync_val_compare_and_swap_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `*__GI___libc_freeres':
/mnt/lfs/source/glibc-2.9/malloc/set-freeres.c:39: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
make[1]: *** [/mnt/lfs/source/glibc_build/libc.so] Error 1
make[1]: Leaving directory `/mnt/lfs/source/glibc-2.9'
make: *** [all] Error 2

After following the good hint:
Code:
echo "CFLAGS += -march=i486 -mtune=native" > configparms

I got this error ( I hope, everyone can unserstand, why I chose th special lines to post, although the error is the same like before):

Code:
__sync_bool_compare_and_swap_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `nscd_getpw_r':
/mnt/lfs/source/glibc-2.9/nscd/nscd_getpw_r.c:232: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `__nscd_drop_map_ref':
/mnt/lfs/source/glibc-2.9/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `nscd_getgr_r':
/mnt/lfs/source/glibc-2.9/nscd/nscd_getgr_r.c:321: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `__nscd_drop_map_ref':
/mnt/lfs/source/glibc-2.9/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `nscd_gethst_r':
/mnt/lfs/source/glibc-2.9/nscd/nscd_gethst_r.c:400: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/source/glibc_build/libc_pic.os:/mnt/lfs/source/glibc-2.9/nscd/nscd-client.h:320: more undefined references to `__sync_fetch_and_add_4' follow
/mnt/lfs/source/glibc_build/libc_pic.os: In function `__nscd_get_map_ref':
/mnt/lfs/source/glibc-2.9/nscd/nscd_helper.c:431: undefined reference to `__sync_val_compare_and_swap_4'
/mnt/lfs/source/glibc_build/libc_pic.os: In function `*__GI___libc_freeres':
/mnt/lfs/source/glibc-2.9/malloc/set-freeres.c:39: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
make[1]: *** [/mnt/lfs/source/glibc_build/libc.so] Error 1
make[1]: Leaving directory `/mnt/lfs/source/glibc-2.9'
make: *** [all] Error 2
So, as I told before, I used the exporting-flag-hint, but i still have this message...... now, what can I do, or, where would I have to look for that kind of help, who perhaps had exactly the same error, and solved it?

I suppose, this undefined references of the glibc COULD be a Part of the API headers..... perhaps the glibc-2.9 is too new for the api-headers of the kernel 2.6.28.8----- and so these references are not implemented yet....... is that right?
If so, than i need to get the fitting glibc for my 28.8 kernel.

Would be nice, If anyone could correct my assumptions.


THX in advance.

--
--
-- i found something regarding mounting the proc and chroot..... could be i forgot to do that ( but that it is not very likely)...

Last edited by me-$-on; 03-23-2009 at 06:59 AM.
 
Old 03-26-2009, 02:37 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Quote:
- binutils 2.19
- glibc 2.9
- Kernel 2.6.28.8
- gcc 4.3.3
So that's not really LFS 6.3 ......... you'd better also have a
look in the book for LFS 6.4 where newer packages are used.
.........

Glibc 2.9 has been "done" ( a few times ? ), please have
a look into the patching found in the "src.rpm's" to see
how Suse 11.1 and Fedora 10 did this.

Suse 11.1 : binutils-2.19, gcc-4.3.3, glibc-2.9

Suse 11.1 source
http://download.opensuse.org/source/.../oss/suse/src/
............

Fedora 10 : binutils-2.18.50 (which is almost 2.19 ),
gcc-4.3.2, glibc-2.9

Fedora 10 source
http://download.fedora.redhat.com/pu.../source/SRPMS/
............
Unpacking e.g. glibc-2.9-2.9.src.rpm ( suse ) :
( use an empty directory, plenty of files )
rpm2cpio glibc-2.9-2.9.src.rpm | cpio -idmv

> > May be read the patch "glibc-fix-nscd.diff"
or use it.
.....

Last edited by knudfl; 03-26-2009 at 02:52 AM.
 
Old 03-27-2009, 06:12 AM   #3
me-$-on
Member
 
Registered: May 2007
Posts: 64

Original Poster
Rep: Reputation: 15
Very nice....

ok, i will try two things:

Using another glibc ( an older version ) ........... and if this works, i will try your hints.... thank You very much.

Read ya.
 
Old 03-31-2009, 02:20 AM   #4
me-$-on
Member
 
Registered: May 2007
Posts: 64

Original Poster
Rep: Reputation: 15
Even with the live CD - damn!

That's not possible.

I downloaded the lfs-6.3 live CD..... and used still this sources:

- binutils 2.19
- glibc 2.9
- Kernel 2.6.28.8
- gcc 4.3.3

Following the lfs-6.4.pdf EXACTLY ( only with the sources mentioned above).

And suddenly the "make" of glibc took much longer to end with an error of "undefined references".

I used the glibc-2.6 from 6.3 and had, again, longer success, until another error occured, which told me again, that some undefined references are not to solve.

So... I must admit, that all my sources, which I wrote at the beginning remained the same. I just repeated the building-process with several glibc sources.... I think, I will have to start from the very beginning.

And I will stuck to the sources of that book now, EXACTLY, only the kernel will be 2.6.29.

Damn shit.
But I think, that's what some people mean, if they say: "After You read the lfs-book 3 or 4 times"...... but without problems it would be boring......

So, till next time, where it surely will be "Even the live-lfs-cd-with-sources" fauils to build glibc........

AMD Athlon 900 Mhz......hmmm, defined as 686....is -mtune=i486 perheps wrong?

Hmmm.........
 
Old 03-31-2009, 01:23 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
  • Short explanation : glibc-2.6 cannot be compiled with gcc-4.3 .
 
Old 04-01-2009, 03:36 AM   #6
me-$-on
Member
 
Registered: May 2007
Posts: 64

Original Poster
Rep: Reputation: 15
Suppose

I still compile with my gcc of the host system...... I am in the first of two "chapters": as I understood, I compile with my host systems gcc and later, after changing the toolchain, I Would compile with my new gcc, right?

Correction: oh, shit I worte something wrong:
I am using the life-CD now..... ehm, does it have the gcc-4.3?

Last edited by me-$-on; 04-01-2009 at 08:22 AM.
 
Old 04-02-2009, 12:09 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
To know, which gcc, you currently are using,
please do the command
'which gcc' ( or 'gcc -v' ).

.....

Last edited by knudfl; 04-02-2009 at 08:17 AM.
 
Old 04-11-2009, 06:22 PM   #8
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
If anybody is still interested, see

http://sourceware.org/bugzilla/show_bug.cgi?id=10062
.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Glibc make check errors, safe to continue kummiliim Linux From Scratch 0 03-02-2008 04:40 PM
Glibc-2.5.1 make check errors shomaster Linux From Scratch 1 09-10-2007 04:44 PM
Compiling glibc-2.3.5 or glibc 2.3.5-r1 on Gentoo fails ghrellin Linux - Software 2 07-19-2005 01:01 AM
Problems with "make check" while compiling Glibc in Chapter 6.11 Spuckdung Linux From Scratch 2 02-13-2005 05:12 AM
Replacing glibc using linuxthreads for glibc using nptl (native positx thread library CestusGW Linux From Scratch 4 01-20-2005 07:26 AM


All times are GMT -5. The time now is 11:17 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration