-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Opening an issue to track the efforts to bring up coreclr/corefx on Alpine Linux ARM.
We've re-scoped this issue to track getting "Hello World!" to run on 64-bit Linux. As a next step, we'll work to get exception handling to work on Linux - see dotnet/coreclr#9370
Related threads:
- Support Alpine Linux (inadvertently to conform with libc for embedded systems) #4210
- coreclr on Android Android Build Issue Discussion cydhaselton/coreclr#1
Current approach is to use a docker container on an ARM device for building coreclr; that one is stored here https://github.com/qmfrederik/dotnet-alpine-arm
Building the native components for Alpine arm64:
- Compile coreclr:
./build.sh arm64 skipgenerateversion skipmscorlib
- Run PAL tests
src/pal/tests/palsuite/runpaltests.sh /home/coreclr/bin/obj/Linux.arm64.Debug/
- Compile corefx:
CPLUS_INCLUDE_PATH=/usr/include/c++/6.3.0/aarch64-alpine-linux-musl/:/usr/include/c++/6.3.0/ src/Native/build-native.sh arm64
- Cross compile mscorlib on Linux for arm:
./build.sh skipnative arm64 debug verbose -rebuild
Putting together a sample app:
- Compile and publish a demo stand-alone .NET core app, copy that one over to Alpine ARM
- Copy
/home/corefx/bin/Linux.arm64.Debug/Native/*
and/home/coreapp # cp ../coreclr/bin/Product/Linux.arm64.Debug/*
to the app dir, as well asbin/Product/Linux.arm64.Debug/mscorlib.dll
andbin/Product/Linux.arm64.Debug/System.Private.CoreLib.dll
from the cross-build on Linux x64.
Backlog:
- Fix libunwind
getcontext
call (currently stubbed out) - Hardware exception handling on aarm64
- Unit tests for the various functions that had to be re-written in assembly?
Open items:
Compile clang 3.9.1 for Alpine; this version may include some welcome bug fixes
Sources are here: http://releases.llvm.org/download.html#3.9.1 , build process here: http://llvm.org/docs/CMake.html
Build process:
mkdir mybuilddir
cd mybuilddir
cmake path/to/llvm/source/root
cmake --build . -- -j 92
cmake --build . --target install
or
cmake -DCMAKE_INSTALL_PREFIX=/usr -P cmake_install.cmake
and at least patches 2, 3 from http://git.alpinelinux.org/cgit/aports/tree/main/llvm?h=3.5-stable
- the same for clang, lld?