Index: trunk/src/libs/xpcom18a4/Makefile.kmk
===================================================================
--- trunk/src/libs/xpcom18a4/Makefile.kmk	(revision 4836)
+++ trunk/src/libs/xpcom18a4/Makefile.kmk	(revision 4837)
@@ -47,11 +47,13 @@
 TEMPLATE_XPCOM_DEFS.x86            = i386=1
 TEMPLATE_XPCOM_DEFS.amd64          = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY\(a\,b\)=__builtin_va_copy\(a\,b\)
-TEMPLATE_XPCOM_DEFS.darwin         = OSTYPE=\"Darwin8.8.1\" OSARCH=\"Darwin\" XP_UNIX=1 XP_MACOSX=1 TARGET_CARBON=1 HAVE_VISIBILITY_ATTRIBUTE=1
-TEMPLATE_XPCOM_DEFS.linux          = OSTYPE=\"Linux2.6\"    OSARCH=\"Linux\"  XP_UNIX=1 _GNU_SOURCE HAVE_VISIBILITY_ATTRIBUTE=1
+TEMPLATE_XPCOM_DEFS.darwin         = OSTYPE=\"Darwin8.8.1\" OSARCH=\"Darwin\" XP_UNIX=1 XP_MACOSX=1 TARGET_CARBON=1 HAVE_VISIBILITY_ATTRIBUTE=1 DARWIN=1
+TEMPLATE_XPCOM_DEFS.linux          = OSTYPE=\"Linux2.6\"    OSARCH=\"Linux\"  XP_UNIX=1 _GNU_SOURCE HAVE_VISIBILITY_ATTRIBUTE=1 ## @todo LINUX=1
 TEMPLATE_XPCOM_DEFS.l4             = OSTYPE=\"L4ENV\"       OSARCH=\"L4\"     XP_UNIX=1 L4ENV HAVE_VISIBILITY_ATTRIBUTE=1
-TEMPLATE_XPCOM_DEFS.os2            = OSTYPE=\"OS/2_4.5\"    OSARCH=\"OS/2\"   XP_OS2 XP_PC BSD_SELECT
+TEMPLATE_XPCOM_DEFS.os2            = OSTYPE=\"OS/2_4.5\"    OSARCH=\"OS/2\"   XP_OS2 XP_PC BSD_SELECT OS2=4
+TEMPLATE_XPCOM_DEFS.solaris        = OSTYPE=\"Solaris10\"   OSARCH=\"Solaris\" XP_UNIX=1 XP_SOLARIS=1 HAVE_LIBDL=1 HAVE_SENDFILEV=1 SOLARIS=1
 TEMPLATE_XPCOM_LDFLAGS.darwin      = $(VBOXR3NP_LDFLAGS.darwin) \
                                      -fshort-wchar -fno-rtti -fno-exceptions -fpascal-strings \
                                      -framework CoreServices -framework CoreFoundation -framework Foundation -framework AppKit -framework Carbon
+TEMPLATE_XPCOM_LDFLAGS.solaris     += -lsendfile
 ifeq ($(filter os2 win,$(BUILD_TARGET)),)
  TEMPLATE_XPCOM_CXXFLAGS          += -fPIC
@@ -125,4 +127,5 @@
 TEMPLATE_XPCOMEXE_LIBS.l4          = $(LIB_RUNTIME) $(VBOX_GCC_LIBGCC)
 TEMPLATE_XPCOMEXE_LDFLAGS.darwin   = -bind_at_load $(TEMPLATE_XPCOM_LDFLAGS.darwin)
+TEMPLATE_XPCOMEXE_LDFLAGS.solaris  = -mimpure-text ## @todo why?
 TEMPLATE_XPCOMEXE_LDFLAGS.l4       = $(L4_DIR)/lib/x86_586/crt0.o \
     -T$(L4_DIR)/lib/x86_586/main_dyn.ld -nostdlib -lgcc \
@@ -788,4 +791,19 @@
 #	nsprpub/pr/src/md/os2/os2vacpp.asm
 
+VBox-xpcom-nspr_SOURCES.solaris  = \
+	nsprpub/pr/src/md/unix/unix.c \
+	nsprpub/pr/src/md/unix/unix_errors.c \
+	nsprpub/pr/src/md/unix/uxproces.c \
+	nsprpub/pr/src/md/unix/uxrng.c \
+	nsprpub/pr/src/md/unix/uxshm.c \
+	nsprpub/pr/src/md/unix/uxwrap.c \
+	nsprpub/pr/src/md/unix/solaris.c \
+	nsprpub/pr/src/pthreads/ptio.c \
+	nsprpub/pr/src/pthreads/ptsynch.c \
+	nsprpub/pr/src/pthreads/ptthread.c \
+	nsprpub/pr/src/pthreads/ptmisc.c
+VBox-xpcom-nspr_SOURCES.solaris.x86 = nsprpub/pr/src/md/unix/os_SunOS_x86.s
+VBox-xpcom-nspr_SOURCES.solaris.amd64 = nsprpub/pr/src/md/unix/os_SunOS_amd64.s
+
 
 nsprpub/pr/src/prvrsion.c_DEPS = $(PATH_VBox-xpcom-nspr)/_pr_bld.h
@@ -972,4 +990,7 @@
 #                                         xpcom/reflect/xptcall/src/md/unix/xptcstubs_vacpp.asm
 
+VBox-xpcom-xptcall_SOURCES.solaris.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_solaris.cpp \
+                                         xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_solaris.cpp
+
 VBox-xpcom-proxy_TEMPLATE = XPCOM
 VBox-xpcom-proxy_NOINST   = 1
@@ -1017,5 +1038,7 @@
 	darwindeps.cpp
 VBoxXPCOM_SOURCES.os2 = \
-	os2deps.cpp
+	vboxdeps.cpp
+VBoxXPCOM_SOURCES.solaris = \
+	vboxdeps.cpp
 VBoxXPCOM_LIBS = \
 	$(TARGET_VBox-xpcom-typelib) \
@@ -1050,4 +1073,5 @@
 #VBoxXPCOM_LDFLAGS = -Wl,--whole-archive $(VBoxXPCOM_LIBS) -Wl,--no-whole-archive $(LIB_RUNTIME)
 VBoxXPCOM_LDFLAGS.darwin = -install_name @executable_path/VBoxXPCOM.dylib
+VBoxXPCOM_LDFLAGS.solaris += -Wl,-M solarislink.map
 
 ifdef VBOX_IPC_RELEASE_LOG
@@ -1138,4 +1162,6 @@
 VBoxXPCOMIPCC_SOURCES.os2 = \
 	ipc/ipcd/client/src/ipcConnectionUnix.cpp
+VBoxXPCOMIPCC_SOURCES.solaris = \
+    ipc/ipcd/client/src/ipcConnectionUnix.cpp
 VBoxXPCOMIPCC_LDFLAGS.darwin = -install_name @executable_path/components/VBoxXPCOMIPCC.dylib
 VBoxXPCOMIPCC_LIBS = \
@@ -1165,4 +1191,6 @@
 VBoxXPCOMIPCD_SOURCES.os2 = \
 	ipc/ipcd/daemon/src/ipcdUnix.cpp
+VBoxXPCOMIPCD_SOURCES.solaris = \
+    ipc/ipcd/daemon/src/ipcdUnix.cpp
 
 #
Index: trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_solaris.h
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_solaris.h	(revision 4836)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_solaris.h	(revision 4837)
@@ -70,4 +70,13 @@
 #define NEED_STRFTIME_LOCK
 
+#if defined(_LARGEFILE64_SOURCE)                                    /* vbox */
+#define _PR_HAVE_OFF64_T                                            /* vbox */
+#elif defined(_LP64) || _FILE_OFFSET_BITS == 32                     /* vbox */
+#define _PR_HAVE_LARGE_OFF_T                                        /* vbox */
+#else                                                               /* vbox */
+#define _PR_NO_LARGE_FILES                                          /* vbox */
+#endif                                                              /* vbox */
+
+
 /*
  * Intel x86 has atomic instructions.
@@ -116,4 +125,7 @@
 #define _PR_INET6_PROBE
 #define _PR_ACCEPT_INHERIT_NONBLOCK
+#if !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__)  /* vbox */
+#define _PR_INET6                                                   /* vbox */
+#endif                                                              /* vbox */
 #ifdef _PR_INET6
 #define _PR_HAVE_INET_NTOP
