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 02-14-2009, 03:27 AM   #1
gsmedia
LQ Newbie
 
Registered: Feb 2009
Posts: 17

Rep: Reputation: 0
Glibc 1st pass wont compile (possibly i486 related)


Hi everyone,
I'm trying to compile Glibc-2.8-20080929 on Fedora10, as part of LFS6.4 chapter 5.7.

when i make glibc i get the following error message at the end of the compile:

Code:
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__libc_fork':
/mnt/lfs/sources/glibc-2.8-20080929/posix/../nptl/sysdeps/unix/sysv/linux/i386/../fork.c:76: undefined reference to `__sync_bool_compare_and_swap_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `nscd_getpw_r':
/mnt/lfs/sources/glibc-2.8-20080929/nscd/nscd_getpw_r.c:232: 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.8-20080929/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.8-20080929/nscd/nscd_getgr_r.c:321: 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.8-20080929/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `nscd_gethst_r':
/mnt/lfs/sources/glibc-2.8-20080929/nscd/nscd_gethst_r.c:400: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os:/mnt/lfs/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: 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.8-20080929/nscd/nscd_helper.c:406: 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.8-20080929/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.8-20080929'
make: *** [all] Error 2
Googling undefined reference to `__sync_val_compare_and_swap_4' reveals that this error generally occurs when -march=i486 isn't passed to the compiler. I've checked and triple checked that ive followed the instruction:
Code:
echo "CFLAGS += -march=i486 -mtune=native" > configparms
The above command is meant to be run in the glibc-build directory isn't it?

I've tried replacing CFLAGS += -march=i486 -mtune=native with CFLAGS += -march=i686 -mtune=native. After lookin at this thread, I tried both:
Code:
CFLAGS="-g -02 -march=i486"
and
Code:
CFLAGS=" -02 -march=i486"
All of the above combinations give the same error message during compilation. Does anyone know what I should try next to solve this problem?

Thanks

Also, every time I try a different configuration combination, should I start with a fresh build directory, or can I just run configure again?
 
Old 03-28-2009, 08:39 AM   #2
aahiqmir
Member
 
Registered: Apr 2008
Posts: 54

Rep: Reputation: 15
Quote:
Originally Posted by gsmedia View Post
Hi everyone,
I'm trying to compile Glibc-2.8-20080929 on Fedora10, as part of LFS6.4 chapter 5.7.

when i make glibc i get the following error message at the end of the compile:

Code:
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__libc_fork':
/mnt/lfs/sources/glibc-2.8-20080929/posix/../nptl/sysdeps/unix/sysv/linux/i386/../fork.c:76: undefined reference to `__sync_bool_compare_and_swap_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `nscd_getpw_r':
/mnt/lfs/sources/glibc-2.8-20080929/nscd/nscd_getpw_r.c:232: 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.8-20080929/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.8-20080929/nscd/nscd_getgr_r.c:321: 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.8-20080929/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `nscd_gethst_r':
/mnt/lfs/sources/glibc-2.8-20080929/nscd/nscd_gethst_r.c:400: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os:/mnt/lfs/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: 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.8-20080929/nscd/nscd_helper.c:406: 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.8-20080929/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.8-20080929'
make: *** [all] Error 2
Googling undefined reference to `__sync_val_compare_and_swap_4' reveals that this error generally occurs when -march=i486 isn't passed to the compiler. I've checked and triple checked that ive followed the instruction:
Code:
echo "CFLAGS += -march=i486 -mtune=native" > configparms
The above command is meant to be run in the glibc-build directory isn't it?

I've tried replacing CFLAGS += -march=i486 -mtune=native with CFLAGS += -march=i686 -mtune=native. After lookin at this thread, I tried both:
Code:
CFLAGS="-g -02 -march=i486"
and
Code:
CFLAGS=" -02 -march=i486"
All of the above combinations give the same error message during compilation. Does anyone know what I should try next to solve this problem?

Thanks

Also, every time I try a different configuration combination, should I start with a fresh build directory, or can I just run configure again?



try reinstalling your host OS.select all packages from package installation screen.then start lfs6.4 from begining.
i had similar problem.and i run

Code:
echo "CFLAGS += -march=i486 -mtune=native" > configparms
without it i ran into the error.
 
Old 06-20-2009, 06:32 AM   #3
gsmedia
LQ Newbie
 
Registered: Feb 2009
Posts: 17

Original Poster
Rep: Reputation: 0
I know that bringing old posts back from the dead is looked down upon, but after months (on and off) of trying to fix this problem, I found a solution. Maybe if someone else finds this It'll save them some time and pain.

For some reason the CFLAGS weren't being passed from the configparams file to the compiler. All I had to do was export it as an environment variable:
Code:
export CFLAGS="-march=i486 -mtune=native -O2 -pipe"
Now I can (hopefully) move on without any further problems.
 
  


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
GRUB error 2 and possibly related problem cajunaggie Linux - General 4 08-31-2007 04:08 AM
Connection issues -- possibly IPv6 related Campion Fedora 6 11-17-2006 08:12 PM
Strange possibly Amarok related problem futz Linux - Software 4 12-13-2005 10:44 AM
Error Compiling GCC (1st Pass) in LFS 6.0 TGWDNGHN Linux From Scratch 1 06-30-2005 08:57 PM
KDSKBENT Error -Nvidia Related... Possibly MTUTech Fedora 0 12-10-2004 05:38 PM

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

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