aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-01-04 11:50:41 +0000
committerGuy Harris <guy@alum.mit.edu>2007-01-04 11:50:41 +0000
commit461d5cc45f02f9b16a9cb58d858131431f1d9dcf (patch)
treed899c01c13b4d0e24b86cc5d3001ba5d9f177992 /configure.in
parentcf6f013568b65eaaa716f8c37edb3e4777b9e4f4 (diff)
Add -Wl,-single_module to the linker flags in Darwin. The page at
http://developer.apple.com/releasenotes/DeveloperTools/RN-dyld/index.html says The static linker ld(1) supports building dylibs as either -multi_module or -single_module. Conceptually, a multi-module dylib is like a group of smaller dylibs - one per source file. The extra meta-data in a multi-module dylib allowed (pre-10.4) dyld to delay binding and running initializers on the individual modules. In Mac OS X 10.4 dyld ignores all multi-module meta-data and completely binds and runs all initializers the same as if it were built single-module. In general, building dylibs -single_module is preferred. The one case where multi-module is still useful is it allows internal functions of a dylib to be interposable. For instance, libSystem.dylib is built multi_module so that malloc() can be overridden and all uses of malloc in libSystem (e.g. strdup) would be redirected to use the overridden version. and we don't need the interposability for our dylibs, and Andreas Fink indicates that it's necessary for the packaged Wireshark builds he's doing. svn path=/trunk/; revision=20301
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in22
1 files changed, 14 insertions, 8 deletions
diff --git a/configure.in b/configure.in
index ba6111786c..61518c4cd0 100644
--- a/configure.in
+++ b/configure.in
@@ -236,14 +236,20 @@ AC_MSG_CHECKING(for platform-specific linker flags)
case "$host_os" in
darwin*)
#
- # Make sure that if we search directories A and B, in
- # that order, for a given library, a non-shared version
- # in directory A, rather than a shared version in
- # directory B, is chosen (so we can use --with-pcap=/usr/local
- # to force all programs to be linked with a static
- # version installed in /usr/local/lib rather than the
- # system version in /usr/lib).
- LDFLAGS="-Wl,-search_paths_first $LDFLAGS"
+ # Add -Wl,-single_module; see the checkin comment for details
+ # of why we do that (it's considered preferable, at least in
+ # OS X 10.4 and later, by Apple, and it's needed for some
+ # packaged build work).
+ #
+ # Add -Wl,-search_paths_first to make sure that if we search
+ # directories A and B, in that order, for a given library, a
+ # non-shared version in directory A, rather than a shared
+ # version in directory B, is chosen (so we can use
+ # --with-pcap=/usr/local to force all programs to be linked
+ # with a static version installed in /usr/local/lib rather than
+ # the system version in /usr/lib).
+ #
+ LDFLAGS="-Wl,-single_module -Wl,-search_paths_first $LDFLAGS"
AC_MSG_RESULT(Apple linker - added -Wl,-search_paths_first)
;;
cygwin*)