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

AArch64 support (ARMv8-A) #3491

Merged
merged 7 commits into from
Nov 2, 2016
Merged

Conversation

ysbaddaden
Copy link
Contributor

@ysbaddaden ysbaddaden commented Oct 31, 2016

Initial AArch64 port, aka ARM64, aka ARMv8-A.

  • ABI: please review, it's based on rust
  • fiber context switch, based on d runtime
  • unwind support (damn easy this time)
    • can raise in spawn (fiber context switch corrupts the callstack)
  • libxml2: failed to raise (missing unwind tables)
  • llvm.readcyclecounter segfaults on Cortex A53/A57 CPUs as previously reported —maybe we'd like to seed Random from /dev/urandom?
  • C bindings for aarch64-unknown-linux-gnu target
  • green std specs:
    • BigFloat specs segfault or hang forever
    • segfault (gc -> yaml_delete -> segfault)
    • 1 failure: HTTP generates RFC1123 with local time zone (certainly a VM misconfiguration) DST issue.

Note: I can't link my posix project in my QEMU machine because ld segfaults... I'll investigate later. In the meantime it's probable the C bindings aren't exact, which may explain some crashes, or maybe the ABI is faulty. ABI fixed, libyaml bindings fixed, but it segfaults because of infinite clang_visitChildren recursive calls. Not investigated.

Please review!

Sorry, something went wrong.

- libxml2 is likely to miss unwind tables
- libyaml bindings
- libgmp bindings
Not the safest choice, but LLVM.read_cycle_counter is unavailable.
Maybe we should use `/dev/urandom` instead.
@ysbaddaden
Copy link
Contributor Author

ysbaddaden commented Nov 1, 2016

Down to a single bug! and most certainly because of a time misconfiguration in my QEMU VM. already fixed in master!

$ ./std_spec

Finished in 2:18 minutes
3474 examples, 1 failures, 0 errors, 1 pending

  1) HTTP generates RFC1123 with local time zone

       expected: "Sun, 06 Nov 1994 06:49:37 GMT"
            got: "Sun, 06 Nov 1994 07:49:37 GMT"

@asterite merge? (if Travis is happy)

@ysbaddaden ysbaddaden changed the title WIP: AArch64 support (ARMv8-A) AArch64 support (ARMv8-A) Nov 1, 2016
@keplersj
Copy link
Contributor

keplersj commented Nov 1, 2016

@ysbaddaden That bug was happening on Travis a few days ago as well. I wouldn't worry about it.

@asterite
Copy link
Member

asterite commented Nov 1, 2016

I already fixed that bug in master, the spec was buggy (it broke because of DST changes)

@ysbaddaden
Copy link
Contributor Author

What the hell? Homebrew is distributing LLVM without the AArch64 target 😭

https://github.com/Homebrew/homebrew-core/blob/master/Formula/llvm.rb#L139

For example Homebrew distributes LLVM without the AArch64 target by
default.
@ysbaddaden
Copy link
Contributor Author

@asterite since LLVM targets can be missing, I made them optional in Crystal, too. We now have a LLVM::BUILT_TARGETS constant, run target ABI specs only when the target is available, and raise an exception at runtime when trying to use a target that isn't available. It fixed the Travis issue.

@asterite
Copy link
Member

asterite commented Nov 2, 2016

@ysbaddaden Nice! I'm happy to see that you was able to solve this with a macro :-)

@ysbaddaden
Copy link
Contributor Author

So, merge?

@asterite
Copy link
Member

asterite commented Nov 2, 2016

@ysbaddaden Whenever you are ready :-)

@ysbaddaden ysbaddaden merged commit e5d2bc6 into crystal-lang:master Nov 2, 2016
@ysbaddaden ysbaddaden deleted the aarch64-support branch November 2, 2016 14:33
maxpowa pushed a commit to maxpowa/crystal that referenced this pull request Nov 19, 2016
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.

None yet

3 participants