add_definitions(-DPLATFORM_UNIX=1)
if(CLR_CMAKE_PLATFORM_LINUX)
- add_definitions(-D__LINUX__=1)
if(CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64)
message("Detected Linux x86_64")
add_definitions(-DLINUX64)
const char* managedAssemblyPath,
unsigned int* exitCode);
-#if defined(__LINUX__)
+#if defined(__linux__)
#define symlinkEntrypointExecutable "/proc/self/exe"
#elif !defined(__APPLE__)
#define symlinkEntrypointExecutable "/proc/curproc/exe"
// Get path to the executable for the current process using
// platform specific means.
-#if defined(__LINUX__)
+#if defined(__linux__)
// On Linux, fetch the entry point EXE absolute path, inclusive of filename.
char exe[PATH_MAX];
ssize_t res = readlink(symlinkEntrypointExecutable, exe, PATH_MAX - 1);
#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0x4644
#elif defined(__FreeBSD__)
#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0xADC4
-#elif defined(__LINUX__)
+#elif defined(__linux__)
#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0x7B79
#elif defined(__NetBSD__)
#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0x1993
#define PAL_CS_NATIVE_DATA_SIZE 24
#elif defined(__hpux__) && (defined(__hppa__) || defined (__ia64__))
#define PAL_CS_NATIVE_DATA_SIZE 148
-#elif defined(__LINUX__) && defined(_ARM_)
+#elif defined(__linux__) && defined(_ARM_)
#define PAL_CS_NATIVE_DATA_SIZE 80
-#elif defined(__LINUX__) && defined(_ARM64_)
+#elif defined(__linux__) && defined(_ARM64_)
#define PAL_CS_NATIVE_DATA_SIZE 116
-#elif defined(__LINUX__) && defined(__x86_64__)
+#elif defined(__linux__) && defined(__x86_64__)
#define PAL_CS_NATIVE_DATA_SIZE 96
#elif defined(__NetBSD__) && defined(__amd64__)
#define PAL_CS_NATIVE_DATA_SIZE 96
#endif
#ifndef PAL_STDCPP_COMPAT
-#if defined(__APPLE_CC__) || defined(__LINUX__)
+#if defined(__APPLE_CC__) || defined(__linux__)
#ifdef BIT64
typedef unsigned long size_t;
typedef long ptrdiff_t;
#else // PAL_STDCPP_COMPAT
typedef wchar_t WCHAR;
-#if defined(__LINUX__)
+#if defined(__linux__)
#ifdef BIT64
typedef long int intptr_t;
typedef unsigned long int uintptr_t;
)
endif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
-if(CMAKE_SYSTEM_NAME STREQUAL Linux)
- add_definitions(-D__LINUX__=1)
-endif(CMAKE_SYSTEM_NAME STREQUAL Linux)
-
add_definitions(-DPLATFORM_UNIX=1)
add_definitions(-DLP64COMPATIBLE=1)
add_definitions(-DFEATURE_PAL=1)
#include <exception>
#if HAVE_LIBUNWIND_H
-#ifndef __LINUX__
+#ifndef __linux__
#define UNW_LOCAL_ONLY
-#endif // !__LINUX__
+#endif // !__linux__
#include <libunwind.h>
-#ifdef __LINUX__
+#ifdef __linux__
#ifdef HAVE_LIBUNWIND_PTRACE
#include <libunwind-ptrace.h>
#endif // HAVE_LIBUNWIND_PTRACE
-#endif // __LINUX__
+#endif // __linux__
#endif // HAVE_LIBUNWIND_H
{
#if HAVE_MACH_EXCEPTIONS
return pthrCurrent->EnableMachExceptions();
-#elif __LINUX__ || defined(__FreeBSD__) || defined(__NetBSD__)
+#elif __linux__ || defined(__FreeBSD__) || defined(__NetBSD__)
// TODO: This needs to be implemented. Cannot put an ASSERT here
// because it will make other parts of PAL fail.
return NO_ERROR;
return pthrCurrent->DisableMachExceptions();
// TODO: This needs to be implemented. Cannot put an ASSERT here
// because it will make other parts of PAL fail.
-#elif __LINUX__ || defined(__FreeBSD__) || defined(__NetBSD__)
+#elif __linux__ || defined(__FreeBSD__) || defined(__NetBSD__)
return NO_ERROR;
#else // HAVE_MACH_EXCEPTIONS
#error not yet implemented
linux we need to use gettid().
--*/
-#if defined(__LINUX__)
+#if defined(__linux__)
#define THREADSilentGetCurrentThreadId() (SIZE_T)syscall(SYS_gettid)
#elif defined(__APPLE__)
inline SIZE_T THREADSilentGetCurrentThreadId() {
PALAPI
PAL_IsDebuggerPresent()
{
-#if defined(__LINUX__)
+#if defined(__linux__)
BOOL debugger_present = FALSE;
char buf[2048];
#include <sys/types.h>
#include <sys/mman.h>
-#if defined(__LINUX__)
+#if defined(__linux__)
#include <gnu/lib-names.h>
#endif
#ifdef VM_MAXUSER_ADDRESS
lpSystemInfo->lpMaximumApplicationAddress = (PVOID) VM_MAXUSER_ADDRESS;
-#elif defined(__sun__) || defined(_AIX) || defined(__hppa__) || ( defined (_IA64_) && defined (_HPUX_) ) || defined(__LINUX__)
+#elif defined(__sun__) || defined(_AIX) || defined(__hppa__) || ( defined (_IA64_) && defined (_HPUX_) ) || defined(__linux__)
lpSystemInfo->lpMaximumApplicationAddress = (PVOID) -1;
#elif defined(USERLIMIT)
lpSystemInfo->lpMaximumApplicationAddress = (PVOID) USERLIMIT;
{
size_t cacheSize = 0;
-#if HAVE_SYSCONF && defined(__LINUX__)
+#if HAVE_SYSCONF && defined(__linux__)
cacheSize = max(cacheSize, sysconf(_SC_LEVEL1_DCACHE_SIZE));
cacheSize = max(cacheSize, sysconf(_SC_LEVEL1_ICACHE_SIZE));
cacheSize = max(cacheSize, sysconf(_SC_LEVEL2_CACHE_SIZE));
Initialization logic for LTTng tracepoint providers.
--*/
-#if defined(__LINUX__)
+#if defined(__linux__)
static const char tpLibName[] = "libcoreclrtraceptprovider.so";
# Compile options
add_definitions(-DPLATFORM_UNIX=1)
-add_definitions(-D__LINUX__=1)
add_definitions(-DLP64COMPATIBLE=1)
add_definitions(-DFEATURE_PAL=1)
add_definitions(-DCORECLR=1)