Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 236512 - permission to commit to pax-utils gentoo-projects CVS repository for scanmacho
Summary: permission to commit to pax-utils gentoo-projects CVS repository for scanmacho
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-02 21:54 UTC by Fabian Groffen
Modified: 2008-12-31 12:22 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
4-arch FAT Mach-O object (library stub) (libz.dylib,27.46 KB, application/octet-stream)
2008-09-08 07:09 UTC, Fabian Groffen
Details
Mach-O executable (scanmacho itself) (scanmacho,32.79 KB, application/octet-stream)
2008-09-08 07:10 UTC, Fabian Groffen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2008-09-02 21:54:33 UTC
After a day of fun:

% ./scanmacho -vvv -F"%f %o %M %D %n %i %S %Z" libz.dylib scanelf{,.o} $EPREFIX/usr/lib/libxml2.dylib
Format: %f %o %M %D %n %i %S %Z
libz.dylib: scanning file {POWERPC,POWERPC_ALL}
FILE  TYPE   CLASS ENDIAN NEEDED INTERP SONAME SIZE 
libz.dylib MH_DYLIB_STUB POWERPC BE /usr/lib/libgcc_s.1.dylib,/usr/lib/libSystem.B.dylib  /usr/lib/libz.1.dylib 28124
libz.dylib: scanning file {POWERPC64,POWERPC_ALL}
libz.dylib MH_DYLIB_STUB POWERPC64 BE /usr/lib/libgcc_s_ppc64.1.dylib,/usr/lib/libSystem.B.dylib  /usr/lib/libz.1.dylib 28124
libz.dylib: scanning file {I386,POWERPC_603}
libz.dylib MH_DYLIB_STUB I386 LE /usr/lib/libgcc_s.1.dylib,/usr/lib/libSystem.B.dylib  /usr/lib/libz.1.dylib 28124
libz.dylib: scanning file {X86_64,POWERPC_603}
libz.dylib MH_DYLIB_STUB X86_64 LE /usr/lib/libgcc_s.1.dylib,/usr/lib/libSystem.B.dylib  /usr/lib/libz.1.dylib 28124
scanelf: scanning file {POWERPC,POWERPC_ALL}
scanelf MH_EXECUTE POWERPC BE /Library/Gentoo/usr/lib/gcc/powerpc-apple-darwin8/4.2.1/libgcc_s.1.dylib,/usr/lib/libSystem.B.dylib /usr/lib/dyld  146160
scanelf.o: scanning file {POWERPC,POWERPC_ALL}
scanmacho: Mach-O lacks LC_LOAD_DYLIB commands: scanelf.o
scanelf.o MH_OBJECT POWERPC BE    200080
/Library/Gentoo/usr/lib/libxml2.dylib: scanning file {POWERPC,POWERPC_970}
libxml2.dylib MH_DYLIB POWERPC BE /usr/lib/libSystem.B.dylib,/Library/Gentoo/lib/libz.dylib,/Library/Gentoo/lib/libiconv.2.dylib  /Library/Gentoo/usr/lib/libxml2.2.dylib 1712868


I made changes to paxmacho and added scanmacho and macho.h.  It isn't perfect yet, but a good step towards some better interoperability with portage and shared libraries on Darwin.  The code should compile on other platforms fine too, like scanelf does on Darwin at the moment.

I can attach a (bit large) diff if you'd like to review it first.
Comment 1 solar (RETIRED) gentoo-dev 2008-09-02 22:28:59 UTC
Approved by solar for all MACHO related files. Please have vapier give the final thumbs up. 
Comment 2 SpanKY gentoo-dev 2008-09-08 06:23:15 UTC
i'll review it once you commit it ... i'm assuming you dont touch any common files other than like the Makefile ...
Comment 3 Fabian Groffen gentoo-dev 2008-09-08 07:09:08 UTC
Created attachment 164881 [details]
4-arch FAT Mach-O object (library stub)

committed, I attach two Mach-O files which allow you to test scanmacho.  First, a FAT library (containing 4 archs)
Comment 4 Fabian Groffen gentoo-dev 2008-09-08 07:10:29 UTC
Created attachment 164882 [details]
Mach-O executable (scanmacho itself)

a Mach-O executable
Comment 5 Fabian Groffen gentoo-dev 2008-12-02 11:56:41 UTC
this has been committed already a while ago
Comment 6 SpanKY gentoo-dev 2008-12-30 13:27:55 UTC
i finally got around to reviewing the code and i committed style/code cleanups and such ... please check it out and make sure i didnt screw anything up ...
Comment 7 Fabian Groffen gentoo-dev 2008-12-30 20:54:06 UTC
All non-style changes look like they clean up some re-iterating code all the time, which is good.  Code still seems to work as expected.  Thanks!

One suggestion, would it be an idea to ban gnuisms (like strndup) in your `make test` script?  Most notably that one breaks on FreeBSD, but on nearly everywhere else too...
Comment 8 SpanKY gentoo-dev 2008-12-31 12:22:25 UTC
strndup() is in POSIX

http://www.opengroup.org/onlinepubs/9699919799/functions/strndup.html