AArch64: temporary patch to allow cross-compiling from non-AArch64#67
AArch64: temporary patch to allow cross-compiling from non-AArch64#67joakim-noah merged 1 commit intoldcfrom
Conversation
|
This isn't worth it IMO. Why cheat for AArch64 instead of letting tests for unimplemented/buggy stuff fail as expected? |
| } | ||
| else | ||
| // Proves that sqrt(real.max) ~~ 0.5/sqrt(real.min_normal) | ||
| static assert(real.min_normal*real.max > 2 && real.min_normal*real.max <= 4); |
There was a problem hiding this comment.
Ah okay this will be required (not inside a test).
std/outbuffer.d
Outdated
| { | ||
| // Remove once va_arg is working. | ||
| } | ||
| else |
There was a problem hiding this comment.
This isn't inside a test either, only the last one is. I don't care if tests fail either, this pull is needed to simply get the stdlib and test runner to compile.
There was a problem hiding this comment.
[This body doesn't even use va_arg, only va_copy and va_end, both LDC intrinsics.]
There was a problem hiding this comment.
Try it for yourself with the latest ldc beta:
./ldc2-1.11.0-beta2-linux-x86_64/bin/ldc2 -mtriple=aarch64-none-linux-android -c ./ldc2-1.11.0-beta2-linux-x86_64/import/std/outbuffer.d
Invalid bitcast
%23 = bitcast %ldc.internal.vararg.std.__va_list %21 to i8*
LLVM ERROR: Broken function found, compilation aborted!
There was a problem hiding this comment.
It hasn't anything to do with va_arg (which btw has an implementation for AArch64), but apparently rather with the va_list type (which it gets from the TargetABI).
There was a problem hiding this comment.
... or the va* functions in the TargetABI (used by the va_start LDC intrinsic etc. IIRC).
There was a problem hiding this comment.
Sure, I haven't looked into varargs much: just going off the asserts in va_arg for non-iOS AArch64 because it's unimplemented, figured this was related to that.
e4cae8c to
fb76e53
Compare
std/outbuffer.d
Outdated
| } | ||
| else | ||
| { | ||
| buf.printf(" %d", 62665); |
There was a problem hiding this comment.
The latest version of ldc-developers/ldc#2802 gets this module to cross-compile again, but this line segfaults in the test runner in vsnprintf. I don't mind tests asserting, but a segfault means you can't run the rest of the tests with one invocation of the test runner, so disable this for AArch64 until we get va_{list,arg} working.
Temporarily disable so the upcoming 1.11 release doesn't require patching, though I don't know that we'll ever bother getting 128-bit floating-point CTFE for AArch64 cross-compilation working. I'
llve removed thestd.outbufferexcision, since @kinke'sva_listpatch gets it to workonce we get.va_listworking on AArch64I'll also merge the
core.internal.convertcommit from dlang/druntime#2257 once I finish the pull and it's merged upstream or before the 1.11 release, whichever comes first, so that no patches will be needed to cross-compile the 1.11 stdlib and its tests for AArch64.