Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Support For Building core Component And Executing Hello World On ARM64 #1450

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

CuriousTommy
Copy link
Contributor

@CuriousTommy CuriousTommy commented Oct 31, 2023

Depending how many commits are needed, I might consider splitting this PR into multiple PRs.

Goal

The main goal is to make sure that Darling is able to build on a ARM64 Linux and can execute a simple hello_world executable.

Additional Goals

  • Verify ARM64 implementation of NSInvocation.
  • Test obj-c equivalent of hello_world.

Tasks

  • Push current ARM64 code (excluding hacks/workarounds that shouldn't be upstream)
  • Properly fix remaining build issues
  • Get Darling to successfully execute a macOS ARM64 hello world binary file on a Fedora ARM64 VM & Asahi Linux Fedora.
  • Test out signal (such as abort or __builtin_trap())
  • Test libdispatch

Known Issues

TODO

Additional PRs

@CuriousTommy CuriousTommy self-assigned this Oct 31, 2023
@CuriousTommy CuriousTommy changed the title Implement Support For Building core Components And Executing Hello World On ARM64 Implement Support For Building core Component And Executing Hello World On ARM64 Oct 31, 2023
src/hosttools/src/coredump/main.c Outdated Show resolved Hide resolved
src/startup/mldr/elfcalls/threads.c Outdated Show resolved Hide resolved
CuriousTommy and others added 23 commits June 13, 2024 12:49
`cpuid.h` is a x86 specific file. Including it on a arm64 device will cause a compile failure.
It turns out that "omp-tools.h" is not a good option.
It really sucks that Apple no longer open sources `libm`... I'm not sure if we should replace `libm` with another macOS friendly math library, or try to implement the math stubs...
I didn't really like the idea of having a bunch of `#ifdefs`, so I decided to implement stub methods for "load" And "setup_stack" that abort if they are called (when they shouldn't be called).
Co-authored-by: Sergey Bugaev <[email protected]>
Co-authored-by: Sergey Bugaev <[email protected]>
It turns out that Linux relies on TPIDR_EL0, so we can't use that register to store the TPIDRRO_EL0. Instead, we will have a variable in mdlr that represents TPIDRRO_EL0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants