Ensure that linker version scripts (used for symbol export control) always exist.
Using wildcard matching in the Makefile is not adequate to determine whether an export file should exist for a module or not, so instead we'll just create one if the module needs one, or copy the default one if it does not. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256428 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
bfb86188c0
commit
c39bfddbfd
|
@ -55,7 +55,7 @@ CC_CFLAGS=$(PTHREAD_CFLAGS) $(_ASTCFLAGS) $(ASTCFLAGS)
|
|||
CXX_CFLAGS=$(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_DECLARATION_AFTER_STATEMENT),$(_ASTCFLAGS) $(ASTCFLAGS))
|
||||
|
||||
ifeq ($(GNU_LD),1)
|
||||
SO_SUPPRESS_SYMBOLS=-Wl,--version-script,$(if $(wildcard $(subst .so,.exports,$@)),$(subst .so,.exports,$@),$(ASTTOPDIR)/default.exports),--warn-common
|
||||
SO_SUPPRESS_SYMBOLS=-Wl,--version-script,$(subst .so,.exports,$@),--warn-common
|
||||
ifneq ($(wildcard $(subst .so,.dynamics,$@)),)
|
||||
SO_SUPPRESS_SYMBOLS+=-Wl,--dynamic-list,$(subst .so,.dynamics,$@)
|
||||
endif
|
||||
|
@ -118,14 +118,14 @@ endif
|
|||
|
||||
%.so: %.o
|
||||
ifeq ($(GNU_LD),1)
|
||||
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* $(LINKER_SYMBOL_PREFIX)
|
||||
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* "$(LINKER_SYMBOL_PREFIX)" "$(ASTTOPDIR)"
|
||||
endif
|
||||
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
|
||||
$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
|
||||
|
||||
%.so: %.oo
|
||||
ifeq ($(GNU_LD),1)
|
||||
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* $(LINKER_SYMBOL_PREFIX)
|
||||
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* "$(LINKER_SYMBOL_PREFIX)" "$(ASTTOPDIR)"
|
||||
endif
|
||||
$(ECHO_PREFIX) echo " [LDXX] $^ -> $@"
|
||||
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(CXX_LDFLAGS_SO) $^ $(CXX_LIBS)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
test -f ${1}.exports.in && ${AWK} "{sub(\"LINKER_SYMBOL_PREFIX\", \"${2}\"); print;}" ${1}.exports.in > ${1}.exports
|
||||
test -f ${1}.exports.in || rm -f ${1}.exports
|
||||
test -f ${1}.exports.in && ${AWK} "{sub(\"LINKER_SYMBOL_PREFIX\", \"${2}\"); print;}" ${1}.exports.in > ${1}.exports && exit 0
|
||||
test -f ${1}.exports.in || rm -f ${1}.exports && cp ${3}/default.exports ${1}.exports && exit 0
|
||||
|
||||
|
|
Reference in New Issue