mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-23 22:33:28 +00:00
Don't use -undefined dynamic_lookup when linking executables on OS X.
This fixes some false positive results for library function tests in configure and also prevents programs crashing at load time due to unresolved references. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@34200 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f24805b244
commit
661d05deb9
2 changed files with 20 additions and 15 deletions
|
@ -1,3 +1,10 @@
|
|||
2011-11-21 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* target.make: Don't use -undefined dynamic_lookup when linking
|
||||
executables on OS X. This fixes some false positive results for
|
||||
library function tests in configure and also prevents programs
|
||||
crashing at load time due to unresolved references.
|
||||
|
||||
2011-10-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* target.make: The -pthread compiler flag is broken on windows ...
|
||||
|
|
28
target.make
28
target.make
|
@ -298,6 +298,17 @@ ifeq ($(FOUNDATION_LIB), apple)
|
|||
DYLIB_DEF_FRAMEWORKS += -framework Foundation
|
||||
endif
|
||||
|
||||
DYLIB_EXTRA_FLAGS += -undefined dynamic_lookup
|
||||
# Useful optimization flag: -Wl,-single_module. This flag only
|
||||
# works starting with 10.3 and is the default since 10.5.
|
||||
ifeq ($(findstring darwin7, $(GNUSTEP_TARGET_OS)), darwin7)
|
||||
DYLIB_EXTRA_FLAGS += -Wl,-single_module
|
||||
endif
|
||||
ifeq ($(findstring darwin8, $(GNUSTEP_TARGET_OS)), darwin8)
|
||||
DYLIB_EXTRA_FLAGS += -Wl,-single_module
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(OBJC_RUNTIME_LIB), gnu)
|
||||
# GNU runtime
|
||||
|
||||
|
@ -309,16 +320,8 @@ ifneq ($(strip $(CC_GNURUNTIME)),)
|
|||
INTERNAL_CFLAGS += -isystem $(CC_GNURUNTIME)
|
||||
endif
|
||||
|
||||
INTERNAL_LDFLAGS += -undefined dynamic_lookup
|
||||
|
||||
SHARED_LD_PREFLAGS += -Wl,-noall_load -read_only_relocs warning $(CC_LDFLAGS)
|
||||
# Useful flag: -Wl,-single_module. This flag only
|
||||
# works starting with 10.3. libs w/ffcall don't link on darwin/ix86 without it.
|
||||
ifeq ($(findstring darwin7, $(GNUSTEP_TARGET_OS)), darwin7)
|
||||
SHARED_LD_PREFLAGS += -single_module
|
||||
endif
|
||||
ifeq ($(findstring darwin8, $(GNUSTEP_TARGET_OS)), darwin8)
|
||||
SHARED_LD_PREFLAGS += -single_module
|
||||
BUNDLE_LIBS += -lSystemStubs
|
||||
endif
|
||||
SHARED_LIB_LINK_CMD = \
|
||||
|
@ -328,6 +331,7 @@ SHARED_LIB_LINK_CMD = \
|
|||
$(DYLIB_COMPATIBILITY_VERSION) \
|
||||
$(DYLIB_CURRENT_VERSION) \
|
||||
-install_name $(LIB_LINK_INSTALL_NAME) \
|
||||
$(DYLIB_EXTRA_FLAGS) \
|
||||
$(ALL_LDFLAGS) -o $@ \
|
||||
$(DYLIB_DEF_FRAMEWORKS) \
|
||||
$^ $(INTERNAL_LIBRARIES_DEPEND_UPON) $(LIBRARIES_FOUNDATION_DEPEND_UPON) \
|
||||
|
@ -342,17 +346,11 @@ SHARED_LIB_LINK_CMD = \
|
|||
|
||||
BUNDLE_LD = $(LD)
|
||||
BUNDLE_LDFLAGS += -fgnu-runtime -bundle
|
||||
BUNDLE_LDFLAGS += -undefined dynamic_lookup
|
||||
|
||||
else
|
||||
# Apple runtime
|
||||
|
||||
DYLIB_EXTRA_FLAGS = -undefined dynamic_lookup
|
||||
# Useful optimization flag: -Wl,-single_module. This flag only
|
||||
# works starting with 10.3.
|
||||
ifeq ($(findstring darwin7, $(GNUSTEP_TARGET_OS)), darwin7)
|
||||
DYLIB_EXTRA_FLAGS += -Wl,-single_module
|
||||
endif
|
||||
|
||||
SHARED_LIB_LINK_CMD = \
|
||||
$(LD) $(SHARED_LD_PREFLAGS) \
|
||||
-dynamiclib $(ARCH_FLAGS) \
|
||||
|
|
Loading…
Reference in a new issue