From owner-freebsd-toolchain@FreeBSD.ORG Fri Jun 17 17:15:41 2011 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA4211065677 for ; Fri, 17 Jun 2011 17:15:41 +0000 (UTC) (envelope-from damjan.marion@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 32A708FC14 for ; Fri, 17 Jun 2011 17:15:40 +0000 (UTC) Received: by fxm11 with SMTP id 11so530957fxm.13 for ; Fri, 17 Jun 2011 10:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:content-type:content-transfer-encoding :subject:date:message-id:to:mime-version:x-mailer; bh=nSObtUVP0gd2nusVqUuOxb+JMAZ84yI/BNQs3OafQCE=; b=YQoLp8oO4MLiywwQVR0CmtDGMwpcPzUigdUJ7w0UNJZvihf/4BEp9mTb/A8mSqix8l c9sRphhID6kXVFdxB13Z00tYZTHcprmXqJkxtt6LFGiaUAQFTNKKXzlocPl0oEkeOoKO 9wgSloF1dM78CFPasx/RuKVyj++uYuFWHU4s0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=b9tY4dN/5xe6EjvZnodCQIdqxuh6IXXXvzkNFrpgMfIa80Ap9aH2GNnIXA1CZTpIgb gze7Nz/RsnTbGPfH14ZW9lCuQhBzsAx2UbIdZKkcIzhlSoitR/TEaG+KhkSuqMiXvCLF gCRMVyQ+/70j8QRdoibHh6guVah4qGsGRQwSs= Received: by 10.223.94.78 with SMTP id y14mr383932fam.24.1308329429844; Fri, 17 Jun 2011 09:50:29 -0700 (PDT) Received: from damarion-mac.lan (93-137-62-161.adsl.net.t-com.hr [93.137.62.161]) by mx.google.com with ESMTPS id o10sm1426503fah.7.2011.06.17.09.50.26 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 17 Jun 2011 09:50:28 -0700 (PDT) From: Damjan Marion Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Fri, 17 Jun 2011 18:50:22 +0200 Message-Id: To: toolchain@freebsd.org Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) Cc: Subject: cross-compiling for arm with clang X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 17:15:41 -0000 Hi,=20 Im trying to fix cross-compiling for arm architecture using clang. I = added following patch: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Makefile.inc1 (revision 223085) +++ Makefile.inc1 (working copy) @@ -226,6 +226,11 @@ GROFF_TMAC_PATH=3D${WORLDTMP}/legacy/usr/share/tmac .endif =20 +.if ${TARGET_ARCH} !=3D ${MACHINE_ARCH} && ${CC:T:Mclang} =3D=3D = "clang" +CROSSENV+=3D CC=3D"${CC} -ccc-host-triple = ${TARGET_ARCH}-elf-freebsd" \ + CXX=3D"${CXX} -ccc-host-triple = ${TARGET_ARCH}-elf-freebsd" +.endif + # bootstrap-tools stage BMAKEENV=3D INSTALL=3D"sh ${.CURDIR}/tools/install.sh" \ PATH=3D${BPATH}:${PATH} \ Now it compiles up to stage 4.2 where it fails (). For some reason = -ccc-host-triple is not passed to compiler, but it is defined in CC.=20 Is CROSSENV right place to add -ccc-host-triple ? Any hints? Thanks, Damjan # make CC=3Dclang CXX=3Dclang++ TARGET=3Darm TARGET_CPUTYPE=3Dcortex-a9 = -DNO_CLEAN _libraries -------------------------------------------------------------- >>> stage 4.2: building libraries -------------------------------------------------------------- cd /usr/src-svn; MAKEOBJDIRPREFIX=3D/zfs/data2/src/obj/arm.arm = MACHINE_ARCH=3Darm MACHINE=3Darm CPUTYPE=3Dcortex-a9 = GROFF_BIN_PATH=3D/zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/legacy/usr/bin= = GROFF_FONT_PATH=3D/zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/legacy/usr/sh= are/groff_font = GROFF_TMAC_PATH=3D/zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/legacy/usr/sh= are/tmac CC=3D"clang -ccc-host-triple arm-elf-freebsd" CXX=3D"clang++ = -ccc-host-triple arm-elf-freebsd" = _SHLIBDIRPREFIX=3D/zfs/data2/src/obj/arm.arm/usr/src-svn/tmp = VERSION=3D"FreeBSD 9.0-CURRENT i386 900036" INSTALL=3D"sh = /usr/src-svn/tools/install.sh" = PATH=3D/zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/legacy/usr/sbin:/zfs/dat= a2/src/obj/arm.arm/usr/src-svn/tmp/legacy/usr/bin:/zfs/data2/src/obj/arm.a= rm/usr/src-svn/tmp/legacy/usr/games:/zfs/data2/src/obj/arm.arm/usr/src-svn= /tmp/usr/sbin:/zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/usr/bin:/zfs/data= 2/src/obj/arm.arm/usr/src-svn/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin = make -f Makefile.inc1 DESTDIR=3D/zfs/data2/src/obj/arm.arm/usr/src-svn/tmp= -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN = -DWITHOUT_PROFILE libraries cd /usr/src-svn; make -f Makefile.inc1 _prereq_libs; make -f = Makefile.inc1 _startup_libs; make -f Makefile.inc1 _prebuild_libs; = make -f Makefile.inc1 _generic_libs; =3D=3D=3D> gnu/lib/libssp/libssp_nonshared (obj,depend,all,install) sh /usr/src-svn/tools/install.sh -C -o root -g wheel -m 444 = libssp_nonshared.a /zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/usr/lib =3D=3D=3D> gnu/lib/libgcc (obj,depend,all,install) sh /usr/src-svn/tools/install.sh -C -o root -g wheel -m 444 = libgcc_eh.a /zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/usr/lib =3D=3D=3D> lib/libcompiler_rt (obj,depend,all,install) sh /usr/src-svn/tools/install.sh -C -o root -g wheel -m 444 = libcompiler_rt.a /zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/usr/lib /zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/usr/lib/libgcc.a -> = libcompiler_rt.a =3D=3D=3D> gnu/lib/csu (obj,depend,all,install) sh /usr/src-svn/tools/install.sh -o root -g wheel -m 444 crtbegin.o = /zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/usr/lib/crtbegin.o sh /usr/src-svn/tools/install.sh -o root -g wheel -m 444 crtend.o = /zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/usr/lib/crtend.o sh /usr/src-svn/tools/install.sh -o root -g wheel -m 444 crtbeginT.o = /zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/usr/lib/crtbeginT.o sh /usr/src-svn/tools/install.sh -o root -g wheel -m 444 crtbegin.So = /zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/usr/lib/crtbeginS.o sh /usr/src-svn/tools/install.sh -o root -g wheel -m 444 crtend.So = /zfs/data2/src/obj/arm.arm/usr/src-svn/tmp/usr/lib/crtendS.o =3D=3D=3D> lib/csu/arm (obj,depend,all,install) clang -O -pipe -mcpu=3Dcortex-a9 -I/usr/src-svn/lib/csu/arm/../common = -I/usr/src-svn/lib/csu/arm/../../libc/include -std=3Dgnu99 = -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type = -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter = -Wcast-align -Wchar-subscripts -Winline -Wnested-externs = -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c -o crt1.o = crt1.s clang: warning: argument unused during compilation: '-mcpu=3Dcortex-a9' clang: warning: argument unused during compilation: '-I = /usr/src-svn/lib/csu/arm/../common' clang: warning: argument unused during compilation: '-I = /usr/src-svn/lib/csu/arm/../../libc/include' clang: warning: argument unused during compilation: '-std=3Dgnu99' clang: warning: argument unused during compilation: '-Wsystem-headers' clang: warning: argument unused during compilation: '-Wall' clang: warning: argument unused during compilation: '-Wno-format-y2k' clang: warning: argument unused during compilation: '-W' clang: warning: argument unused during compilation: = '-Wno-unused-parameter' clang: warning: argument unused during compilation: = '-Wstrict-prototypes' clang: warning: argument unused during compilation: = '-Wmissing-prototypes' clang: warning: argument unused during compilation: '-Wpointer-arith' clang: warning: argument unused during compilation: '-Wreturn-type' clang: warning: argument unused during compilation: '-Wcast-qual' clang: warning: argument unused during compilation: '-Wwrite-strings' clang: warning: argument unused during compilation: '-Wswitch' clang: warning: argument unused during compilation: '-Wshadow' clang: warning: argument unused during compilation: '-Wunused-parameter' clang: warning: argument unused during compilation: '-Wcast-align' clang: warning: argument unused during compilation: '-Wchar-subscripts' clang: warning: argument unused during compilation: '-Winline' clang: warning: argument unused during compilation: '-Wnested-externs' clang: warning: argument unused during compilation: '-Wredundant-decls' clang: warning: argument unused during compilation: = '-Wold-style-definition' clang: warning: argument unused during compilation: '-Wno-pointer-sign' crt1.s:11:2: error: unknown use of instruction mnemonic without a size = suffix mov r5, r2 /* cleanup */ =20 ^ crt1.s:12:2: error: unknown use of instruction mnemonic without a size = suffix mov r4, r1 /* obj_main */ =20 ^ crt1.s:13:2: error: unknown use of instruction mnemonic without a size = suffix mov r3, r0 /* ps_strings */ ^ crt1.s:15:13: error: expected ']' in brackets expression ldr r0, [sp, #0x0000] ^ crt1.s:16:14: error: unknown token in expression add r1, sp, #0x0004=20 ^ crt1.s:17:2: error: unknown use of instruction mnemonic without a size = suffix add r2, r1, r0, lsl #2 ^ crt1.s:18:14: error: unknown token in expression add r2, r2, #0x0004=20 ^ crt1.s:20:14: error: unknown token in expression bic sp, sp, #7 ^ crt1.s:21:14: error: unknown token in expression sub sp, sp, #8 ^ crt1.s:22:13: error: expected ']' in brackets expression str r5, [sp, #4] ^ crt1.s:23:13: error: expected ']' in brackets expression str r4, [sp, #0] ^ crt1.s:25:2: error: invalid instruction mnemonic 'b' b __start =20 ^ *** Error code 1 Stop in /usr/src-svn/lib/csu/arm. *** Error code 1 Stop in /usr/src-svn. *** Error code 1 Stop in /usr/src-svn. *** Error code 1 Stop in /usr/src-svn. *** Error code 1 Stop in /usr/src-svn.