Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 6535)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 6536)
@@ -34,5 +34,5 @@
  #
  ifeq ($(BUILD_TARGET),linux)
-  LIBRARIES  = RuntimeLnx32GuestR0 RuntimeLnx32GuestR3
+  LIBRARIES  = RuntimeLnx32GuestR0 RuntimeLnx32GuestR3 RuntimeLnx32GuestR3Shared
  else ifeq ($(BUILD_TARGET),os2)
   LIBRARIES  = RuntimeOS2GuestR0 RuntimeOS2GuestR3 #RuntimeOS2Warp3GuestR0
@@ -40,5 +40,5 @@
   LIBRARIES = RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
  else
-  LIBRARIES = RuntimeGuestR0 RuntimeGuestR3
+  LIBRARIES = RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Shared
   #LIBRARIES.os2 = RuntimeOS2Warp3GuestR0
   #LIBRARIES.win = RuntimeW32NT4GuestR0
@@ -49,5 +49,5 @@
  #
 else ifdef VBOX_ADDITIONS_LINUX_ONLY
- LIBRARIES  = RuntimeLnx32GuestR0 RuntimeLnx32GuestR3
+ LIBRARIES  = RuntimeLnx32GuestR0 RuntimeLnx32GuestR3 RuntimeLnx32GuestR3Shared
 else ifdef VBOX_ADDITIONS_WIN32_ONLY
  LIBRARIES = RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
@@ -68,5 +68,5 @@
    endif
    ifdef VBOX_WITH_LINUX_ADDITIONS
-    LIBRARIES += RuntimeLnx32GuestR3
+    LIBRARIES += RuntimeLnx32GuestR3 RuntimeLnx32GuestR3Shared
     ifdef VBOX_WITH_LINUX_ADDITIONS_32BIT_R0
      LIBRARIES += RuntimeLnx32GuestR0
@@ -78,5 +78,5 @@
    endif
   else
-   LIBRARIES += RuntimeGuestR0 RuntimeGuestR3
+   LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Shared
   endif
   #LIBRARIES.os2 = RuntimeOS2Warp3GuestR0
@@ -456,4 +456,40 @@
 ## PORTME: Porters add their selection of platform specific files for Ring-3 here.
 
+RuntimeR3Shared_SOURCES       = \
+	common/err/errmsg.cpp \
+	common/err/RTErrConvertFromErrno.cpp \
+	common/log/logformat.cpp \
+	common/misc/assert.cpp \
+	common/misc/sanity-c.c \
+	common/misc/sanity-cpp.cpp \
+	common/string/strformat.cpp \
+	common/string/strformatrt.cpp \
+	common/string/string.cpp \
+	common/string/strprintf.cpp \
+	common/string/unidata.cpp \
+	common/string/utf-8.cpp \
+	common/string/utf-16.cpp \
+	generic/pathhost-generic.cpp \
+	generic/RTAssertDoBreakpoint-generic.cpp \
+	r3/alloc.cpp \
+	r3/fileio.cpp \
+	r3/fs.cpp \
+	r3/path.cpp
+
+# VBox specific stuff.
+RuntimeR3Shared_SOURCES += \
+	VBox/strformat-vbox.cpp
+
+RuntimeR3Shared_SOURCES.linux = \
+	r3/posix/fileio-posix.cpp \
+	r3/posix/path-posix.cpp \
+	r3/posix/utf8-posix.cpp
+
+
+RuntimeR3Shared_SOURCES.solaris = \
+	r3/posix/fileio-posix.cpp \
+	r3/posix/path-posix.cpp \
+	r3/posix/utf8-posix.cpp
+
 
 #
@@ -523,4 +559,24 @@
 
 #
+# RuntimeGuestR3Shared - Guest Additions Runtime (static) which does not require initialisation.
+#
+RuntimeGuestR3Shared_TEMPLATE             := VBOXGUESTR3LIB
+RuntimeGuestR3Shared_SDKS.win             := $(RuntimeR3_SDKS.win)
+RuntimeGuestR3Shared_DEFS                 := $(filter-out RTCRITSECT_STRICT, $(RuntimeR3_DEFS)) \
+                                             VBOX_SHARED_RUNTIME
+RuntimeGuestR3Shared_DEFS.$(BUILD_TARGET) := $(RuntimeR3_DEFS.$(BUILD_TARGET))
+RuntimeGuestR3Shared_INCS                 := $(RuntimeR3_INCS)
+RuntimeGuestR3Shared_INCS.$(BUILD_TARGET) := $(RuntimeR3_INCS.$(BUILD_TARGET))
+RuntimeGuestR3Shared_SOURCES              := $(filter-out \
+	generic/RTLogWriteUser-generic.cpp \
+	, $(RuntimeR3Shared_SOURCES))
+RuntimeGuestR3Shared_SOURCES              += \
+	VBox/logbackdoor.cpp \
+	VBox/logbackdoor-redirect.cpp
+RuntimeGuestR3Shared_SOURCES.$(BUILD_TARGET) := $(RuntimeR3Shared_SOURCES.$(BUILD_TARGET))
+RuntimeGuestR3Shared_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) := $(RuntimeR3Shared_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
+
+
+#
 # RuntimeW32GuestR3 - Win32 guest program runtime.
 #
@@ -546,4 +602,21 @@
 RuntimeLnx32GuestR3_SOURCES   += VBox/logbackdoor.cpp
 RuntimeLnx32GuestR3_INCS       = $(RuntimeR3_INCS.linux)    $(RuntimeR3_INCS)
+
+
+#
+# RuntimeLnx32GuestR3Shared - 32-bit Linux guest program runtime which does not require
+# initialisation.
+#
+RuntimeLnx32GuestR3Shared_TEMPLATE   = VBOXLNX32GUESTR3LIB
+RuntimeLnx32GuestR3Shared_DEFS       = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 \
+                                       LDR_WITH_PE RT_WITH_VBOX VBOX_SHARED_RUNTIME
+ifdef IPRT_WITH_KSTUFF
+ RuntimeLnx32GuestR3Shared_DEFS     += LDR_WITH_KLDR
+endif
+RuntimeLnx32GuestR3Shared_SOURCES    = $(RuntimeR3Shared_SOURCES.linux) $(RuntimeR3Shared_SOURCES)
+RuntimeLnx32GuestR3Shared_SOURCES   += \
+        VBox/logbackdoor.cpp \
+        VBox/logbackdoor-redirect.cpp
+RuntimeLnx32GuestR3Shared_INCS       = $(RuntimeR3_INCS.linux)    $(RuntimeR3_INCS)
 
 
Index: /trunk/src/VBox/Runtime/VBox/strformat-vbox.cpp
===================================================================
--- /trunk/src/VBox/Runtime/VBox/strformat-vbox.cpp	(revision 6535)
+++ /trunk/src/VBox/Runtime/VBox/strformat-vbox.cpp	(revision 6536)
@@ -139,5 +139,5 @@
              */
             case 't':
-#ifdef IN_RING3                         /* we don't want this anywhere else yet. */
+#if defined(IN_RING3) && !defined(VBOX_SHARED_RUNTIME)  /* we don't want this anywhere else yet. */
                 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%#x\n", RTThreadSelf());
 #else /* !IN_RING3 */
Index: /trunk/src/VBox/Runtime/r3/path.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/path.cpp	(revision 6535)
+++ /trunk/src/VBox/Runtime/r3/path.cpp	(revision 6536)
@@ -553,4 +553,5 @@
 }
 
+#ifndef VBOX_SHARED_RUNTIME
 
 /**
@@ -685,2 +686,4 @@
 #endif
 }
+
+#endif /* !VBOX_SHARED_RUNTIME */
Index: /trunk/src/VBox/Runtime/r3/posix/path-posix.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/posix/path-posix.cpp	(revision 6535)
+++ /trunk/src/VBox/Runtime/r3/posix/path-posix.cpp	(revision 6536)
@@ -401,4 +401,6 @@
 
 
+#ifndef VBOX_SHARED_RUNTIME
+
 RTDECL(int) RTPathProgram(char *pszPath, unsigned cchPath)
 {
@@ -487,4 +489,5 @@
 }
 
+#endif /* !VBOX_SHARED_RUNTIME */
 
 #ifndef RT_OS_L4
