Backout changeset f12e5c87adf6 (bug 852950) because it breaks running from dist/bin
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 20 Mar 2013 23:59:45 +0100
changeset 125704 4d3c7024506b5d49d62e0eaef95011f0e386f4b6
parent 125703 e70bea1fd1662ece0eb065c085bce689456b7fa0
child 125705 e2cb4c8c2b58e7a721de0996e9c0e1c3b2e75c5c
push id24461
push useremorley@mozilla.com
push dateThu, 21 Mar 2013 11:51:51 +0000
treeherdermozilla-central@a73a2b5c423b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs852950
milestone22.0a1
backs outf12e5c87adf6b120d6f5bcbf67689799e958732c
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout changeset f12e5c87adf6 (bug 852950) because it breaks running from dist/bin
b2g/installer/package-manifest.in
b2g/installer/removed-files.in
browser/installer/package-manifest.in
browser/installer/removed-files.in
configure.in
mobile/android/installer/package-manifest.in
mozglue/android/APKOpen.cpp
toolkit/library/Makefile.in
toolkit/library/dependentlibs.py
toolkit/toolkit.mozbuild
xpcom/build/FrozenFunctions.cpp
xpcom/build/Makefile.in
xpcom/build/nsXPCOM.h
xpcom/build/nsXPCOMPrivate.h
xpcom/glue/nsCycleCollectorUtils.h
xpcom/glue/nsThreadUtils.h
xpcom/reflect/xptcall/public/xptcall.h
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_alpha_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ipf32.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ipf64.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_parisc_linux.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_aix.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_aix64.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_ibmobj_aix.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_linux.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_openbsd.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_rhapsody.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc64_openbsd.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc_linux_GCC3.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris_GCC3.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris_SUNW.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparcv9_solaris_SUNW.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_x86_solaris_SUNW.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_alpha.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_linux.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_solaris.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp
xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp
xpcom/reflect/xptcall/src/md/win32/xptcinvoke_x86_64.cpp
xpcom/reflect/xptcall/src/md/win32/xptcinvoke_x86_gnu.cpp
xpcom/string/public/nsXPCOMStrings.h
xpcom/stub/Makefile.in
xpcom/stub/dependentlibs.py
xpcom/stub/moz.build
xpcom/stub/nsXPComStub.cpp
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -49,16 +49,17 @@
 #ifndef MOZ_STATIC_JS
 @BINPATH@/@DLL_PREFIX@mozjs@DLL_SUFFIX@
 #endif
 #ifndef MOZ_FOLD_LIBS
 @BINPATH@/@DLL_PREFIX@plc4@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@plds4@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@
 #endif
+@BINPATH@/@DLL_PREFIX@xpcom@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@mozalloc@DLL_SUFFIX@
 #ifdef MOZ_DMD
 @BINPATH@/@DLL_PREFIX@dmd@DLL_SUFFIX@
 #endif
 #ifdef XP_MACOSX
 @BINPATH@/XUL
 #else
 @BINPATH@/@DLL_PREFIX@xul@DLL_SUFFIX@
--- a/b2g/installer/removed-files.in
+++ b/b2g/installer/removed-files.in
@@ -15,9 +15,8 @@ components/dom_sms.xpt
 @DLL_PREFIX@nspr4@DLL_SUFFIX@
 @DLL_PREFIX@plds4@DLL_SUFFIX@
 @DLL_PREFIX@plc4@DLL_SUFFIX@
 @DLL_PREFIX@ssl3@DLL_SUFFIX@
 @DLL_PREFIX@smime3@DLL_SUFFIX@
 @DLL_PREFIX@nssutil3@DLL_SUFFIX@
 @DLL_PREFIX@mozsqlite3@DLL_SUFFIX@
 #endif
-@DLL_PREFIX@xpcom@DLL_SUFFIX@
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -64,16 +64,17 @@
 #endif
 #ifndef MOZ_NATIVE_NSPR
 #ifndef MOZ_FOLD_LIBS
 @BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@plc4@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@plds4@DLL_SUFFIX@
 #endif
 #endif
+@BINPATH@/@DLL_PREFIX@xpcom@DLL_SUFFIX@
 #ifdef XP_MACOSX
 @BINPATH@/XUL
 #else
 @BINPATH@/@DLL_PREFIX@xul@DLL_SUFFIX@
 #endif
 #ifdef XP_MACOSX
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@.app/
 @BINPATH@/@DLL_PREFIX@plugin_child_interpose@DLL_SUFFIX@
--- a/browser/installer/removed-files.in
+++ b/browser/installer/removed-files.in
@@ -21,17 +21,16 @@
 @DLL_PREFIX@nspr4@DLL_SUFFIX@
 @DLL_PREFIX@plds4@DLL_SUFFIX@
 @DLL_PREFIX@plc4@DLL_SUFFIX@
 @DLL_PREFIX@ssl3@DLL_SUFFIX@
 @DLL_PREFIX@smime3@DLL_SUFFIX@
 @DLL_PREFIX@nssutil3@DLL_SUFFIX@
 @DLL_PREFIX@mozsqlite3@DLL_SUFFIX@
 #endif
-@DLL_PREFIX@xpcom@DLL_SUFFIX@
 LICENSE
 browserconfig.properties
 chrome/US.jar
 chrome/app-chrome.manifest
 chrome/browser.manifest
 chrome/chrome.rdf
 chrome/chromelist.txt
 chrome/classic.jar
--- a/configure.in
+++ b/configure.in
@@ -1014,20 +1014,20 @@ MOZ_JPEG_CFLAGS=
 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/media/libjpeg)'
 MOZ_BZ2_CFLAGS=
 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
 MOZ_PNG_CFLAGS=
 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/media/libpng)'
 
 MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)'
 MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)'
-DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxul -lxpcom_core -lmozalloc'
+DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core -lmozalloc'
 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
-XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxul -lmozalloc'
-LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS)'
+XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom -lmozalloc'
+LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
 
 # These are specially defined on Windows only
 case "$target" in
 *-mingw*)
   XPCOM_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
   XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime.$(LIB_SUFFIX)'
@@ -2111,18 +2111,18 @@ ia64*-hpux*)
         RC='$(WINDRES)'
         # Use static libgcc and libstdc++
         LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"
         # Use temp file for windres (bug 213281)
         RCFLAGS='-O coff --use-temp-file'
         # mingw doesn't require kernel32, user32, and advapi32 explicitly
         LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32 -luserenv -lsecur32 -lnetapi32"
         MOZ_FIX_LINK_PATHS=
-        DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxul -lxpcom_core -lmozalloc'
-        XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxul -lmozalloc'
+        DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core -lmozalloc'
+        XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom -lmozalloc'
         DLL_PREFIX=
         IMPORT_LIB_SUFFIX=dll.a
 
         # We use mix of both POSIX and Win32 printf format across the tree, so format
         # warnings are useless on mingw.
         MOZ_C_SUPPORTS_WARNING(-Wno-, format, ac_c_has_wno_format)
         MOZ_CXX_SUPPORTS_WARNING(-Wno-, format, ac_cxx_has_wno_format)
     else
@@ -2177,19 +2177,19 @@ ia64*-hpux*)
         CFLAGS="$CFLAGS -we4553"
         CXXFLAGS="$CXXFLAGS -we4553"
         LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib netapi32.lib"
         MOZ_DEBUG_FLAGS='-Zi'
         MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
         WARNINGS_AS_ERRORS='-WX'
         MOZ_OPTIMIZE_FLAGS='-O1'
         MOZ_FIX_LINK_PATHS=
-        DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
-        XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
-        LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
+        DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
+        XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
+        LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
         MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
         LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
         dnl For profile-guided optimization
         PROFILE_GEN_CFLAGS="-GL"
         PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
         dnl XXX: PGO builds can fail with warnings treated as errors,
         dnl specifically "no profile data available" appears to be
         dnl treated as an error sometimes. This might be a consequence
@@ -2353,18 +2353,18 @@ ia64*-hpux*)
     BIN_FLAGS='-Zlinker /ST:0x100000'
     IMPLIB='emximp -o'
     FILTER='true'
     LDFLAGS='-Zmap'
     WARNINGS_AS_ERRORS='-Werror'
     MOZ_DEBUG_FLAGS="-g -fno-inline"
     MOZ_OPTIMIZE_FLAGS="-O2"
     MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
-    DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
-    LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
+    DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
+    LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
     TARGET_MD_ARCH=os2
     _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
     RC=rc.exe
     MC=mc.exe
     RCFLAGS='-n'
     MOZ_USER_DIR="Mozilla"
     ZIP="$ZIP -X"
     STRIP=lxlite
@@ -4577,34 +4577,32 @@ cairo-os2)
 cairo-cocoa)
     MOZ_WIDGET_TOOLKIT=cocoa
     AC_DEFINE(MOZ_WIDGET_COCOA)
     LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
     TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
     TK_CFLAGS="-DNO_X11"
     CFLAGS="$CFLAGS $TK_CFLAGS"
     CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
-    DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/bin/XUL -lxpcom_core -lmozalloc'
-    XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/bin/XUL -lmozalloc'
+    LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
     MOZ_USER_DIR="Mozilla"
     MOZ_FS_LAYOUT=bundle
     MOZ_WEBGL=1
     MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
 cairo-uikit)
     MOZ_WIDGET_TOOLKIT=uikit
     AC_DEFINE(MOZ_WIDGET_UIKIT)
     LDFLAGS="$LDFLAGS -framework UIKit -lobjc"
     TK_CFLAGS="-DNO_X11"
     TK_LIBS='-framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreText'
     CFLAGS="$CFLAGS $TK_CFLAGS"
     CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
-    DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/bin/XUL -lxpcom_core -lmozalloc'
-    XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/bin/XUL -lmozalloc'
+    LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
     MOZ_USER_DIR="Mozilla"
     MOZ_FS_LAYOUT=bundle
     ;;
 
 cairo-android)
     AC_DEFINE(MOZ_WIDGET_ANDROID)
     MOZ_WIDGET_TOOLKIT=android
     TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -35,16 +35,17 @@
 #ifndef MOZ_STATIC_JS
 @BINPATH@/@DLL_PREFIX@mozjs@DLL_SUFFIX@
 #endif
 #ifndef MOZ_FOLD_LIBS
 @BINPATH@/@DLL_PREFIX@plc4@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@plds4@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@
 #endif
+@BINPATH@/@DLL_PREFIX@xpcom@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@mozalloc@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@mozglue@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@omxplugin@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@omxplugingb@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@omxplugingb235@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@omxpluginhc@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@omxpluginsony@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@omxpluginfroyo@DLL_SUFFIX@
--- a/mozglue/android/APKOpen.cpp
+++ b/mozglue/android/APKOpen.cpp
@@ -219,19 +219,21 @@ loadGeckoLibs(const char *apkName)
   getrusage(RUSAGE_THREAD, &usage1);
   
   RefPtr<Zip> zip = ZipCollection::GetZip(apkName);
 
 #ifdef MOZ_CRASHREPORTER
   file_ids = (char *)extractBuf("lib.id", zip);
 #endif
 
-  char *file = new char[strlen(apkName) + sizeof("!/libxul.so")];
-  sprintf(file, "%s!/libxul.so", apkName);
-  xul_handle = __wrap_dlopen(file, RTLD_GLOBAL | RTLD_LAZY);
+  char *file = new char[strlen(apkName) + sizeof("!/libxpcom.so")];
+  sprintf(file, "%s!/libxpcom.so", apkName);
+  __wrap_dlopen(file, RTLD_GLOBAL | RTLD_LAZY);
+  // libxul.so is pulled from libxpcom.so, so we don't need to give the full path
+  xul_handle = __wrap_dlopen("libxul.so", RTLD_GLOBAL | RTLD_LAZY);
   delete[] file;
 
 #ifdef MOZ_CRASHREPORTER
   free(file_ids);
   file_ids = NULL;
 #endif
 
   if (!xul_handle) {
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -681,13 +681,8 @@ ifdef ENABLE_TESTS
 DEFINES += -DENABLE_LAYOUTDEBUG
 endif
 endif
 
 ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_PROFILE_USE))
 # Wrap linker to measure peak virtual memory usage.
 LD := $(PYTHON) $(topsrcdir)/build/link.py $(CURDIR)/linker-vsize $(LD)
 endif
-
-libs:: $(FINAL_TARGET)/dependentlibs.list
-
-$(FINAL_TARGET)/dependentlibs.list: 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/dependentlibs.py
+++ /dev/null
@@ -1,135 +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/.
-
-'''Given a library, dependentlibs.py prints the list of libraries it depends
-upon that are in the same directory, followed by the library itself.
-'''
-
-from optparse import OptionParser
-import os
-import re
-import fnmatch
-import subprocess
-import sys
-from mozpack.executables import (
-    get_type,
-    ELF,
-    MACHO,
-)
-
-TOOLCHAIN_PREFIX = ''
-
-def dependentlibs_dumpbin(lib):
-    '''Returns the list of dependencies declared in the given DLL'''
-    try:
-        proc = subprocess.Popen(['dumpbin', '-dependents', lib], stdout = subprocess.PIPE)
-    except OSError:
-        # dumpbin is missing, probably mingw compilation. Try using objdump.
-        return dependentlibs_mingw_objdump(lib)
-    deps = []
-    for line in proc.stdout:
-        # Each line containing an imported library name starts with 4 spaces
-        match = re.match('    (\S+)', line)
-        if match:
-             deps.append(match.group(1))
-        elif len(deps):
-             # There may be several groups of library names, but only the
-             # first one is interesting. The second one is for delayload-ed
-             # libraries.
-             break
-    proc.wait()
-    return deps
-
-def dependentlibs_mingw_objdump(lib):
-    proc = subprocess.Popen(['objdump', '-x', lib], stdout = subprocess.PIPE)
-    deps = []
-    for line in proc.stdout:
-        match = re.match('\tDLL Name: (\S+)', line)
-        if match:
-            deps.append(match.group(1))
-    proc.wait()
-    return deps
-
-def dependentlibs_readelf(lib):
-    '''Returns the list of dependencies declared in the given ELF .so'''
-    proc = subprocess.Popen([TOOLCHAIN_PREFIX + 'readelf', '-d', lib], stdout = subprocess.PIPE)
-    deps = []
-    for line in proc.stdout:
-        # Each line has the following format:
-        #  tag (TYPE)          value
-        # Looking for NEEDED type entries
-        tmp = line.split(' ', 3)
-        if len(tmp) > 3 and tmp[2] == '(NEEDED)':
-            # NEEDED lines look like:
-            # 0x00000001 (NEEDED)             Shared library: [libname]
-            match = re.search('\[(.*)\]', tmp[3])
-            if match:
-                deps.append(match.group(1))
-    proc.wait()
-    return deps
-
-def dependentlibs_otool(lib):
-    '''Returns the list of dependencies declared in the given MACH-O dylib'''
-    proc = subprocess.Popen(['otool', '-l', lib], stdout = subprocess.PIPE)
-    deps= []
-    cmd = None
-    for line in proc.stdout:
-        # otool -l output contains many different things. The interesting data
-        # is under "Load command n" sections, with the content:
-        #           cmd LC_LOAD_DYLIB
-        #       cmdsize 56
-        #          name libname (offset 24)
-        tmp = line.split()
-        if len(tmp) < 2:
-            continue
-        if tmp[0] == 'cmd':
-            cmd = tmp[1]
-        elif cmd == 'LC_LOAD_DYLIB' and tmp[0] == 'name':
-            deps.append(re.sub('^@executable_path/','',tmp[1]))
-    proc.wait()
-    return deps
-
-def dependentlibs(lib, libpaths, func):
-    '''For a given library, returns the list of recursive dependencies that can
-    be found in the given list of paths, followed by the library itself.'''
-    assert(libpaths)
-    assert(isinstance(libpaths, list))
-    deps = []
-    for dep in func(lib):
-        if dep in deps or os.path.isabs(dep):
-            continue
-        for dir in libpaths:
-            deppath = os.path.join(dir, dep)
-            if os.path.exists(deppath):
-                deps.extend([d for d in dependentlibs(deppath, libpaths, func) if not d in deps])
-                deps.append(dep)
-                break
-
-    return deps
-
-def main():
-    parser = OptionParser()
-    parser.add_option("-L", dest="libpaths", action="append", metavar="PATH", help="Add the given path to the library search path")
-    parser.add_option("-p", dest="toolchain_prefix", metavar="PREFIX", help="Use the given prefix to readelf")
-    (options, args) = parser.parse_args()
-    if options.toolchain_prefix:
-        global TOOLCHAIN_PREFIX
-        TOOLCHAIN_PREFIX = options.toolchain_prefix
-    lib = args[0]
-    binary_type = get_type(lib)
-    if binary_type == ELF:
-        func = dependentlibs_readelf
-    elif binary_type == MACHO:
-        func = dependentlibs_otool
-    else:
-        ext = os.path.splitext(lib)[1]
-        assert(ext == '.dll')
-        func = dependentlibs_dumpbin
-    if not options.libpaths:
-        options.libpaths = [os.path.dirname(lib)]
-
-    print '\n'.join(dependentlibs(lib, options.libpaths, func) + [lib])
-
-if __name__ == '__main__':
-    main()
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -201,16 +201,17 @@ 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')
+add_tier_dir('platform', 'xpcom/stub')
 
 if CONFIG['MOZ_REPLACE_MALLOC']:
     add_tier_dir('platform', 'memory/replace')
 
 if CONFIG['NS_TRACE_MALLOC']:
     add_tier_dir('platform', 'tools/trace-malloc')
 
 if CONFIG['MOZ_ENABLE_GNOME_COMPONENT']:
deleted file mode 100644
--- a/xpcom/build/FrozenFunctions.cpp
+++ /dev/null
@@ -1,131 +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 "nsXPCOM.h"
-#include "nsXPCOMPrivate.h"
-#include "nsXPCOMStrings.h"
-#include "xptcall.h"
-
-#include <string.h>
-
-/**
- * Private Method to register an exit routine.  This method
- * used to allow you to setup a callback that will be called from 
- * the NS_ShutdownXPCOM function after all services and 
- * components have gone away. It was fatally flawed in that the component
- * DLL could be released before the exit function was called; it is now a
- * stub implementation that does nothing.
- */
-XPCOM_API(nsresult)
-NS_RegisterXPCOMExitRoutine(XPCOMExitRoutine exitRoutine, uint32_t priority);
-
-XPCOM_API(nsresult)
-NS_UnregisterXPCOMExitRoutine(XPCOMExitRoutine exitRoutine);
-
-static const XPCOMFunctions kFrozenFunctions = {
-    XPCOM_GLUE_VERSION,
-    sizeof(XPCOMFunctions),
-    &NS_InitXPCOM2,
-    &NS_ShutdownXPCOM,
-    &NS_GetServiceManager,
-    &NS_GetComponentManager,
-    &NS_GetComponentRegistrar,
-    &NS_GetMemoryManager,
-    &NS_NewLocalFile,
-    &NS_NewNativeLocalFile,
-    &NS_RegisterXPCOMExitRoutine,
-    &NS_UnregisterXPCOMExitRoutine,
-
-    // these functions were added post 1.4
-    &NS_GetDebug,
-    &NS_GetTraceRefcnt,
-
-    // these functions were added post 1.6
-    &NS_StringContainerInit,
-    &NS_StringContainerFinish,
-    &NS_StringGetData,
-    &NS_StringSetData,
-    &NS_StringSetDataRange,
-    &NS_StringCopy,
-    &NS_CStringContainerInit,
-    &NS_CStringContainerFinish,
-    &NS_CStringGetData,
-    &NS_CStringSetData,
-    &NS_CStringSetDataRange,
-    &NS_CStringCopy,
-    &NS_CStringToUTF16,
-    &NS_UTF16ToCString,
-    &NS_StringCloneData,
-    &NS_CStringCloneData,
-
-    // these functions were added post 1.7 (post Firefox 1.0)
-    &NS_Alloc,
-    &NS_Realloc,
-    &NS_Free,
-    &NS_StringContainerInit2,
-    &NS_CStringContainerInit2,
-    &NS_StringGetMutableData,
-    &NS_CStringGetMutableData,
-    NULL,
-
-    // these functions were added post 1.8
-    &NS_DebugBreak,
-    &NS_LogInit,
-    &NS_LogTerm,
-    &NS_LogAddRef,
-    &NS_LogRelease,
-    &NS_LogCtor,
-    &NS_LogDtor,
-    &NS_LogCOMPtrAddRef,
-    &NS_LogCOMPtrRelease,
-    &NS_GetXPTCallStub,
-    &NS_DestroyXPTCallStub,
-    &NS_InvokeByIndex,
-    nullptr,
-    nullptr,
-    &NS_StringSetIsVoid,
-    &NS_StringGetIsVoid,
-    &NS_CStringSetIsVoid,
-    &NS_CStringGetIsVoid,
-
-    // these functions were added post 1.9
-    &NS_CycleCollectorSuspect2,
-    &NS_CycleCollectorForget2
-};
-
-EXPORT_XPCOM_API(nsresult)
-NS_GetFrozenFunctions(XPCOMFunctions *functions, const char* /* libraryPath */)
-{
-    if (!functions)
-        return NS_ERROR_OUT_OF_MEMORY;
-
-    if (functions->version != XPCOM_GLUE_VERSION)
-        return NS_ERROR_FAILURE;
-
-    uint32_t size = functions->size;
-    if (size > sizeof(XPCOMFunctions))
-        size = sizeof(XPCOMFunctions);
-
-    size -= offsetof(XPCOMFunctions, init);
-
-    memcpy(&functions->init, &kFrozenFunctions.init, size);
-
-    return NS_OK;
-}
-
-/*
- * Stubs for nsXPCOMPrivate.h
- */
-
-EXPORT_XPCOM_API(nsresult)
-NS_RegisterXPCOMExitRoutine(XPCOMExitRoutine exitRoutine, uint32_t priority)
-{
-  return NS_OK;
-}
-
-EXPORT_XPCOM_API(nsresult)
-NS_UnregisterXPCOMExitRoutine(XPCOMExitRoutine exitRoutine)
-{
-  return NS_OK;
-}
--- a/xpcom/build/Makefile.in
+++ b/xpcom/build/Makefile.in
@@ -33,17 +33,16 @@ endif
 CPPSRCS = \
   $(XPCOM_GLUE_SRC_LCPPSRCS) \
   $(XPCOM_GLUENS_SRC_LCPPSRCS) \
   nsXPComInit.cpp \
   nsXPCOMStrings.cpp \
   Services.cpp \
   Omnijar.cpp \
   FileLocation.cpp \
-  FrozenFunctions.cpp \
   $(NULL)
 
 ifeq (Darwin, $(OS_ARCH))
 CPPSRCS += mozPoisonWriteBase.cpp mozPoisonWriteMac.cpp
 else ifeq ($(OS_ARCH),WINNT)
 CPPSRCS += mozPoisonWriteBase.cpp mozPoisonWriteWin.cpp
 else
 CPPSRCS += mozPoisonWriteStub.cpp
--- a/xpcom/build/nsXPCOM.h
+++ b/xpcom/build/nsXPCOM.h
@@ -1,16 +1,44 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 #ifndef nsXPCOM_h__
 #define nsXPCOM_h__
 
+/* Map frozen functions to private symbol names if not using strict API. */
+#ifdef MOZILLA_INTERNAL_API
+# define NS_InitXPCOM2               NS_InitXPCOM2_P
+# define NS_ShutdownXPCOM            NS_ShutdownXPCOM_P
+# define NS_GetServiceManager        NS_GetServiceManager_P
+# define NS_GetComponentManager      NS_GetComponentManager_P
+# define NS_GetComponentRegistrar    NS_GetComponentRegistrar_P
+# define NS_GetMemoryManager         NS_GetMemoryManager_P
+# define NS_NewLocalFile             NS_NewLocalFile_P
+# define NS_NewNativeLocalFile       NS_NewNativeLocalFile_P
+# define NS_GetDebug                 NS_GetDebug_P
+# define NS_GetTraceRefcnt           NS_GetTraceRefcnt_P
+# define NS_Alloc                    NS_Alloc_P
+# define NS_Realloc                  NS_Realloc_P
+# define NS_Free                     NS_Free_P
+# define NS_DebugBreak               NS_DebugBreak_P
+# define NS_LogInit                  NS_LogInit_P
+# define NS_LogTerm                  NS_LogTerm_P
+# define NS_LogAddRef                NS_LogAddRef_P
+# define NS_LogRelease               NS_LogRelease_P
+# define NS_LogCtor                  NS_LogCtor_P
+# define NS_LogDtor                  NS_LogDtor_P
+# define NS_LogCOMPtrAddRef          NS_LogCOMPtrAddRef_P
+# define NS_LogCOMPtrRelease         NS_LogCOMPtrRelease_P
+# define NS_CycleCollectorSuspect2   NS_CycleCollectorSuspect2_P
+# define NS_CycleCollectorForget2    NS_CycleCollectorForget2_P
+#endif
+
 #include "nscore.h"
 #include "nsXPCOMCID.h"
 
 #ifdef __cplusplus
 #define DECL_CLASS(c) class c
 #define DECL_STRUCT(c) struct c
 #else
 #define DECL_CLASS(c) typedef struct c c
