diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2016-10-04 02:56:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-04 02:56:42 +0200 |
commit | 9c506048df2e03002eda612966977b739b585aba (patch) | |
tree | a3c044a33188139f08604a1e997e2f241a121b01 /CMakeLists.txt | |
parent | 3c67761c09e029569466ef1e96a2b0d67873c8a3 (diff) | |
download | coreclr-9c506048df2e03002eda612966977b739b585aba.tar.gz coreclr-9c506048df2e03002eda612966977b739b585aba.tar.bz2 coreclr-9c506048df2e03002eda612966977b739b585aba.zip |
Add support for Alpine Linux (#7440)
This change enables build of CoreCLR on Alpine Linux. Here is the list
of changes:
- Disable asserts checking RSP in arbitrary threads against cached stack limit
for the respective thread. The stack on Alpine obviously grows over the limit
reported by the pthread functions.
- Disable using XSTATE. This should be re-enabled after MUSL gets the _xstate,
_fpx_sw_bytes and related data structures added to the signal.h header.
- Disable setting rlimit of RLIMIT_NOFILE to the max value, since it breaks
debugging for some reason.
- Add skipping over the hardware signal trampoline in the PAL_VirtualUnwind.
While we were not trying to walk over it in a simple case, in a case where
an exception was thrown from a catch handler of a hardware exception, we
still attempted to walk over it and it fails on Alpine.
- Fix detection of Alpine Linux in the PAL's CMakeLists.txt so that it works
in Docker containers too.
- Modified PAL_VirtualUnwind to make the check for unwinding past the bottom
of the stack unconditional. We had a long list of platforms where we were
doing this check and it doesn't hurt to do it on platforms where it is not
needed. I have done that rather than adding a check for Alpine Linux as
another platform that needs it.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a40d7f284d..140b7871be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,6 +132,16 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux) clr_unknown_arch() endif() set(CLR_CMAKE_PLATFORM_LINUX 1) + + # Detect Alpine Linux + SET(OS_RELEASE_FILENAME "/etc/os-release") + if (EXISTS ${OS_RELEASE_FILENAME}) + file(READ ${OS_RELEASE_FILENAME} OS_RELEASE) + string(FIND "${OS_RELEASE}" "ID=alpine" CLR_CMAKE_PLATFORM_ALPINE_LINUX) + if(CLR_CMAKE_PLATFORM_ALPINE_LINUX EQUAL -1) + unset(CLR_CMAKE_PLATFORM_ALPINE_LINUX) + endif(CLR_CMAKE_PLATFORM_ALPINE_LINUX EQUAL -1) + endif(EXISTS ${OS_RELEASE_FILENAME}) endif(CMAKE_SYSTEM_NAME STREQUAL Linux) if(CMAKE_SYSTEM_NAME STREQUAL Darwin) @@ -562,4 +572,4 @@ if(CLR_CMAKE_BUILD_TESTS) add_subdirectory(tests) endif(CLR_CMAKE_BUILD_TESTS) -include(definitionsconsistencycheck.cmake)
\ No newline at end of file +include(definitionsconsistencycheck.cmake) |