Skip to content

Running dotnet core on Alpine for ARM32 #10111

Closed

Description

@JensNordenbro

Due to its small footprint (OS image size), Alpine is suited for embedded scenarios on ARM32.

Things leading to this:

  • Today dotnet core is Community Supported on ARM32.

  • dotnet core 2.1 will support arm32 officially (Supported Operating Systems and Chip Architectures-section)

  • Today dotnet core 2.1 is running on Alpine for x86.

  • It is possible to run docker on an embedded system (for example ResinOS) and in order to do this efficiently a small container image is needed, hence the need for Alpine support.

  • It is expected to have symmetry in OS support between different CPU architectures where possible

(If/when this is implemented the docker images for running .net core application should be available. )

Activity

  1. RussKeldorph commented on Apr 10, 2018

    @RussKeldorph
    Contributor
  2. janvorli commented on Apr 10, 2018

    @janvorli
    Member

    See my comment https://github.com/dotnet/coreclr/issues/9370#issuecomment-364912259
    We want to support ARM32 Alpine, but in order to do that, we need a way to cross build for Alpine arm on x64. The cross build mechanisms that we have in our build now works only for debian based distros and uses qemu-debootstrap. That would not work for Alpine.
    In the comment above, I've identified a potential way to do that.

  3. janvorli commented on Apr 19, 2018

    @janvorli
    Member

    Oh, that's unfortunate. But as for your previous comment, why would we need to ship the toolchain? Wouldn't compiling the runtime bits with it be sufficient?

  4. janvorli commented on Apr 20, 2018

    @janvorli
    Member

    (for some reason, cmake picks up /bin/c++ instead of /bin/clang++ in this docker)

    I have seen cases when clang package has installed clang, but clang++-3.x or vice versa. In other words, the version was just on one of those and it was causing the same or similar issue. Adding a symbolic link to make it symmetric helped.

    I was thinking that we might need to ship the generated ABI libs

    I believe the ABI is the same and the only difference is in the supported instructions inside the binaries. So we should be able to build dotnet core using the self compiled toolchain, but the result should work on the Alpine as is.

  5. janvorli commented on Apr 25, 2018

    @janvorli
    Member

    @kasper3 that is awesome! Thank you so much for looking into it and making it work!
    I'll be happy to do the integration.

  6. sdmaclea commented on Apr 26, 2018

    @sdmaclea
    Contributor

    @janvorli Would you be willing to do this for arm64 also. I think alpine is interesting in arm64 docker scenarios because it is lightweight.

  7. janvorli commented on Apr 26, 2018

    @janvorli
    Member

    @sdmaclea sure, I think there would be only minor differences needed for arm64.

    I'll get to it next week, I'm flying home from Redmond this afternoon.

  8. janvorli commented on May 9, 2018

    @janvorli
    Member

    Update: I have the build working for both arm and arm64, but I need to test it on a real device / container yet to make sure the compiled binaries are 100% correct.

    @kasper3 the steps you have provided were really a great guideline. However, they were actually compiling under the qemu and so the compilation was really slow. So I have implemented the cross build the same way as we build for debian / ubuntu. That means that the build system's clang is used for building and the rootfs just provides the libraries / headers to compile / link against.
    The only issue was that the LD sets the .interp section to point to the glibc loader instead of the musl one, since it knows nothing about musl. For the time being, I've added a linker option that asks it to set it explicitly to the musl one, but I am not sure if that's a correct solution.
    I am sorry for the delay, but I was OOF this and the last week Monday and Tuesday.

    If you are interested, you can check the current state here:
    janvorli/coreclr@0a03ff8

  9. 32 remaining items

  10. transferred this issue fromdotnet/coreclron Jan 31, 2020
  11. added this to the Future milestone on Jan 31, 2020
  12. added
    untriaged
    on Feb 26, 2020
  13. removed
    untriaged
    on Jun 25, 2020
  14. JensNordenbro commented on Mar 21, 2022

    @JensNordenbro
    Author

    Is this status really correct?
    The related #2021 seems to be done.

    image

  15. ericstj commented on Mar 22, 2022

    @ericstj
    Member
  16. Repository owner moved this from Future to Done in Triage POD for Reflection, META, etc.on Mar 22, 2022
  17. ghost locked as resolved and limited conversation to collaborators on Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions