Red Hat Bugzilla – Bug 120671
libaio does not compile in native mode on ppc64
Last modified: 2007-11-30 17:07:01 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
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
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):
Steps to Reproduce:
1. Rebuild libaio on ppc64.
Actual Results: Error rebuilding libaio on ppc64.
Expected Results: libaio should rebuild cleanly on ppc64.
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
Created attachment 99348 [details]
Change libaio.h to check for ppc64 within ppc ifdef when expanding PADDED* macros
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.
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?
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!
Your initial problem can be solved by passing --target=ppc64 to rpmbuild.
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
P.S. Please discount my 4/12 "Additional info" comment about
an "undefined reference to io_getevents".
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.
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.
I checked the latest rpm, libaio-0.3.104, and did not see the fix there. Did I
miss it? Thanks --
This fix made it into U4. The version of libaio is 0.3.96-5.