Bug 455712 - undefined reference to Built-in functions for atomic memory access
undefined reference to Built-in functions for atomic memory access
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
9
i686 Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-17 06:28 EDT by Steven Côté
Modified: 2008-07-19 15:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-19 15:38:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test program source (211 bytes, text/plain)
2008-07-17 06:28 EDT, Steven Côté
no flags Details

  None (edit)
Description Steven Côté 2008-07-17 06:28:08 EDT
Description of problem:
Sorry if I'm doing this wrong but I've tried compiling the attached test program
on a Ubuntu system and it works fine (using GCC 4.2.3). When attempting to use
the Built-in functions for atomic memory access
(http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Atomic-Builtins.html#Atomic-Builtins),
the built-in functions give an undefined reference error:

[smc@localhost ~]$ gcc -Wall test.c 
/tmp/ccIRjIFU.o: In function `inc':
test.c:(.text+0x15): undefined reference to `__sync_add_and_fetch_4'
collect2: ld returned 1 exit status



Version-Release number of selected component (if applicable):
gcc-4.3.0-8

How reproducible:
I've attached a simple program to demonstrate the problem. As best I can tell,
this program should compile and link.
Comment 1 Steven Côté 2008-07-17 06:28:08 EDT
Created attachment 312027 [details]
Test program source
Comment 2 Jakub Jelinek 2008-07-19 15:38:41 EDT
That's user error.  You can't use them on CPUs that don't support them.
You likely don't have a plain i386 and i486 and higher already support them,
so just compile with -march=i486, -march=i586, -march=i686 or higher.

Note You need to log in before you can comment on or make changes to this bug.