Trouble with underscores
Subject : Trouble with underscores
From: Sean Hinde <email@hidden >
Date: Mon, 28 Oct 2002 17:47:08 +0000
Hi,
I posted this up at Apple Discussions but no joy yet.. maybe someone
here can help?
I'm trying to finish part of the port of Erlang (www.erlang.org) to OS
X and have some problems with its crypto application..
The build process makes an object file using (slightly cut down for
clarity):
ld -r -u MD5 -lcrypto -o elib.o
which is made into a shared library with
cc -bundle -flat_namespace -undefined suppress elib.o -o elibcrypto.so
-lc -lcurses -lm
This is loaded into the erlang system with the snippet:
dyld_last_result = NSCreateObjectFileImageFromFile(dlname, &ofile);
if (dyld_last_result == NSObjectFileImageSuccess)
handle = NSLinkModule(ofile, dlname, NSLINKMODULE_OPTION_PRIVATE);
return handle;
But I get a load of stuff to stderror:
dyld: /opt/R9B/lib/erlang/erts-5.2/bin/beam Undefined symbols:
MD5
My current theory is that this is something to do with underscores and
indeed if I use:
ld -r -u _MD5 -l crypto -o elib.o
as the first step then things get a little farther - until the next
snippet from erlang which tries to find a reference to the symbol with:
NSSymbol nssymbol = NSLookupSymbolInModule((NSModule*)handle,func_name);
return nssymbol != NULL ? NSAddressOfSymbol(nssymbol) : NULL;
which returns NULL.
This all works fine with Linux/Solarix etc (using dlsym etc). Does
anyone have any further suggestions?
Thanks,
Sean
_______________________________________________
unix-porting mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/unix-porting
Do not post admin requests to the list. They will be ignored.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.