[GSoC 2017] Porting Swift to Haiku - Week #1 / #2

Hello everyone!

Last week I introduced myself and my GSoC project on porting Swift to Haiku, which can be found here in case if you missed it. The bonding period so far involved a mix of initial communication with my mentors jua_ and korli (Thanks for merging my HaikuPorter recipes!) alongside receiving assistance from other haiku-devs, notably PulkoMandy and waddlesplash. In addition, I mostly spent the week researching the swift front-end driver internals [1] by reading its documentation, patching more script files used for building swift and meeting several other GSoC students on IRC/mailing lists; and I wish them good luck with their projects. Shortly afterwards, I’ve made contact with the swift-dev mailing list about this project and asked about adding 32 bit support and both ideas are acceptable with the swift community [2]. But until the x86_64 port has a functioning toolchain, x86 support will be considered later.


This is a companion discussion topic for the original entry at https://www.haiku-os.org/blog/return0e/2017-05-22_%5Bgsoc_2017%5D_porting_swift_to_haiku_-_week_1_2/

Great progress so far!

I’m looking forward to the WIP recipe to try out :slight_smile:
Have you been able to resolve the locking problems yet?

Oh, and if you need help with implementing things like dl_iterate_phdr(), don’t hesitate to ask on the ML.

I’ve tracked down the bug that involves passing a null Mutex handle, somewhere inside the ProtocolConformance class and Metadata classes which are both used for initializing/looking up runtime type metadata in dynamically linked libraries generated by swift. As dl_iterate_phdr() isn’t avaliable on Haiku, (I had to comment it out for it to compile.) the initialization that happens when running a swift binary won’t work and will result in a crash. Here’s a crash report when running either a swift file or executable.

What is needed ATM is a Haiku equivalent for dl_iterate_phdr() maybe get_next_image_info() could be used for this? I’ll see if I can get a recipe out this week. :slight_smile: