Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Apr 2011 07:43:57 -0500
From:      Mark Tinguely <marktinguely@gmail.com>
To:        Vassilis Laganakos <vassilis.laganakos@yahoo.com>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: LLVM/Clang cross-compiling for ARM
Message-ID:  <4DA6EC0D.3070301@gmail.com>
In-Reply-To: <475540.33003.qm@web112105.mail.gq1.yahoo.com>
References:  <475540.33003.qm@web112105.mail.gq1.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/14/2011 6:06 AM, Vassilis Laganakos wrote:
> Hi Damjan, Mark,
>
> ----- Original Message -----
>
>> From:Damjan Marion<damjan.marion@gmail.com>
>> To:Mark Tinguely<marktinguely@gmail.com>
>> Cc:Vassilis Laganakos<vassilis.laganakos@yahoo.com>; "freebsd-arm@freebsd.org"<freebsd-arm@freebsd.org>
>> Sent:Thursday, April 14, 2011 8:13 AM
>> Subject:Re: LLVM/Clang cross-compiling for ARM
>>
>>
>> Hi Mark,
>>
>> Seems that clang from current (made by i386 buildworld) is able to build ARM
>> code:
>>
>> # clang -v                                                                     
>>                                                                                 
>>      FreeBSD clang version 2.9 (trunk 126547) 20110226
>> Target: i386-undermydesk-freebsd9.0
>> Thread model: posix
>>
> That's the same I get when I build llvm/clang as a cross-compiler, and I thought that
> something was wrong. I'd expect that to be: "arm-unknown-freebsd9.0", but it
> seems from your test bellow that it does generate ARM code.
>
>> # clang -march=armv7-a -mfloat-abi=soft -ccc-host-triple arm-elf -integrated-as
>> hello.c -o hello.o -c                                                           
>>                   
>> # file hello.o                                                                 
>>                                                                                 
>>   
>> hello.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
>>
>> # clang -march=armv7-a -mfloat-abi=soft -ccc-host-triple arm-elf hello.c -o
>> hello.S -S
>>
>> # cat hello.S
>>
>>      .syntax unified
>>      .cpu cortex-a8
>>      .eabi_attribute 6, 10
>>      .eabi_attribute 7, 65
>>      .eabi_attribute 8, 1
>>      .eabi_attribute 9, 2
>>      .eabi_attribute 10, 2
>>      .eabi_attribute 20, 1
>>      .eabi_attribute 21, 1
>>      .eabi_attribute 23, 3
>>      .eabi_attribute 24, 1
>>      .eabi_attribute 25, 1
>>      .file    "hello.c"
>>      .text
>>      .globl    main
>>      .align    2
>>      .type    main,%function
>> main:
>>      push    {r11, lr}
>>      mov    r11, sp
>>      sub    sp, sp, #12
>>      mov    r0, #0
>>      str    r0, [r11, #-4]
>>      str    r0, [sp, #4]
>>      movw    r0, :lower16:.L.str
>>      movt    r0, :upper16:.L.str
>>      bl    printf
>>      str    r0, [sp]
>>      ldr    r0, [sp, #4]
>>      mov    sp, r11
>>      ldmia    sp!, {r11, pc}
>> .Ltmp0:
>>      .size    main, .Ltmp0-main
>>
>>      .type    .L.str,%object
>>      .section    .rodata.str1.1,"aMS",%progbits,1
>> .L.str:
>>      .asciz     "Hello World!\n"
>>      .size    .L.str, 14
>>
>
> Well you proved the opposite from what we assumed, since this looks like ARM assembly to me :)
>
> Anyone knows if something has changed in http://wiki.freebsd.org/BuildingFreeBSDWithClang
> since it was last edited?
>
>
> Damjan, if you find some more info about this with llvm/clang, could you please post
> the links here? :)
>
> Thanks,
> Vassilis
>
>

Good news. Thank-you for the update.

--Mark.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DA6EC0D.3070301>