-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
[tracker] AArch64 progress #2153
Comments
|
@klickverbot I still have some trouble with the 128bit emulation code. |
|
@redstar: What sort of trouble in particular? |
|
Link to Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=791976 |
|
I've been trying out Android/AArch64, now that I have access to an Android/AArch64 tablet, with an updated version of dlang/druntime#1267 for As a result, I wonder if native TLS can be made to work on Android/AArch64, though when I tried reverting my llvm patch and other ldc/druntime modifications for Walter's brand of emulated TLS, the resulting test binary would segfault when the GC called some thread-local variable. I didn't look into it further and switched to llvm's emulated TLS instead, which is what clang uses on Android/AArch64, but I'll investigate using native TLS more later. Using llvm's emulated TLS and cross-compiling the druntime tests, I had to disable these I thought that might be related to ldc not supporting cross-compiling to the larger 128-bit reals from linux/x64, but I then tried compiling ldc from the ltsmaster branch natively on the tablet and it had the same issue. David, you didn't hit this? Most of the druntime tests pass with llvm's emulated TLS, only I'm now trying to build the phobos tests, but having issues with compiling |
|
Oh, I've hit these, plus varargs are not implement yet. |
|
Is the problem really "varargs", or just the calling convention (va_list is a struct that gets passed by value)? |
|
I should have been more precise: The problem isn't the passing of varargs (which works just fine), but the implementation of |
|
And fixing #2150 is needed for proper C/C++ interop with somewhat larger structs passed by value. |
|
I've posted a preliminary patch for the ABI issue at #2150, which applies on top of |
|
Any updates? I'd like to help with testing on Raspberry Pi 3. |
|
@ohdatboi what OS/version are you running on your raspi3? I was surprised to find that raspibian is 32bit os, so by default, most stuff will compile/run just fine there. If you are running something else, ArchLinux or other, would be interesting for testing. I have a handful of "other" linux/arrch64 platforms that could be used for testing. |
Thanks, more platforms for testing (especially with different instruction set extensions/…) is always good to have on ARM. However, the main blocker for steady progress on AArch64 is really just the availability of a CI system. As things are currently, things improve once every while when somebody makes a push, and then slowly regress again. When I worked on AArch64 a while back, most of the test suite passed (with that WIP patch, apart from |
|
@truedat101 I use ArchLinux Arm, 32-bit version. Indeed, It works like a charm. Currently, 64-bit systems for RPi3 miss GPU firmware. Somebody works on this for Debian, so eventually it'd be done. |
|
@klickverbot are you suggesting the project needs an AARCH64 device for the CI server as a build/test node? |
|
Yes, running a 64-bit OS and exposed as CI webservice pluggable into GitHub. |
|
@kinke - I can provide that. Who should I contact about setup details? I've got a Pine64 cluster I can dedicate for this purpose. |
|
Oh wow, that'd be awesome. Feel free to drop me a mail at kinke <ät> gmx <döt> net. |
|
@kinke sorry got tied up with some CES stuff end of year for work. I'll try to get this box online. I have such a weird setup with my ISP ... hoping DDNS will work. |
|
Alright, finally got back to this and got much farther. With this tiny patch to ldc 1.8 from git master in a linux/x64 VPS to invoke llvm's emulated TLS, I built an ldc against stock llvm that cross-compiles most of the stdlib, after setting I don't have a way to pass llvm's emulated TLS to the GC, so the GC will crap out if called, which is why I disable the GC and a few modules that call it directly when building the The rest of the tests all pass when running that Finally, with a small patch for Phobos, I was able to get the I also had to apply @jpf91's upstream dlang/phobos@a3d16b958 and dlang/phobos@3a9b0513d, but that's it. With those patches, including disabling the GC in the test runner as for druntime, only 5 modules assert somewhere in the Phobos tests, That marks only 7 Phobos modules that have tests failing on Android/AArch64, everything else passes. |
|
@joakim-noah Great work! |
|
I've done nothing, other than the simple bindings for Bionic/AArch64 that I've now put online at dlang/druntime#2148. Along with my first patch above to comment out some tests in This is all on you, David, Johannes, and whoever else chipped in with the related linux/AArch64 port so far, which I had nothing to do with. Now that I know where the port's at- farther along than the ARM port when I used it for Android- I hope to chip in with finishing it up. |
|
Tried out ltsmaster and the stdlib tests natively on Android/AArch64 again: got everything to build by applying the ldc patch above, commenting out building and running Several more modules fail in Phobos, nine to be exact, along with most of those that failed with ldc master. Most seem related to concurrency, such as I don't think any more that that's related to TLS or the GC, as they work when cross-compiled from ldc master. The only That means 89 of 103 Phobos modules pass though- including the two failing asserts in |
|
Took a look at the math-related failures that hit modules in both ltsmaster and master, got three of those ltsmaster modules to pass when these workarounds were added or tests disabled, showing there's not much left to be done: I'll pick any low-hanging fruit left with these and move on to emulated TLS. |
|
Kai gave me access to his linux/AArch64 VPS that he uses for his ldc buildbot, so I was able to build and run these same tests there too. Pretty much all the druntime tests for ltsmaster pass, except for the aforementioned tests from After applying upstream commit a3d16b9 to I also ran the dmd test suite and logged only 21 failing tests. 10 errored out because If I build ldc 1.8 natively on linux/AArch64 with that ltsmaster build, it flakes out when building some druntime modules with weird errors, just like when I tried it on Android/AArch64, which I'm guessing are from varargs not working yet. So I built whatever I could and cross-compiled the rest from a linux/x64 VPS, ie some of druntime and most of phobos, as done above for all the stdlib tests with ldc 1.8 for Android. As a result, After applying the This same patch, except for the unneeded |
|
Did you build using a LLVM build with assertions enabled? IIRC va_arg isn't even supposed to compile on ARM64/Linux. |
|
According to the log, it apparently compiles (as long as feeding it primitive types only), but doesn't work. ;) |
|
Oh and master still lacks the ExplicitByvalRewrite fix from ltsmaster. One should probably side-by-side diff the whole ltsmaster/master TargetABI stuff (not just AArch64). Plus va_arg doesn't work with master, apparently due to cross-module-inlining stuff added in the meantime (and not supporting D function declarations whose IR declaration is skipped, such as functions with |
No, I don't, but @myfreeweb did and hit an assertion when he tried to use that pull. Even if |
|
Some useful links for anyone looking to implement va_arg, too many acronyms and compiler magic for me: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf (Section B.4) |
I can confirm that for a different piece of software, without Edit: After a long minimizing session, I found this example. It fails with 1.12, but passes with 1.13-beta1... I don't know which commit fixed this. Perhaps worth tracking it down, so we know it is really fixed. (I don't have the energy now) |
|
With the given testcase, I'm unable to reproduce with the official ldc 1.2 and 1.3 builds for linux/x64 and Android/AArch64, when compiled with the |
|
I was using ubuntu trusty cross-compiling with ldc 1.12 to aarch64, and running the executable in qemu. |
|
I don't remember exactly, but there might have been some extra issues with bfd for Shippable, and switching to gold improved things. I may be misremembering though, it's been some time. |
|
Any progress? |
|
I have another $2000 USD bounty waiting for PayPal eCheck to pass, aimed at rewarding a full test suite in AArch64 support |
This sound interesting! Would passing it on GNU/Linux be enough, or do you require Android/iOS support? |
|
There needs to be a tracking issue for Android/iOS + AArch64 so that I can put a bounty for it separately, but I think this would be a good milestone to just have it working for GNU/Linux. |
|
Are there any test failures still? It seems already pretty good for real applications. I've been using LDC (mostly on GtkD projects) on FreeBSD/aarch64 for over a year now, haven't noticed any arch specific issues. |
Yes, mostly related to ABI and lacking Shippable AArch64 CI (on Ubuntu 16.04) is green because test failures are ignored for now; the logs show what's still missing. |
|
@dnadlinger: Are you working on this? I could look into the AArch64 ABI for a start. |
|
Hey, as an outsider I wanted to hook into this discussion to see where things stand at in terms of stability - is it considered stable enough to use it in commercial development for the Play Store? ARM64 is a requirement as of August iirc due to Google now forcing every APK to have 64 bit natives. I have no experience with D at all, nor with compiler development, but if there are things I can do to help I'm willing to get my hands dirty! |
That's difficult to answer. With the upcoming AArch64 ABI fixes (will be in the next beta in a few weeks), I'd think that the compiler side should be pretty complete, leaving the few library issues. Wrt. Android, the bigger problem is that we have no test results - neither from CI, nor recent ones from a manual run. A full testrun requires testing a native Android LDC on the device, which requires a clang toolchain for linking too, which AFAIK again means that one has to resort to a regular-Linux-emulating app like Termux (edit: for which there's an LDC package I'm 'maintaining' without ever running or testing it myself :])... |
|
Update: ABI issues hopefully fixed for good (at least for non-Apple), incl. C(++) interop and varargs. Current testsuite status for Shippable CI on Ubuntu 16.04:
|
|
The dmd-testsuite-release test driver failure is probably a regular Phobos bug and unrelated to AArch64. Also sporadically seen for DMD CI, e.g., there. |
|
Update: dmd-testsuite-release is now tested and all green, see 36e1911. |
|
The issue still is, see my latest posts; the bounty less so in the sense of the few remaining parts IMO definitely not justifying the full bounty. |
|
@etcimon: I don't quite remember how Bountysource works (just that I thought they were bought out by some … weird entity at some point), but are you already out of pocket for your generous donation? If no, maybe we should just call it quits; if yes, maybe those of us having done major amounts of work so far can push through to full support and then split the bounty up somehow so that it isn't "lost". (Edit: Also see bountysource/core#1539.) |
I'm currently on-off working on
aarch64-unknown-linux-gnuand have a large part of the test suite passing already, includingstd.math(IEEE 754 quad-precision real support). The idea is to get anltsmastercompiler that passes the whole test suite first. See the log of the latest AArch64 CI builds for the current status of the test suite.Open items:
core.stdc.stdarg.va_argsupportstd.convsupport for quad-precision reals - Extend std.conv.parse for strings to full ieeeQuadruple precision and other fixes dlang/phobos#6633core.internal.convertsupport for CTFE conversion of Quadruple reals to a ubyte array - core.internal.convert: add IEEE Quadruple support dlang/druntime#2257std.numeric.CustomFloatsupport for Quadruple realsstd.internal.math.gammafunction-NaNthat trips some asserts instd.mathandstd.algorithm.sorting, but only when natively compiling on AArch64Upstream PRs to integrate into
ltsmaster:@redstar: How is your
centwork progressing?The text was updated successfully, but these errors were encountered: