diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fd75c3341ff..a06768f272ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,8 @@ project(CoreCLR) # Enable @rpath support for shared libraries. set(MACOSX_RPATH ON) +set(CLR_CMAKE_PLATFORM_LINUX_ALPINE 1) + if(CMAKE_VERSION VERSION_EQUAL 3.0 OR CMAKE_VERSION VERSION_GREATER 3.0) cmake_policy(SET CMP0042 NEW) endif() @@ -85,6 +87,13 @@ elseif(WIN32) endif() endif() +if(CLR_CMAKE_PLATFORM_LINUX_ALPINE) + set(CLR_CMAKE_ENABLE_TRACE 0) + add_compile_options(-fshort-wchar) +else() + set(CLR_CMAKE_ENABLE_TRACE 1) +endif() + if(WIN32) enable_language(ASM_MASM) else() @@ -217,9 +226,9 @@ elseif (CLR_CMAKE_PLATFORM_UNIX) endif(WIN32) -if (WIN32 OR CLR_CMAKE_PLATFORM_LINUX) +if ((WIN32 OR CLR_CMAKE_PLATFORM_LINUX) AND CLR_CMAKE_ENABLE_TRACE) add_definitions(-DFEATURE_EVENT_TRACE=1) -endif (WIN32 OR CLR_CMAKE_PLATFORM_LINUX) +endif ((WIN32 OR CLR_CMAKE_PLATFORM_LINUX) AND CLR_CMAKE_ENABLE_TRACE) if (CLR_CMAKE_PLATFORM_LINUX) add_definitions(-DFEATURE_EVENTSOURCE_XPLAT=1) @@ -705,4 +714,4 @@ else () endif () endif (IS_64BIT_BUILD EQUAL 1) -add_subdirectory(src) +#add_subdirectory(src) diff --git a/src/ToolBox/SOS/lldbplugin/CMakeLists.txt b/src/ToolBox/SOS/lldbplugin/CMakeLists.txt index 6eb30054caf6..c6c44134824e 100644 --- a/src/ToolBox/SOS/lldbplugin/CMakeLists.txt +++ b/src/ToolBox/SOS/lldbplugin/CMakeLists.txt @@ -17,6 +17,11 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64) return() endif() +if(CLR_CMAKE_PLATFORM_LINUX_ALPINE) + message(WARNING "lldb is not supported on Alpine Linux yet") + return() +endif() + set(ENABLE_LLDBPLUGIN ${CLR_CMAKE_PLATFORM_UNIX} CACHE BOOL "Enable building the SOS plugin for LLDB.") set(REQUIRE_LLDBPLUGIN ${CLR_CMAKE_PLATFORM_LINUX} CACHE BOOL "Require building the SOS plugin for LLDB.") diff --git a/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/dlls/mscoree/coreclr/CMakeLists.txt index 297a41143c9d..d4359b976ae5 100644 --- a/src/dlls/mscoree/coreclr/CMakeLists.txt +++ b/src/dlls/mscoree/coreclr/CMakeLists.txt @@ -114,12 +114,12 @@ else() ) endif(WIN32) -if(CLR_CMAKE_PLATFORM_LINUX) +if(CLR_CMAKE_PLATFORM_LINUX AND CLR_CMAKE_ENABLE_TRACE) list(APPEND CORECLR_LIBRARIES eventprovider ) -endif(CLR_CMAKE_PLATFORM_LINUX) +endif(CLR_CMAKE_PLATFORM_LINUX AND CLR_CMAKE_ENABLE_TRACE) target_link_libraries(coreclr ${CORECLR_LIBRARIES}) diff --git a/src/pal/CMakeLists.txt b/src/pal/CMakeLists.txt index 8753538e4eb6..2181b5c66b50 100644 --- a/src/pal/CMakeLists.txt +++ b/src/pal/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.8.12.2) project(COREPAL) +set(PAL_CMAKE_ENABLE_TRACE 0) + include_directories(${COREPAL_SOURCE_DIR}/inc) include_directories(${COREPAL_SOURCE_DIR}/src) include_directories(${COREPAL_SOURCE_DIR}/../inc) diff --git a/src/pal/src/CMakeLists.txt b/src/pal/src/CMakeLists.txt index ad5425b8df25..2787659a522c 100644 --- a/src/pal/src/CMakeLists.txt +++ b/src/pal/src/CMakeLists.txt @@ -225,6 +225,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux) unwind unwind-generic uuid + intl ) endif(CMAKE_SYSTEM_NAME STREQUAL Linux) @@ -254,9 +255,9 @@ endif(CMAKE_SYSTEM_NAME STREQUAL Darwin) add_subdirectory(examples) -if(CMAKE_SYSTEM_NAME STREQUAL Linux) +if((CMAKE_SYSTEM_NAME STREQUAL Linux) AND PAL_CMAKE_ENABLE_TRACE) add_subdirectory(eventprovider) -endif(CMAKE_SYSTEM_NAME STREQUAL Linux) +endif((CMAKE_SYSTEM_NAME STREQUAL Linux) AND PAL_CMAKE_ENABLE_TRACE) # Install the static PAL library for VS install (TARGETS coreclrpal DESTINATION lib) diff --git a/src/pal/src/configure.cmake b/src/pal/src/configure.cmake index 333f0094c59e..2131713d02c7 100644 --- a/src/pal/src/configure.cmake +++ b/src/pal/src/configure.cmake @@ -933,7 +933,7 @@ else() # Anything else is Linux unset(HAVE_LIBUNWIND_H CACHE) message(FATAL_ERROR "Cannot find libunwind. Try installing libunwind8 and libunwind8-dev (or the appropriate packages for your platform)") endif() - if(NOT HAVE_LTTNG_TRACEPOINT_H) + if(NOT HAVE_LTTNG_TRACEPOINT_H AND PAL_CMAKE_ENABLE_TRACE) unset(HAVE_LTTNG_TRACEPOINT_H CACHE) message(FATAL_ERROR "Cannot find liblttng-ust-dev. Try installing liblttng-ust-dev (or the appropriate packages for your platform)") endif() diff --git a/src/pal/src/loader/module.cpp b/src/pal/src/loader/module.cpp index 4d0426d8b581..1f0bb73faa9f 100644 --- a/src/pal/src/loader/module.cpp +++ b/src/pal/src/loader/module.cpp @@ -57,8 +57,10 @@ Module Name: #include #include -#if defined(__LINUX__) +#if defined(__LINUX__) && defined(__GLIBC__) #include +#else +#define LIBC_SO "libc.so" #endif using namespace CorUnix; diff --git a/src/pal/src/misc/sysinfo.cpp b/src/pal/src/misc/sysinfo.cpp index f444e8c13140..89eec0a2f412 100644 --- a/src/pal/src/misc/sysinfo.cpp +++ b/src/pal/src/misc/sysinfo.cpp @@ -342,7 +342,7 @@ PAL_GetLogicalProcessorCacheSizeFromOS() { size_t cacheSize = 0; -#if HAVE_SYSCONF && defined(__LINUX__) +#if HAVE_SYSCONF && defined(__LINUX__) && defined(_SC_LEVEL1_DCACHE_SIZE_) cacheSize = max(cacheSize, sysconf(_SC_LEVEL1_DCACHE_SIZE)); cacheSize = max(cacheSize, sysconf(_SC_LEVEL1_ICACHE_SIZE)); cacheSize = max(cacheSize, sysconf(_SC_LEVEL2_CACHE_SIZE)); diff --git a/src/pal/src/safecrt/internal_securecrt.h b/src/pal/src/safecrt/internal_securecrt.h index 012b6f733328..d188111da891 100644 --- a/src/pal/src/safecrt/internal_securecrt.h +++ b/src/pal/src/safecrt/internal_securecrt.h @@ -24,6 +24,11 @@ #ifndef _INC_INTERNAL_SECURECRT #define _INC_INTERNAL_SECURECRT +typedef unsigned long __uint64_t; +typedef signed long __int64_t; +typedef __int64_t int64_t; +typedef __uint64_t uint64_t; + /* more VS specific goodness */ #define __out_ecount_z( x ) #define __out_ecount( x ) diff --git a/src/pal/src/safecrt/output.inl b/src/pal/src/safecrt/output.inl index 1a333187ec09..8675f07cfce2 100644 --- a/src/pal/src/safecrt/output.inl +++ b/src/pal/src/safecrt/output.inl @@ -28,6 +28,7 @@ //typedef __int64_t __int64; +#define __GNUC_VA_LIST #define FORMAT_VALIDATIONS typedef double _CRT_DOUBLE; diff --git a/src/pal/src/safecrt/safecrt_output_l.c b/src/pal/src/safecrt/safecrt_output_l.c index 36b98c29753d..72b9bc5ea65e 100644 --- a/src/pal/src/safecrt/safecrt_output_l.c +++ b/src/pal/src/safecrt/safecrt_output_l.c @@ -21,6 +21,7 @@ ****/ #define _SAFECRT_IMPL +#define __GNUC_VA_LIST #define __STDC_LIMIT_MACROS #include "pal/palinternal.h" diff --git a/src/pal/src/thread/context.cpp b/src/pal/src/thread/context.cpp index ebd4383a71eb..589f4b363120 100644 --- a/src/pal/src/thread/context.cpp +++ b/src/pal/src/thread/context.cpp @@ -422,7 +422,7 @@ void CONTEXTToNativeContext(CONST CONTEXT *lpContext, native_context_t *native) if ((lpContext->ContextFlags & CONTEXT_FLOATING_POINT) == CONTEXT_FLOATING_POINT) { -#ifdef _AMD64_ +#if 0 //_AMD64_ FPREG_ControlWord(native) = lpContext->FltSave.ControlWord; FPREG_StatusWord(native) = lpContext->FltSave.StatusWord; FPREG_TagWord(native) = lpContext->FltSave.TagWord; @@ -481,7 +481,7 @@ void CONTEXTFromNativeContext(const native_context_t *native, LPCONTEXT lpContex if ((contextFlags & CONTEXT_FLOATING_POINT) == CONTEXT_FLOATING_POINT) { -#ifdef _AMD64_ +#if 0//def _AMD64_ lpContext->FltSave.ControlWord = FPREG_ControlWord(native); lpContext->FltSave.StatusWord = FPREG_StatusWord(native); lpContext->FltSave.TagWord = FPREG_TagWord(native); diff --git a/src/pal/tests/palsuite/CMakeLists.txt b/src/pal/tests/palsuite/CMakeLists.txt index 19464a3bc7fd..07560c6807a7 100644 --- a/src/pal/tests/palsuite/CMakeLists.txt +++ b/src/pal/tests/palsuite/CMakeLists.txt @@ -21,5 +21,7 @@ add_subdirectory(miscellaneous) add_subdirectory(pal_specific) add_subdirectory(samples) add_subdirectory(threading) -add_subdirectory(eventprovider) +if(PAL_CMAKE_ENABLE_TRACE) + add_subdirectory(eventprovider) +endif() diff --git a/src/vm/CMakeLists.txt b/src/vm/CMakeLists.txt index e9e59f82fbe7..70208c593011 100644 --- a/src/vm/CMakeLists.txt +++ b/src/vm/CMakeLists.txt @@ -265,11 +265,11 @@ set(VM_SOURCES_WKS weakreferencenative.cpp ) -if(CLR_CMAKE_PLATFORM_LINUX OR WIN32) +if((CLR_CMAKE_PLATFORM_LINUX OR WIN32) AND CLR_CMAKE_ENABLE_TRACE) list(APPEND VM_SOURCES_WKS eventtrace.cpp ) -endif(CLR_CMAKE_PLATFORM_LINUX OR WIN32) +endif((CLR_CMAKE_PLATFORM_LINUX OR WIN32) AND CLR_CMAKE_ENABLE_TRACE) if(WIN32)