On 2010-11-12 14:41, Michel Fortin wrote:
On 2010-11-12 04:08:56 -0500, Jacob Carlborg <d...@me.com> said:

Now this really starts to annoy me. I don't know if it's a bug in Mac
OS X or in DMD but I'm getting this error when building some libraries
(Tango, for example):

/usr/bin/ranlib: object: libtango.a(tango-coreBitArray-release.o)
malformed object (LC_SEGMENT command 0 filesize field greater than
vmsize field)
ar: internal ranlib command failed

I've seen something similar too with some transitory test cases while
playing with DMD to generate Objective-C data structures. I'd tend to
believe there's a bug in the backend. I didn't know this bug could be
trigged by compiling code with regular DMD, it could have been something
I trigged playing with the compiler to make it generate extra Objectve-C
segments/sections.

If you want to inspect the object file, I suggest you extract
tango-coreBitArray-release.o from the libtango.a archive and play with
otool, objdump, dumpobj, and perhaps obj2asm. The first two are provided
with Apple's developer tools so they and tend to better reflect the
linker in their understanding of the object file format; the later two
come with DMD and better reflect Walter's implementation.

I used the dumpobj tool to inspect the LC_SEGMENT and just as the error message says, the filesize field is greater than the vmsize field.

--
/Jacob Carlborg

Reply via email to