--- a/xpcom/build/nsXPCOMPrivate.h
+++ b/xpcom/build/nsXPCOMPrivate.h
@@ -212,25 +212,25 @@ void LogTerm();
  * GRE_CONF_NAME          - Name of the GRE Configuration file
  */
 
 #if defined(XP_WIN32) || defined(XP_OS2)
 
 #define XPCOM_SEARCH_KEY  "PATH"
 #define GRE_CONF_NAME     "gre.config"
 #define GRE_WIN_REG_LOC   L"Software\\mozilla.org\\GRE"
-#define XPCOM_DLL         XUL_DLL
-#define LXPCOM_DLL        LXUL_DLL
+#define XPCOM_DLL         "xpcom.dll"
+#define LXPCOM_DLL        L"xpcom.dll"
 #define XUL_DLL           "xul.dll"
 #define LXUL_DLL          L"xul.dll"
 
 #else // Unix
 #include <limits.h> // for PATH_MAX
 
-#define XPCOM_DLL         XUL_DLL
+#define XPCOM_DLL "libxpcom" MOZ_DLL_SUFFIX
 
 // you have to love apple..
 #ifdef XP_MACOSX  
 #define XPCOM_SEARCH_KEY  "DYLD_LIBRARY_PATH"
 #define GRE_FRAMEWORK_NAME "XUL.framework"
 #define XUL_DLL            "XUL"
 #else
 #define XPCOM_SEARCH_KEY  "LD_LIBRARY_PATH"
--- a/xpcom/glue/nsCycleCollectorUtils.h
+++ b/xpcom/glue/nsCycleCollectorUtils.h
@@ -4,16 +4,17 @@
 
 #ifndef nsCycleCollectorUtils_h__
 #define nsCycleCollectorUtils_h__
 
 #include "nscore.h"
 #include "mozilla/threads/nsThreadIDs.h"
 
 #if defined(MOZILLA_INTERNAL_API)
