VirtualBox

Ignore:
Timestamp:
Mar 29, 2010 7:56:26 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59459
Message:

iprt: applying sparc patch (selectively).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/log/log.cpp

    r25899 r27800  
    293293            RTLogGroupSettings(pLogger, pszGroupSettings);
    294294
     295#if defined(RT_ARCH_X86) && (!defined(LOG_USE_C99) || !defined(RT_WITHOUT_EXEC_ALLOC))
    295296        /*
    296297         * Emit wrapper code.
    297298         */
    298 #if defined(LOG_USE_C99) && defined(RT_WITHOUT_EXEC_ALLOC)
    299         pu8Code = (uint8_t *)RTMemAlloc(64);
    300 #else
    301299        pu8Code = (uint8_t *)RTMemExecAlloc(64);
    302 #endif
    303300        if (pu8Code)
    304301        {
    305302            pLogger->pfnLogger = *(PFNRTLOGGER*)&pu8Code;
    306 #if defined(RT_ARCH_AMD64) || (defined(LOG_USE_C99) && defined(RT_WITHOUT_EXEC_ALLOC))
    307             /* this wrapper will not be used on AMD64, we will be requiring C99 compilers there. */
    308             *pu8Code++ = 0xcc;
    309 #else
    310303            *pu8Code++ = 0x68;          /* push imm32 */
    311304            *(void **)pu8Code = pLogger;
     
    319312            *pu8Code++ = 0x04;
    320313            *pu8Code++ = 0xc3;          /* ret near */
    321 #endif
    322314            AssertMsg((uintptr_t)pu8Code - (uintptr_t)pLogger->pfnLogger <= 64,
    323315                      ("Wrapper assembly is too big! %d bytes\n", (uintptr_t)pu8Code - (uintptr_t)pLogger->pfnLogger));
    324 
    325 
     316            rc = VINF_SUCCESS;
     317        }
     318        else
     319        {
     320# ifdef RT_OS_LINUX
     321            if (pszErrorMsg) /* Most probably SELinux causing trouble since the larger RTMemAlloc succeeded. */
     322                RTStrPrintf(pszErrorMsg, cchErrorMsg, "mmap(PROT_WRITE | PROT_EXEC) failed -- SELinux?");
     323# endif
     324            rc = VERR_NO_MEMORY;
     325        }
     326        if (RT_SUCCESS(rc))
     327#endif /* X86 wrapper code*/
     328        {
    326329#ifdef IN_RING3 /* files and env.vars. are only accessible when in R3 at the present time. */
    327330            /*
     
    435438            RTMemExecFree(*(void **)&pLogger->pfnLogger);
    436439#endif
    437         }
    438         else
    439         {
    440 #ifdef RT_OS_LINUX
    441             /*
    442              * RTMemAlloc() succeeded but RTMemExecAlloc() failed -- most probably an SELinux problem.
    443              */
    444             if (pszErrorMsg)
    445                 RTStrPrintf(pszErrorMsg, cchErrorMsg, "mmap(PROT_WRITE | PROT_EXEC) failed -- SELinux?");
    446 #endif /* RT_OS_LINUX */
    447             rc = VERR_NO_MEMORY;
    448440        }
    449441        RTMemFree(pLogger);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette