[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Fri Apr 3 12:46:37 CEST 2009


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	09/04/03 12:46:37

Modified files:
	cm3/m3-sys/cminstall/src/config-no-install/: PPC_DARWIN 

Log message:
	Darwin ld offers the following powerful confusing features
	-install_name @executable_path/../foo.dylib
	-install_name @loader_path/../foo.dylib
	-install_name @rpath/../foo.dylib
	
	@executable_path is the oldest and easiest to understand.
	I believe it was introduced sometime prior to 10.4.
	
	@loader_path -- I don't know what this means,
	people say it is "better" than @executable_path,
	it was introduced in 10.4.
	I suspect it means either "the referencing file"
	instead of "the executable" or perhaps the
	list of files loaded so far.
	
	@rpath was introduced in 10.5 and is said to be even "better".
	Though I don't know exactly what it does.
	
	There are just way way way too many options here.
	The web generally only has current documentation.
	Local man pages are appropriately out of date, but
	don't always give history.
	
	As well there is tool -- install_name_tool -- that can be
	used to "patch" the paths recorded in files.
	You can reserve specified or "maximum" padding for it.
	Let's be nice and slightly wasteful and give maximum padding.
	
	Throw in -dead_strip.
	
	Would be nice to use -dead_strip_dylibs and -pie, but they require 10.5.
	
	Would be nice to -multiply_defined error, but we can only immediately
	get away with that for shared libraries. For executables I get an
	error about __cxa_exit. Lame but oh well for now.
	
	Primary net result is that while DYLD_LIBRARY_PATH and LD_LIBRARY_PATH
	can presumably be used either to override install_name, or provide a fallback,
	such as for uninstalled binaries, (which order is the probe? Can experiment
	to find out...), installed binaries should work without any extra
	environment variable, which is nice. As long as everything is in
	/base/bin
	/base/lib
	
	But hey, we give you maximum padding, so you can use install_name_tool.
	A hypothetical fancy installer might do that. Might.
	
	I have half an inclination that we should write our own ELF and MachO
	dynamic loader and get to some sane simple small appropriately flexible
	and portable system...(not sure if MachO is pluggable but most ELF
	systems are).




More information about the M3commit mailing list