+#define NS_IsCycleCollectorThread NS_IsCycleCollectorThread_P
 #if defined(XP_WIN)
 bool NS_IsCycleCollectorThread();
 #elif defined(NS_TLS)
 // Defined in nsThreadManager.cpp.
 extern NS_TLS mozilla::threads::ID gTLSThreadID;
 inline bool NS_IsCycleCollectorThread()
 {
   return gTLSThreadID == mozilla::threads::CycleCollector;
--- a/xpcom/glue/nsThreadUtils.h
+++ b/xpcom/glue/nsThreadUtils.h
@@ -14,16 +14,33 @@
 #include "nsIRunnable.h"
 #include "nsICancelableRunnable.h"
 #include "nsStringGlue.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "mozilla/threads/nsThreadIDs.h"
 #include "mozilla/Likely.h"
 
+// This is needed on some systems to prevent collisions between the symbols
+// appearing in xpcom_core and xpcomglue.  It may be unnecessary in the future
+// with better toolchain support.
+#ifdef MOZILLA_INTERNAL_API
+# define NS_SetThreadName NS_SetThreadName_P
+# define NS_NewThread NS_NewThread_P
+# define NS_NewNamedThread NS_NewNamedThread_P
+# define NS_GetCurrentThread NS_GetCurrentThread_P
+# define NS_GetMainThread NS_GetMainThread_P
+# define NS_IsMainThread NS_IsMainThread_P
+# define NS_DispatchToCurrentThread NS_DispatchToCurrentThread_P
+# define NS_DispatchToMainThread NS_DispatchToMainThread_P
+# define NS_ProcessPendingEvents NS_ProcessPendingEvents_P
+# define NS_HasPendingEvents NS_HasPendingEvents_P
+# define NS_ProcessNextEvent NS_ProcessNextEvent_P
+#endif
+
 //-----------------------------------------------------------------------------
 // These methods are alternatives to the methods on nsIThreadManager, provided
 // for convenience.
 
 /**
  * Set name of the target thread.  This operation is asynchronous.
  */
 extern NS_COM_GLUE void
--- a/xpcom/reflect/xptcall/public/xptcall.h
+++ b/xpcom/reflect/xptcall/public/xptcall.h
@@ -3,16 +3,22 @@
  * 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/. */
 
 /* Public declarations for xptcall. */
 
 #ifndef xptcall_h___
 #define xptcall_h___
 
+#ifdef MOZILLA_INTERNAL_API
+# define NS_GetXPTCallStub     NS_GetXPTCallStub_P
+# define NS_DestroyXPTCallStub NS_DestroyXPTCallStub_P
+# define NS_InvokeByIndex      NS_InvokeByIndex_P
+#endif
+
 #include "nscore.h"
 #include "nsISupports.h"
 #include "xpt_struct.h"
 #include "xptinfo.h"
 #include "jsapi.h"
 
 struct nsXPTCMiniVariant
 {
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_alpha_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_alpha_openbsd.cpp
@@ -56,30 +56,30 @@ invoke_copy_to_stack(uint64_t* d, uint32
             *d = (uint64_t)s->val.p;
             break;
         }
     }
 }
 
 /*
  * EXPORT_XPCOM_API(nsresult)
- * NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+ * NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
  *                  uint32_t paramCount, nsXPTCVariant* params)
  */
 __asm__(
-    "#### NS_InvokeByIndex ####\n"
+    "#### NS_InvokeByIndex_P ####\n"
 ".text\n\t"
     ".align 5\n\t"
-    ".globl NS_InvokeByIndex\n\t"
-    ".ent NS_InvokeByIndex\n"
-"NS_InvokeByIndex:\n\t"
+    ".globl NS_InvokeByIndex_P\n\t"
+    ".ent NS_InvokeByIndex_P\n"
+"NS_InvokeByIndex_P:\n\t"
     ".frame $15,32,$26,0\n\t"
     ".mask 0x4008000,-32\n\t"
     "ldgp $29,0($27)\n"
-"$NS_InvokeByIndex..ng:\n\t"
+"$NS_InvokeByIndex_P..ng:\n\t"
     "subq $30,32,$30\n\t"
     "stq $26,0($30)\n\t"
     "stq $15,8($30)\n\t"
     "bis $30,$30,$15\n\t"
     ".prologue 1\n\t"
 
     /*
      * Allocate enough stack space to hold the greater of 6 or "paramCount"+1
@@ -135,10 +135,10 @@ invoke_copy_to_stack(uint64_t* d, uint32
     "jsr $26,($27),0\n\t"   /* call virtual function */
     "ldgp $29,0($26)\n\t"
 
     "bis $15,$15,$30\n\t"
     "ldq $26,0($30)\n\t"
     "ldq $15,8($30)\n\t"
     "addq $30,32,$30\n\t"
     "ret $31,($26),1\n\t"
-    ".end NS_InvokeByIndex"
+    ".end NS_InvokeByIndex_P"
     );
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_openbsd.cpp
@@ -95,17 +95,17 @@ invoke_copy_to_stack(uint64_t * d, uint3
                 gpregs[nr_gpr++] = value;
             else
                 *d++ = value;
         }
     }
 }
 
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports * that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports * that, uint32_t methodIndex,
                  uint32_t paramCount, nsXPTCVariant * params)
 {
     uint32_t nr_gpr, nr_fpr, nr_stack;
     invoke_count_words(paramCount, params, nr_gpr, nr_fpr, nr_stack);
     
     // Stack, if used, must be 16-bytes aligned
     if (nr_stack)
         nr_stack = (nr_stack + 1) & ~1;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ipf32.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ipf32.s
@@ -2,34 +2,34 @@
 // Select C numeric constant
         .radix  C
 // for 64 bit mode, use .psr abi64
         .psr    abi32
 // big endian
         .psr    msb
 // Section has executable code
         .section .text, "ax","progbits"
-// procedure named 'NS_InvokeByIndex'
-        .proc   NS_InvokeByIndex
+// procedure named 'NS_InvokeByIndex_P'
+        .proc   NS_InvokeByIndex_P
 // manual bundling
         .explicit
 
 // extern "C" uint32_t
 // invoke_copy_to_stack(uint64_t* d,
 //   const uint32_t paramCount, nsXPTCVariant* s)
         .global invoke_copy_to_stack
 //      .exclass  invoke_copy_to_stack, @fullyvisible
         .type   invoke_copy_to_stack,@function
 
-//      .exclass  NS_InvokeByIndex, @fullyvisible
-        .type   NS_InvokeByIndex,@function
+//      .exclass  NS_InvokeByIndex_P, @fullyvisible
+        .type   NS_InvokeByIndex_P,@function
 
-// NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+// NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
 //   uint32_t paramCount, nsXPTCVariant* params);
-NS_InvokeByIndex::
+NS_InvokeByIndex_P::
         .prologue
         .save ar.pfs, r37
 // allocate 4 input args, 6 local args, and 8 output args
         alloc           r37 = ar.pfs, 4, 6, 8, 0   // M
         nop.i           0                       ;; // I
 
 // unwind table already knows gp, no need to specify anything
         add             r39 = 0, gp                // A
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ipf64.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ipf64.s
@@ -2,34 +2,34 @@
 // Select C numeric constant
         .radix  C
 // for 64 bit mode, use .psr abi64
         .psr    abi64
 // little endian
         .psr    lsb
 // Section has executable code
         .section .text, "ax","progbits"
-// procedure named 'NS_InvokeByIndex'
-        .proc   NS_InvokeByIndex
+// procedure named 'NS_InvokeByIndex_P'
+        .proc   NS_InvokeByIndex_P
 // manual bundling
         .explicit
 
 // extern "C" uint32_t
 // invoke_copy_to_stack(uint64_t* d,
 //   const uint32_t paramCount, nsXPTCVariant* s)
         .global invoke_copy_to_stack
 //      .exclass  invoke_copy_to_stack, @fullyvisible
         .type   invoke_copy_to_stack,@function
 
-//      .exclass  NS_InvokeByIndex, @fullyvisible
-        .type   NS_InvokeByIndex,@function
+//      .exclass  NS_InvokeByIndex_P, @fullyvisible
+        .type   NS_InvokeByIndex_P,@function
 
 // XPTC_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
 //   uint32_t paramCount, nsXPTCVariant* params);
-NS_InvokeByIndex::
+NS_InvokeByIndex_P::
         .prologue
         .save ar.pfs, r37
 // allocate 4 input args, 6 local args, and 8 output args
         alloc           r37 = ar.pfs, 4, 6, 8, 0   // M
         nop.i           0                       ;; // I
 
 // unwind table already knows gp, no need to specify anything
         add             r39 = 0, gp                // A
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s
@@ -33,25 +33,25 @@
 #define A0OFF (FRAMESZ + (0*SZREG))
 #define A1OFF (FRAMESZ + (1*SZREG))
 #define A2OFF (FRAMESZ + (2*SZREG))
 #define A3OFF (FRAMESZ + (3*SZREG))
 
 	.text
 
 #	
-# _NS_InvokeByIndex(that, methodIndex, paramCount, params)
+# _NS_InvokeByIndex_P(that, methodIndex, paramCount, params)
 #                      a0       a1          a2         a3
 
-	.globl	_NS_InvokeByIndex
+	.globl	_NS_InvokeByIndex_P
 	.align	2
-	.type	_NS_InvokeByIndex,@function
-	.ent	_NS_InvokeByIndex,0
+	.type	_NS_InvokeByIndex_P,@function
+	.ent	_NS_InvokeByIndex_P,0
 	.frame	fp, FRAMESZ, ra
-_NS_InvokeByIndex:
+_NS_InvokeByIndex_P:
 	SETUP_GP
 	subu	sp, FRAMESZ
 
 	# specify the save register mask for gp, fp, ra, a3 - a0
 	.mask 0xD00000F0, RAOFF-FRAMESZ
 
 	sw	ra, RAOFF(sp)
 	sw	fp, FPOFF(sp)
@@ -126,9 +126,9 @@ 1:	subu	sp, v0
 	# leave variable stack frame
 	move	sp, fp
 
 	lw	ra, RAOFF(sp)
 	lw	fp, FPOFF(sp)
 
 	addiu	sp, FRAMESZ
 	j	ra
-END(_NS_InvokeByIndex)
+END(_NS_InvokeByIndex_P)
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
@@ -16,22 +16,22 @@ RAOFF=FRAMESZ-(1*SZREG)
 A0OFF=FRAMESZ-(2*SZREG)
 A1OFF=FRAMESZ-(3*SZREG)
 A2OFF=FRAMESZ-(4*SZREG)
 A3OFF=FRAMESZ-(5*SZREG)
 S0OFF=FRAMESZ-(6*SZREG)
 GPOFF=FRAMESZ-(7*SZREG)
 
 #
-# _NS_InvokeByIndex(that, methodIndex, paramCount, params)
+# _NS_InvokeByIndex_P(that, methodIndex, paramCount, params)
 #                      a0       a1          a2         a3
 
-NESTED(_NS_InvokeByIndex, FRAMESZ, ra)
+NESTED(_NS_InvokeByIndex_P, FRAMESZ, ra)
     PTR_SUBU sp, FRAMESZ
-    SETUP_GP64(GPOFF, _NS_InvokeByIndex)
+    SETUP_GP64(GPOFF, _NS_InvokeByIndex_P)
 
     REG_S    ra, RAOFF(sp)
     REG_S    a0, A0OFF(sp)
     REG_S    a1, A1OFF(sp)
     REG_S    a2, A2OFF(sp)
     REG_S    a3, A3OFF(sp)
     REG_S    s0, S0OFF(sp)
 
@@ -114,9 +114,9 @@ NESTED(_NS_InvokeByIndex, FRAMESZ, ra)
 
     move     sp, s0
 
     RESTORE_GP64
     REG_L    ra, RAOFF(sp)
     REG_L    s0, S0OFF(sp)
     PTR_ADDU sp, FRAMESZ
     j    ra
-.end _NS_InvokeByIndex
+.end _NS_InvokeByIndex_P
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_parisc_linux.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_parisc_linux.s
@@ -7,21 +7,21 @@
 
   .LEVEL 1.1
   .text
   .align 4
 
 framesz:
   .equ 128
 
-.globl NS_InvokeByIndex
-  .type NS_InvokeByIndex, @function
+.globl NS_InvokeByIndex_P
+  .type NS_InvokeByIndex_P, @function
 
 
-NS_InvokeByIndex:
+NS_InvokeByIndex_P:
   .PROC
   .CALLINFO FRAME=72, CALLER,SAVE_RP, SAVE_SP, ENTRY_GR=3
   .ENTRY
 
 ; frame marker takes 48 bytes,
 ; register spill area takes 8 bytes,
 ; local stack area takes 72 bytes result in 128 bytes total
 
@@ -99,10 +99,10 @@ NS_InvokeByIndex:
         COPY    %r3,%r30              ; restore saved stack ptr
 
         LDW          -148(%sp),%rp
         LDWM       -128(%sp),%r3
         BV,N             (%rp)
         NOP
   .EXIT
   .PROCEND  ;in=23,24,25,26;
-  .SIZE NS_InvokeByIndex, .-NS_InvokeByIndex
+  .SIZE NS_InvokeByIndex_P, .-NS_InvokeByIndex_P
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.s
@@ -14,31 +14,31 @@
 .set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
 .set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
 .set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
 .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
 .set f30,30; .set f31,31
 
 
 #
-# NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+# NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
 #                    uint32_t paramCount, nsXPTCVariant* params)
 #
 
         .section ".toc","aw"
         .section ".text"
         .align 2
-        .globl  NS_InvokeByIndex
+        .globl  NS_InvokeByIndex_P
         .section ".opd","aw"
         .align 3
-NS_InvokeByIndex:
-        .quad   .NS_InvokeByIndex,.TOC.@tocbase
+NS_InvokeByIndex_P:
+        .quad   .NS_InvokeByIndex_P,.TOC.@tocbase
         .previous
-        .type   NS_InvokeByIndex,@function
-.NS_InvokeByIndex:
+        .type   NS_InvokeByIndex_P,@function
+.NS_InvokeByIndex_P:
         mflr    0
         std     0,16(r1)
 
         std     r29,-24(r1)
         std     r30,-16(r1)
         std     r31,-8(r1)
 
         mr      r29,r3                  # Save 'that' in r29
@@ -121,12 +121,12 @@ NS_InvokeByIndex:
         ld      r1,0(r1)                # Revert stack frame
         ld      0,16(r1)                # Reload lr
         ld      29,-24(r1)              # Restore NVGPRS
         ld      30,-16(r1)
         ld      31,-8(r1)
         mtlr    0
         blr
 
-        .size   NS_InvokeByIndex,.-.NS_InvokeByIndex
+        .size   NS_InvokeByIndex_P,.-.NS_InvokeByIndex_P
 
         # Magic indicating no need for an executable stack
         .section .note.GNU-stack, "", @progbits ; .previous
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_aix.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_aix.s
@@ -20,34 +20,34 @@
 .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
 .set f30,30; .set f31,31
 .set BO_IF,12
 .set CR0_EQ,2
 
 
 
         .rename H.10.NO_SYMBOL{PR},""
-        .rename H.18.NS_InvokeByIndex{TC},"NS_InvokeByIndex"
+        .rename H.18.NS_InvokeByIndex_P{TC},"NS_InvokeByIndex_P"
 
 
 # .text section
 
         .csect  H.10.NO_SYMBOL{PR}
-        .globl  .NS_InvokeByIndex
-        .globl  NS_InvokeByIndex{DS}
+        .globl  .NS_InvokeByIndex_P
+        .globl  NS_InvokeByIndex_P{DS}
         .extern .invoke_copy_to_stack
         .extern ._ptrgl{PR}
 
 
 #
-#   NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+#   NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
 #                   uint32_t paramCount, nsXPTCVariant* params)
 #
 
-.NS_InvokeByIndex:
+.NS_InvokeByIndex_P:
 		mflr	r0
 		stw	r31,-4(sp)
 #
 # save off the incoming values in the caller's parameter area
 #		
 		stw	r3,24(sp)		# that
 		stw	r4,28(sp)		# methodIndex
 		stw	r5,32(sp)		# paramCount
@@ -112,18 +112,18 @@
 		mtlr    r0
 		lwz     r31,-4(sp)
 	        blr
 
 
 # .data section
 
         .toc                            # 0x00000038
-T.18.NS_InvokeByIndex:
-        .tc     H.18.NS_InvokeByIndex{TC},NS_InvokeByIndex{DS}
+T.18.NS_InvokeByIndex_P:
+        .tc     H.18.NS_InvokeByIndex_P{TC},NS_InvokeByIndex_P{DS}
 
-        .csect  NS_InvokeByIndex{DS}
-        .long   .NS_InvokeByIndex     # "\0\0\0\0"
+        .csect  NS_InvokeByIndex_P{DS}
+        .long   .NS_InvokeByIndex_P     # "\0\0\0\0"
         .long   TOC{TC0}                # "\0\0\0008"
         .long   0x00000000              # "\0\0\0\0"
-# End   csect   NS_InvokeByIndex{DS}
+# End   csect   NS_InvokeByIndex_P{DS}
 
 # .bss section	
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_aix64.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_aix64.s
@@ -15,33 +15,33 @@
 .set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
 .set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
 .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
 .set f30,30; .set f31,31
 .set BO_IF,12
 .set CR0_EQ,2
 
         .rename H.10.NO_SYMBOL{PR},""
-        .rename H.18.NS_InvokeByIndex{TC},"NS_InvokeByIndex"
+        .rename H.18.NS_InvokeByIndex_P{TC},"NS_InvokeByIndex_P"
 
 
 # .text section
 
         .csect  H.10.NO_SYMBOL{PR}
-        .globl  .NS_InvokeByIndex
-        .globl  NS_InvokeByIndex{DS}
+        .globl  .NS_InvokeByIndex_P
+        .globl  NS_InvokeByIndex_P{DS}
         .extern .invoke_copy_to_stack
         .extern ._ptrgl{PR}
 
 #
-#   NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+#   NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
 #                      uint32_t paramCount, nsXPTCVariant* params)
 #
 
-.NS_InvokeByIndex:
+.NS_InvokeByIndex_P:
         mflr    r0
         std     r31,-8(sp)
 #
 # save off the incoming values in the caller's parameter area
 #		
         std     r3,48(sp)       # that
         std     r4,56(sp)       # methodIndex
         std     r5,64(sp)       # paramCount
@@ -111,18 +111,18 @@
         addi    sp,sp,168
         mtlr    r0
         ld      r31,-8(sp)
         blr
 
 # .data section
 
         .toc                            # 0x00000038
-T.18.NS_InvokeByIndex:
-        .tc     H.18.NS_InvokeByIndex{TC},NS_InvokeByIndex{DS}
+T.18.NS_InvokeByIndex_P:
+        .tc     H.18.NS_InvokeByIndex_P{TC},NS_InvokeByIndex_P{DS}
 
-        .csect  NS_InvokeByIndex{DS}
-        .llong  .NS_InvokeByIndex     # "\0\0\0\0"
+        .csect  NS_InvokeByIndex_P{DS}
+        .llong  .NS_InvokeByIndex_P     # "\0\0\0\0"
         .llong  TOC{TC0}                # "\0\0\0008"
         .llong  0x00000000              # "\0\0\0\0"
-# End   csect   NS_InvokeByIndex{DS}
+# End   csect   NS_InvokeByIndex_P{DS}
 
 # .bss section
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_ibmobj_aix.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_ibmobj_aix.s
@@ -20,34 +20,34 @@
 .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
 .set f30,30; .set f31,31
 .set BO_IF,12
 .set CR0_EQ,2
 
 
 
         .rename H.10.NO_SYMBOL{PR},""
-        .rename H.18.NS_InvokeByIndex{TC},"NS_InvokeByIndex"
+        .rename H.18.NS_InvokeByIndex_P{TC},"NS_InvokeByIndex_P"
 
 
 # .text section
 
         .csect  H.10.NO_SYMBOL{PR}
-        .globl  .NS_InvokeByIndex
-        .globl  NS_InvokeByIndex{DS}
+        .globl  .NS_InvokeByIndex_P
+        .globl  NS_InvokeByIndex_P{DS}
         .extern .invoke_copy_to_stack
         .extern ._ptrgl{PR}
 
 
 #
-#   NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+#   NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
 #                   uint32_t paramCount, nsXPTCVariant* params)
 #
 
-.NS_InvokeByIndex:
+.NS_InvokeByIndex_P:
 		mflr	r0
 		stw	r31,-4(sp)
 #
 # save off the incoming values in the caller's parameter area
 #		
 		stw	r3,24(sp)		# that
 		stw	r4,28(sp)		# methodIndex
 		stw	r5,32(sp)		# paramCount
@@ -107,18 +107,18 @@
 		mtlr    r0
 		lwz     r31,-4(sp)
 	        blr
 
 
 # .data section
 
         .toc                            # 0x00000038
-T.18.NS_InvokeByIndex:
-        .tc     H.18.NS_InvokeByIndex{TC},NS_InvokeByIndex{DS}
+T.18.NS_InvokeByIndex_P:
+        .tc     H.18.NS_InvokeByIndex_P{TC},NS_InvokeByIndex_P{DS}
 
-        .csect  NS_InvokeByIndex{DS}
-        .long   .NS_InvokeByIndex     # "\0\0\0\0"
+        .csect  NS_InvokeByIndex_P{DS}
+        .long   .NS_InvokeByIndex_P     # "\0\0\0\0"
         .long   TOC{TC0}                # "\0\0\0008"
         .long   0x00000000              # "\0\0\0\0"
-# End   csect   NS_InvokeByIndex{DS}
+# End   csect   NS_InvokeByIndex_P{DS}
 
 # .bss section	
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_linux.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_linux.s
@@ -16,25 +16,25 @@
 .set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
 .set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
 .set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
 .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
 .set f30,30; .set f31,31
 		      
         .section ".text"
 	.align 2
-	.globl NS_InvokeByIndex
-	.type  NS_InvokeByIndex,@function
+	.globl NS_InvokeByIndex_P
+	.type  NS_InvokeByIndex_P,@function
 
 //
-// NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+// NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
 //                  uint32_t paramCount, nsXPTCVariant* params)
 //
 
-NS_InvokeByIndex:
+NS_InvokeByIndex_P:
 	stwu    sp,-32(sp)			// setup standard stack frame
 	mflr    r0				// save LR
 	stw     r3,8(sp)			// r3 <= that
 	stw     r4,12(sp)			// r4 <= methodIndex
 	stw     r30,16(sp)
 	stw     r31,20(sp)
 
 	stw     r0,36(sp)			// store LR backchain
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_openbsd.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_openbsd.s
@@ -16,25 +16,25 @@
 .set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
 .set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
 .set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
 .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
 .set f30,30; .set f31,31
 
 	.section ".text"
 	.align 2
-	.globl NS_InvokeByIndex
-	.type  NS_InvokeByIndex,@function
+	.globl NS_InvokeByIndex_P
+	.type  NS_InvokeByIndex_P,@function
 
 //
-// NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+// NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
 //                    uint32_t paramCount, nsXPTCVariant* params)
 //
 
-NS_InvokeByIndex:
+NS_InvokeByIndex_P:
 	stwu	sp,-32(sp)			// setup standard stack frame
 	mflr	r0				// save LR
 	stw	r3,8(sp)			// r3 <= that
 	stw	r4,12(sp)			// r4 <= methodIndex
 	stw	r30,16(sp)
 	stw	r31,20(sp)
 
 	stw	r0,36(sp)			// store LR backchain
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_rhapsody.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_rhapsody.s
@@ -9,22 +9,22 @@
 # ** Assumed vtable layout (obtained by disassembling with gdb):
 # ** 4 bytes per vtable entry, skip 0th and 1st entries, so the mapping
 # ** from index to entry is (4 * index) + 8.
 #
 
 .text
 	.align 2
 #
-#   NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+#   NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
 #                    uint32_t paramCount, nsXPTCVariant* params)
 #
 
-.globl __NS_InvokeByIndex	
-__NS_InvokeByIndex:
+.globl __NS_InvokeByIndex_P	
+__NS_InvokeByIndex_P:
 	mflr	r0
 	stw	r31,-4(r1)
 #
 # save off the incoming values in the callers parameter area
 #		
 	stw	r3,24(r1)               ; that
 	stw	r4,28(r1)               ; methodIndex
 	stw	r5,32(r1)               ; paramCount
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc64_openbsd.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc64_openbsd.s
@@ -9,25 +9,25 @@
     for sparcv9 Solaris.
 
     See the SPARC Compliance Definition (SCD) Chapter 3
     for more information about what is going on here, including
     the use of BIAS (0x7ff).
     The SCD is available from http://www.sparc.com/.
 */
 
-        .global NS_InvokeByIndex
-        .type   NS_InvokeByIndex, #function
+        .global NS_InvokeByIndex_P
+        .type   NS_InvokeByIndex_P, #function
 
 /*
-    NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+    NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                      uint32_t paramCount, nsXPTCVariant* params);
     
 */
-NS_InvokeByIndex:
+NS_InvokeByIndex_P:
         save    %sp,-(128 + 64),%sp ! room for the register window and
                                     ! struct pointer, rounded up to 0 % 64
         sll     %i2,4,%l0           ! assume the worst case
                                     ! paramCount * 2 * 8 bytes
         cmp     %l0, 0              ! are there any args? If not,
         be      .invoke             ! no need to copy args to stack
         nop
 
@@ -78,9 +78,9 @@ NS_InvokeByIndex:
 
         jmpl    %l0,%o7             ! call the routine
         mov     %i0,%o0             ! move 'this' pointer to out register
 
         mov     %o0,%i0             ! propagate return value
         ret
         restore
 
-        .size    NS_InvokeByIndex, .-NS_InvokeByIndex
+        .size    NS_InvokeByIndex_P, .-NS_InvokeByIndex
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc_linux_GCC3.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc_linux_GCC3.s
@@ -3,23 +3,23 @@
  * 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/. */
 
 /*
  * Platform specific code to invoke XPCOM methods on native objects for
  * Linux/Sparc with gcc 3 ABI.
  */
-        .global NS_InvokeByIndex
+        .global NS_InvokeByIndex_P
 /*
  *  NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
  *                 uint32_t paramCount, nsXPTCVariant* params);
  *   
  */
-NS_InvokeByIndex:
+NS_InvokeByIndex_P:
         save    %sp,-(64 + 16),%sp   ! room for the register window and
                                     ! struct pointer, rounded up to 0 % 16
         mov     %i2,%o0             ! paramCount
         call    invoke_count_words  ! returns the required stack size in %o0
         mov     %i3,%o1             ! params
         
 	sll     %o0,2,%l0           ! number of bytes
         sub     %sp,%l0,%sp         ! create the additional stack space
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris_GCC3.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris_GCC3.s
@@ -3,22 +3,22 @@
  * 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/. */
 
 /*
  * Platform specific code to invoke XPCOM methods on native objects for
  * solaris/sparc with gcc 3 ABI.
  */
-        .global NS_InvokeByIndex
+        .global NS_InvokeByIndex_P
 /*
- *  NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+ *  NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
  *                   uint32_t paramCount, nsXPTCVariant* params);
  */
-NS_InvokeByIndex:
+NS_InvokeByIndex_P:
         save    %sp,-(64 + 32),%sp  ! room for the register window and
                                     ! struct pointer, rounded up to 0 % 32
         mov     %i2,%o0             ! paramCount
         call    invoke_count_words  ! returns the required stack size in %o0
         mov     %i3,%o1             ! params
         
         sll     %o0,2,%l0           ! number of bytes
         sub     %sp,%l0,%sp         ! create the additional stack space
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris_SUNW.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris_SUNW.s
@@ -1,24 +1,24 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * 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/. */
 
 /* Platform specific code to invoke XPCOM methods on native objects */
 
-        .global NS_InvokeByIndex
-        .type   NS_InvokeByIndex, #function
+        .global NS_InvokeByIndex_P
+        .type   NS_InvokeByIndex_P, #function
 /*
-    NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+    NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                      uint32_t paramCount, nsXPTCVariant* params);
     
 */
-NS_InvokeByIndex:
+NS_InvokeByIndex_P:
         save    %sp,-(64 + 32),%sp  ! room for the register window and
                                     ! struct pointer, rounded up to 0 % 32
         sll     %i2,3,%l0           ! assume the worst case
                                     ! paramCount * 2 * 4 bytes
         cmp     %l0, 0              ! are there any args? If not,
         be      .invoke             ! no need to copy args to stack
 
         sub     %sp,%l0,%sp         ! create the additional stack space
@@ -48,9 +48,9 @@ NS_InvokeByIndex:
 
         jmpl    %l0,%o7             ! call the routine
         mov     %i0,%o0             ! move 'this' pointer to out register
 
         mov     %o0,%i0             ! propagate return value
         ret
         restore
 
-        .size    NS_InvokeByIndex, .-NS_InvokeByIndex
+        .size    NS_InvokeByIndex_P, .-NS_InvokeByIndex_P
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparcv9_solaris_SUNW.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparcv9_solaris_SUNW.s
@@ -9,25 +9,25 @@
     for sparcv9 Solaris.
 
     See the SPARC Compliance Definition (SCD) Chapter 3
     for more information about what is going on here, including
     the use of BIAS (0x7ff).
     The SCD is available from http://www.sparc.com/.
 */
 
-        .global NS_InvokeByIndex
-        .type   NS_InvokeByIndex, #function
+        .global NS_InvokeByIndex_P
+        .type   NS_InvokeByIndex_P, #function
 
 /*
-    NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+    NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                      uint32_t paramCount, nsXPTCVariant* params);
     
 */
-NS_InvokeByIndex:
+NS_InvokeByIndex_P:
         save    %sp,-(128 + 64),%sp ! room for the register window and
                                     ! struct pointer, rounded up to 0 % 64
         sll     %i2,4,%l0           ! assume the worst case
                                     ! paramCount * 2 * 8 bytes
         cmp     %l0, 0              ! are there any args? If not,
         be      .invoke             ! no need to copy args to stack
 
         sub     %sp,%l0,%sp         ! create the additional stack space
@@ -77,9 +77,9 @@ NS_InvokeByIndex:
 
         jmpl    %l0,%o7             ! call the routine
         mov     %i0,%o0             ! move 'this' pointer to out register
 
         mov     %o0,%i0             ! propagate return value
         ret
         restore
 
-        .size    NS_InvokeByIndex, .-NS_InvokeByIndex
+        .size    NS_InvokeByIndex_P, .-NS_InvokeByIndex_P
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_x86_solaris_SUNW.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_x86_solaris_SUNW.s
@@ -1,11 +1,11 @@
-	.globl NS_InvokeByIndex
-	.type NS_InvokeByIndex, @function
-NS_InvokeByIndex:
+	.globl NS_InvokeByIndex_P
+	.type NS_InvokeByIndex_P, @function
+NS_InvokeByIndex_P:
 	push       %ebp
 	movl       %esp,%ebp
 	push       %ebx
 	call       .CG0.66
 .CG0.66:
 	pop        %ebx
 	addl       $_GLOBAL_OFFSET_TABLE_+0x1,%ebx
 	push       20(%ebp)
@@ -46,10 +46,10 @@ NS_InvokeByIndex:
 	popl	%esi
 	popl	%ebx
 	/ INLINE_END
 	addl       $16,%esp
 	pop        %ebx
 	movl       %ebp,%esp
 	pop        %ebp
 	ret        
-	.size NS_InvokeByIndex, . - NS_InvokeByIndex
+	.size NS_InvokeByIndex_P, . - NS_InvokeByIndex_P
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp
@@ -28,17 +28,17 @@ invoke_copy_to_stack(uint32_t paramCount
         default                  : *((void**)d)    = s->val.p;           break;
         }
     }
 }
 } // extern "C"
 
 /*
   EXPORT_XPCOM_API(nsresult)
-  NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+  NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                    uint32_t paramCount, nsXPTCVariant* params);
 
   Each param takes at most two 4-byte words.
   It doesn't matter if we push too many words, and calculating the exact
   amount takes time.
 
   that        = ebp + 0x08
   methodIndex = ebp + 0x0c
@@ -47,21 +47,21 @@ invoke_copy_to_stack(uint32_t paramCount
 
 */
 
 __asm__ (
 	".text\n\t"
 /* alignment here seems unimportant here; this was 16, now it's 2 which
    is what xptcstubs uses. */
 	".align 2\n\t"
-	".globl " SYMBOL_UNDERSCORE "NS_InvokeByIndex\n\t"
+	".globl " SYMBOL_UNDERSCORE "NS_InvokeByIndex_P\n\t"
 #ifndef XP_MACOSX
-	".type  " SYMBOL_UNDERSCORE "NS_InvokeByIndex,@function\n"
+	".type  " SYMBOL_UNDERSCORE "NS_InvokeByIndex_P,@function\n"
 #endif
-	SYMBOL_UNDERSCORE "NS_InvokeByIndex:\n\t"
+	SYMBOL_UNDERSCORE "NS_InvokeByIndex_P:\n\t"
 	"pushl %ebp\n\t"
 	"movl  %esp, %ebp\n\t"
 	"movl  0x10(%ebp), %eax\n\t"
 	"leal  0(,%eax,8),%edx\n\t"
 
         /* set up call frame for method. */
 	"subl  %edx, %esp\n\t"       /* make room for params. */
 /* Align to maximum x86 data size: 128 bits == 16 bytes == XMM register size.
@@ -87,11 +87,11 @@ invoke_copy_to_stack(uint32_t paramCount
 	"movl  (%ecx), %edx\n\t"
 	"movl  0x0c(%ebp), %eax\n\t"    /* function index */
 	"leal  (%edx,%eax,4), %edx\n\t"
 	"call  *(%edx)\n\t"
 	"movl  %ebp, %esp\n\t"
 	"popl  %ebp\n\t"
 	"ret\n"
 #ifndef XP_MACOSX
-	".size " SYMBOL_UNDERSCORE "NS_InvokeByIndex, . -" SYMBOL_UNDERSCORE "NS_InvokeByIndex\n\t"
+	".size " SYMBOL_UNDERSCORE "NS_InvokeByIndex_P, . -" SYMBOL_UNDERSCORE "NS_InvokeByIndex_P\n\t"
 #endif
 );
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_alpha.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_alpha.cpp
@@ -56,30 +56,30 @@ invoke_copy_to_stack(uint64_t* d, uint32
             *d = (uint64_t)s->val.p;
             break;
         }
     }
 }
 
 /*
  * EXPORT_XPCOM_API(nsresult)
- * NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+ * NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
  *                  uint32_t paramCount, nsXPTCVariant* params)
  */
 __asm__(
-    "#### NS_InvokeByIndex ####\n"
+    "#### NS_InvokeByIndex_P ####\n"
 ".text\n\t"
     ".align 5\n\t"
-    ".globl NS_InvokeByIndex\n\t"
-    ".ent NS_InvokeByIndex\n"
-"NS_InvokeByIndex:\n\t"
+    ".globl NS_InvokeByIndex_P\n\t"
+    ".ent NS_InvokeByIndex_P\n"
+"NS_InvokeByIndex_P:\n\t"
     ".frame $15,32,$26,0\n\t"
     ".mask 0x4008000,-32\n\t"
     "ldgp $29,0($27)\n"
-"$NS_InvokeByIndex..ng:\n\t"
+"$NS_InvokeByIndex_P..ng:\n\t"
     "subq $30,32,$30\n\t"
     "stq $26,0($30)\n\t"
     "stq $15,8($30)\n\t"
     "bis $30,$30,$15\n\t"
     ".prologue 1\n\t"
 
     /*
      * Allocate enough stack space to hold the greater of 6 or "paramCount"+1
@@ -135,10 +135,10 @@ invoke_copy_to_stack(uint64_t* d, uint32
     "jsr $26,($27),0\n\t"   /* call virtual function */
     "ldgp $29,0($26)\n\t"
 
     "bis $15,$15,$30\n\t"
     "ldq $26,0($30)\n\t"
     "ldq $15,8($30)\n\t"
     "addq $30,32,$30\n\t"
     "ret $31,($26),1\n\t"
-    ".end NS_InvokeByIndex"
+    ".end NS_InvokeByIndex_P"
     );
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp
@@ -92,17 +92,17 @@ extern "C" {
                 *((void**)d) = s->val.p;
                 break;
             }
         }
     }
 }
 
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                    uint32_t paramCount, nsXPTCVariant* params)
 {
     uint32_t result, n;
 
     n = invoke_count_words(paramCount, params) * 4;
 
  __asm__ __volatile__(
     "subl  %5, %%sp\n\t"      /* make room for params */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp
@@ -82,18 +82,18 @@ invoke_copy_to_stack(uint32_t* d, uint32
         case nsXPTType::T_WCHAR  : *d = (wchar_t) s->val.wc;    break;
         default:
             *((void**)d) = s->val.p;
             break;
         }
     }
 }
 
