Bug 1041936 part 2 - Directly use the static library "xul" to link into "xul-gtest" instead of having an intermediate library "xul" used by "xul-shared" and "xul-gtest". r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 23 Jul 2014 13:33:09 +0900
changeset 217275 c71f854e6358af163f016af7661ce5f9d4151a0e
parent 217274 cd98f0ea7fd93469e3d6f2f0e64b35fce545400c
child 217276 f5f7cf07eef6024579b9ea3efd2aad097c5f8cda
push idunknown
push userunknown
push dateunknown
reviewersgps
bugs1041936
milestone34.0a1
Bug 1041936 part 2 - Directly use the static library "xul" to link into "xul-gtest" instead of having an intermediate library "xul" used by "xul-shared" and "xul-gtest". r=gps
browser/components/build/moz.build
content/base/test/moz.build
content/canvas/compiledtest/moz.build
content/media/compiledtest/moz.build
content/media/webaudio/compiledtest/moz.build
dom/audiochannel/tests/moz.build
editor/txmgr/tests/moz.build
extensions/gnomevfs/moz.build
intl/lwbrk/tests/moz.build
intl/unicharutil/tests/moz.build
ipc/app/moz.build
ipc/ipdl/test/cxx/app/moz.build
js/xpconnect/shell/moz.build
js/xpconnect/tests/components/native/moz.build
js/xpconnect/tests/moz.build
media/libcubeb/tests/moz.build
media/mtransport/test/moz.build
media/webrtc/signaling/test/moz.build
memory/mozalloc/tests/moz.build
netwerk/streamconv/test/moz.build
netwerk/test/moz.build
rdf/tests/rdfcat/moz.build
rdf/tests/rdfpoll/moz.build
rdf/tests/triplescat/moz.build
security/manager/ssl/tests/compiled/moz.build
startupcache/test/moz.build
storage/test/moz.build
toolkit/components/places/tests/cpp/moz.build
toolkit/crashreporter/test/moz.build
toolkit/library/Makefile.in
toolkit/library/build/Makefile.in
toolkit/library/build/moz.build
toolkit/library/gtest/moz.build
toolkit/library/libxul.mozbuild
toolkit/library/moz.build
toolkit/system/dbus/moz.build
toolkit/system/gnome/moz.build
toolkit/toolkit.mozbuild
tools/trace-malloc/moz.build
widget/tests/moz.build
xpcom/reflect/xptcall/tests/moz.build
xpcom/reflect/xptinfo/tests/moz.build
xpcom/sample/moz.build
xpcom/tests/bug656331_component/moz.build
xpcom/tests/component/moz.build
xpcom/tests/component_no_aslr/moz.build
xpcom/tests/external/moz.build
xpcom/tests/moz.build
xpcom/tests/windows/moz.build
xpcom/typelib/xpt/tests/moz.build
xulrunner/examples/simple/components/src/moz.build
--- a/browser/components/build/moz.build
+++ b/browser/components/build/moz.build
@@ -22,10 +22,10 @@ LOCAL_INCLUDES += [
     '../feeds/src',
     '../migration/src',
     '../shell/src',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/content/base/test/moz.build
+++ b/content/base/test/moz.build
@@ -41,10 +41,10 @@ MOCHITEST_CHROME_MANIFESTS += [
     'chrome/chrome.ini',
 ]
 
 BROWSER_CHROME_MANIFESTS += ['browser.ini']
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/content/canvas/compiledtest/moz.build
+++ b/content/canvas/compiledtest/moz.build
@@ -14,10 +14,10 @@ FAIL_ON_WARNINGS = True
 
 LOCAL_INCLUDES += [
     '../src',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/content/media/compiledtest/moz.build
+++ b/content/media/compiledtest/moz.build
@@ -14,10 +14,10 @@ FAIL_ON_WARNINGS = True
 
 LOCAL_INCLUDES += [
     '..',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/content/media/webaudio/compiledtest/moz.build
+++ b/content/media/webaudio/compiledtest/moz.build
@@ -14,10 +14,10 @@ FAIL_ON_WARNINGS = True
 
 LOCAL_INCLUDES += [
     '..',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/dom/audiochannel/tests/moz.build
+++ b/dom/audiochannel/tests/moz.build
@@ -15,10 +15,10 @@ if CONFIG['OS_ARCH'] == 'WINNT':
 
 MOCHITEST_MANIFESTS += ['mochitest.ini']
 
 FAIL_ON_WARNINGS = True
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/editor/txmgr/tests/moz.build
+++ b/editor/txmgr/tests/moz.build
@@ -10,10 +10,10 @@ CPP_UNIT_TESTS += [
 
 SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
 
 FAIL_ON_WARNINGS = True
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/extensions/gnomevfs/moz.build
+++ b/extensions/gnomevfs/moz.build
@@ -15,10 +15,10 @@ IS_COMPONENT = True
 # make sure this component is never statically linked into the main
 # application.  this is necessary since we don't want to force users
 # to install gnome-vfs2 in order to use the rest of mozilla ;-)
 FORCE_SHARED_LIB = True
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/intl/lwbrk/tests/moz.build
+++ b/intl/lwbrk/tests/moz.build
@@ -12,10 +12,10 @@ SOURCES += sorted('%s.cpp' % t for t in 
 
 LOCAL_INCLUDES += [
     '../public',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/intl/unicharutil/tests/moz.build
+++ b/intl/unicharutil/tests/moz.build
@@ -19,17 +19,17 @@ LOCAL_INCLUDES += [
     '../public',
 ]
 
 USE_STATIC_LIBS = True
 
 USE_LIBS += [
     'mozalloc',
     'unicharutil_external_s',
-    'xul-shared',
+    'xul',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     USE_LIBS += [
         'xpcomglue_staticruntime_s',
     ]
 else:
     USE_LIBS += [
--- a/ipc/app/moz.build
+++ b/ipc/app/moz.build
@@ -12,17 +12,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'andr
     ]
     FINAL_TARGET = 'dist/bin/lib'
 else:
     SOURCES += [
         'MozillaRuntimeMain.cpp',
     ]
     USE_LIBS += [
         'mozalloc',
-        'xul-shared',
+        'xul',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 LOCAL_INCLUDES += [
     '/toolkit/xre',
     '/xpcom/base',
 ]
--- a/ipc/ipdl/test/cxx/app/moz.build
+++ b/ipc/ipdl/test/cxx/app/moz.build
@@ -17,10 +17,10 @@ LOCAL_INCLUDES += [
 ]
 
 if CONFIG['_MSC_VER']:
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/js/xpconnect/shell/moz.build
+++ b/js/xpconnect/shell/moz.build
@@ -36,10 +36,10 @@ if CONFIG['_MSC_VER']:
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     RCINCLUDE = 'xpcshell.rc'
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/js/xpconnect/tests/components/native/moz.build
+++ b/js/xpconnect/tests/components/native/moz.build
@@ -22,10 +22,10 @@ DEFINES['LIBRARY_FILENAME'] = '%s%s%s' %
     CONFIG['DLL_SUFFIX']
 )
 
 FAIL_ON_WARNINGS = True
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/js/xpconnect/tests/moz.build
+++ b/js/xpconnect/tests/moz.build
@@ -13,10 +13,10 @@ TEST_TOOL_DIRS += [
     'components/js',
 ]
 
 XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/media/libcubeb/tests/moz.build
+++ b/media/libcubeb/tests/moz.build
@@ -40,10 +40,10 @@ else:
     if CONFIG['OS_TARGET'] == 'Android':
         USE_LIBS += [
             'speex',
         ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/media/mtransport/test/moz.build
+++ b/media/mtransport/test/moz.build
@@ -85,15 +85,15 @@ LOCAL_INCLUDES += [
 
 USE_LIBS += [
     '/media/webrtc/trunk/testing/gtest_gtest/gtest',
     'mozalloc',
     'mtransport_s',
     'nicer',
     'nrappkit',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
 
 if CONFIG['MOZ_SCTP']:
     USE_LIBS += [
         'nksctp_s',
     ]
--- a/media/webrtc/signaling/test/moz.build
+++ b/media/webrtc/signaling/test/moz.build
@@ -98,17 +98,17 @@ USE_LIBS += [
     '/media/webrtc/signalingtest/signaling_sipcc/sipcc',
     '/media/webrtc/trunk/testing/gtest_gtest/gtest',
     'gkmedias',
     'mozalloc',
     'mtransport_s',
     'nksrtp_s',
     'webrtc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
     'yuv',
 ]
 
 if CONFIG['BUILD_ARM_NEON']:
     USE_LIBS += [
         'yuv_neon',
     ]
 
--- a/memory/mozalloc/tests/moz.build
+++ b/memory/mozalloc/tests/moz.build
@@ -8,10 +8,10 @@ CPP_UNIT_TESTS += [
     'TestVolatileBuffer',
 ]
 
 SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/netwerk/streamconv/test/moz.build
+++ b/netwerk/streamconv/test/moz.build
@@ -18,10 +18,10 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     if CONFIG['GNU_CXX']:
         LDFLAGS += ['-mconsole']
     else:
         LDFLAGS += ['-SUBSYSTEM:CONSOLE']
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/netwerk/test/moz.build
+++ b/netwerk/test/moz.build
@@ -61,10 +61,10 @@ SOURCES += sorted('%s.cpp' % t for t in 
 RESOURCE_FILES += [
     'urlparse.dat',
     'urlparse_unx.dat',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/rdf/tests/rdfcat/moz.build
+++ b/rdf/tests/rdfcat/moz.build
@@ -8,10 +8,10 @@ PROGRAM = 'rdfcat'
 
 SOURCES += [
     'rdfcat.cpp',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/rdf/tests/rdfpoll/moz.build
+++ b/rdf/tests/rdfpoll/moz.build
@@ -8,10 +8,10 @@ PROGRAM = 'rdfpoll'
 
 SOURCES += [
     'rdfpoll.cpp',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/rdf/tests/triplescat/moz.build
+++ b/rdf/tests/triplescat/moz.build
@@ -8,10 +8,10 @@ PROGRAM = 'triplescat'
 
 SOURCES += [
     'triplescat.cpp',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/security/manager/ssl/tests/compiled/moz.build
+++ b/security/manager/ssl/tests/compiled/moz.build
@@ -8,10 +8,10 @@ CPP_UNIT_TESTS += [
   'TestCertDB',
 ]
 
 SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/startupcache/test/moz.build
+++ b/startupcache/test/moz.build
@@ -13,10 +13,10 @@ SOURCES += sorted('%s.cpp' % t for t in 
 EXTRA_COMPONENTS += [
     'TestStartupCacheTelemetry.js',
     'TestStartupCacheTelemetry.manifest',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/storage/test/moz.build
+++ b/storage/test/moz.build
@@ -34,15 +34,15 @@ LOCAL_INCLUDES += [
     '../src',
 ]
 
 FAIL_ON_WARNINGS = True
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
 
 if not CONFIG['MOZ_NATIVE_SQLITE'] and not CONFIG['MOZ_FOLD_LIBS']:
     USE_LIBS += [
         'mozsqlite3',
     ]
--- a/toolkit/components/places/tests/cpp/moz.build
+++ b/toolkit/components/places/tests/cpp/moz.build
@@ -10,15 +10,15 @@ CPP_UNIT_TESTS += [
 
 SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
 
 FAIL_ON_WARNINGS = True
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
 
 if CONFIG['JS_SHARED_LIBRARY']:
     USE_LIBS += [
         'js',
     ]
--- a/toolkit/crashreporter/test/moz.build
+++ b/toolkit/crashreporter/test/moz.build
@@ -37,10 +37,10 @@ LOCAL_INCLUDES += [
     '../google-breakpad/src/',
 ]
 
 include('/toolkit/crashreporter/crashreporter.mozbuild')
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -1,13 +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/.
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 CXXFLAGS += $(TK_CFLAGS)
 endif
 
+include $(topsrcdir)/toolkit/library/libxul.mk
+
+ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_PROFILE_USE))
+# Wrap linker to measure peak virtual memory usage.
+LD := $(PYTHON) $(topsrcdir)/build/link.py linker-vsize $(LD)
+endif
+
 include $(topsrcdir)/config/rules.mk
 
+ifdef COMPILE_ENVIRONMENT
+libs:: $(FINAL_TARGET)/dependentlibs.list
+endif
+
+$(FINAL_TARGET)/dependentlibs.list: $(topsrcdir)/toolkit/library/dependentlibs.py $(SHARED_LIBRARY) $(wildcard $(if $(wildcard $(FINAL_TARGET)/dependentlibs.list),$(addprefix $(FINAL_TARGET)/,$(shell cat $(FINAL_TARGET)/dependentlibs.list))))
+	$(PYTHON) $< $(SHARED_LIBRARY) -L $(FINAL_TARGET) $(if $(TOOLCHAIN_PREFIX),$(addprefix -p ,$(TOOLCHAIN_PREFIX))) > $@
+
 .PHONY: gtestxul
 gtestxul:
 	$(MAKE) -C gtest libs LINK_GTEST=1
deleted file mode 100644
--- a/toolkit/library/build/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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/.
-
-include $(topsrcdir)/toolkit/library/libxul.mk
-
-ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_PROFILE_USE))
-# Wrap linker to measure peak virtual memory usage.
-LD := $(PYTHON) $(topsrcdir)/build/link.py $(DEPTH)/toolkit/library/linker-vsize $(LD)
-endif
-
-include $(topsrcdir)/config/rules.mk
-
-ifdef COMPILE_ENVIRONMENT
-libs:: $(FINAL_TARGET)/dependentlibs.list
-endif
-
-$(FINAL_TARGET)/dependentlibs.list: $(topsrcdir)/toolkit/library/dependentlibs.py $(SHARED_LIBRARY) $(wildcard $(if $(wildcard $(FINAL_TARGET)/dependentlibs.list),$(addprefix $(FINAL_TARGET)/,$(shell cat $(FINAL_TARGET)/dependentlibs.list))))
-	$(PYTHON) $< $(SHARED_LIBRARY) -L $(FINAL_TARGET) $(if $(TOOLCHAIN_PREFIX),$(addprefix -p ,$(TOOLCHAIN_PREFIX))) > $@
deleted file mode 100644
--- a/toolkit/library/build/moz.build
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-LIBRARY_NAME = 'xul-shared'
-SDK_LIBRARY = True
-
-include('../libxul.mozbuild')
--- a/toolkit/library/gtest/moz.build
+++ b/toolkit/library/gtest/moz.build
@@ -3,9 +3,13 @@
 # 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/.
 
 LIBRARY_NAME = 'xul-gtest'
 
 FINAL_TARGET = 'dist/bin/gtest'
 
+USE_LIBS += [
+    'static:xul',
+]
+
 include('../libxul.mozbuild')
--- a/toolkit/library/libxul.mozbuild
+++ b/toolkit/library/libxul.mozbuild
@@ -51,57 +51,9 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
     ]
 
 if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
     LOCAL_INCLUDES += [
         '/widget/windows',
         '/xpcom/base',
     ]
     # This file is (only) included from subdirectories, and the file is here.
-    RCINCLUDE = '../xulrunner.rc'
-
-USE_LIBS += [
-    'xul',
-]
-
-# js needs to come after xul for now, because it is an archive and its content
-# is discarded when it comes first.
-USE_LIBS += [
-    'js',
-]
-
-if CONFIG['OS_ARCH'] == 'WINNT':
-    USE_LIBS += [
-        'sandboxbroker',
-    ]
-
-if CONFIG['MOZ_DMD']:
-    USE_LIBS += [
-        'dmd',
-    ]
-
-if not CONFIG['MOZ_NATIVE_ZLIB'] and not CONFIG['ZLIB_IN_MOZGLUE']:
-    USE_LIBS += [
-        'mozz',
-    ]
-
-if not CONFIG['MOZ_NATIVE_SQLITE'] and not CONFIG['MOZ_FOLD_LIBS']:
-    USE_LIBS += [
-        'mozsqlite3',
-    ]
-
-USE_LIBS += [
-    'gkmedias',
-    'mozalloc',
-]
-
-if CONFIG['MOZ_WIDGET_GTK'] and CONFIG['MOZ_ENABLE_GTK3']:
-    USE_LIBS += [
-        'mozgtk_stub',
-    ]
-
-if CONFIG['MOZ_JPROF']:
-    USE_LIBS += [
-        'jprof',
-    ]
-
-# This needs to be last
-USE_LIBS += ['StaticXULComponentsEnd']
+    RCINCLUDE = '$(topsrcdir)/toolkit/library/xulrunner.rc'
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -1,20 +1,28 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 LIBRARY_NAME = 'xul'
 
+SDK_LIBRARY = True
+
+FORCE_STATIC_LIB = True
+
+STATIC_LIBRARY_NAME = 'xul_s'
+
 SOURCES += [
     'StaticXULComponentsStart.cpp',
 ]
 
+MSVC_ENABLE_PGO = True
+
 # This, combined with the fact the file is first, makes the start pointer
 # it contains first in Windows PGO builds.
 SOURCES['StaticXULComponentsStart.cpp'].no_pgo = True
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         'nsDllMain.cpp',
     ]
@@ -27,9 +35,55 @@ LOCAL_INCLUDES += [
 
 if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
     LOCAL_INCLUDES += [
         '/xpcom/base',
     ]
 
 FAIL_ON_WARNINGS = True
 
-DIRS += ['StaticXULComponentsEnd', 'build', 'gtest']
+DIRS += ['gtest']
+
+include('libxul.mozbuild')
+
+# js needs to come after xul for now, because it is an archive and its content
+# is discarded when it comes first.
+USE_LIBS += [
+    'js',
+]
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+    USE_LIBS += [
+        'sandboxbroker',
+    ]
+
+if CONFIG['MOZ_DMD']:
+    USE_LIBS += [
+        'dmd',
+    ]
+
+if not CONFIG['MOZ_NATIVE_ZLIB'] and not CONFIG['ZLIB_IN_MOZGLUE']:
+    USE_LIBS += [
+        'mozz',
+    ]
+
+if not CONFIG['MOZ_NATIVE_SQLITE'] and not CONFIG['MOZ_FOLD_LIBS']:
+    USE_LIBS += [
+        'mozsqlite3',
+    ]
+
+USE_LIBS += [
+    'gkmedias',
+    'mozalloc',
+]
+
+if CONFIG['MOZ_WIDGET_GTK'] and CONFIG['MOZ_ENABLE_GTK3']:
+    USE_LIBS += [
+        'mozgtk_stub',
+    ]
+
+if CONFIG['MOZ_JPROF']:
+    USE_LIBS += [
+        'jprof',
+    ]
+
+# This needs to be last
+USE_LIBS += ['StaticXULComponentsEnd']
--- a/toolkit/system/dbus/moz.build
+++ b/toolkit/system/dbus/moz.build
@@ -12,10 +12,10 @@ SOURCES += [
 
 LIBRARY_NAME = 'dbusservice'
 
 IS_COMPONENT = True
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/toolkit/system/gnome/moz.build
+++ b/toolkit/system/gnome/moz.build
@@ -31,10 +31,10 @@ IS_COMPONENT = True
 
 LOCAL_INCLUDES += [
     '/toolkit/components/build/',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -152,16 +152,17 @@ add_tier_dir('platform', 'other-licenses
 if CONFIG['MOZ_GIO_COMPONENT']:
     add_tier_dir('platform', 'extensions/gio')
 
 # Applications can cheat and ask for code to be
 # built before libxul so it can be linked into libxul.
 add_tier_dir('platform', app_libxul_dirs)
 add_tier_dir('platform', app_libxul_static_dirs, static=True)
 
+add_tier_dir('platform', 'toolkit/library/StaticXULComponentsEnd')
 add_tier_dir('platform', 'toolkit/library')
 
 if CONFIG['MOZ_REPLACE_MALLOC']:
     add_tier_dir('platform', 'memory/replace')
 
 if CONFIG['NS_TRACE_MALLOC']:
     add_tier_dir('platform', 'tools/trace-malloc')
 
--- a/tools/trace-malloc/moz.build
+++ b/tools/trace-malloc/moz.build
@@ -42,10 +42,10 @@ SIMPLE_PROGRAMS += simple_cpp_sources
 
 RESOURCE_FILES += [
     'spacetrace.css'
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/widget/tests/moz.build
+++ b/widget/tests/moz.build
@@ -24,10 +24,10 @@ FAIL_ON_WARNINGS = True
 #     is bug 652123.
 #     CPP_UNIT_TESTS += ['TestChromeMargin']
 
 SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/xpcom/reflect/xptcall/tests/moz.build
+++ b/xpcom/reflect/xptcall/tests/moz.build
@@ -10,10 +10,10 @@ SIMPLE_PROGRAMS = [
 
 SOURCES += [
     '%s.cpp' % s for s in SIMPLE_PROGRAMS
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/xpcom/reflect/xptinfo/tests/moz.build
+++ b/xpcom/reflect/xptinfo/tests/moz.build
@@ -10,10 +10,10 @@ SOURCES += [
 
 SIMPLE_PROGRAMS += [
     'TestInterfaceInfo'
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/xpcom/sample/moz.build
+++ b/xpcom/sample/moz.build
@@ -38,10 +38,10 @@ IS_COMPONENT = True
 
 RESOURCE_FILES.samples += [
     'xpconnect-sample.html',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/xpcom/tests/bug656331_component/moz.build
+++ b/xpcom/tests/bug656331_component/moz.build
@@ -18,10 +18,10 @@ DEFINES['LIBRARY_FILENAME'] = '%s%s%s' %
     CONFIG['DLL_PREFIX'],
     LIBRARY_NAME,
     CONFIG['DLL_SUFFIX']
 )
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/xpcom/tests/component/moz.build
+++ b/xpcom/tests/component/moz.build
@@ -18,10 +18,10 @@ DEFINES['LIBRARY_FILENAME'] = '%s%s%s' %
     CONFIG['DLL_PREFIX'],
     LIBRARY_NAME,
     CONFIG['DLL_SUFFIX']
 )
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/xpcom/tests/component_no_aslr/moz.build
+++ b/xpcom/tests/component_no_aslr/moz.build
@@ -18,10 +18,10 @@ DEFINES['LIBRARY_FILENAME'] = '%s%s%s' %
     CONFIG['DLL_PREFIX'],
     LIBRARY_NAME,
     CONFIG['DLL_SUFFIX']
 )
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/xpcom/tests/external/moz.build
+++ b/xpcom/tests/external/moz.build
@@ -10,10 +10,10 @@ SIMPLE_PROGRAMS = [
 
 SOURCES += [
     '%s.cpp' % s for s in SIMPLE_PROGRAMS
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/xpcom/tests/moz.build
+++ b/xpcom/tests/moz.build
@@ -122,10 +122,10 @@ LOCAL_INCLUDES += [
 
 RESOURCE_FILES += [
     'test.properties',
 ]
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/xpcom/tests/windows/moz.build
+++ b/xpcom/tests/windows/moz.build
@@ -9,10 +9,10 @@ CPP_UNIT_TESTS += [
     'TestNtPathToDosPath',
 ]
 
 SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]
--- a/xpcom/typelib/xpt/tests/moz.build
+++ b/xpcom/typelib/xpt/tests/moz.build
@@ -13,10 +13,10 @@ SOURCES += [
     '%s.cpp' % s for s in SIMPLE_PROGRAMS
 ]
 
 FAIL_ON_WARNINGS = True
 
 USE_LIBS += [
     'mozalloc',
     'xpt',
-    'xul-shared',
+    'xul',
 ]
--- a/xulrunner/examples/simple/components/src/moz.build
+++ b/xulrunner/examples/simple/components/src/moz.build
@@ -17,10 +17,10 @@ EXTRA_COMPONENTS += [
 
 IS_COMPONENT = True
 
 XPI_NAME = 'simple'
 
 USE_LIBS += [
     'mozalloc',
     'xpcomglue_s',
-    'xul-shared',
+    'xul',
 ]