VirtualBox

Changeset 3888

Show
Ignore:
Timestamp:
07/26/07 18:26:39 (1 year ago)
Author:
vboxsync
Message:

Solaris.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Config.kmk

    r3837 r3888  
    467467ifndef DONT_USE_YASM 
    468468 VBOX_ASTOOL    = YASM 
    469  VBOX_LDR_FMT_2_YASM_DBGINFO.elf   = -g dwarf2 
     469 ifeq ($(BUILD_PLATFORM),solaris) 
     470   # solaris yasm bug: crashes with dwarf2 debug info. 
     471   # yasm 0.6.0, 0.6.99.HEAD, compiled with both suncc as well as gcc 
     472   VBOX_LDR_FMT_2_YASM_DBGINFO.elf   = 
     473 else 
     474   VBOX_LDR_FMT_2_YASM_DBGINFO.elf   = -g dwarf2 
     475 endif 
    470476 VBOX_LDR_FMT_2_YASM_DBGINFO.lx    = -g stabs 
    471477 VBOX_LDR_FMT_2_YASM_DBGINFO.macho = 
     
    494500 else ifeq ($(BUILD_TARGET),darwin) 
    495501  VBOX_GCC_TOOL := GXX4MACHO 
     502 else ifeq ($(BUILD_TARGET),solaris) 
     503  VBOX_GCC_TOOL := GXX3 
    496504 else 
    497505  VBOX_GCC_TOOL := GXX3 
     
    815823# We need to export YASM for OSE, but since it was converted to .zip we need to 
    816824# allow for the location used by the zip to be properly cleaned up first. 
    817 ifeq ($(filter-out win.x86 linux.x86, $(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)),) 
     825ifeq ($(filter-out win.x86 linux.x86 solaris.x86, $(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)),) 
    818826 PATH_TOOL_YASM ?= $(PATH_DEVTOOLS_BLD)/bin 
    819827endif 
     
    14341442TEMPLATE_VBOXR0DRV_LIBS                = kmodc++ kmod cc_kext cpp_kext $(VBOX_GCC_LIBGCC) 
    14351443endif 
     1444 
     1445ifeq ($(BUILD_TARGET),solaris) 
     1446# x86 Solaris: 
     1447## The location of the solaris kernel headers. 
     1448VBOX_SOLARIS_SRC ?= /usr/include/sys 
     1449## The Solaris /usr/include. 
     1450VBOX_SOLARIS_SYS_INCS ?= /usr/include 
     1451 
     1452TEMPLATE_VBOXR0DRV_TOOL                = $(VBOX_GCC_TOOL) 
     1453TEMPLATE_VBOXR0DRV_DEFS                = _KERNEL _STRICT_STDC IN_RING0 IN_RT_R0 
     1454TEMPLATE_VBOXR0DRV_INCS                = \ 
     1455        $(VBOX_SOLARIS_SRC) \ 
     1456        $(VBOX_SOLARIS_SYS_INCS) 
     1457TEMPLATE_VBOXR0DRV_SYSSUFF             = .o 
     1458TEMPLATE_VBOXR0DRV_LDFLAGS             = -r 
     1459# exclude -Wall because of solaris headers' #pragma ident warnings that gcc refuses to supress!! 
     1460TEMPLATE_VBOXR0DRV_CFLAGS              = -Wno-trigraphs -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \ 
     1461        -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs\ 
     1462        -O2 -ffreestanding -nodefaultlibs -fno-strict-aliasing -fno-common -std=c99 
     1463## *************************** SOLARISTODO  ****************** 
     1464endif   # solaris 
    14361465 
    14371466ifeq ($(BUILD_TARGET),freebsd) 
     
    15941623TEMPLATE_VBOXR3EXE_LIBS                = pthread 
    15951624 else ifeq ($(BUILD_TARGET),solaris) 
    1596 $(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!) 
    15971625TEMPLATE_VBOXR3EXE_TOOL                = GXX3PLAIN 
    15981626TEMPLATE_VBOXR3EXE_LIBS                = rt 
     
    16131641TEMPLATE_VBOXR3_DEFS.l4     = $(TEMPLATE_VBOXR3EXE_DEFS.l4) __PIC__ 
    16141642TEMPLATE_VBOXR3_DEFS.darwin = $(TEMPLATE_VBOXR3EXE_DEFS.darwin) PIC 
    1615 ifeq ($(BUILD_TARGET_ARCH),amd64
     1643ifeq ($(filter-out solaris.x86 %.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),
    16161644 ifneq ($(BUILD_TARGET),win) 
    16171645  TEMPLATE_VBOXR3_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) PIC 
     
    18141842TEMPLATE_VBOXMAINEXE_INCS               += $(VBOX_PATH_MACOSX_SDK_INCS) 
    18151843 else ifeq ($(BUILD_TARGET),solaris) 
    1816 $(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!) 
    18171844TEMPLATE_VBOXMAINEXE_TOOL                = GXX3PLAIN 
    18181845TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME) rt 
     
    21132140TEMPLATE_VBOXBLDPROG_LIBS                = 
    21142141 else ifeq ($(BUILD_PLATFORM),solaris) 
    2115 $(warning Warning: VBOX Build: Target $(BUILD_PLATFORM) is not officially supported!) 
    21162142TEMPLATE_VBOXBLDPROG_TOOL                = GXX3PLAIN 
    21172143TEMPLATE_VBOXBLDPROG_LIBS                = rt 
  • trunk/include/iprt/spinlock.h

    r3637 r3888  
    6262#  define RTSPINLOCKTMP_INITIALIZER { 0 } 
    6363 
    64 # elif defined(RT_OS_OS2) || defined(RT_OS_FREEBSD) 
     64# elif defined(RT_OS_OS2) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) 
    6565    /** The saved [R|E]FLAGS. (dummy) */ 
    6666    RTUINTREG       uFlags; 
  • trunk/include/iprt/string.h

    r3637 r3888  
    3838# include <string.h> 
    3939# undef strdup 
     40#elif defined(RT_OS_SOLARIS) && defined(_KERNEL) 
     41  /* 
     42   * Same case as with FreeBSD kernel: 
     43   * The string.h stuff clashes with sys/systm.h 
     44   * ffs = find first set bit. 
     45   */ 
     46# define ffs ffs_string_h 
     47# include <string.h> 
     48# undef ffs 
    4049#else 
    4150# include <string.h> 
  • trunk/src/VBox/Devices/Makefile.kmk

    r3765 r3888  
    442442endif 
    443443 
     444ifeq ($(BUILD_TARGET),solaris) 
     445Drivers_SOURCES      := $(filter-out \ 
     446        Storage/DrvHost% \ 
     447        , $(Drivers_SOURCES)) 
     448Drivers_SOURCES.os2   = 
     449endif 
     450 
    444451Drivers_SOURCES.win   = \ 
    445452        Network/DrvTAPWin32.cpp \ 
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r3621 r3888  
    3737SYSMODS.win     += VBoxDrv 
    3838SYSMODS.os2     += VBoxDrv 
     39SYSMODS.solaris += vboxdrv 
    3940endif 
    4041 
     
    245246 
    246247 
     248# 
     249# vboxdrv.o - The Solaris Kernel Module. 
     250# 
     251ifeq ($(BUILD_TARGET),solaris) 
     252vboxdrv_TEMPLATE      = VBOXR0DRV 
     253vboxdrv_DEFS          = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE 
     254vboxdrv_INCS         := $(PATH_SUB_CURRENT) 
     255vboxdrv_LIBS          = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) 
     256vboxdrv_SOURCES       = \ 
     257        $(BUILD_TARGET)/SUPDrv-$(BUILD_TARGET).c 
     258#       SUPDRVShared.c 
     259endif # solaris 
     260 
     261 
    247262include $(PATH_KBUILD)/subfooter.kmk 
    248263 
  • trunk/src/VBox/HostDrivers/Support/SUPDRV.h

    r3672 r3888  
    9696#   include <iprt/string.h> 
    9797 
     98#elif defined(RT_OS_SOLARIS) 
     99#   include <iprt/string.h> 
     100 
    98101#else 
    99102#   error "unsupported OS." 
     
    176179 
    177180/* No log API in OS/2 only COM port. */ 
     181# define OSDBGPRINT(a) printf a 
     182 
     183 
     184/* 
     185 * Solaris 
     186 */ 
     187#elif defined(RT_OS_SOLARIS) 
    178188# define OSDBGPRINT(a) printf a 
    179189 
     
    577587    uint16_t                    Alignment; /**< Alignment */ 
    578588#endif 
    579 #if defined(RT_OS_DARWIN) || defined(RT_OS_OS2) 
     589#if defined(RT_OS_DARWIN) || defined(RT_OS_OS2) || defined(RT_OS_SOLARIS) 
    580590    /** Pointer to the next session with the same hash. */ 
    581591    PSUPDRVSESSION              pNextHash; 
  • trunk/src/VBox/Runtime/Makefile.kmk

    r3707 r3888  
    396396        timesup.cpp \ 
    397397 
     398RuntimeR3_SOURCES.solaris = \ 
     399        generic/RTDirQueryInfo-generic.cpp \ 
     400        generic/RTDirSetTimes-generic.cpp \ 
     401        generic/RTFileMove-generic.cpp \ 
     402        generic/RTLogWriteDebugger-generic.cpp \ 
     403        generic/RTTimerCreate-generic.cpp \ 
     404        generic/pathhost-generic.cpp \ 
     405        generic/sched-generic.cpp \ 
     406        generic/uuid-generic.cpp \ 
     407        r3/solaris/alloc-solaris.cpp \ 
     408        r3/posix/dir-posix.cpp \ 
     409        r3/posix/env-posix.cpp \ 
     410        r3/posix/fileio-posix.cpp \ 
     411        r3/posix/filelock-posix.cpp \ 
     412        r3/posix/fs-posix.cpp \ 
     413        r3/posix/ldrNative-posix.cpp \ 
     414        r3/posix/path-posix.cpp \ 
     415        r3/posix/process-posix.cpp \ 
     416        r3/posix/rand-posix.cpp \ 
     417        r3/posix/sems-posix.cpp \ 
     418        r3/posix/system-posix.cpp \ 
     419        r3/posix/thread-posix.cpp \ 
     420        r3/posix/time-posix.cpp \ 
     421        r3/posix/timelocal-posix.cpp \ 
     422        r3/posix/timer-posix.cpp \ 
     423        r3/posix/RTTimeNow-posix.cpp \ 
     424        generic/utf16locale-generic.cpp \ 
     425        r3/posix/utf8-posix.cpp \ 
     426        timesup.cpp \ 
     427 
     428 
    398429## PORTME: Porters add their selection of platform specific files for Ring-3 here. 
    399430 
     
    729760        r0drv/linux/thread-r0drv-linux.c 
    730761 
     762# SOLARISTODO - Todo for Solaris 
     763# RuntimeR0Drv_SOURCES.solaris = \ 
     764#       generic/RTAssertDoBreakpoint-generic.cpp \ 
     765#       r0drv/solaris/alloc-r0drv-solaris.c \ 
     766#       r0drv/solaris/initterm-r0drv-solaris.c 
     767 
     768 
    731769RuntimeR0Drv_SOURCES.win = \ 
    732770        generic/RTAssertDoBreakpoint-generic.cpp \ 
  • trunk/src/VBox/Runtime/VBox/log-vbox.cpp

    r3672 r3888  
    126126# if defined(RT_OS_WINDOWS) 
    127127#  include <Windows.h> 
    128 # elif defined(RT_OS_LINUX) 
     128# elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) 
    129129#  include <unistd.h> 
    130130# elif defined(RT_OS_L4) 
     
    300300        RTLogLoggerEx(pLogger, 0, ~0U, "Commandline: %ls\n", GetCommandLineW()); 
    301301 
    302 # elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) 
     302# elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) 
    303303#  ifdef RT_OS_LINUX 
    304304        FILE *pFile = fopen("/proc/self/cmdline", "r"); 
    305 #  else         
     305#  elif defined(RT_OS_SOLARIS) 
     306        /* 
     307         * I have a sinking feeling solaris' psinfo format could be different from cmdline 
     308         * Must check at run time and possible just ignore this section for solaris 
     309         */ 
     310        char szArgFileBuf[80]; 
     311        RTStrPrintf(szArgFileBuf, sizeof(szArgFileBuf), "/proc/%ld/psinfo", (long)getpid()); 
     312        FILE* pFile = fopen(szArgFileBuf, "r"); 
     313#  else /* RT_OS_FREEBSD: */ 
    306314        FILE *pFile = fopen("/proc/curproc/cmdline", "r"); 
    307 #  endif         
     315#  endif 
    308316        if (pFile) 
    309317        { 
  • trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp

    r2981 r3888  
    4444#include "internal/path.h" 
    4545 
     46#if !defined(RT_OS_SOLARIS) 
     47# define HAVE_DIRENT_D_TYPE 1 
     48#endif 
     49 
    4650 
    4751RTDECL(bool) RTDirExists(const char *pszPath) 
     
    225229 
    226230 
     231#ifdef HAVE_DIRENT_D_TYPE 
    227232/** 
    228233 * Converts the d_type field to IPRT directory entry type. 
     
    249254    } 
    250255} 
     256#endif /*HAVE_DIRENT_D_TYPE */ 
    251257 
    252258 
     
    295301             */ 
    296302            pDirEntry->INodeId = pDir->Data.d_ino; /* may need #ifdefing later */ 
     303#ifdef HAVE_DIRENT_D_TYPE 
    297304            pDirEntry->enmType = rtDirType(pDir->Data.d_type); 
     305#else 
     306            pDirEntry->enmType = RTDIRENTRYTYPE_UNKNOWN; 
     307#endif 
    298308            pDirEntry->cbName  = (uint16_t)cchName; 
    299309            Assert(pDirEntry->cbName == cchName); 
     
    416426            if (RT_FAILURE(rc)) 
    417427            { 
     428#ifdef HAVE_DIRENT_D_TYPE 
    418429                rtDirSetDummyInfo(&pDirEntry->Info, rtDirType(pDir->Data.d_type)); 
     430#else 
     431                rtDirSetDummyInfo(&pDirEntry->Info, RTDIRENTRYTYPE_UNKNOWN); 
     432#endif 
    419433                rc = VWRN_NO_DIRENT_INFO; 
    420434            } 
  • trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp

    r3672 r3888  
    4545/* This is currently ifdef'ed out in the relevant L4 header file */ 
    4646/* Same as `utimes', but takes an open file descriptor instead of a name.  */ 
    47 extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW; 
     47extern int futimes(int __fd, __const struct timeval __tvp[2]) __THROW; 
     48#endif 
     49 
     50#ifdef RT_OS_SOLARIS 
     51# define futimes(filedes, timeval)   futimesat(filedes, NULL, timeval) 
     52# define RTTIME_INCL_TIMEVAL /** @todo remove me after fixing iprt/time.h */ 
    4853#endif 
    4954 
  • trunk/src/VBox/Runtime/r3/posix/path-posix.cpp

    r3672 r3888  
    3434#ifdef RT_OS_DARWIN 
    3535# include <mach-o/dyld.h> 
     36#endif 
     37#ifdef RT_OS_SOLARIS 
     38# define RTTIME_INCL_TIMEVAL /** @todo remove me after fixing iprt/time.h */ 
    3639#endif 
    3740 
     
    408411         */ 
    409412/** @todo use RTProcGetExecutableName() */ 
    410 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) 
     413#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) 
    411414# ifdef RT_OS_LINUX 
    412415        int cchLink = readlink("/proc/self/exe", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1); 
    413 # else 
     416# elif defined(RT_OS_SOLARIS) 
     417        pid_t curProcId = getpid(); 
     418        char szFileBuf[PATH_MAX + 1]; 
     419        sprintf(szFileBuf, "/proc/%ld/path/a.out", curProcId); 
     420        int cchLink = readlink(szFileBuf, &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1); 
     421# else /* RT_OS_FREEBSD: */ 
    414422        int cchLink = readlink("/proc/curproc/file", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1); 
    415423# endif 
  • trunk/src/VBox/Runtime/r3/posix/process-posix.cpp

    r3672 r3888  
    237237     * files and code for this. 
    238238     */ 
    239 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) 
     239#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) 
    240240# ifdef RT_OS_LINUX 
    241241    int cchLink = readlink("/proc/self/exe", pszExecName, cchExecName - 1); 
    242 # else     
     242# elif defined(RT_OS_SOLARIS) 
     243    char szFileBuf[80]; 
     244    RTStrPrintf(szFileBuf, sizeof(szFileBuf), "/proc/%ld/path/a.out", (long)getpid()); 
     245    int cchLink = readlink(szFileBuf, pszExecName, cchExecName - 1); 
     246# else 
    243247    int cchLink = readlink("/proc/curproc/file", pszExecName, cchExecName - 1); 
    244 # endif     
     248# endif 
    245249    if (cchLink > 0 && (size_t)cchLink <= cchExecName - 1) 
    246250    { 
  • trunk/src/VBox/Runtime/r3/posix/sems-posix.cpp

    r3672 r3888  
    3838#endif 
    3939 
     40#ifdef RT_OS_SOLARIS 
     41# include <sched.h> 
     42# define pthread_yield() sched_yield() 
     43#endif 
     44 
    4045 
    4146/******************************************************************************* 
  • trunk/src/VBox/Runtime/r3/posix/system-posix.cpp

    r2981 r3888  
    2828 
    2929#include <unistd.h> 
    30 #include <sys/sysctl.h> 
     30#if !defined(RT_OS_SOLARIS) 
     31# include <sys/sysctl.h> 
     32#endif 
    3133 
    3234 
     
    3941{ 
    4042    int cCpus; NOREF(cCpus); 
    41      
     43 
    4244    /* 
    4345     * The sysconf way (linux and others). 
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r3672 r3888  
    2828#include <pthread.h> 
    2929#include <signal.h> 
     30#if defined(RT_OS_SOLARIS) 
     31# include <sched.h> 
     32#endif 
    3033 
    3134#include <iprt/thread.h> 
     
    205208#elif defined(RT_OS_FREEBSD) /* void pthread_yield */ 
    206209        pthread_yield(); 
     210#elif defined(RT_OS_SOLARIS) 
     211        sched_yield(); 
    207212#else 
    208213        if (!pthread_yield()) 
     
    238243#ifdef RT_OS_DARWIN 
    239244    pthread_yield_np(); 
     245#elif defined(RT_OS_SOLARIS) 
     246    sched_yield(); 
    240247#else 
    241248    pthread_yield(); 
  • trunk/src/VBox/VMM/Makefile.kmk

    r3857 r3888  
    164164VBoxVMM_LDFLAGS.linux = -Wl,--no-undefined 
    165165VBoxVMM_LDFLAGS.darwin = -install_name @executable_path/VBoxVMM.dylib 
     166VBoxVMM_LDFLAGS.solaris = -mimpure-text 
    166167 
    167168 
  • trunk/src/recompiler/InnoTek/config-host.h

    r3726 r3888  
    3636/*#  define CONFIG_BSD*/ 
    3737# elif defined(RT_OS_SOLARIS) 
    38 /*#  define CONFIG_SUN*/ 
     38#  define CONFIG_SOLARIS 
    3939# elif !defined(IPRT_NO_CRT) 
    4040#  define HAVE_BYTESWAP_H 1 
  • trunk/src/recompiler/InnoTek/crt/stdio.h

    r2981 r3888  
    2020 */ 
    2121 
    22 #ifndef __stdio_h__ 
    23 #define __stdio_h__ 
     22#ifndef ___InnoTek_stdio_h 
     23#define ___InnoTek_stdio_h 
    2424 
    2525#ifndef LOG_GROUP 
     
    4141 
    4242typedef struct FILE FILE; 
     43 
     44#if defined(RT_OS_SOLARIS) 
     45/** @todo check solaris' floatingpoint.h as to why we do this */ 
     46# define _FILEDEFED 
     47#endif 
    4348 
    4449DECLINLINE(int) fprintf(FILE *ignored, const char *pszFormat, ...) 
  • trunk/src/recompiler/Makefile.kmk

    r3533 r3888  
    6868ifeq ($(BUILD_TARGET_ARCH),amd64) 
    6969 REM_USE_NOCRT := 1 
     70endif 
     71 
     72# 
     73# We need to figure out the solaris version. 
     74# 
     75ifeq ($(BUILD_TARGET),solaris) 
     76 ifndef HOST_SOLARIS 
     77  # fixme- HOST_SOLARIS := $(shell uname ... | $(SED_EXT)... ) 
     78 endif 
    7079endif 
    7180 
     
    197206 $(REM_MOD)_LDFLAGS.os2     = -Zomf 
    198207 $(REM_MOD)_LDFLAGS.debug   = -g 
     208 $(REM_MOD)_LDFLAGS.solaris = -mimpure-text 
     209 $(REM_MOD)_DEFS.solaris    += HOST_SOLARIS=$(HOST_SOLARIS) 
    199210 ifeq ($(BUILD_TARGET_ARCH),amd64) 
    200211  $(REM_MOD)_LIBS           = $(FILE_TOOL_GCC3_LIBGCC) 
  • trunk/src/recompiler/fpu/softfloat-native.c

    r1 r3888  
    77{ 
    88    STATUS(float_rounding_mode) = val; 
    9 #if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10
     9#if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && (HOST_SOLARIS < 10 || HOST_SOLARIS == 11)
    1010    fpsetround(val); 
    1111#elif defined(__arm__) 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy