Index: include/iprt/alloca.h
===================================================================
--- include/iprt/alloca.h	(revision 37995)
+++ include/iprt/alloca.h	(working copy)
@@ -37,14 +37,18 @@
  * When we're in kernel territory it starts getting a bit more
  * interesting of course...
  */
-#if defined(IN_RING0) \
- && (defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD))
+#ifdef IN_RING0
+# if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
 /* ASSUMES GNU C */
-# define alloca(cb) __builtin_alloca(cb)
+#  define alloca(cb) __builtin_alloca(cb)
+# else
+#  include <stdlib.h>
+#  include <malloc.h>
+# endif
 
 #else
 # include <stdlib.h>
-# if !defined(RT_OS_DARWIN) && !defined(RT_OS_FREEBSD)
+# if !defined(RT_OS_DARWIN) && !defined(RT_OS_FREEBSD) && !defined(__GLIBC__)
 #  include <malloc.h>
 # endif
 # ifdef RT_OS_SOLARIS
Index: src/VBox/Devices/Serial/DrvHostSerial.cpp
===================================================================
--- src/VBox/Devices/Serial/DrvHostSerial.cpp	(revision 37995)
+++ src/VBox/Devices/Serial/DrvHostSerial.cpp	(working copy)
@@ -33,7 +33,7 @@
 #include <iprt/semaphore.h>
 #include <iprt/uuid.h>
 
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
 # include <errno.h>
 # ifdef RT_OS_SOLARIS
 #  include <sys/termios.h>
@@ -101,7 +101,7 @@
     /** the device path */
     char                        *pszDevicePath;
 
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
     /** the device handle */
     RTFILE                      hDeviceFile;
 # ifdef RT_OS_DARWIN
@@ -194,7 +194,7 @@
 static DECLCALLBACK(int) drvHostSerialSetParameters(PPDMICHARCONNECTOR pInterface, unsigned Bps, char chParity, unsigned cDataBits, unsigned cStopBits)
 {
     PDRVHOSTSERIAL pThis = PDMICHAR_2_DRVHOSTSERIAL(pInterface);
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
     struct termios *termiosSetup;
     int baud_rate;
 #elif defined(RT_OS_WINDOWS)
@@ -483,7 +483,7 @@
         {
             /* copy the send queue so we get a linear buffer with the maximal size. */
             uint8_t ch = pThis->u8SendByte;
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
 
             size_t cbWritten;
             rc = RTFileWrite(pThis->hDeviceFile, &ch, 1, &cbWritten);
@@ -680,7 +680,7 @@
             }
             cbRemaining = cbRead;
 
-#elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
 
             size_t cbRead;
             struct pollfd aFDs[2];
@@ -845,7 +845,7 @@
 static DECLCALLBACK(int) drvHostSerialWakeupRecvThread(PPDMDRVINS pDrvIns, PPDMTHREAD /*pThread*/)
 {
     PDRVHOSTSERIAL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTSERIAL);
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
     size_t cbIgnored;
     return RTPipeWrite(pThis->hWakeupPipeW, "", 1, &cbIgnored);
 
@@ -858,7 +858,7 @@
 #endif
 }
 
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
 /* -=-=-=-=- Monitor thread -=-=-=-=- */
 
 /**
@@ -978,7 +978,7 @@
 {
     PDRVHOSTSERIAL pThis = PDMICHAR_2_DRVHOSTSERIAL(pInterface);
 
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
     int modemStateSet = 0;
     int modemStateClear = 0;
 
@@ -1026,7 +1026,7 @@
 {
     PDRVHOSTSERIAL pThis = PDMICHAR_2_DRVHOSTSERIAL(pInterface);
 
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
     if (fBreak)
         ioctl(RTFileToNative(pThis->hDeviceFile), TIOCSBRK);
     else
@@ -1063,7 +1063,7 @@
     pThis->SendSem = NIL_RTSEMEVENT;
 
     int rc;
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
 
     rc = RTPipeClose(pThis->hWakeupPipeW); AssertRC(rc);
     pThis->hWakeupPipeW = NIL_RTPIPE;
@@ -1113,7 +1113,7 @@
     /*
      * Init basic data members and interfaces.
      */
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
     pThis->hDeviceFile  = NIL_RTFILE;
 # ifdef RT_OS_DARWIN
     pThis->hDeviceFileR = NIL_RTFILE;
@@ -1209,7 +1209,7 @@
         {
             case VERR_ACCESS_DENIED:
                 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
                                            N_("Cannot open host device '%s' for read/write access. Check the permissions "
                                               "of that device ('/bin/ls -l %s'): Most probably you need to be member "
                                               "of the device group. Make sure that you logout/login after changing "
@@ -1227,7 +1227,7 @@
     }
 
     /* Set to non blocking I/O */
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
 
     fcntl(RTFileToNative(pThis->hDeviceFile), F_SETFL, O_NONBLOCK);
 # ifdef RT_OS_DARWIN
@@ -1272,7 +1272,7 @@
     if (RT_FAILURE(rc))
         return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostSerial#%d cannot create send thread"), pDrvIns->iInstance);
 
-#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
     /* Linux & darwin needs a separate thread which monitors the status lines. */
 # ifndef RT_OS_LINUX
     ioctl(RTFileToNative(pThis->hDeviceFile), TIOCMGET, &pThis->fStatusLines);
Index: src/VBox/Runtime/r3/posix/utf8-posix.cpp
===================================================================
--- src/VBox/Runtime/r3/posix/utf8-posix.cpp	(revision 37995)
+++ src/VBox/Runtime/r3/posix/utf8-posix.cpp	(working copy)
@@ -168,7 +168,7 @@
             size_t      cbOutLeft = cbOutput2;
             const void *pvInputLeft = pvInput;
             void       *pvOutputLeft = pvOutput;
-#if defined(RT_OS_LINUX) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
+#if defined(RT_OS_LINUX) || defined(__GLIBC__) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
             if (iconv(hIconv, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
 #else
             if (iconv(hIconv, (const char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
@@ -294,7 +294,7 @@
             size_t      cbOutLeft = cbOutput2;
             const void *pvInputLeft = pvInput;
             void       *pvOutputLeft = pvOutput;
-#if defined(RT_OS_LINUX) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
+#if defined(RT_OS_LINUX) || defined(__GLIBC__) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
             if (iconv(icHandle, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
 #else
             if (iconv(icHandle, (const char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
Index: src/VBox/Main/xml/Settings.cpp
===================================================================
--- src/VBox/Main/xml/Settings.cpp	(revision 37995)
+++ src/VBox/Main/xml/Settings.cpp	(working copy)
@@ -109,6 +109,8 @@
 #   define VBOX_XML_PLATFORM     "solaris"
 #elif defined (RT_OS_WINDOWS)
 #   define VBOX_XML_PLATFORM     "windows"
+#elif defined (__GLIBC__)
+#   define VBOX_XML_PLATFORM     "gnu"
 #else
 #   error Unsupported platform!
 #endif
Index: src/VBox/Main/cbinding/VBoxXPCOMCGlue.c
===================================================================
--- src/VBox/Main/cbinding/VBoxXPCOMCGlue.c	(revision 37995)
+++ src/VBox/Main/cbinding/VBoxXPCOMCGlue.c	(working copy)
@@ -44,7 +44,7 @@
 /*******************************************************************************
 *   Defined Constants And Macros                                               *
 *******************************************************************************/
-#if defined(__linux__) || defined(__linux_gnu__) || defined(__sun__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__linux_gnu__) || defined(__GLIBC__) || defined(__sun__) || defined(__FreeBSD__)
 # define DYNLIB_NAME    "VBoxXPCOMC.so"
 #elif defined(__APPLE__)
 # define DYNLIB_NAME    "VBoxXPCOMC.dylib"
@@ -189,7 +189,7 @@
      * Try the known standard locations.
      */
     g_szVBoxErrMsg[0] = '\0';
-#if defined(__gnu__linux__) || defined(__linux__)
+#if defined(__gnu__linux__) || defined(__linux__) || defined(__GLIBC__)
     if (tryLoadOne("/opt/VirtualBox", 1) == 0)
         return 0;
     if (tryLoadOne("/usr/lib/virtualbox", 1) == 0)
Index: src/VBox/GuestHost/OpenGL/include/cr_dll.h
===================================================================
--- src/VBox/GuestHost/OpenGL/include/cr_dll.h	(revision 37995)
+++ src/VBox/GuestHost/OpenGL/include/cr_dll.h	(working copy)
@@ -22,7 +22,7 @@
 	char *name;
 #if defined(WINDOWS)
 	HINSTANCE hinstLib;
-#elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)
+#elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)
 	void *hinstLib;
 #elif defined(DARWIN)
 	void *hinstLib;		/* void to avoid including the headers */
Index: src/VBox/GuestHost/OpenGL/include/cr_timer.h
===================================================================
--- src/VBox/GuestHost/OpenGL/include/cr_timer.h	(revision 37995)
+++ src/VBox/GuestHost/OpenGL/include/cr_timer.h	(working copy)
@@ -35,7 +35,7 @@
 #elif defined(WINDOWS)
 	LARGE_INTEGER performance_counter, performance_frequency;
 	double one_over_frequency;
-#elif defined( Linux ) || defined( FreeBSD ) || defined(DARWIN) || defined(AIX) || defined (SunOS) || defined(OSF1)
+#elif defined( Linux ) || defined(__GLIBC__) || defined( FreeBSD ) || defined(DARWIN) || defined(AIX) || defined (SunOS) || defined(OSF1)
 	struct timeval timeofday;
 #endif
 } CRTimer;
Index: src/VBox/GuestHost/OpenGL/spu_loader/glloader.py
===================================================================
--- src/VBox/GuestHost/OpenGL/spu_loader/glloader.py	(revision 37995)
+++ src/VBox/GuestHost/OpenGL/spu_loader/glloader.py	(working copy)
@@ -34,7 +34,7 @@
 #  define SYSTEM_AGL "AGL"
 # endif
 #include <string.h> /* VBOX */
-#elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)
+#elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)
 #include <string.h>
 #if defined(AIX)
 #define SYSTEM_GL "libGL.o"
@@ -143,7 +143,7 @@
 		 * version if it exists; otherwise, we'll use /usr/lib.
 		 */
 		/*crStrcpy(system_path, "/usr/lib");*/
-#if defined(__linux__) && defined(__amd64__)
+#if (defined(__linux__) || defined(__GLIBC_)) && defined(__amd64__)
 		/*if (sizeof(void *) == 8 && FileExists("/usr/lib64", lib)) {
 			crStrcat(system_path, "64");
 		}*/
@@ -154,7 +154,7 @@
 		}*/
 #endif
 	}
-#if !defined(__linux__) && !defined(SunOS) && !defined(__FreeBSD__)
+#if !defined(__linux__) && !defined(__GLIBC__) && !defined(SunOS) && !defined(__FreeBSD__)
 	crStrcat( system_path, "/" );
 #endif
 #if !defined(CR_NO_GL_SYSTEM_PATH)
Index: src/VBox/GuestHost/OpenGL/util/dll.c
===================================================================
--- src/VBox/GuestHost/OpenGL/util/dll.c	(revision 37995)
+++ src/VBox/GuestHost/OpenGL/util/dll.c	(working copy)
@@ -14,7 +14,7 @@
 #include <string.h>
 #endif
 
-#if defined(IRIX) || defined(IRIX64) || defined(Linux) || defined(FreeBSD) || defined(AIX) || defined(DARWIN) || defined(SunOS) || defined(OSF1)
+#if defined(IRIX) || defined(IRIX64) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(DARWIN) || defined(SunOS) || defined(OSF1)
 #include <dlfcn.h>
 #endif
 
@@ -203,7 +203,7 @@
 		dll_err = "Unknown DLL type";
 		break;
 	};
-#elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)
+#elif defined(IRIX) || defined(IRIX64) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)
 	if (resolveGlobal)
 		dll->hinstLib = dlopen( dllname, RTLD_LAZY | RTLD_GLOBAL );
 	else
@@ -256,7 +256,7 @@
 
 	return (CRDLLFunc) NSAddressOfSymbol( nssym );
 
-#elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)
+#elif defined(IRIX) || defined(IRIX64) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)
 	return (CRDLLFunc) dlsym( dll->hinstLib, symname );
 #else
 #error CR DLL ARCHITETECTURE
@@ -300,7 +300,7 @@
 		NSUnLinkModule( (NSModule) dll->hinstLib, 0L );
 		break;
 	}
-#elif defined(IRIX) || defined(IRIX64) || defined(Linux) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)
+#elif defined(IRIX) || defined(IRIX64) || defined(__GLIBC__) || defined(FreeBSD) || defined(AIX) || defined(SunOS) || defined(OSF1)
 	/*
 	 * Unloading Nvidia's libGL will crash VirtualBox later during shutdown.
 	 * Therefore we will skip unloading it. It will be unloaded later anway
Index: src/VBox/GuestHost/OpenGL/util/timer.c
===================================================================
--- src/VBox/GuestHost/OpenGL/util/timer.c	(revision 37995)
+++ src/VBox/GuestHost/OpenGL/util/timer.c	(working copy)
@@ -35,7 +35,7 @@
 #elif defined( WINDOWS )
 	QueryPerformanceCounter( &t->performance_counter );
 	return ((double) t->performance_counter.QuadPart)*t->one_over_frequency;
-#elif defined( Linux ) || defined( FreeBSD ) || defined(DARWIN) || defined(AIX) || defined(SunOS) || defined(OSF1)
+#elif defined( Linux ) || defined(__GLIBC__) || defined( FreeBSD ) || defined(DARWIN) || defined(AIX) || defined(SunOS) || defined(OSF1)
 	gettimeofday( &t->timeofday, NULL );	
 	return t->timeofday.tv_sec + t->timeofday.tv_usec / 1000000.0;
 #else
Index: src/VBox/Additions/x11/VBoxClient/seamless-guest.h
===================================================================
--- src/VBox/Additions/x11/VBoxClient/seamless-guest.h	(revision 37995)
+++ src/VBox/Additions/x11/VBoxClient/seamless-guest.h	(working copy)
@@ -43,7 +43,7 @@
     };
 };
 
-#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(__GLIBC__)
 # include "seamless-x11.h"  /* for VBoxGuestSeamlessGuestImpl */
 #else
 # error Port me