-extern "C" nsresult _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                                         uint32_t paramCount,
                                         nsXPTCVariant* params);
 
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                    uint32_t paramCount, nsXPTCVariant* params)
 {
-    return _NS_InvokeByIndex(that, methodIndex, paramCount, params);
+    return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params);
 }
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
@@ -123,18 +123,18 @@ invoke_copy_to_stack(uint64_t* d, uint32
                 regs[i] = (uint64_t)s->val.p;
             else
                *d++ = (uint64_t)s->val.p;
             break;
         }
     }
 }
 
-extern "C" nsresult _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                                         uint32_t paramCount,
                                         nsXPTCVariant* params);
 
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                    uint32_t paramCount, nsXPTCVariant* params)
 {
-    return _NS_InvokeByIndex(that, methodIndex, paramCount, params);
+    return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params);
 }
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp
@@ -1,18 +1,18 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 // Platform specific code to invoke XPCOM methods on native objects
 
-// The purpose of NS_InvokeByIndex() is to map a platform
+// The purpose of NS_InvokeByIndex_P() is to map a platform
 // independent call to the platform ABI. To do that,
-// NS_InvokeByIndex() has to determine the method to call via vtable
+// NS_InvokeByIndex_P() has to determine the method to call via vtable
 // access. The parameters for the method are read from the
 // nsXPTCVariant* and prepared for the native ABI.
 
 // The PowerPC64 platform ABI can be found here:
 // http://www.freestandards.org/spec/ELF/ppc64/
 // and in particular:
 // http://www.freestandards.org/spec/ELF/ppc64/PPC-elf64abi-1.9.html#FUNC-CALL
 
