Bug 899405 - Allow host and target compilers to depend on stdc++-compat independently. r=ted

This commit is contained in:
Mike Hommey 2013-07-31 14:04:23 +09:00
parent 622c6ed12a
commit 9aec57a82e
8 changed files with 24 additions and 17 deletions

View File

@ -61,6 +61,8 @@ def find_version(e):
args += ['-shared', '-Wl,-t']
p = subprocess.Popen(args, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
candidates = [x for x in p.stdout if 'libstdc++.so' in x]
if not candidates:
return ''
assert len(candidates) == 1
libstdcxx = parse_ld_line(candidates[-1])

View File

@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['STDCXX_COMPAT']:
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION'] or CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
DIRS += ['stdc++compat']
if CONFIG['USE_ELF_HACK']:

View File

@ -14,11 +14,11 @@ STL_FLAGS =
NO_EXPAND_LIBS = 1
NO_PROFILE_GUIDED_OPTIMIZE = 1
$(NULL)
HOST_CPPSRCS = $(CPPSRCS)
ifdef MOZ_LIBSTDCXX_HOST_VERSION
HOST_CPPSRCS = stdc++compat.cpp
endif
include $(topsrcdir)/config/rules.mk
CXXFLAGS += -DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_TARGET_VERSION)
HOST_CXXFLAGS += -DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_TARGET_VERSION)
HOST_CXXFLAGS += -DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_HOST_VERSION)

View File

@ -6,11 +6,10 @@
MODULE = 'build'
CPP_SOURCES += [
'stdc++compat.cpp',
]
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
LIBRARY_NAME = 'stdc++compat'
CPP_SOURCES += ['stdc++compat.cpp']
HOST_LIBRARY_NAME = 'host_stdc++compat'
LIBRARY_NAME = 'stdc++compat'
if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
HOST_LIBRARY_NAME = 'host_stdc++compat'

View File

@ -17,7 +17,7 @@ VISIBILITY_FLAGS =
# STDCXX_COMPAT is not needed here, and will actually fail because
# libstdc++-compat is not built yet.
STDCXX_COMPAT =
MOZ_LIBSTDCXX_HOST_VERSION =
ifneq (WINNT,$(HOST_OS_ARCH))
HOST_PROGRAM = nsinstall_real$(HOST_BIN_SUFFIX)

View File

@ -747,14 +747,18 @@ EXPAND_MKSHLIB_ARGS += --symbol-order $(SYMBOL_ORDER)
endif
EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) $(EXPAND_MKSHLIB_ARGS) -- $(MKSHLIB)
ifdef STDCXX_COMPAT
ifneq (,$(MOZ_LIBSTDCXX_TARGET_VERSION)$(MOZ_LIBSTDCXX_HOST_VERSION))
ifneq ($(OS_ARCH),Darwin)
CHECK_STDCXX = objdump -p $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' > /dev/null && echo "TEST-UNEXPECTED-FAIL | | We don't want these libstdc++ symbols to be used:" && objdump -T $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' && exit 1 || exit 0
endif
ifdef MOZ_LIBSTDCXX_TARGET_VERSION
EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,stdc++compat,$(DEPTH)/build/unix/stdc++compat)
endif
ifdef MOZ_LIBSTDCXX_HOST_VERSION
HOST_EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,host_stdc++compat,$(DEPTH)/build/unix/stdc++compat)
endif
endif
# autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
# this file

View File

@ -7534,10 +7534,8 @@ MOZ_ARG_ENABLE_BOOL(stdcxx-compat,
[ --enable-stdcxx-compat Enable compatibility with older libstdc++],
STDCXX_COMPAT=1)
AC_SUBST(STDCXX_COMPAT)
if test -n "$STDCXX_COMPAT"; then
eval $(CXX="$CXX" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
eval $(CXX="$CXX" HOST_CXX="$HOST_CXX" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
AC_SUBST(MOZ_LIBSTDCXX_TARGET_VERSION)
AC_SUBST(MOZ_LIBSTDCXX_HOST_VERSION)
fi

View File

@ -747,14 +747,18 @@ EXPAND_MKSHLIB_ARGS += --symbol-order $(SYMBOL_ORDER)
endif
EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) $(EXPAND_MKSHLIB_ARGS) -- $(MKSHLIB)
ifdef STDCXX_COMPAT
ifneq (,$(MOZ_LIBSTDCXX_TARGET_VERSION)$(MOZ_LIBSTDCXX_HOST_VERSION))
ifneq ($(OS_ARCH),Darwin)
CHECK_STDCXX = objdump -p $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' > /dev/null && echo "TEST-UNEXPECTED-FAIL | | We don't want these libstdc++ symbols to be used:" && objdump -T $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' && exit 1 || exit 0
endif
ifdef MOZ_LIBSTDCXX_TARGET_VERSION
EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,stdc++compat,$(DEPTH)/build/unix/stdc++compat)
endif
ifdef MOZ_LIBSTDCXX_HOST_VERSION
HOST_EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,host_stdc++compat,$(DEPTH)/build/unix/stdc++compat)
endif
endif
# autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
# this file