[cfe-dev] Targeting ARM with Clang

Philippe Hausler phausler at gmail.com
Sun Jul 18 11:14:59 PDT 2010


On Jul 18, 2010, at 12:49 PM, Chris Lattner wrote:

> 
> On Jul 18, 2010, at 4:34 AM, Zhongxing Xu wrote:
> 
>> On Sat, Jul 17, 2010 at 4:47 AM, Anton Korobeynikov
>> <anton at korobeynikov.info> wrote:
>>>> ./Debug+Asserts/bin/clang -arch armv7 -S -O3 -o - hello.c
>>> -arch is darwin-only thing though...
>> 
>> Why -arch is darwin-only?
> 
> Because clang needs to know what assembler, linker, libraries etc to use for arm.  Darwin supports -arch throughout the entire toolchain, so clang can just run "as -arch armv7".  Linux and other targets don't have anything like this, and noone has enhanced clang to support the linux model.

I am facing a similar issue as the original poster; I am targeting both ARM and x86 linux platforms, building on Mac OS X. Would it be possible to gain -arch support via defining a ToolChain instead of using the -ccc-host-triple and piping the assembly into the platform assembler? This I assume would require then building a driver driver for that platform?

Additionally is there a way when defining a ToolChain to replace potentially incompatible assembly calls before its sent to the assembler?

Any insight/suggestions on where to look up more detailed information on defining a ToolChain would be appreciated.

Sincerely,
Philippe Hausler



More information about the cfe-dev mailing list