@@ -85,11 +85,11 @@ invoke_copy_to_stack(uint64_t* gpregs,
                 *d = tempu64;
         }
         if (i >= 7)
             d++;
     }
 }
 
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                    uint32_t paramCount, nsXPTCVariant* params);
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_linux.cpp
@@ -1,18 +1,18 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 // Platform specific code to invoke XPCOM methods on native objects
 
-// The purpose of NS_InvokeByIndex() is to map a platform
+// The purpose of NS_InvokeByIndex_P() is to map a platform
 // indepenpent call to the platform ABI. To do that,
-// NS_InvokeByIndex() has to determine the method to call via vtable
+// NS_InvokeByIndex_P() has to determine the method to call via vtable
 // access. The parameters for the method are read from the
 // nsXPTCVariant* and prepared for th native ABI.  For the Linux/PPC
 // ABI this means that the first 8 integral and floating point
 // parameters are passed in registers.
 
 #include "xptcprivate.h"
 
 // 8 integral parameters are passed in registers
@@ -115,10 +115,10 @@ invoke_copy_to_stack(uint32_t* d,
                 *d++          = tempu32;
         }
         
     }
 }
 
 extern "C"
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                  uint32_t paramCount, nsXPTCVariant* params);
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_openbsd.cpp
@@ -1,18 +1,18 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 // Platform specific code to invoke XPCOM methods on native objects
 
-// The purpose of NS_InvokeByIndex() is to map a platform
+// The purpose of NS_InvokeByIndex_P() is to map a platform
 // indepenpent call to the platform ABI. To do that,
-// NS_InvokeByIndex() has to determine the method to call via vtable
+// NS_InvokeByIndex_P() has to determine the method to call via vtable
 // access. The parameters for the method are read from the
 // nsXPTCVariant* and prepared for th native ABI.  For the Linux/PPC
 // ABI this means that the first 8 integral and floating point
 // parameters are passed in registers.
 
 #include "xptcprivate.h"
 
 // 8 integral parameters are passed in registers
@@ -97,10 +97,10 @@ invoke_copy_to_stack(uint32_t* d,
                 *d++          = tempu32;
         }
         
     }
 }
 
 extern "C"
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                  uint32_t paramCount, nsXPTCVariant* params);
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp
@@ -96,18 +96,18 @@ invoke_copy_to_stack(uint32_t* d, uint32
         default:
             // all the others are plain pointer types
             *((void**)d) = s->val.p;
             break;
         }
     }
 }
 
-extern "C" nsresult _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                                       uint32_t paramCount, 
                                       nsXPTCVariant* params);
 
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                  uint32_t paramCount, nsXPTCVariant* params)
 {
-    return _NS_InvokeByIndex(that, methodIndex, paramCount, params);
+    return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params);
 }    
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_solaris.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_solaris.cpp
@@ -96,17 +96,17 @@ invoke_copy_to_stack(uint64_t * d, uint3
                 gpregs[nr_gpr++] = value;
             else
                 *d++ = value;
         }
     }
 }
 
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports * that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports * that, uint32_t methodIndex,
                  uint32_t paramCount, nsXPTCVariant * params)
 {
     uint32_t nr_gpr, nr_fpr, nr_stack;
     invoke_count_words(paramCount, params, nr_gpr, nr_fpr, nr_stack);
     
     // Stack, if used, must be 16-bytes aligned
     if (nr_stack)
         nr_stack = (nr_stack + 1) & ~1;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp
@@ -97,17 +97,17 @@ invoke_copy_to_stack(uint64_t * d, uint3
                 gpregs[nr_gpr++] = value;
             else
                 *d++ = value;
         }
     }
 }
 
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports * that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports * that, uint32_t methodIndex,
                  uint32_t paramCount, nsXPTCVariant * params)
 {
     uint32_t nr_stack;
     invoke_count_words(paramCount, params, nr_stack);
     
     // Stack, if used, must be 16-bytes aligned
     if (nr_stack)
         nr_stack = (nr_stack + 1) & ~1;
--- a/xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp
+++ b/xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp
@@ -44,17 +44,17 @@ invoke_copy_to_stack(uint32_t* d, uint32
     }
 }
 
 #pragma warning(disable : 4035) // OK to have no return value
 // Tell the PDB file this function has a standard frame pointer, and not to use
 // a custom FPO program.
 #pragma optimize( "y", off )
 extern "C" NS_EXPORT nsresult NS_FROZENCALL
-NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                  uint32_t paramCount, nsXPTCVariant* params)
 {
     __asm {
         mov     edx,paramCount      // Save paramCount for later
         test    edx,edx             // maybe we don't have any params to copy
         jz      noparams
         mov     eax,edx             
         shl     eax,3               // *= 8 (max possible param size)
--- a/xpcom/reflect/xptcall/src/md/win32/xptcinvoke_x86_64.cpp
+++ b/xpcom/reflect/xptcall/src/md/win32/xptcinvoke_x86_64.cpp
@@ -46,14 +46,14 @@ invoke_copy_to_stack(uint64_t* d, uint32
 }
 
 extern "C" nsresult
 XPTC__InvokebyIndex(nsISupports* that, uint32_t methodIndex,
                     uint32_t paramCount, nsXPTCVariant* params);
 
 extern "C"
 EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                    uint32_t paramCount, nsXPTCVariant* params)
 {
     return XPTC__InvokebyIndex(that, methodIndex, paramCount, params);
 }
 
--- a/xpcom/reflect/xptcall/src/md/win32/xptcinvoke_x86_gnu.cpp
+++ b/xpcom/reflect/xptcall/src/md/win32/xptcinvoke_x86_gnu.cpp
@@ -40,17 +40,17 @@ invoke_copy_to_stack(uint32_t paramCount
             break;
         }
     }
 }
 } // extern "C"
 
 /*
   EXPORT_XPCOM_API(nsresult)
-  NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+  NS_InvokeByIndex_P(nsISupports* that, uint32_t methodIndex,
                    uint32_t paramCount, nsXPTCVariant* params);
 
   Each param takes at most two 4-byte words.
   It doesn't matter if we push too many words, and calculating the exact
   amount takes time.
 
   that        = ebp + 0x08
   methodIndex = ebp + 0x0c
@@ -59,18 +59,18 @@ invoke_copy_to_stack(uint32_t paramCount
 
 */
 
 __asm__ (
 	".text\n\t"
 /* alignment here seems unimportant here; this was 16, now it's 2 which
    is what xptcstubs uses. */
 	".align 2\n\t"
-	".globl _NS_InvokeByIndex\n\t"
-	"_NS_InvokeByIndex:\n\t"
+	".globl _NS_InvokeByIndex_P\n\t"
+	"_NS_InvokeByIndex_P:\n\t"
 	"pushl %ebp\n\t"
 	"movl  %esp, %ebp\n\t"
 	"movl  0x10(%ebp), %eax\n\t"
 	"leal  0(,%eax,8),%edx\n\t"
 
         /* set up call frame for method. */
 	"subl  %edx, %esp\n\t"       /* make room for params. */
 /* Align to maximum x86 data size: 128 bits == 16 bytes == XMM register size.
@@ -96,11 +96,11 @@ invoke_copy_to_stack(uint32_t paramCount
 	"movl  (%ecx), %edx\n\t"
 	"movl  0x0c(%ebp), %eax\n\t"    /* function index */
 	"leal  (%edx,%eax,4), %edx\n\t"
 	"call  *(%edx)\n\t"
 	"movl  %ebp, %esp\n\t"
 	"popl  %ebp\n\t"
 	"ret\n"
 	".section .drectve\n\t"
-	".ascii \" -export:NS_InvokeByIndex\"\n\t"
+	".ascii \" -export:NS_InvokeByIndex_P\"\n\t"
 	".text\n\t"
 );
--- a/xpcom/string/public/nsXPCOMStrings.h
+++ b/xpcom/string/public/nsXPCOMStrings.h
@@ -13,16 +13,44 @@
 /**
  * nsXPCOMStrings.h
  *
  * This file describes a minimal API for working with XPCOM's abstract
  * string classes.  It divorces the consumer from having any run-time
  * dependency on the implementation details of the abstract string types.
  */
 
+// Map frozen functions to private symbol names if not using strict API.
+#ifdef MOZILLA_INTERNAL_API
+# define NS_StringContainerInit           NS_StringContainerInit_P
+# define NS_StringContainerInit2          NS_StringContainerInit2_P
+# define NS_StringContainerFinish         NS_StringContainerFinish_P
+# define NS_StringGetData                 NS_StringGetData_P
+# define NS_StringGetMutableData          NS_StringGetMutableData_P
+# define NS_StringCloneData               NS_StringCloneData_P
+# define NS_StringSetData                 NS_StringSetData_P
+# define NS_StringSetDataRange            NS_StringSetDataRange_P
+# define NS_StringCopy                    NS_StringCopy_P
+# define NS_StringSetIsVoid               NS_StringSetIsVoid_P
+# define NS_StringGetIsVoid               NS_StringGetIsVoid_P
+# define NS_CStringContainerInit          NS_CStringContainerInit_P
+# define NS_CStringContainerInit2         NS_CStringContainerInit2_P
+# define NS_CStringContainerFinish        NS_CStringContainerFinish_P
+# define NS_CStringGetData                NS_CStringGetData_P
+# define NS_CStringGetMutableData         NS_CStringGetMutableData_P
+# define NS_CStringCloneData              NS_CStringCloneData_P
+# define NS_CStringSetData                NS_CStringSetData_P
+# define NS_CStringSetDataRange           NS_CStringSetDataRange_P
+# define NS_CStringCopy                   NS_CStringCopy_P
+# define NS_CStringSetIsVoid              NS_CStringSetIsVoid_P
+# define NS_CStringGetIsVoid              NS_CStringGetIsVoid_P
+# define NS_CStringToUTF16                NS_CStringToUTF16_P
+# define NS_UTF16ToCString                NS_UTF16ToCString_P
+#endif
+
 #include "nscore.h"
 
 /* The base string types */
 class nsAString;
 class nsACString;
 
 /* ------------------------------------------------------------------------- */
 
