LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-24-2007, 02:40 PM   #1
rendezvous123
LQ Newbie
 
Registered: May 2007
Distribution: Xubuntu 8.04
Posts: 18

Rep: Reputation: 0
glibc make error: undefined reference to `__sync_fetch_and_add_4'


I am currently trying to compile glibc 2.6 from source, but during make, i get the following errors:
Code:
/media/sda4/sources/glibc-build/elf/librtld.os: In function `add_dependency':
/media/sda4/sources/glibc-2.6/elf/dl-lookup.c:106: undefined reference to `__sync_fetch_and_add_4'
/media/sda4/sources/glibc-2.6/elf/dl-lookup.c:110: undefined reference to `__sync_val_compare_and_swap_4'
/media/sda4/sources/glibc-build/elf/librtld.os: In function `_dl_profile_fixup':
/media/sda4/sources/glibc-2.6/elf/dl-runtime.c:196: undefined reference to `__sync_val_compare_and_swap_4'
/media/sda4/sources/glibc-2.6/elf/dl-runtime.c:205: undefined reference to `__sync_fetch_and_add_4'
/media/sda4/sources/glibc-build/elf/librtld.os: In function `_dl_fixup':
/media/sda4/sources/glibc-2.6/elf/dl-runtime.c:102: undefined reference to `__sync_val_compare_and_swap_4'
/media/sda4/sources/glibc-2.6/elf/dl-runtime.c:110: undefined reference to `__sync_fetch_and_add_4'
/media/sda4/sources/glibc-build/elf/librtld.os: In function `dl_open_worker':
/media/sda4/sources/glibc-2.6/elf/dl-open.c:425: undefined reference to `__sync_val_compare_and_swap_4'
/media/sda4/sources/glibc-2.6/elf/dl-open.c:427: undefined reference to `__sync_fetch_and_add_4'
/media/sda4/sources/glibc-build/elf/librtld.os: In function `_dl_close_worker':
/media/sda4/sources/glibc-2.6/elf/dl-close.c:407: undefined reference to `__sync_val_compare_and_swap_4'
/media/sda4/sources/glibc-2.6/elf/dl-close.c:409: undefined reference to `__sync_fetch_and_add_4'
collect2: ld returned 1 exit status
make[2]: *** [/media/sda4/sources/glibc-build/elf/ld.so] Error 1
make[2]: Leaving directory `/media/sda4/sources/glibc-2.6/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/media/sda4/sources/glibc-2.6'
make: *** [all] Error 2
The only "solution" i've found for it is passing "-march=i486", but that fails for me--no such option. I have no idea how to fix this error. Any help is appreciated.
 
Old 07-24-2007, 06:39 PM   #2
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
-march=i486 is a gcc flag
try
Code:
 
export CFLAGS="${CFLAGS} -march=i486"
i hope i wrote that right.

then in that same shell do your configure make
 
Old 07-25-2007, 01:48 AM   #3
rendezvous123
LQ Newbie
 
Registered: May 2007
Distribution: Xubuntu 8.04
Posts: 18

Original Poster
Rep: Reputation: 0
After doing that, i received the following:
Quote:
/media/sda4/sources/glibc-build/config.h:3:3: error: #error "glibc cannot be compiled without optimization"
I'm stuck again...
 
Old 08-08-2007, 03:11 AM   #4
rendezvous123
LQ Newbie
 
Registered: May 2007
Distribution: Xubuntu 8.04
Posts: 18

Original Poster
Rep: Reputation: 0
Okay, i managed to get by that error by checking out the default CFLAGS that gets generated in config.make without setting CFLAGS myself and adding -march=i486 to it on the next configure:
Code:
CFLAGS="-g -02 -march=i486"
But then i ran into this error:
Code:
/media/sda4/sources/glibc-build/libc_pic.os: In function `sync_file_range':
(.text+0x9e963): undefined reference to `.Lpseudo_end'
collect2: ld returned 1 exit status
Now i'm stuck again. Any one know how to get by this error? (Took a while just to get passed the previous error.)
 
Old 11-09-2008, 07:18 PM   #5
sesquiannual
LQ Newbie
 
Registered: Nov 2008
Location: NE Indiana
Distribution: manually upgraded red hat
Posts: 1

Rep: Reputation: 0
I've been working through similar problems myself. I appear to have gotten further than you by leaving out the '-g'. It isn't really a optimization flag and is more for giving extra data to a debugger.
 
  


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
can't '$make xconfig' anymore - undefined reference bioe007 Slackware 4 01-31-2007 01:36 AM
Error: Make on kismet-2005-08-R1 "undefined reference" zeevolking Linux - Software 1 12-23-2005 08:40 PM
Kernel make bzImage error "undefined reference" w/ Prism2.5 USB driver under 2.6 joachimvb Mandriva 1 09-24-2004 07:43 PM
Undefined Reference errors during make. sheenak Programming 5 05-14-2004 06:14 AM
make error/ undefined reference apljdi Linux - Newbie 1 10-29-2002 01:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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