-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add support for target aarch64-linux-musl #5861
Conversation
@jirutka really the only way to test it would be to run the spec suite and compile the compiler with a compiled compiler. There used to be an automated tool for generating these but it's out of date :( |
0290f49
to
d904dbf
Compare
spec/std/llvm/aarch64_spec.cr
Outdated
@@ -6,7 +6,7 @@ LLVM.init_aarch64 | |||
{% end %} | |||
|
|||
private def abi | |||
triple = "aarch64-unknown-linux-gnu" | |||
triple = LLVM.default_target_triple.gsub(/^(.+?)-/, "aarch64-") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% on this change, why does it need to happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure about it too, but hard-coded aarch64-unknown-linux-gnu
is not very useful for testing aarch64 with musl, isn’t it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve copied this from:
triple = LLVM.default_target_triple.gsub(/^(.+?)-/, "x86_64-") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these specs should be changed to always test all the triples we support... Specs run shouldn't depend on the config of the host.
However, leaving it as-is is fine for now, since there's no difference between the calling convention and struct layout for musl and glibc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I’ve reverted this change.
d904dbf
to
c85dc7a
Compare
c85dc7a
to
71de1d9
Compare
Does it at least partially work? Where can I find it? |
@jirutka There are several, see crystal-lang/crystal_lib, olbat/libgen and TechMagister/bindgencr. |
@Sija no, the one specifically used for generating the current bindings was https://github.com/ysbaddaden/posix. But the definition files are incomplete and I never got it to work. It might be able to get you most of the way there though? |
@RX14 thx, I had a feeling I missed one from @ysbaddaden. |
And it stops on this, even when |
These are just broken tests, the result is correct.
These failures are quite expected. |
IIRC iconv is broken on x86 musl too, can you confirm? Is the time related spec due to a missing zonedb? Please submit a patch to wrap the |
Yes, the same errors are on x86_64.
Yes, the error is gone after installing tzdata! |
Yeah, skip the GB2312 encoding issues. Musl's iconv doesn't support this encoding, and specs have always failed. |
@jirutka can you confirm that (with all the PRs and patches):
If so, this is 👍 to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fantastic, great to have another libc supported, and thank you so so much for your packaging efforts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks a lot for this!
* Fix codegen/asm specs to run x86 ASM only on x86_64 and i686 See #5861 (comment) * Fix codegen/sizeof specs for aarch64 (and other 64bit arches) See #5861 (comment)
@RX14, could you please verify if it’s correct? Is there some way how to automatically check it or even generate? I’ve done this by hand, comparing existing x86_64-linux-gnu vs. aarch64-linux-gnu and musl arch-specific sources.
Related to #5467