Mailing Lists: Apple Mailing Lists

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

linking shared libraries with dependent shared libraries



I'm trying to port our product to OS X/Darwin. It makes heavy use of shared libraries and it currently runs on Linux and Windows. On OS X, I'm using twolevel_namespace.

As the shared libraries are built, they are output into a common directory across the source tree. This allows the ELF targets to find dependent shared libraries as needed while either another shared library or an executable is linked.

e.g.:
shlib1
shlib2
 depends on shlib1
exe
 depends on shlib2

On OS X, I can't figure out how to get ld to search the same directory shlib2 was in to find shlib1. With Windows this doesn't matter since the DLL worries about other dependents at load time. With Linux, ld searches the same directory.

I know I could work around this by explicitly linking shlib1 to exe. However, this is very impractical because it would make the build process very clumsy. Not only would the developer have to play detective to find out what the entire dependency tree is, but the entire build tree would have to be gone through if a heavily used library changed its dependents.

Don't tell me to use frameworks.  This isn't a Darwin-only project.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden


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.