Skip to content

chnmrc/swift4arm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 

Repository files navigation

Swift4Arm

Swift 4 Arm

  1. Integration Major Problem

  2. Brief Introduction

  3. Memory managment

  4. Patch Procedure

  5. Download binary



Integration Major Problem

  • Problem on: /proc/cpu/alignment
  • Memory Managment
  • ARCH build support

Brief Introduction

All began on early 2018 and i was complaining on the fact that swift on arm32 was kind on a frozen status.

And i thought it's not possible we must do something before it is to late, at this moment we were on the early swift 4.1 pre release and then swift on arm32 was exactly one major release behind.

At the beginning i tried all different compile setting and i made also some comparison with a x86 linux system but this was only wasting time.

Then i tried all possible llvm/clang version and the same result.

After that i made the decision to scan completely the source code and it paid off.

I found just at the early stage the solution for the /proc/cpu/alignment problem that gave me a lot confidence that we don’t take so long for resolving this arm32 issue but at the end the must challenging part has to come.

Memory managment

An important topic in this a kind of project.
I started to look at the glibc in particular on the malloc.c and here i tried different version but since glibc in the last releases is very solid i switched back to version 2.23.
My feeling is that malloc is very robust.
After this i made the decision to let malloc to do the alignment. Then NIO come out and that got me the final motivation to keep fighting.
I know Norman Maurer from the java community, and i thought if he does something like this it must be well done and it is.
And what for a great opportunity for such a kind of arm32 devices so a lot of ideas comes in my mind like a NIO based scalable MQTT broker.
Here i want to thank's both of @normanmaurer and @helge for the quick integration of arm32 on NIO.
At the end i come to this patch release what i think is not the ideal solution but the most important thing is we have now a working environment to work on.
And finally this great announcement i was so surprised thank you apple and always thank you steve

Patch Procedure

  • git checkout git clone https://github.com/apple/swift
  • git checkout of all depency swift packages ./swift/utils/update-checkout --clone
  • git checkout swift-4.1.2-RELEASE branch on all modules
  • apply the patch on the starting directory -> patch -p4 < swift4arm.patch
  • Now you are ready for the building procedure
  • Consult also the great @uraimo resource
  • For a Docker installation i advice to follow the work of @helge
  • For Swift on arm64 follow the work of @futurejones
  • For further question please contact the swift arm slack group

Download binary

Here you can download the complete binary tar.
I tested it against several projects : Kitura, SwiftNIO etc. feel free to report any issue.



For any challenging project swift related feel free to contact me info@mchini.com.



Marco Chini info@mchini.com

Releases

No releases published

Packages

No packages published