Bug 120671 - libaio does not compile in native mode on ppc64
libaio does not compile in native mode on ppc64
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: libaio (Show other bugs)
3.0
powerpc Linux
medium Severity medium
: ---
: ---
Assigned To: Jeffrey Moyer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-12 17:04 EDT by Janet Morgan
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: 0.3.96-5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-19 16:16:39 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)
Change libaio.h to check for ppc64 within ppc ifdef when expanding PADDED* macros (833 bytes, patch)
2004-04-12 20:04 EDT, Janet Morgan
no flags Details | Diff

  None (edit)
Description Janet Morgan 2004-04-12 17:04:17 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET 
CLR 1.0.3705)

Description of problem:

I tried to rebuild the latest libaio on ppc64 and got back an error: 

[root@left root]# rpmbuild --rebuild libaio-0.3.98-2.1.src.rpm
Installing libaio-0.3.98-2.1.src.rpm
error: Architecture is not included: ppc64pseries

My understanding was that this rpm was to support all platforms.   Is 
this a know restriction?

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


How reproducible:
Always

Steps to Reproduce:
1. Rebuild libaio on ppc64. 
2.
3.
    

Actual Results:  Error rebuilding libaio on ppc64.

Expected Results:  libaio should rebuild cleanly on ppc64.

Additional info:

If I install libaio, manually add "-m64" to CFLAGS in the Makefile 
and then run make, I receive the following error when trying to 
compile/link my test application:

tpccppc:/tmp# cc test.c -m64 -laio -L/usr/src/packages/SOURCES/libaio-
0.3.98/src -o test
/tmp/ccS9O9OK.o(.text+0x200): In function `.main':
: undefined reference to `.io_getevents'
collect2: ld returned 1 exit status
Comment 1 Janet Morgan 2004-04-12 20:04:36 EDT
Created attachment 99348 [details]
Change libaio.h to check for ppc64 within ppc ifdef when expanding PADDED* macros
Comment 2 Janet Morgan 2004-04-12 20:11:21 EDT
It looks like the problem is in the "PADDED*" macro defines in
libaio.h.  It appears that when __powerpc64__ is defined, so is 
__PPC__, so the PADDED* macros expand for __PPC__ in both cases.  This
produces an incorrectly-structured iocb when running in ppc64 native
mode.   The above  patch fixes the problem by checking for
__powerpc64__ within the __PPC__ #elif.
~                                                         
Comment 3 Janet Morgan 2004-04-12 20:28:16 EDT
So my patch fixes the run-time problem with 64-bit aio on ppc64 (BTW,
the specific failure was an EINVAL back from io_submit), but what
about the rpm error per my first comment?
Comment 4 Jeffrey Moyer 2004-04-13 09:09:16 EDT
I'm sorry, I've been very busy of late.  I will try to give this
attention by the end of the week.  Thanks for the patch!
Comment 5 Jeffrey Moyer 2004-04-14 15:16:48 EDT
Your initial problem can be solved by passing --target=ppc64 to rpmbuild.
Comment 6 Janet Morgan 2004-04-14 16:38:25 EDT
OK, thanks much for the rpmbuild info.  I have passed it along to my 
co-worker who reported the problem to me.  

Looking forward to your input on the patch I appended on 4/12.  
Several folks have been testing with it and it seems to work just 
fine.

P.S.  Please discount my 4/12 "Additional info" comment about 
an "undefined reference to io_getevents".
Comment 7 Jeffrey Moyer 2004-04-14 17:16:44 EDT
The patch looks sane.  I've applied it in my tree, so it will go out
the next time I update libaio, presumably for U3.

-Jeff
Comment 8 Janet Morgan 2004-04-14 17:28:21 EDT
Thank you.
Comment 9 Jeffrey Moyer 2004-09-15 07:28:58 EDT
Sorry, this didn't go into U3.  I have it built into the U4 tree,
though.  I've added ppc64pseries and ppc64iseries to the exclusivearch
line in the spec file as well.  The new version is 0.3.96-4.

-Jeff
Comment 10 Janet Morgan 2005-05-11 12:54:11 EDT
I checked the latest rpm, libaio-0.3.104, and did not see the fix there.  Did I 
miss it?  Thanks --
Comment 11 Jeffrey Moyer 2005-09-19 16:16:39 EDT
This fix made it into U4.  The version of libaio is 0.3.96-5.

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