Date: Thu, 14 Apr 2011 04:06:54 -0700 (PDT) From: Vassilis Laganakos <vassilis.laganakos@yahoo.com> To: Damjan Marion <damjan.marion@gmail.com> Cc: "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org> Subject: Re: LLVM/Clang cross-compiling for ARM Message-ID: <475540.33003.qm@web112105.mail.gq1.yahoo.com>
next in thread | raw e-mail | index | archive | help
Hi Damjan, Mark,=0A=0A----- Original Message -----=0A=0A> From:Damjan Mario= n <damjan.marion@gmail.com>=0A> To:Mark Tinguely <marktinguely@gmail.com>= =0A> Cc:Vassilis Laganakos <vassilis.laganakos@yahoo.com>; "freebsd-arm@fre= ebsd.org" <freebsd-arm@freebsd.org>=0A> Sent:Thursday, April 14, 2011 8:13 = AM=0A> Subject:Re: LLVM/Clang cross-compiling for ARM=0A> =0A> =0A> Hi Mark= ,=0A> =0A> Seems that clang from current (made by i386 buildworld) is able = to build ARM =0A> code:=0A> =0A> # clang -v=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A> =A0 =A0 FreeBSD clang= version 2.9 (trunk 126547) 20110226=0A> Target: i386-undermydesk-freebsd9.= 0=0A> Thread model: posix=0A> =0AThat's the same I get when I build llvm/cl= ang as a cross-compiler, and I thought that=0Asomething was wrong. I'd expe= ct that to be: "arm-unknown-freebsd9.0", but it=0Aseems from your test bell= ow that it does generate ARM code.=0A=0A> # clang -march=3Darmv7-a -mfloat-= abi=3Dsoft -ccc-host-triple arm-elf -integrated-as =0A> hello.c -o hello.o = -c=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A> =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =0A> # file hello.o=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =0A> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A> =A0 =0A> hello.o: ELF 32-bit LSB relo= catable, ARM, version 1 (SYSV), not stripped=0A> =0A> # clang -march=3Darmv= 7-a -mfloat-abi=3Dsoft -ccc-host-triple arm-elf hello.c -o =0A> hello.S -S= =0A> =0A> # cat hello.S=0A> =0A> =A0=A0=A0 .syntax unified=0A> =A0=A0=A0 .c= pu cortex-a8=0A> =A0=A0=A0 .eabi_attribute 6, 10=0A> =A0=A0=A0 .eabi_attrib= ute 7, 65=0A> =A0=A0=A0 .eabi_attribute 8, 1=0A> =A0=A0=A0 .eabi_attribute = 9, 2=0A> =A0=A0=A0 .eabi_attribute 10, 2=0A> =A0=A0=A0 .eabi_attribute 20, = 1=0A> =A0=A0=A0 .eabi_attribute 21, 1=0A> =A0=A0=A0 .eabi_attribute 23, 3= =0A> =A0=A0=A0 .eabi_attribute 24, 1=0A> =A0=A0=A0 .eabi_attribute 25, 1=0A= > =A0=A0=A0 .file=A0=A0=A0 "hello.c"=0A> =A0=A0=A0 .text=0A> =A0=A0=A0 .glo= bl=A0=A0=A0 main=0A> =A0=A0=A0 .align=A0=A0=A0 2=0A> =A0=A0=A0 .type=A0=A0= =A0 main,%function=0A> main:=0A> =A0=A0=A0 push=A0=A0=A0 {r11, lr}=0A> =A0= =A0=A0 mov=A0=A0=A0 r11, sp=0A> =A0=A0=A0 sub=A0=A0=A0 sp, sp, #12=0A> =A0= =A0=A0 mov=A0=A0=A0 r0, #0=0A> =A0=A0=A0 str=A0=A0=A0 r0, [r11, #-4]=0A> = =A0=A0=A0 str=A0=A0=A0 r0, [sp, #4]=0A> =A0=A0=A0 movw=A0=A0=A0 r0, :lower1= 6:.L.str=0A> =A0=A0=A0 movt=A0=A0=A0 r0, :upper16:.L.str=0A> =A0=A0=A0 bl= =A0=A0=A0 printf=0A> =A0=A0=A0 str=A0=A0=A0 r0, [sp]=0A> =A0=A0=A0 ldr=A0= =A0=A0 r0, [sp, #4]=0A> =A0=A0=A0 mov=A0=A0=A0 sp, r11=0A> =A0=A0=A0 ldmia= =A0=A0=A0 sp!, {r11, pc}=0A> .Ltmp0:=0A> =A0=A0=A0 .size=A0=A0=A0 main, .Lt= mp0-main=0A> =0A> =A0=A0=A0 .type=A0=A0=A0 .L.str,%object=0A> =A0=A0=A0 .se= ction=A0=A0=A0 .rodata.str1.1,"aMS",%progbits,1=0A> .L.str:=0A> =A0=A0=A0 .= asciz=A0=A0=A0 "Hello World!\n"=0A> =A0=A0=A0 .size=A0=A0=A0 .L.str, 14=0A= >=0A=0A=0AWell you proved the opposite from what we assumed, since this loo= ks like ARM assembly to me :)=0A=0AAnyone knows if something has changed in= http://wiki.freebsd.org/BuildingFreeBSDWithClang=0Asince it was last edite= d?=0A=0A=0ADamjan, if you find some more info about this with llvm/clang, c= ould you please post=0Athe links here? :)=0A=0AThanks,=0AVassilis=0A
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?475540.33003.qm>