-
-
Notifications
You must be signed in to change notification settings - Fork 424
First Android/x86 patch that produces a working D executable #734
Conversation
Only had a short glance, but LGTM. |
Except for the blah blah |
They work. I've built small Android/x86 command-line executables using this patch and a lightly modified sections_solaris.d, which I repurposed for Android. It is incomplete as there is still missing stuff like TLS, which I'm working on now. But yeah, this versioning scheme isn't set in stone, we can still rearrange it later. I'm not sure exactly what interface you need for GDC. Right now, |
@joakim-noah - Android and linux are defined in the places where Android and linux are expected to be defined (otherwise you may not get either in some target configurations). When the target is Android, the config setup pull in the linux headers too, thus both get defined. This is quite deliberate on GCC's part as Android is a target switch that falls under the |
As stated on the manpage: http://manpages.ubuntu.com/manpages/trusty/en/man1/gcc.1.html |
Thanks for the link, I didn't know gcc had such android flags. However, the fact remains that code generation for linux/x86 and Android/x86 is essentially the same, perhaps a couple of well-known, non-Android-specific compiler/linker flags difference and TLS will probably have to be handled differently. So there's not much of a difference in GDC x86 codegen for linux vs. Android, we're only talking here about how to handle predefined globals supplied by GDC when it builds druntime and phobos. Presumably you can patch GDC to override whatever it currently defines. If you are reluctant to do so, we need to know exactly what it does provide and what they mean. I think you're saying GDC will compile druntime with the predefined globals Such a scheme would be problematic however, as it doesn't provide a good way to differentiate between glibc and bionic in druntime. I suppose we could take |
The idea is that you shouldn't have bionic and glibc in the same sources. |
Perhaps that is possible under your proposed platform reorg of druntime being discussed in pull #732, but it's not the way druntime is organized today. My android pulls will just be provisional for now, for early devs and testers to bang on. We'll reorganize them once you guys iron out the details of the druntime platform reorg. |
Rest is OK. |
lgtm, @ibuclaw to pull |
Thanks @andralex |
Auto-merge toggled on |
First Android/x86 patch that produces a working D executable
This is the first patch where I was able to build actual D Android/x86 executables that use the core of druntime, cleaned up a bit since. I tried to follow the existing naming conventions in druntime, like sigaction_t and stat_t. There were two unnecessary uses of version(Posix) that I removed. FD_(CLR|SET|ISSET|ZERO) are defined in assembly in bionic. I didn't bother translating them, since they aren't used anywhere but the unit tests. This patch alone can't actually be used to build executables, as it needs a sections_android.d and mak/SRCS needs to be trimmed to only include these files. Those patches will come next.