The file
command can detect what binary types are available in a file.
file -b /usr/bin/atrm
setuid Mach-O universal binary with 3 architectures
/usr/bin/atrm (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/atrm (for architecture i386): Mach-O executable i386
/usr/bin/atrm (for architecture ppc7400): Mach-O executable ppc
So, then, it is just a matter of using find and filtering appropriately. Something like this should find all binaries on the system that have a PPC subsection.
find / -perm -u+x ! -type d -exec file {} \; | grep ppc | awk '{print $1}'
PPC only is a little more difficult. For that, you'll want to do three commands to create 2 files in /tmp, the first containing a list of PPC files and the second a list of 32 or 64 bit x86 files. Conveniently, 'ppc' matches ppc and ppc64.
find / -perm -u+x ! -type d -exec file {} \; | grep ppc | awk '{print $1}' > /tmp/ppc
find / -perm -u+x ! -type d -exec file {} \; | grep i386 | awk '{print $1}' > /tmp/x86
find / -perm -u+x ! -type d -exec file {} \; | grep x86_64 | awk '{print $1}' >> /tmp/x86
Then, sort/uniq a bit (just sorts the paths and makes sure each binary is only listed once):
cat /tmp/x86 | sort | uniq > /tmp/x86.filtered
cat /tmp/ppc | sort | uniq > /tmp/ppc.filtered
Then, use diff (and a bit more processing) to spew the list of files that are ppc only:
diff /tmp/ppc.filtered /tmp/x86.filtered | grep -e '<' | awk '{print $2}' | perl -p -e 's/:$//'
The end result should be a list of files that only contain ppc executable mach-o sections. I would suggest verifying the list before nuking anything.
Some notes:
All of the above is done in the Terminal.
This is just a hack; it worked just fine on my system and I'm glad you asked because I wanted to know the same. But it is just a hack.
The kernel framework is just a bunch of headers to allow for sensible communication with kernel and the ability to build kernel extensions There is are no libraries in it to link against a userspace application.
If you are trying to use userspace IOKit functions to communicate with the kernel side of IOKit you should be using IOKit.framework. If you are trying to use functions that are only defined in the Kernel.framework headers from a user space application then you are doing something wrong.
Best Answer
I don't even own a Mac so feel free to disregard this, but your path has "mac32" in it, which suggests to me that it's a 32 bit library. "architecture" in computers usually refers to 32/64 bit CPU architectures, and I've heard that Snow Leopard has a big emphasis on migrating to 64 bit apps. As such, my first blush impression is that you are using a 32 bit library which Snow Leopard is warning you away from.
Hope that helps you get going in the right direction!