LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   glibc-compiling loves to make errors? ok, let me post mine here: glibc 2.9 (http://www.linuxquestions.org/questions/linux-from-scratch-13/glibc-compiling-loves-to-make-errors-ok-let-me-post-mine-here-glibc-2-9-a-713742/)

me-$-on 03-23-2009 05:56 AM

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)...

knudfl 03-26-2009 03:37 AM

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.
.....

me-$-on 03-27-2009 07:12 AM

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.

me-$-on 03-31-2009 03:20 AM

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.........

knudfl 03-31-2009 02:23 PM

  • Short explanation : glibc-2.6 cannot be compiled with gcc-4.3 .

me-$-on 04-01-2009 04:36 AM

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?

knudfl 04-02-2009 01:09 AM

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

.....

Sergei Steshenko 04-11-2009 07:22 PM

If anybody is still interested, see

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


All times are GMT -5. The time now is 08:44 AM.