« Page Setup Dialog exa… | Home | FileMaker 18 File Scr… »

LLVM Bitcode

Did you know that Bitcode feature in Xcode and LLVM made it possible for Apple to recompile all 32-bit apps for the Apple Watch as 64-bit versions?

Bitcode is the representation of the app as the LLVM compiler internally uses it. The platform independent part parses code, optimizes and then passes this intermediate representation to the platform specific code generator, which then builds machine instructions for the target processor. Instead of outputting 32-bit code, Apple took the intermediate representation (the Bitcode) and let LLVM make a 64-bit version. A few tweaks may be needed like stubs to take 32-bit arguments and than call system functions with 64-bit values, but it looks like Apple figured that out.

Now if Apple goes someday with ARM processor for MacOS, the Bitcode in Mac apps (on the App Store) could allow the system to recompile the app for ARM 64-bit automatically. The developer uploaded his applications to Mac App Store and if bitcode is included, Apple could deliver them as ARM 64-bit for newer Macs automatically. Or if the bitcode is delivered with the final application, this could be done on the Mac on first-run.

I think that is a great way to make transition easier and not require an emulation at runtime like Rosetta for PPC code.

And to play with the bitcode option, I build a couple of libraries with bitcode and got a the MBS FileMaker Plugin for iOS built with Bitcode included. For a test with our MBS Xojo Plugins, I built a few of them with bitcode enabled. Maybe I can do the same for MacOS and make sure our plugin would benefit from an on device recompilation if such transition happens. But for now, we keep this as an experiment and disable bitcode again. Claris FileMaker Plugin
02 06 19 - 12:45