scummvm/scummvm — pull request #444 by lordhoto (2014-03-06 20:40:56+00:00)
Title: IPHONE: Support clang based toolchain

As the title indicates this allows us to use a clang based toolchain based on this toolchain: https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/wiki/HowTo_en We do not actually support exactly that toolchain but a slightly further patched one. I describe how to build this one over here: http://lordhoto.users.sourceforge.net/BUILD-IOS.txt

I had to slightly patch ScummVM's ARM assembly files to work with the cctools' AS assembler because it doesn't auto align code. Actually there's further issues with some of our ARM assembly files and the cctools' AS assembler, but I patched AS for that (that it also accepts uppercase mnemonics and that it accepts ".global" instead of ".global"), that is one further patch I added on top of the original toolchain patchset (in the hope it makes AS work with third party's GNU AS sources too, but sadly it doesn't with the external libraries I tried...). In theory we might also change all mnemonics to lowercase and replace .global by .global. This latter two might be required for supporting the official iOS toolchain (if somebody has access to a modern one and could test assembling, for example, engines/scumm/gfxARM.s that would be cool!).

One big advantage should be that we now support a slightly more standard iOS toolchain and furthermore should not need to rely on the iOS 5+ hack in the iphonebundle target anymore because the toolchain will use the modern/working startup code. I also made sure that we can build with iOS SDK 3.1.2 and thus still should be able to support first gen iPhone hardware.

The real annoyance is that we cannot use libmad's etc. ARM assembly anymoe because it doesn't assemble with cctools' AS... Any feedback/suggestions would be appreciated here. XBMC seems to use some preprocessing script for assembly files: https://gitorious.org/xbmc/xbmc/source/acb12233beb7212778708b784d663f5fc46c6f2a:tools/osx/ios-depends/gas-preprocessor/gas-preprocessor.pl Maybe we can steal from that and patch cctools' AS or simply insert nicely working script ourselves.