Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dlcompat and leading underscores on functions



[sending to list again, used the wrong e-mail address before - apologies list maintainer]

I asked myself that question, and decided the packages need to be more aware of cross platform issues rather than fixing it in dlsym. You can check if leading underscores are required in configure and prepend it in the dlsym calls if needed. Also write to the package authors/maintainers and tell them to include your patch to fix these issues.

See the configure check in glib for an example of how to do it. Okay, don't I'll append some code from it :)

There is no linker switch that I am aware of, and dlsym does not prepend the underscore. It would be easy for dlsym to do this, but I don't think it should.

Peter


From configure.in in glib:

         int glib_underscore_test (void) { return 42; }
		int main() {
		  void *f1 = (void*)0, *f2 = (void*)0, *handle;
		  handle = dlopen ((void*)0, 0);
		  if (handle) {
		    f1 = dlsym (handle, "glib_underscore_test");
		    f2 = dlsym (handle, "_glib_underscore_test");
		  } return (!f2 || f1);
		}

On Tuesday, March 19, 2002, at 10:57 AM, Mark Hessling wrote:


Is there a compiler/linker switch that can suppress the leading underscore
on exported function names in a bundle ?
or
Should dlcompat's dlsym() really prepend the underscore ?
_______________________________________________
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.