Add support for Alpine Linux (#7440)
authorJan Vorlicek <janvorli@microsoft.com>
Tue, 4 Oct 2016 00:56:42 +0000 (02:56 +0200)
committerGitHub <noreply@github.com>
Tue, 4 Oct 2016 00:56:42 +0000 (02:56 +0200)
commit9c506048df2e03002eda612966977b739b585aba
treea3c044a33188139f08604a1e997e2f241a121b01
parent3c67761c09e029569466ef1e96a2b0d67873c8a3
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.
CMakeLists.txt
clrdefinitions.cmake
src/pal/src/CMakeLists.txt
src/pal/src/exception/seh-unwind.cpp
src/pal/src/exception/seh.cpp
src/pal/src/exception/signal.cpp
src/pal/src/include/pal/context.h
src/pal/src/init/pal.cpp
src/pal/src/thread/context.cpp
src/vm/stackwalk.cpp
src/vm/threads.cpp