Browse files

Bug 748739 - Link stdc++compat as a static library, and always link i…

…t when STDCXX_COMPAT is enabled. r=ted

--HG--
rename : build/stdc++compat.cpp => build/unix/stdc++compat/stdc++compat.cpp
  • Loading branch information...
1 parent ae6c05c commit 3cb43c5b0c0da0dfdc160ab56c00aa2745f44185 @glandium glandium committed Apr 30, 2012
View
5 allmakefiles.sh
@@ -89,6 +89,11 @@ if [ "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" ]; then
add_makefiles "
build/unix/Makefile
"
+ if [ "$STDCXX_COMPAT" ]; then
+ add_makefiles "
+ build/unix/stdc++compat/Makefile
+ "
+ fi
if [ "$USE_ELF_HACK" ]; then
add_makefiles "
build/unix/elfhack/Makefile
View
6 build/unix/Makefile.in
@@ -47,8 +47,12 @@ include $(DEPTH)/config/autoconf.mk
MODULE = build
+ifdef STDCXX_COMPAT
+DIRS += stdc++compat
+endif
+
ifdef USE_ELF_HACK
-DIRS = elfhack
+DIRS += elfhack
endif
TEST_DIRS = test
View
1 build/unix/elfhack/Makefile.in
@@ -54,7 +54,6 @@ VPATH += $(topsrcdir)/build
HOST_CPPSRCS = \
elf.cpp \
elfhack.cpp \
- $(STDCXX_COMPAT) \
$(NULL)
OS_CXXFLAGS := $(filter-out -fno-exceptions,$(OS_CXXFLAGS)) -fexceptions
View
27 build/unix/stdc++compat/Makefile.in
@@ -0,0 +1,27 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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/.
+
+DEPTH = ../../..
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+MODULE = build
+LIBRARY_NAME = stdc++compat
+HOST_LIBRARY_NAME = host_stdc++compat
+FORCE_STATIC_LIB= 1
+STL_FLAGS =
+NO_EXPAND_LIBS = 1
+
+CPPSRCS = \
+ stdc++compat.cpp
+ $(NULL)
+
+HOST_CPPSRCS = $(CPPSRCS)
+
+include $(topsrcdir)/config/rules.mk
+
+CXXFLAGS += -DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_TARGET_VERSION)
View
0 build/stdc++compat.cpp → build/unix/stdc++compat/stdc++compat.cpp
File renamed without changes.
View
4 config/Makefile.in
@@ -49,6 +49,10 @@ include $(DEPTH)/config/autoconf.mk
# headers, so that we can use it to set up the wrapped system headers.
VISIBILITY_FLAGS =
+# STDCXX_COMPAT is not needed here, and will actually fail because
+# libstdc++-compat is not built yet.
+STDCXX_COMPAT =
+
HOST_PROGRAM = nsinstall$(HOST_BIN_SUFFIX)
ifeq (WINNT,$(HOST_OS_ARCH))
View
3 config/config.mk
@@ -789,6 +789,9 @@ ifdef STDCXX_COMPAT
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
+
+EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,stdc++compat,$(DEPTH)/build/unix/stdc++compat)
+HOST_EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,host_stdc++compat,$(DEPTH)/build/unix/stdc++compat)
endif
# autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
View
3 config/rules.mk
@@ -826,9 +826,6 @@ endif # NO_PROFILE_GUIDED_OPTIMIZE
##############################################
-stdc++compat.$(OBJ_SUFFIX): CXXFLAGS+=-DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_TARGET_VERSION)
-host_stdc++compat.$(OBJ_SUFFIX): CXXFLAGS+=-DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_HOST_VERSION)
-
checkout:
$(MAKE) -C $(topsrcdir) -f client.mk checkout
View
2 configure.in
@@ -7519,7 +7519,7 @@ dnl ========================================================
STDCXX_COMPAT=
MOZ_ARG_ENABLE_BOOL(stdcxx-compat,
[ --enable-stdcxx-compat Enable compatibility with older libstdc++],
- STDCXX_COMPAT=stdc++compat.cpp)
+ STDCXX_COMPAT=1)
AC_SUBST(STDCXX_COMPAT)
View
1 dom/plugins/test/testplugin/Makefile.in
@@ -62,7 +62,6 @@ VPATH += $(topsrcdir)/build
CPPSRCS = \
nptest.cpp \
nptest_utils.cpp \
- $(STDCXX_COMPAT) \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
View
3 js/src/config/config.mk
@@ -789,6 +789,9 @@ ifdef STDCXX_COMPAT
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
+
+EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,stdc++compat,$(DEPTH)/build/unix/stdc++compat)
+HOST_EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,host_stdc++compat,$(DEPTH)/build/unix/stdc++compat)
endif
# autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
View
3 js/src/config/rules.mk
@@ -826,9 +826,6 @@ endif # NO_PROFILE_GUIDED_OPTIMIZE
##############################################
-stdc++compat.$(OBJ_SUFFIX): CXXFLAGS+=-DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_TARGET_VERSION)
-host_stdc++compat.$(OBJ_SUFFIX): CXXFLAGS+=-DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_HOST_VERSION)
-
checkout:
$(MAKE) -C $(topsrcdir) -f client.mk checkout
View
1 toolkit/crashreporter/client/Makefile.in
@@ -66,7 +66,6 @@ VPATH += $(topsrcdir)/build/
CPPSRCS = \
crashreporter.cpp \
- $(STDCXX_COMPAT) \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
View
4 toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/Makefile.in
@@ -61,8 +61,4 @@ HOST_LIBS += \
# force C++ linking
CPP_PROG_LINK = 1
-#XXX: bug 554854 causes us to be unable to run binaries on the build slaves
-# due to them having an older libstdc++
-HOST_LDFLAGS += -static
-
include $(topsrcdir)/config/rules.mk
View
1 toolkit/crashreporter/test/Makefile.in
@@ -64,7 +64,6 @@ CPPSRCS = \
logging.cc \
minidump.cc \
pathname_stripper.cc \
- $(STDCXX_COMPAT) \
$(NULL)
LOCAL_INCLUDES += \
View
1 toolkit/library/Makefile.in
@@ -28,7 +28,6 @@ MAKE_FRAMEWORK=1
endif
VPATH += $(topsrcdir)/build/
-CPPSRCS += $(STDCXX_COMPAT)
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
CPPSRCS += dlldeps-xul.cpp
View
5 xpcom/tests/Makefile.in
@@ -205,8 +205,3 @@ check::
$(DIST)/bin/TestRegistrationOrder$(BIN_SUFFIX) $(regOrderDir)
GARBAGE += TestScriptable.h
-
-ifdef STDCXX_COMPAT
-TestCheckedInt: $(STDCXX_COMPAT:.cpp=.$(OBJ_SUFFIX))
-TestCheckedInt: LIBS += $(STDCXX_COMPAT:.cpp=.$(OBJ_SUFFIX))
-endif

0 comments on commit 3cb43c5

Please sign in to comment.