Bug 699149

Summary: Atomic __sync_fetch_and_{add,or,and} fail on ppc
Product: Red Hat Enterprise Linux 5 Reporter: Mattias Ellert <mattias.ellert>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.8   
Target Milestone: rc   
Target Release: ---   
Hardware: ppc   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-28 17:17:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Mattias Ellert 2011-04-23 16:14:00 UTC
Description of problem:

When compiling xrootd in koji for EPEL 5 ppc I get the following errors:

/builddir/build/BUILD/xrootd-3.0.3/src/Xrd/.libs/libXrd.so: undefined reference to `__sync_fetch_and_add_8'
/builddir/build/BUILD/xrootd-3.0.3/src/Xrd/.libs/libXrd.so: undefined reference to `__sync_fetch_and_or_8'
/builddir/build/BUILD/xrootd-3.0.3/src/Xrd/.libs/libXrd.so: undefined reference to `__sync_fetch_and_and_8'

For a full build log see:
https://koji.fedoraproject.org/koji/getfile?taskID=3021012&name=build.log

The configure script has a test that checks if these functions are implemented and that test succeeds:

"checking whether gcc provide atomic ops... yes"

But the compilation fails anyway.

The compilation works fine on i386 and x86_64.

Version-Release number of selected component (if applicable):
gcc-4.1.2-50.el5.ppc
gcc-c++-4.1.2-50.el5.ppc

How reproducible:
I tried pushing the resubmit button and got the same error again.
(I don't have access to any other ppc system to do testing than submitting things to koji - so it is not easy to figure out what is broken.)

Steps to Reproduce:
1. Submit xrootd 3.0.3 to EPEL 5 koji

Actual results:
Build fails on ppc (succeeds on i386 an x86_64)

Expected results:
Successful builds on all architectures

Comment 1 Jakub Jelinek 2011-04-28 17:17:23 UTC
Wrong assumption of the package.  If the configury test tests for say 32-bit __sync_* and then tries to use 64-bit __sync_*, it can very well fail.
PowerPC 32-bit doesn't have 64-bit atomics (similarly to e.g. i486; i586+ supports even 64-bit ones though).