[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Mon Jul 13 12:08:21 CEST 2009


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	09/07/13 12:08:21

Modified files:
	cm3/m3-sys/cminstall/src/config-no-install/: Darwin.common 

Log message:
	Fix dynamic linking on Darwin.
	There doesn't seem to be an existing way to install symlinks that point both from and to LIB_INSTALL
	so we are forced to use something a bit roundabout. As well, you can't symlink path1/foo to path2/bar,
	only path1/foo to path2/foo and path1/bar to path1/foo.
	So we have:
	
	jaypro:m3core jay$ otool -L /cm3/lib/libm3core.dylib
	/cm3/lib/libm3core.dylib:
	@executable_path/../lib/libm3core.5.dylib (compatibility version 5.0.0, current version 5.2.0)
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
	jaypro:m3core jay$ ls -l /cm3/lib/
	total 3152
	-rwxr-xr-x  1 jay  admin  1602336 Jul 13 02:41 libm3core.5.2.dylib
	lrwxr-xr-x  1 jay  admin       44 Jul 13 02:50 libm3core.5.dylib -> ../pkg/m3core/AMD64_DARWIN/libm3core.5.dylib
	lrwxr-xr-x  1 jay  admin       42 Jul 13 02:50 libm3core.dylib -> ../pkg/m3core/AMD64_DARWIN/libm3core.dylib
	jaypro:m3core jay$ ls -l /cm3/pkg/m3core/AMD64_DARWIN/
	total 4352
	-rw-r--r--  1 jay  admin     1832 Jul 13 00:21 Compiler.i3
	lrwxr-xr-x  1 jay  admin       32 Jul 13 02:50 libm3core.5.2.dylib -> ../../../lib/libm3core.5.2.dylib
	lrwxr-xr-x  1 jay  admin       32 Jul 13 02:50 libm3core.5.dylib -> ../../../lib/libm3core.5.2.dylib
	-rw-r--r--  1 jay  admin  1991136 Jul 13 02:41 libm3core.a
	lrwxr-xr-x  1 jay  admin       32 Jul 13 02:50 libm3core.dylib -> ../../../lib/libm3core.5.2.dylib
	-rw-r--r--  1 jay  admin   213624 Jul 13 00:21 libm3core.m3x
	
	In future we will probably try to do better.
	In particular we will probably just use -L/cm3/lib in the link command and not pass all the -Lpkg options.
	
	Note however that the static .libs are in the pkg directories and not in the lib directory, so actually
	we need to chose -Lpkg vs. -Llib based on standalone or not.
	Perhaps we will move the static libs also.
	(standalone isn't a single bit, libraries that a non-standalone executable uses might be standalone;
	it might also work to pass both -Llib and -Lpkg, for each -l)
	
	We should also probably use a runpath of @executable/../lib/libfoo.5.2.dylib, instead of libfoo.5.dylib,
	to avoid several levels of indirection at load time (yes, I realize it was somewhat deliberate, but
	I don't believe we strive for the high level of binary compatibility that this system has in mind.)
	Then we could dispense entirely with several of the links.
	
	This also fixes build not to ship, and the code duplication between make_lib and skip_lib.




More information about the M3commit mailing list