On AIX, I would run:
ar -X32 -t libdb2.a
and check for output to determine if there is a 32-bit object in the archive. Similarly with -X64 for checking for a 64-bit object. However, what about if I’m on another platform, and need to check the archive to see what it has? Usually I’m on Linux when I need to check, but I could just as easily be on Solaris or HP-UX.
I used to check for shr.o and shr_64.o, since that’s what’s being compiled, but those are starting to show up in actual messages that are in the archives, and thus the reliability of these have dropped to the point where I’m getting false positives.
If anyone has a pointer, preferably something I can do in perl, that’d be great.
I don’t think there is an easy way. If you create two AIX archives, one 32-bit and one 64-bit, as follows:
you end up with archives that are not in a readable format by the linux
ar:I tried using
stringsto see if anything obvious was in the archives, but found nothing. Your ony remaining option is to build a binutils package targetting AIX (download binutils, configure with option--target=powerpc-ibm-aix5.3, runmakeand voilà: you’ve got a tool calledpowerpc-ibm-aix5.3-arsomewhere in that build tree).