Index: trunk/src/libs/xpcom18a4/os2deps.cpp
===================================================================
--- trunk/src/libs/xpcom18a4/os2deps.cpp	(revision 4836)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/* The usual story: drag stuff from the libraries into the link. */
-
-
-#include <plstr.h>
-#include <prio.h>
-#include <nsDeque.h>
-#include <nsHashSets.h>
-#include <nsIPipe.h>
-
-uintptr_t deps[] =
-{
-    (uintptr_t)PL_strncpy,
-    (uintptr_t)PL_strchr,
-    (uintptr_t)PL_HashString,
-    (uintptr_t)PR_DestroyPollableEvent,
-    (uintptr_t)NS_NewPipe2,
-    0
-};
-
-void foodep(void)
-{
-    nsVoidHashSetSuper *a = new nsVoidHashSetSuper();
-    a->Init(123);
-    nsDeque *b = new nsDeque((nsDequeFunctor*)0);
-}
-
Index: trunk/src/libs/xpcom18a4/solarislink.map
===================================================================
--- trunk/src/libs/xpcom18a4/solarislink.map	(revision 4837)
+++ trunk/src/libs/xpcom18a4/solarislink.map	(revision 4837)
@@ -0,0 +1,43 @@
+# Solaris VBoxXPCom linker map file for GCC 3.4.3 (csl-sol210-3_4-20050802)
+#
+# Solaris gcc(3.4.3) does not honour visibility attributes (hidden,default...)
+# For this reason we use this linker map file to tell the Solaris linker to make
+# the attribute hidden symbols as STV_HIDDEN (using local) and attribute default
+# symbols as STV_DEFAULT (using global).
+#
+# The mapfile will be passed to the Solaris linker using -Wl,-M <thismapfile>
+#
+# Name mangled symbols were deciphered using using:
+#      elfdump VBoxXPCom.so | grep <unmanged-symbol-name>
+#
+# Specifying mangled names may not be the best way, but as long as the
+# compiler's mangling scheme does not change, it will work.
+# For gcc(4.x.+) we WILL need to change this mapfile to suit its new mangling.
+#
+{
+local:
+XPTC_InvokeByIndex;
+XPT_ArenaStrDup;
+_Z19NS_NewUnicharBufferPP16nsIUnicharBufferP11nsISupportsj;
+_ZN8nsString4TrimEPKciii;
+_ZN15nsPrintfCStringC1EPKcz;
+_ZN14nsXPTCStubBase9Sentinel4Ev;
+_ZN14nsXPTCStubBase9Sentinel3Ev;
+_ZN14nsXPTCStubBase9Sentinel2Ev;
+_ZN14nsXPTCStubBase9Sentinel1Ev;
+_ZN14nsXPTCStubBase9Sentinel0Ev;
+_ZTI14nsXPTCStubBase;
+
+global:
+_ZN18nsComponentManager14CreateInstanceEPKcP11nsISupportsRK4nsIDPPv;
+_ZN18nsComponentManager14CreateInstanceERK4nsIDP11nsISupportsS2_PPv;
+_ZN20nsPromiseFlatCString4InitERK10nsACString;
+_Z22PL_DHashStubEnumRemoveP12PLDHashTableP15PLDHashEntryHdrjPv;
+_ZNK4nsID8ToStringEv;
+XPT_NewXDRState;
+XPT_DestroyArena;
+XPT_NewArena;
+XPT_DestroyXDRState;
+XPT_DoHeader;
+XPT_ArenaMalloc;
+};
Index: trunk/src/libs/xpcom18a4/vboxdeps.cpp
===================================================================
--- trunk/src/libs/xpcom18a4/vboxdeps.cpp	(revision 4837)
+++ trunk/src/libs/xpcom18a4/vboxdeps.cpp	(revision 4837)
@@ -0,0 +1,27 @@
+/* The usual story: drag stuff from the libraries into the link. */
+
+
+#include <plstr.h>
+#include <prio.h>
+#include <nsDeque.h>
+#include <nsHashSets.h>
+#include <nsIPipe.h>
+
+uintptr_t deps[] =
+{
+    (uintptr_t)PL_strncpy,
+    (uintptr_t)PL_strchr,
+    (uintptr_t)PL_strncpyz,
+    (uintptr_t)PL_HashString,
+    (uintptr_t)PR_DestroyPollableEvent,
+    (uintptr_t)NS_NewPipe2,
+    0
+};
+
+void foodep(void)
+{
+    nsVoidHashSetSuper *a = new nsVoidHashSetSuper();
+    a->Init(123);
+    nsDeque *b = new nsDeque((nsDequeFunctor*)0);
+}
+
Index: trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_util.c
===================================================================
--- trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_util.c	(revision 4836)
+++ trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_util.c	(revision 4837)
@@ -55,5 +55,5 @@
 }
 
-#ifdef XP_MAC
+#if defined(XP_MAC) || defined(XP_SOLARIS)
 static char *strdup(const char *c)
 {
