Thread overview
LDC for iOS prebuilt binaries
Jul 09, 2015
Dan Olson
Jul 10, 2015
Manu
Jul 10, 2015
Dan Olson
Jul 10, 2015
Elvis Zhou
Jul 10, 2015
Jack Stouffer
Jul 10, 2015
Dan Olson
Jul 10, 2015
Rishub Nagpal
Jul 10, 2015
Joakim
July 09, 2015
I've made a set of binaries and universal libs for the LDC iOS cross-compiler.  It is based on LDC 0.15.1 (2.066) and LLVM 3.5.1.

https://github.com/smolt/ldc-iphone-dev/releases/tag/ios-0.15.1-150708

Only 32-bit devices currently; arm64 work starts next month when I acquire an iPhone 6.

The download should have everything needed to run on an OS X build host in the same fashion as LDC downloads.  But I may have missed something. Feedback appreciated.
-- 
Dan
July 10, 2015
Possible to make cross compilers for other hosts?
Who uses a mac? ;)

On 9 July 2015 at 16:32, Dan Olson via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> I've made a set of binaries and universal libs for the LDC iOS cross-compiler.  It is based on LDC 0.15.1 (2.066) and LLVM 3.5.1.
>
> https://github.com/smolt/ldc-iphone-dev/releases/tag/ios-0.15.1-150708
>
> Only 32-bit devices currently; arm64 work starts next month when I acquire an iPhone 6.
>
> The download should have everything needed to run on an OS X build host in the same fashion as LDC downloads.  But I may have missed something. Feedback appreciated.
> --
> Dan
July 10, 2015
Manu via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> writes:
>
> Possible to make cross compilers for other hosts?
> Who uses a mac? ;)

Hi Manu - I wish I knew the answer.  I assume you are thinking Windows. I just looked at some stackoverflow answers, specifically at Xamarin.iOS for Windows, and all seem to require a Mac at somepoint in the iOS dev process.

Just thinking now as I type:
- druntime, and phobos as built should be fine, since they are already
   cross compiled for iOS/arm
- ldc could be built as an iOS cross compiler on Windows with a little
   work
- that leaves: cross linker (I think Apple open sources it), and app
   tools to create, sign, and download apps.  Maybe someone in the
   field knows a solution.

http://developer.xamarin.com/guides/ios/getting_started/installation/windows/

http://stackoverflow.com/questions/22358/how-can-i-develop-for-iphone-using-a-windows-development-machine

-- 
Dan

July 10, 2015
On Friday, 10 July 2015 at 05:38:47 UTC, Dan Olson wrote:
> Manu via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> writes:
>> [...]
>
> [...]

http://www.itoolchain.com/
or
iPhone toolchain on cygwin
July 10, 2015
On Thursday, 9 July 2015 at 06:32:28 UTC, Dan Olson wrote:
> Only 32-bit devices currently; arm64 work starts next month when I acquire an iPhone 6.
>
> The download should have everything needed to run on an OS X build host in the same fashion as LDC downloads.

Great work. D will get a huge boost in popularity if it can work on mobile devices.

Does this have any way to call the iOS Obj-C libraries for UI rendering and the like? Or is that a separate project?
July 10, 2015
"Jack Stouffer" <jack@jackstouffer.com> writes:
>
> Does this have any way to call the iOS Obj-C libraries for UI rendering and the like? Or is that a separate project?

It is a separate project and is gradually getting pulled into DMD:

http://forum.dlang.org/post/mnm1sf$kp8$1@digitalmars.com

For now, you can write UI part in Objective-C and rest as D.  From D you could call any of the C-based graphics APIs (e.g. CGContextFillRect) but you'd have to write declarations - or try out Dstep:

https://github.com/jacob-carlborg/dstep

Another approach is using a framework with D bindings like Allegro5.

http://forum.dlang.org/post/m2sicg48ff.fsf@comcast.net

This looked promising but I have not pursed beyond that post.
-- 
Dan
July 10, 2015
On Thursday, 9 July 2015 at 06:32:28 UTC, Dan Olson wrote:
> I've made a set of binaries and universal libs for the LDC iOS cross-compiler.  It is based on LDC 0.15.1 (2.066) and LLVM 3.5.1.
>
> https://github.com/smolt/ldc-iphone-dev/releases/tag/ios-0.15.1-150708
>
> Only 32-bit devices currently; arm64 work starts next month when I acquire an iPhone 6.
>
> The download should have everything needed to run on an OS X build host in the same fashion as LDC downloads.  But I may have missed something. Feedback appreciated.

Good Work! I'd like to help get D to work on android, but I do not know much about llvm and arm compilers to be of much help. Last I heard there was an issue with exception handling and TLS, is that still so?

anyway, good job!
July 10, 2015
On Friday, 10 July 2015 at 20:38:16 UTC, Rishub Nagpal wrote:
> On Thursday, 9 July 2015 at 06:32:28 UTC, Dan Olson wrote:
>> I've made a set of binaries and universal libs for the LDC iOS cross-compiler.  It is based on LDC 0.15.1 (2.066) and LLVM 3.5.1.
>>
>> https://github.com/smolt/ldc-iphone-dev/releases/tag/ios-0.15.1-150708
>>
>> Only 32-bit devices currently; arm64 work starts next month when I acquire an iPhone 6.
>>
>> The download should have everything needed to run on an OS X build host in the same fashion as LDC downloads.  But I may have missed something. Feedback appreciated.
>
> Good Work! I'd like to help get D to work on android, but I do not know much about llvm and arm compilers to be of much help. Last I heard there was an issue with exception handling and TLS, is that still so?

That's funny, because I was just thinking about putting my Android patches for ldc online and trying to get more people to chip in on working through the remaining tests to be fixed for Android/ARM.

I got TLS working a month and a half ago (http://forum.dlang.org/post/imkgasjuvbbasyghdggs@forum.dlang.org) and exception-handling seems to be working since this fix I ferreted out last week (http://forum.dlang.org/post/qsfaussopqwwjuljdjrt@forum.dlang.org).  Now it's just codegen issues, with about half of phobos modules' tests failing somewhere, though many of those modules only have a handful of tests that fail.  For example, only three unit test blocks fail in std.stdio and one in std.path.  Common causes appear to be problems with ranges and functions from std.random.

I'm going through each module and commenting out failing tests and checking backtraces, a time-consuming process that's got me thinking about hacking the test runner, so that failing tests in one unit test block won't stop other test blocks from the same module from running, as is the case now.

If you or anybody else is interested in chipping in, reply in the Android thread (first link above) and I'll put some patches and build info online.  Unfortunately, to really fix any of these issues, you'll probably have to know something about ARM assembly, LLVM IR, and be comfortable stepping through the binary with gdb but without debug info, although simply triaging the tests to figure out what works and what doesn't could probably be done by almost anyone.