From owner-freebsd-arm@FreeBSD.ORG Thu Apr 14 07:14:02 2011 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56AD7106564A for ; Thu, 14 Apr 2011 07:14:02 +0000 (UTC) (envelope-from damjan.marion@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id D72688FC0A for ; Thu, 14 Apr 2011 07:14:01 +0000 (UTC) Received: by wwc33 with SMTP id 33so1532161wwc.31 for ; Thu, 14 Apr 2011 00:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer; bh=Uxlz0wJEFbVNSTamRRcCRu4EeFs6TUUJxrwKyN7TrRs=; b=XqN0uaVCALHQgtvBGEI9f5YrbJ3IkZUYjwknr4mS958i5hY4Yk+fk6GmOEhvacltKR l07k6PCxt7FHj7parGHe3CbuHfG01VYPblDbG0WBqoHw72TYxeb9eaA9K4r+/0HNFPDK tqLoht1KOsVQvxmDCPCPUOei56XeAx5AfntF4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=qqPVYpWEvebTyVq9iAqgCnIVBQY8x9qIlyyEMSh6jGXaO54FhgWF/fmoglb04xi/jA uE5EGUhJPlSwOfZhFjDF1c8OS7LhOsYpTAcWe2I6k6n8Hib4e9u5XYUJm0zVrk46VUvq a+sRojH7DYvejXxiQj4XFM6qrNAEks9O6FZMQ= Received: by 10.217.7.4 with SMTP id z4mr5991027wes.89.1302765239116; Thu, 14 Apr 2011 00:13:59 -0700 (PDT) Received: from [192.168.123.4] (cpe-109-60-66-194.zg3.cable.xnet.hr [109.60.66.194]) by mx.google.com with ESMTPS id bd8sm791980wbb.31.2011.04.14.00.13.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Apr 2011 00:13:58 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Damjan Marion In-Reply-To: <4DA65B0F.1040807@gmail.com> Date: Thu, 14 Apr 2011 09:13:55 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <714C855E-0EC8-4129-A1A4-C9C978D1B349@gmail.com> References: <794721.93419.qm@web112111.mail.gq1.yahoo.com> <574B5BB8-3BD6-4C87-9FC7-9549C02A2FCD@gmail.com> <4DA65B0F.1040807@gmail.com> To: Mark Tinguely X-Mailer: Apple Mail (2.1084) Cc: "freebsd-arm@freebsd.org" Subject: Re: LLVM/Clang cross-compiling for ARM X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2011 07:14:02 -0000 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 # clang -march=3Darmv7-a -mfloat-abi=3Dsoft -ccc-host-triple arm-elf = -integrated-as hello.c -o hello.o -c = =20 # file hello.o = = =20 hello.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped # clang -march=3Darmv7-a -mfloat-abi=3Dsoft -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 Regards, Damjan On Apr 14, 2011, at 4:25 AM, Mark Tinguely wrote: > =46rom distant memory, Clang was looking up the current processor and = compiled in the assembly options for that architecture (i386). I can't = remember if it was still kicking out i386 assembly as well. One idea I = had was short-circuit the answer to those architecture queries and = return "arm". >=20 > Has anyone tried to compile Clang on an ARM arch and then build world = with that? I suppose that would be a slow development environment. >=20 > --Mark. >=20 > On 4/13/2011 5:35 PM, Damjan Marion wrote: >> Hi Vassilis, >>=20 >> On Apr 14, 2011, at 12:02 AM, Vassilis Laganakos wrote: >>=20 >>> Hello Damjan, >>>=20 >>> ----- Original Message ----- >>>> From:Damjan Marion >>>> To:freebsd-arm@freebsd.org >>>> Cc: >>>> Sent:Sunday, April 10, 2011 5:10 PM >>>> Subject:Re: LLVM/Clang cross-compiling for ARM >>>>=20 >>>>=20 >>>> Hi, >>>>=20 >>>> What is the current status of LLVM/Clang cross-compiling for ARM = targets? >>>> Is anybody working actively on this? >>>>=20 >>> I started taking a look into building llvm as cross-compiler >>> for ARM and trying to build -CURRENT for an existing port, >>> so see how far we get :) >>>=20 >>> I'm currently stuck a bit in the first step :) As Mark T. pointed >>> out in a recent email, llvm in -CURRENT does not cross-build, >>> so we have to use an external compiler for now. >> What exactly is missing in current version of llvm in -CURRENT? >>=20 >> After reading some high level overview of llvm i was under impression >> that llvm natively supports multiple targets, but seems that I was = wrong. >>=20 >>> I'll hopefully get back soon with some useful info about this... >> Cool, please keep us updated. >>=20 >> Thanks, >>=20 >> Damjan >> _______________________________________________ >> freebsd-arm@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-arm >> To unsubscribe, send any mail to = "freebsd-arm-unsubscribe@freebsd.org" >>=20 >=20