[Mono-osx] mkbunde produces broken binary

Alexander Shulgin alexander.shulgin at yessoftware.com
Mon Oct 25 09:11:25 EDT 2010


On 28.09.2010 14:51, jahewson wrote:
>
> I'm trying to get mkbundle to work on OS X 10.6.3, using Mono 2.8
>
> To get mkbundle itself working I use the following hacks from the forum:
>
> export
> PKG_CONFIG_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/"
> export AS="as -arch i386"
> export CC="cc -arch i386"
>
> This works, and mkbundle produces a binary, however attempting to run the
> binary gives the error:
>
> dyld: _dyld_bind_fully_image_containing_address() error
> dyld: Symbol not found: _CFLocaleCopyCurrent
>    Referenced from:
> /Library/Frameworks/Mono.framework/Versions/2.8/lib/libmono-2.0.1.dylib
>    Expected in: dynamic lookup
>
> Trace/BPT trap
>
> It's taken me a several days to get mkbundle working at all... to me this is
> a deal breaker for Mono adoption.

I was bitten by the same issue, but have found a workaround:

$ mkbundle hello.exe -c -o hello.c --keeptemp

$ cc -arch i386 -g -o hello -Wall hello.c `pkg-config --cflags --libs 
mono-2` temp.o -framework CoreFoundation

So basically, this tells mkbundle to produce and assemble temp.s and 
only produce hello.c which we then compile using the same command 
mkbundle will use, while adding that '-framework' option.

I guess the correct way would be to fix mono-2.pc file to include the 
required option.

--
Alex


More information about the Mono-osx mailing list