new file mode 100644
--- /dev/null
+++ b/xpcom/stub/Makefile.in
@@ -0,0 +1,59 @@
+# vim:set ts=8 sw=8 sts=8 noet:
+# 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		= @DEPTH@
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+LIBRARY_NAME	= xpcom
+
+# The XPCOM glue uses realpath() on libxpcom.so to resolve any symlinks. We
+# want it to find dist/bin and not xpcom/stub so we copy instead of symlinking.
+NSDISTMODE = copy
+
+# Do not set EXPORT_LIBRARY as we do not want xpcom in the static libs list
+#EXPORT_LIBRARY = 1
+GRE_MODULE	= 1
+MOZILLA_INTERNAL_API = 1
+
+
+LOCAL_INCLUDES	= -I$(srcdir)/../build
+
+CPPSRCS		= nsXPComStub.cpp
+
+# If we have an import library, then copy that to the SDK.  Otherwise,
+# copy the shared library.
+ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
+SDK_LIBRARY = $(IMPORT_LIBRARY)
+else
+SDK_LIBRARY = $(SHARED_LIBRARY)
+endif
+
+
+FORCE_SHARED_LIB = 1
+
+EXTRA_DSO_LDOPTS = $(LIBS_DIR)
+
+ifeq (bundle,$(MOZ_FS_LAYOUT))
+EXTRA_DSO_LDOPTS += $(DIST)/bin/XUL
+else
+EXTRA_DSO_LIBS = xul
+endif
+
+EXTRA_DSO_LDOPTS +=				\
+	$(EXTRA_DSO_LIBS)			\
+	$(NSPR_LIBS)				\
+	$(MOZALLOC_LIB)				\
+	$(NULL)
+
+include $(topsrcdir)/config/rules.mk
+
+libs:: $(FINAL_TARGET)/dependentlibs.list
+
+$(FINAL_TARGET)/dependentlibs.list: 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))) > $@
new file mode 100644
--- /dev/null
+++ b/xpcom/stub/dependentlibs.py
@@ -0,0 +1,135 @@
+# 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/.
+
+'''Given a library, dependentlibs.py prints the list of libraries it depends
+upon that are in the same directory.
+'''
+
+from optparse import OptionParser
+import os
+import re
+import fnmatch
+import subprocess
+import sys
+from mozpack.executables import (
+    get_type,
+    ELF,
+    MACHO,
+)
+
+TOOLCHAIN_PREFIX = ''
+
+def dependentlibs_dumpbin(lib):
+    '''Returns the list of dependencies declared in the given DLL'''
+    try:
+        proc = subprocess.Popen(['dumpbin', '-dependents', lib], stdout = subprocess.PIPE)
+    except OSError:
+        # dumpbin is missing, probably mingw compilation. Try using objdump.
+        return dependentlibs_mingw_objdump(lib)
+    deps = []
+    for line in proc.stdout:
+        # Each line containing an imported library name starts with 4 spaces
+        match = re.match('    (\S+)', line)
+        if match:
+             deps.append(match.group(1))
+        elif len(deps):
+             # There may be several groups of library names, but only the
+             # first one is interesting. The second one is for delayload-ed
+             # libraries.
+             break
+    proc.wait()
+    return deps
+
+def dependentlibs_mingw_objdump(lib):
+    proc = subprocess.Popen(['objdump', '-x', lib], stdout = subprocess.PIPE)
+    deps = []
+    for line in proc.stdout:
+        match = re.match('\tDLL Name: (\S+)', line)
+        if match:
+            deps.append(match.group(1))
+    proc.wait()
+    return deps
+
+def dependentlibs_readelf(lib):
+    '''Returns the list of dependencies declared in the given ELF .so'''
+    proc = subprocess.Popen([TOOLCHAIN_PREFIX + 'readelf', '-d', lib], stdout = subprocess.PIPE)
+    deps = []
+    for line in proc.stdout:
+        # Each line has the following format:
+        #  tag (TYPE)          value
+        # Looking for NEEDED type entries
+        tmp = line.split(' ', 3)
+        if len(tmp) > 3 and tmp[2] == '(NEEDED)':
+            # NEEDED lines look like:
+            # 0x00000001 (NEEDED)             Shared library: [libname]
+            match = re.search('\[(.*)\]', tmp[3])
+            if match:
+                deps.append(match.group(1))
+    proc.wait()
+    return deps
+
+def dependentlibs_otool(lib):
+    '''Returns the list of dependencies declared in the given MACH-O dylib'''
+    proc = subprocess.Popen(['otool', '-l', lib], stdout = subprocess.PIPE)
+    deps= []
+    cmd = None
+    for line in proc.stdout:
+        # otool -l output contains many different things. The interesting data
+        # is under "Load command n" sections, with the content:
+        #           cmd LC_LOAD_DYLIB
+        #       cmdsize 56
+        #          name libname (offset 24)
+        tmp = line.split()
+        if len(tmp) < 2:
+            continue
+        if tmp[0] == 'cmd':
+            cmd = tmp[1]
+        elif cmd == 'LC_LOAD_DYLIB' and tmp[0] == 'name':
+            deps.append(re.sub('^@executable_path/','',tmp[1]))
+    proc.wait()
+    return deps
+
+def dependentlibs(lib, libpaths, func):
+    '''For a given library, returns the list of recursive dependencies that can
+    be found in the given list of paths'''
+    assert(libpaths)
+    assert(isinstance(libpaths, list))
+    deps = []
+    for dep in func(lib):
+        if dep in deps or os.path.isabs(dep):
+            continue
+        for dir in libpaths:
+            deppath = os.path.join(dir, dep)
+            if os.path.exists(deppath):
+                deps.extend([d for d in dependentlibs(deppath, libpaths, func) if not d in deps])
+                deps.append(dep)
+                break
+
+    return deps
+
+def main():
+    parser = OptionParser()
+    parser.add_option("-L", dest="libpaths", action="append", metavar="PATH", help="Add the given path to the library search path")
+    parser.add_option("-p", dest="toolchain_prefix", metavar="PREFIX", help="Use the given prefix to readelf")
+    (options, args) = parser.parse_args()
+    if options.toolchain_prefix:
+        global TOOLCHAIN_PREFIX
+        TOOLCHAIN_PREFIX = options.toolchain_prefix
+    lib = args[0]
+    binary_type = get_type(lib)
+    if binary_type == ELF:
+        func = dependentlibs_readelf
+    elif binary_type == MACHO:
+        func = dependentlibs_otool
+    else:
+        ext = os.path.splitext(lib)[1]
+        assert(ext == '.dll')
+        func = dependentlibs_dumpbin
+    if not options.libpaths:
+        options.libpaths = [os.path.dirname(lib)]
+
+    print '\n'.join(dependentlibs(lib, options.libpaths, func))
+
+if __name__ == '__main__':
+    main()
new file mode 100644
--- /dev/null
+++ b/xpcom/stub/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+MODULE = 'xpcom'
+
new file mode 100644
--- /dev/null
+++ b/xpcom/stub/nsXPComStub.cpp
@@ -0,0 +1,514 @@
+/* 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 "nsXPCOM.h"
+#include "nsXPCOMPrivate.h"
+#include "nsXPCOMStrings.h"
+#include "xptcall.h"
+
+#include <string.h>
+
+/**
+ * Private Method to register an exit routine.  This method
+ * used to allow you to setup a callback that will be called from 
+ * the NS_ShutdownXPCOM function after all services and 
+ * components have gone away. It was fatally flawed in that the component
+ * DLL could be released before the exit function was called; it is now a
+ * stub implementation that does nothing.
+ */
+XPCOM_API(nsresult)
+NS_RegisterXPCOMExitRoutine(XPCOMExitRoutine exitRoutine, uint32_t priority);
+
+XPCOM_API(nsresult)
+NS_UnregisterXPCOMExitRoutine(XPCOMExitRoutine exitRoutine);
+
+static const XPCOMFunctions kFrozenFunctions = {
+    XPCOM_GLUE_VERSION,
+    sizeof(XPCOMFunctions),
+    &NS_InitXPCOM2_P,
+    &NS_ShutdownXPCOM_P,
+    &NS_GetServiceManager_P,
+    &NS_GetComponentManager_P,
+    &NS_GetComponentRegistrar_P,
+    &NS_GetMemoryManager_P,
+    &NS_NewLocalFile_P,
+    &NS_NewNativeLocalFile_P,
+    &NS_RegisterXPCOMExitRoutine,
+    &NS_UnregisterXPCOMExitRoutine,
+
+    // these functions were added post 1.4
+    &NS_GetDebug_P,
+    &NS_GetTraceRefcnt_P,
+
+    // these functions were added post 1.6
+    &NS_StringContainerInit_P,
+    &NS_StringContainerFinish_P,
+    &NS_StringGetData_P,
+    &NS_StringSetData_P,
+    &NS_StringSetDataRange_P,
+    &NS_StringCopy_P,
+    &NS_CStringContainerInit_P,
+    &NS_CStringContainerFinish_P,
+    &NS_CStringGetData_P,
+    &NS_CStringSetData_P,
+    &NS_CStringSetDataRange_P,
+    &NS_CStringCopy_P,
+    &NS_CStringToUTF16_P,
+    &NS_UTF16ToCString_P,
+    &NS_StringCloneData_P,
+    &NS_CStringCloneData_P,
+
+    // these functions were added post 1.7 (post Firefox 1.0)
+    &NS_Alloc_P,
+    &NS_Realloc_P,
+    &NS_Free_P,
+    &NS_StringContainerInit2_P,
+    &NS_CStringContainerInit2_P,
+    &NS_StringGetMutableData_P,
+    &NS_CStringGetMutableData_P,
+    NULL,
+
+    // these functions were added post 1.8
+    &NS_DebugBreak_P,
+    &NS_LogInit_P,
+    &NS_LogTerm_P,
+    &NS_LogAddRef_P,
+    &NS_LogRelease_P,
+    &NS_LogCtor_P,
+    &NS_LogDtor_P,
+    &NS_LogCOMPtrAddRef_P,
+    &NS_LogCOMPtrRelease_P,
+    &NS_GetXPTCallStub_P,
+    &NS_DestroyXPTCallStub_P,
+    &NS_InvokeByIndex_P,
+    nullptr,
+    nullptr,
+    &NS_StringSetIsVoid_P,
+    &NS_StringGetIsVoid_P,
+    &NS_CStringSetIsVoid_P,
+    &NS_CStringGetIsVoid_P,
+
+    // these functions were added post 1.9
+    &NS_CycleCollectorSuspect2_P,
+    &NS_CycleCollectorForget2_P
+};
+
+EXPORT_XPCOM_API(nsresult)
+NS_GetFrozenFunctions(XPCOMFunctions *functions, const char* /* libraryPath */)
+{
+    if (!functions)
+        return NS_ERROR_OUT_OF_MEMORY;
+
+    if (functions->version != XPCOM_GLUE_VERSION)
+        return NS_ERROR_FAILURE;
+
+    uint32_t size = functions->size;
+    if (size > sizeof(XPCOMFunctions))
+        size = sizeof(XPCOMFunctions);
+
+    size -= offsetof(XPCOMFunctions, init);
+
+    memcpy(&functions->init, &kFrozenFunctions.init, size);
+
+    return NS_OK;
+}
+
+/*
+ * Stubs for nsXPCOM.h
+ */
+
+#undef NS_InitXPCOM2
+EXPORT_XPCOM_API(nsresult)
+NS_InitXPCOM2(nsIServiceManager **result,
+              nsIFile *binDirectory,
+              nsIDirectoryServiceProvider *dirProvider)
+{
+  return NS_InitXPCOM2_P(result, binDirectory, dirProvider);
+}
+
+#undef NS_ShutdownXPCOM
+EXPORT_XPCOM_API(nsresult)
+NS_ShutdownXPCOM(nsIServiceManager *svcMgr)
+{
+  return NS_ShutdownXPCOM_P(svcMgr);
+}
+
+#undef NS_GetServiceManager
+EXPORT_XPCOM_API(nsresult)
+NS_GetServiceManager(nsIServiceManager* *result)
+{
+  return NS_GetServiceManager_P(result);
+}
+
+#undef NS_GetComponentManager
+EXPORT_XPCOM_API(nsresult)
+NS_GetComponentManager(nsIComponentManager* *result)
+{
+  return NS_GetComponentManager_P(result);
+}
+
+#undef NS_GetComponentRegistrar
+EXPORT_XPCOM_API(nsresult)
+NS_GetComponentRegistrar(nsIComponentRegistrar** result)
+{
+  return NS_GetComponentRegistrar_P(result);
+}
+
+#undef NS_GetMemoryManager
+EXPORT_XPCOM_API(nsresult)
+NS_GetMemoryManager(nsIMemory* *result)
+{
+  return NS_GetMemoryManager_P(result);
+}
+
+#undef NS_NewLocalFile
+EXPORT_XPCOM_API(nsresult)
+NS_NewLocalFile(const nsAString &path,
+                bool followLinks,
+                nsIFile **result)
+{
+  return NS_NewLocalFile_P(path, followLinks, result);
+}
+
+#undef NS_NewNativeLocalFile
+EXPORT_XPCOM_API(nsresult)
+NS_NewNativeLocalFile(const nsACString &path,
+                      bool followLinks,
+                      nsIFile **result)
+{
+  return NS_NewNativeLocalFile_P(path, followLinks, result);
+}
+
+#undef NS_GetDebug
+EXPORT_XPCOM_API(nsresult)
+NS_GetDebug(nsIDebug **result)
+{
+  return NS_GetDebug_P(result);
+}
+
+#undef NS_GetTraceRefcnt
+EXPORT_XPCOM_API(nsresult)
+NS_GetTraceRefcnt(nsITraceRefcnt **result)
+{
+  return NS_GetTraceRefcnt_P(result);
+}
+
+#undef NS_Alloc
+EXPORT_XPCOM_API(void*)
+NS_Alloc(size_t size)
+{
+  return NS_Alloc_P(size);
+}
+
+#undef NS_Realloc
+EXPORT_XPCOM_API(void*)
+NS_Realloc(void* ptr, size_t size)
+{
+  return NS_Realloc_P(ptr, size);
+}
+
+#undef NS_Free
+EXPORT_XPCOM_API(void)
+NS_Free(void* ptr)
+{
+  NS_Free_P(ptr);
+}
+
+#undef NS_DebugBreak
+EXPORT_XPCOM_API(void)
+NS_DebugBreak(uint32_t aSeverity, const char *aStr, const char *aExpr,
+              const char *aFile, int32_t aLine)
+{
+  NS_DebugBreak_P(aSeverity, aStr, aExpr, aFile, aLine);
+}
+
+#undef NS_LogInit
+EXPORT_XPCOM_API(void)
+NS_LogInit()
+{
+  NS_LogInit_P();
+}
+
+#undef NS_LogTerm
+EXPORT_XPCOM_API(void)
+NS_LogTerm()
+{
+  NS_LogTerm_P();
+}
+
+#undef NS_LogAddRef
+EXPORT_XPCOM_API(void)
+NS_LogAddRef(void* aPtr, nsrefcnt aNewRefCnt,
+             const char *aTypeName, uint32_t aInstanceSize)
+{
+  NS_LogAddRef_P(aPtr, aNewRefCnt, aTypeName, aInstanceSize);
+}
+
+#undef NS_LogRelease
+EXPORT_XPCOM_API(void)
+NS_LogRelease(void* aPtr, nsrefcnt aNewRefCnt, const char *aTypeName)
+{
+  NS_LogRelease_P(aPtr, aNewRefCnt, aTypeName);
+}
+
+#undef NS_LogCtor
+EXPORT_XPCOM_API(void)
+NS_LogCtor(void *aPtr, const char *aTypeName, uint32_t aInstanceSize)
+{
+  NS_LogCtor_P(aPtr, aTypeName, aInstanceSize);
+}
+
+#undef NS_LogDtor
+EXPORT_XPCOM_API(void)
+NS_LogDtor(void *aPtr, const char *aTypeName, uint32_t aInstanceSize)
+{
+  NS_LogDtor_P(aPtr, aTypeName, aInstanceSize);
+}
+
+#undef NS_LogCOMPtrAddRef
+EXPORT_XPCOM_API(void)
+NS_LogCOMPtrAddRef(void *aCOMPtr, nsISupports* aObject)
+{
+  NS_LogCOMPtrAddRef_P(aCOMPtr, aObject);
+}
+
+#undef NS_LogCOMPtrRelease
+EXPORT_XPCOM_API(void)
+NS_LogCOMPtrRelease(void *aCOMPtr, nsISupports* aObject)
+{
+  NS_LogCOMPtrRelease_P(aCOMPtr, aObject);
+}
+
+#undef NS_GetXPTCallStub
+EXPORT_XPCOM_API(nsresult)
+NS_GetXPTCallStub(REFNSIID aIID, nsIXPTCProxy* aOuter,
+                  nsISomeInterface* *aStub)
+{
+  return NS_GetXPTCallStub_P(aIID, aOuter, aStub);
+}
+
+#undef NS_DestroyXPTCallStub
+EXPORT_XPCOM_API(void)
+NS_DestroyXPTCallStub(nsISomeInterface* aStub)
+{
+  NS_DestroyXPTCallStub_P(aStub);
+}
+
+#undef NS_InvokeByIndex
+EXPORT_XPCOM_API(nsresult)
+NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+                 uint32_t paramCount, nsXPTCVariant* params)
+{
+  return NS_InvokeByIndex_P(that, methodIndex, paramCount, params);
+}
+
+/*
+ * Stubs for nsXPCOMPrivate.h
+ */
+
+EXPORT_XPCOM_API(nsresult)
+NS_RegisterXPCOMExitRoutine(XPCOMExitRoutine exitRoutine, uint32_t priority)
+{
+  return NS_OK;
+}
+
+EXPORT_XPCOM_API(nsresult)
+NS_UnregisterXPCOMExitRoutine(XPCOMExitRoutine exitRoutine)
+{
+  return NS_OK;
+}
+
+/*
+ * Stubs for nsStringAPI.h
+ */
+
+#undef NS_StringContainerInit
+EXPORT_XPCOM_API(nsresult)
+NS_StringContainerInit(nsStringContainer &aStr)
+{
+  return NS_StringContainerInit_P(aStr);
+}
+
+#undef NS_StringContainerInit2
+EXPORT_XPCOM_API(nsresult)
+NS_StringContainerInit2(nsStringContainer &aStr,
+                        const PRUnichar   *aData,
+                        uint32_t           aDataLength,
+                        uint32_t           aFlags)
+{   
+  return NS_StringContainerInit2_P(aStr, aData, aDataLength, aFlags);
+}
+
+#undef NS_StringContainerFinish
+EXPORT_XPCOM_API(void)
+NS_StringContainerFinish(nsStringContainer &aStr)
+{
+  NS_StringContainerFinish_P(aStr);
+}
+
+#undef NS_StringGetData
+EXPORT_XPCOM_API(uint32_t)
+NS_StringGetData(const nsAString &aStr, const PRUnichar **aBuf, bool *aTerm)
+{
+  return NS_StringGetData_P(aStr, aBuf, aTerm);
+}
+
+#undef NS_StringGetMutableData
+EXPORT_XPCOM_API(uint32_t)
+NS_StringGetMutableData(nsAString &aStr, uint32_t aLen, PRUnichar **aBuf)
+{
+  return NS_StringGetMutableData_P(aStr, aLen, aBuf);
+}
+
+#undef NS_StringCloneData
+EXPORT_XPCOM_API(PRUnichar *)
+NS_StringCloneData(const nsAString &aStr)
+{
+  return NS_StringCloneData_P(aStr);
+}
+
+#undef NS_StringSetData
+EXPORT_XPCOM_API(nsresult)
+NS_StringSetData(nsAString &aStr, const PRUnichar *aBuf, uint32_t aCount)
+{
+  return NS_StringSetData_P(aStr, aBuf, aCount);
+}
+
+#undef NS_StringSetDataRange
+EXPORT_XPCOM_API(nsresult)
+NS_StringSetDataRange(nsAString &aStr, uint32_t aCutStart, uint32_t aCutLength,
+                      const PRUnichar *aBuf, uint32_t aCount)
+{
+  return NS_StringSetDataRange_P(aStr, aCutStart, aCutLength, aBuf, aCount);
+}
+
+#undef NS_StringCopy
+EXPORT_XPCOM_API(nsresult)
+NS_StringCopy(nsAString &aDest, const nsAString &aSrc)
+{
+  return NS_StringCopy_P(aDest, aSrc);
+}
+
+#undef NS_StringSetIsVoid
+EXPORT_XPCOM_API(void)
+NS_StringSetIsVoid(nsAString &aStr, const bool aIsVoid)
+{
+  NS_StringSetIsVoid_P(aStr, aIsVoid);
+}
+
+#undef NS_StringGetIsVoid
+EXPORT_XPCOM_API(bool)
+NS_StringGetIsVoid(const nsAString &aStr)
+{
+  return NS_StringGetIsVoid_P(aStr);
+}
+
+#undef NS_CStringContainerInit
+EXPORT_XPCOM_API(nsresult)
+NS_CStringContainerInit(nsCStringContainer &aStr)
+{
+  return NS_CStringContainerInit_P(aStr);
+}
+
+#undef NS_CStringContainerInit2
+EXPORT_XPCOM_API(nsresult)
+NS_CStringContainerInit2(nsCStringContainer &aStr,
+                         const char         *aData,
+                         uint32_t            aDataLength,
+                         uint32_t            aFlags)
+{   
+  return NS_CStringContainerInit2_P(aStr, aData, aDataLength, aFlags);
+}
+
+#undef NS_CStringContainerFinish
+EXPORT_XPCOM_API(void)
+NS_CStringContainerFinish(nsCStringContainer &aStr)
+{
+  NS_CStringContainerFinish_P(aStr);
+}
+
+#undef NS_CStringGetData
+EXPORT_XPCOM_API(uint32_t)
+NS_CStringGetData(const nsACString &aStr, const char **aBuf, bool *aTerm)
+{
+  return NS_CStringGetData_P(aStr, aBuf, aTerm);
+}
+
+#undef NS_CStringGetMutableData
+EXPORT_XPCOM_API(uint32_t)
+NS_CStringGetMutableData(nsACString &aStr, uint32_t aLen, char **aBuf)
+{
+  return NS_CStringGetMutableData_P(aStr, aLen, aBuf);
+}
+
+#undef NS_CStringCloneData
+EXPORT_XPCOM_API(char *)
+NS_CStringCloneData(const nsACString &aStr)
+{
+  return NS_CStringCloneData_P(aStr);
+}
+
+#undef NS_CStringSetData
+EXPORT_XPCOM_API(nsresult)
+NS_CStringSetData(nsACString &aStr, const char *aBuf, uint32_t aCount)
+{
+  return NS_CStringSetData_P(aStr, aBuf, aCount);
+}
+
+#undef NS_CStringSetDataRange
+EXPORT_XPCOM_API(nsresult)
+NS_CStringSetDataRange(nsACString &aStr, uint32_t aCutStart, uint32_t aCutLength,
+                       const char *aBuf, uint32_t aCount)
+{
+  return NS_CStringSetDataRange_P(aStr, aCutStart, aCutLength, aBuf, aCount);
+}
+
+#undef NS_CStringCopy
+EXPORT_XPCOM_API(nsresult)
+NS_CStringCopy(nsACString &aDest, const nsACString &aSrc)
+{
+  return NS_CStringCopy_P(aDest, aSrc);
+}
+
+#undef NS_CStringSetIsVoid
+EXPORT_XPCOM_API(void)
+NS_CStringSetIsVoid(nsACString &aStr, const bool aIsVoid)
+{
+  NS_CStringSetIsVoid_P(aStr, aIsVoid);
+}
+
+#undef NS_CStringGetIsVoid
+EXPORT_XPCOM_API(bool)
+NS_CStringGetIsVoid(const nsACString &aStr)
+{
+  return NS_CStringGetIsVoid_P(aStr);
+}
+
+#undef NS_CStringToUTF16
+EXPORT_XPCOM_API(nsresult)
+NS_CStringToUTF16(const nsACString &aSrc, nsCStringEncoding aSrcEncoding, nsAString &aDest)
+{
+  return NS_CStringToUTF16_P(aSrc, aSrcEncoding, aDest);
+}
+
+#undef NS_UTF16ToCString
+EXPORT_XPCOM_API(nsresult)
+NS_UTF16ToCString(const nsAString &aSrc, nsCStringEncoding aDestEncoding, nsACString &aDest)
+{
+  return NS_UTF16ToCString_P(aSrc, aDestEncoding, aDest);
+}
+
+#undef NS_CycleCollectorSuspect2
+EXPORT_XPCOM_API(nsPurpleBufferEntry*)
+NS_CycleCollectorSuspect2(void *obj, nsCycleCollectionParticipant *p)
+{
+  return NS_CycleCollectorSuspect2_P(obj, p);
+}
+
+#undef NS_CycleCollectorForget2
+EXPORT_XPCOM_API(bool)
+NS_CycleCollectorForget2(nsPurpleBufferEntry* e)
+{
+  return NS_CycleCollectorForget2_P(e);
+}