November 15, 2013
On Friday, 15 November 2013 at 06:18:00 UTC, Joakim wrote:
> On Friday, 15 November 2013 at 00:18:50 UTC, Martin Nowak wrote:
>> On 11/14/2013 05:14 PM, Kai Nacke wrote:
>>> But this is only half of the story. My target is Linux/ARM which is
>>> already supported by druntime/phobos. If you target a smartphone then
>>> you also have to add Android or iOS support to druntime/phobos.
>>
>> Currently version (linux) in druntime is equivalent to glibc.
>> Porting druntime to bionic or newlib might be quite an effort but I have no concrete idea what issues to expect.
>
> As Kai says, has anyone worked on getting D running on Android before?  I've been thinking about attempting an Android port for years.  I thought I'd spin up some x86 VMs this weekend and take a crack at getting D working on Android/x86 (http://www.android-x86.org/) as a first step.  If anyone has started on this already, I could chip in on their branch.
>
> Also, does dmd have any support for cross-compilation or is it better to stick to ldc/gdc when cross compiling to Android?
>
> On a related note, it looks like Rust was ported to Android/ARM earlier this year:
>
> https://github.com/mozilla/rust/wiki/Doc-building-for-android

Yes, have a look at an initial port of GDC to Android

https://bitbucket.org/goshawk/gdc/wiki/GDC%20on%20Android
November 15, 2013
On 2013-11-15 00:35, Manu wrote:

> Very good point. I wonder if there's room to make a push for this in 2.065.

Highly  unlikely. It seems like Walter wanted us to first implement ARC, to not be worse the Objective-C currently is. But we haven't been able to come to an agreement on how to do that.

As Michel noted it currently only supports 32bit and the legacy runtime. Although I think it still would be usable to include, even without ARC and 64bit/modern runtime. It will just get harder to keep up to date the longer time it takes.

http://forum.dlang.org/thread/kq7li9$2j9v$1@digitalmars.com?page=4#post-kqcm79:241eqf:241:40digitalmars.com

http://forum.dlang.org/thread/l34lei$255v$1@digitalmars.com

-- 
/Jacob Carlborg
November 15, 2013
On 2013-11-15 02:50, Michel Fortin wrote:

> Still no modern runtime support I'd guess? With support only for the
> legacy runtime you're stuck compiling for 32-bit OS X only; 32-bit iOS
> uses the modern runtime.

Right, I forgot about that. I haven't done a single thing on this since the last time I announced it.

> And since the DMD backend won't emit ARM code, if I were still working
> on this the first thing I'd do is rebase everything to work on top of LDC.

I think that would be quite difficult. Although it would probably be easier to get 64bit and modern runtime support. An advantage of doing it in DMD (except that it's already in DMD) is that it's probably a bigger chance of it being officially added to D and not just an extension to LDD. If it's added to DMD it will automatically be merged by both LDC and GDC.

Another idea would be to add it to DMD with the current platform support. Then when it's merged with LDC, let them add support for ARM, 64bit and modern runtime.

BTW, do you automatically scan the newsgroups for "http://michelf.ca/projects/d-objc/" :)

-- 
/Jacob Carlborg
November 15, 2013
On Friday, 15 November 2013 at 07:22:07 UTC, Paulo Pinto wrote:
> On Friday, 15 November 2013 at 06:18:00 UTC, Joakim wrote:
>> As Kai says, has anyone worked on getting D running on Android before?  I've been thinking about attempting an Android port for years.  I thought I'd spin up some x86 VMs this weekend and take a crack at getting D working on Android/x86 (http://www.android-x86.org/) as a first step.  If anyone has started on this already, I could chip in on their branch.
>
> Yes, have a look at an initial port of GDC to Android
>
> https://bitbucket.org/goshawk/gdc/wiki/GDC%20on%20Android

Thanks for the link.  It looks like Johannes Pfau took a stab at getting some minimal Android support into gdc a couple years back, with the handful of small patches listed here:

https://bitbucket.org/jpf/gdc/branch/android

Anyone get any farther than that?

Would it make sense to use dmd for linux/x86 to cross-compile to Android/x86 or is this a job for ldc/gdc only?
November 15, 2013
On Friday, 15 November 2013 at 08:24:55 UTC, Joakim wrote:
> On Friday, 15 November 2013 at 07:22:07 UTC, Paulo Pinto wrote:
>> On Friday, 15 November 2013 at 06:18:00 UTC, Joakim wrote:
>>> As Kai says, has anyone worked on getting D running on Android before?  I've been thinking about attempting an Android port for years.  I thought I'd spin up some x86 VMs this weekend and take a crack at getting D working on Android/x86 (http://www.android-x86.org/) as a first step.  If anyone has started on this already, I could chip in on their branch.
>>
>> Yes, have a look at an initial port of GDC to Android
>>
>> https://bitbucket.org/goshawk/gdc/wiki/GDC%20on%20Android
>
> Thanks for the link.  It looks like Johannes Pfau took a stab at getting some minimal Android support into gdc a couple years back, with the handful of small patches listed here:
>
> https://bitbucket.org/jpf/gdc/branch/android
>
> Anyone get any farther than that?
>
> Would it make sense to use dmd for linux/x86 to cross-compile to Android/x86 or is this a job for ldc/gdc only?

I would say ldc/gdc only, as LLVM/gcc are the supported NDK toolchains and dmd lacks an ARM backend.
November 15, 2013
On Friday, 15 November 2013 at 08:54:21 UTC, Paulo Pinto wrote:
> On Friday, 15 November 2013 at 08:24:55 UTC, Joakim wrote:
>> Would it make sense to use dmd for linux/x86 to cross-compile to Android/x86 or is this a job for ldc/gdc only?
>
> I would say ldc/gdc only, as LLVM/gcc are the supported NDK toolchains and dmd lacks an ARM backend.

Yeah, I'm aware of these facts, but I don't think they matter.  For one, dmd not having an ARM backend doesn't impact me since I'm targeting Android/x86 for now, :) as stated earlier.  I don't think it's relevant what toolchains are integrated into the NDK as, for example, the Free Pascal compiler can now compile to Android and it isn't based on gcc or llvm:

http://wiki.freepascal.org/Android

I think the bigger issue is that llvm/gcc and therefore ldc/gdc have support for cross-compilation, but I don't know the status of cross-compiling support with dmd.
November 15, 2013
On Friday, 15 November 2013 at 09:20:18 UTC, Joakim wrote:
> On Friday, 15 November 2013 at 08:54:21 UTC, Paulo Pinto wrote:
>> On Friday, 15 November 2013 at 08:24:55 UTC, Joakim wrote:
>>> Would it make sense to use dmd for linux/x86 to cross-compile to Android/x86 or is this a job for ldc/gdc only?
>>
>> I would say ldc/gdc only, as LLVM/gcc are the supported NDK toolchains and dmd lacks an ARM backend.
>
> Yeah, I'm aware of these facts, but I don't think they matter.  For one, dmd not having an ARM backend doesn't impact me since I'm targeting Android/x86 for now, :) as stated earlier.  I don't think it's relevant what toolchains are integrated into the NDK as, for example, the Free Pascal compiler can now compile to Android and it isn't based on gcc or llvm:
>
> http://wiki.freepascal.org/Android
>
> I think the bigger issue is that llvm/gcc and therefore ldc/gdc have support for cross-compilation, but I don't know the status of cross-compiling support with dmd.

Yes, but FreePascal already had an ARM backend before they started with Android, and cross-compiling support infrastructure.

As far as I know dmd does not support cross compiling.

--
Paulo
November 15, 2013
On 15 November 2013 09:45, Paulo Pinto <pjmlp@progtools.org> wrote:

> On Friday, 15 November 2013 at 09:20:18 UTC, Joakim wrote:
>
>> On Friday, 15 November 2013 at 08:54:21 UTC, Paulo Pinto wrote:
>>
>>> On Friday, 15 November 2013 at 08:24:55 UTC, Joakim wrote:
>>>
>>>> Would it make sense to use dmd for linux/x86 to cross-compile to Android/x86 or is this a job for ldc/gdc only?
>>>>
>>>
>>> I would say ldc/gdc only, as LLVM/gcc are the supported NDK toolchains and dmd lacks an ARM backend.
>>>
>>
>> Yeah, I'm aware of these facts, but I don't think they matter.  For one, dmd not having an ARM backend doesn't impact me since I'm targeting Android/x86 for now, :) as stated earlier.  I don't think it's relevant what toolchains are integrated into the NDK as, for example, the Free Pascal compiler can now compile to Android and it isn't based on gcc or llvm:
>>
>> http://wiki.freepascal.org/Android
>>
>> I think the bigger issue is that llvm/gcc and therefore ldc/gdc have support for cross-compilation, but I don't know the status of cross-compiling support with dmd.
>>
>
> Yes, but FreePascal already had an ARM backend before they started with Android, and cross-compiling support infrastructure.
>
> As far as I know dmd does not support cross compiling.
>
> --
> Paulo
>


-m32/-m64 is the closest you'll get to a cross-compilation in dmd. ;-)

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


November 15, 2013
On 2013-11-15 10:45, Paulo Pinto wrote:

> As far as I know dmd does not support cross compiling.

Only for 32bit/64bit on the same architecture.

-- 
/Jacob Carlborg
November 15, 2013
On 2013-11-15 00:35, Manu wrote:

> Very good point. I wonder if there's room to make a push for this in 2.065.

Note, I'm willing work on to syncing my branches to upstream if Walter is interested in this. Getting support for 64bit and modern runtime would be too far away for this release.

-- 
/Jacob Carlborg