On Mar 28, 2005, at 3:07 AM, Andreas Grosam wrote: XCode passes the option -install_name to the linker phase (Ld).
I assume Ld calls ld which is refered to as "darwin linker". The help available in XCode says that option -install_name is a "darwin option" and referes to the man page of the "darwin linker" for further description.
However, the man page ld(1) does not mention an option -install_name.
Is this the same as -dylib_install_name? Or do i miss something else?
Xcode's 'Ld' "pseudo-tool" actually invokes gcc to handle the link phase, as the gcc driver processes and passes through a consistent set of options. If you look closely at the build step it reads something like
Ld /Volumes/Local/Objects/ldtest.dylib normal ppc cd /Volumes/Local/Users/espich/ldtest /usr/bin/gcc-3.3 -o /Volumes/Local/Objects/ldtest.dylib -L/Volumes/Local/Objects -F/Volumes/Local/Objects -filelist /Volumes/Local/Objects/Intermediates/ldtest.build/ldtest.build/Objects-normal/ppc/ldtest.LinkFileList -framework Cocoa -arch ppc -Wl,-single_module -dynamiclib -compatibility_version 1 -current_version 1 -install_name /usr/local/lib/ldtest.dylib
Thegcc passes the -install_name value to libtool, which processes libraries before sending them on to the actual linker in static or dynamic mode.
-install_name name For a dynamic shared library this specifies the file name the library will be installed in for programs that use it. If this is not specified the name specified by the -o output option will be used.
For dynamic libraries this is indeed passed through to the Darwin linker ld in the -dylib_install_name option:
-dylib_install_name name For dynamic shared library files, specifies the name of the file the library will be installed in for programs that use it. If this is not specified, the name specified in the -o name option will be used. This option is used as the libtool(1) -install_name name option when its -dynamic option is specified.
The specific value that's passed is a concatenation of the Install Path, Product Name. and Executable Suffix build settings, for example, the above target has the following build settings:
INSTALL_PATH /usr/local/lib PRODUCT_NAME ldtest EXECUTABLE EXTENSION dylib
hence the -install_name /usr/local/lib/ldtest.dylib on the gcc command line.
Chris
|