From owner-freebsd-arch@FreeBSD.ORG Wed Feb 27 18:37:15 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 94D26C20 for ; Wed, 27 Feb 2013 18:37:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-gh0-f182.google.com (mail-gh0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5ACEA70D for ; Wed, 27 Feb 2013 18:37:15 +0000 (UTC) Received: by mail-gh0-f182.google.com with SMTP id z15so127959ghb.41 for ; Wed, 27 Feb 2013 10:37:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=zXuGAJbizBSYDDwyfZzwnvZG1CZ60+AlUGjfWQOpl+c=; b=JFoVf9f/sMtQU7C+kmLg7nSBG6J8uT/tePoKNjM5Y7NJ2QgvStorgePhJ2ukyy4gyJ 11QYdN4JJIh6NtAhnHyufjizcrjh9onJ0zfezxurftBsPPGO8kCG7YLAkUcv9ZHx4W5f LLxI8JxQAWlsuOeofnCTtGiVt4kuGrpQoBchML4A3gHck4hKy6eFLpAHOwiGRYtu020z KV6zxQls5FpU43MBO68SBy327WFMTajSXY+0gJMpklYHS+osIA3QhyjpceV6XZ09eh4u fx6UtIe1Dh+CeROuaJzgOv/036qW29b2gYLwFrmdwVNPKNxetKk0sCxVRsDoY+PmFkpb adLQ== X-Received: by 10.236.147.35 with SMTP id s23mr2288314yhj.97.1361990229351; Wed, 27 Feb 2013 10:37:09 -0800 (PST) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPS id g27sm4737736yhm.21.2013.02.27.10.37.07 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Feb 2013 10:37:08 -0800 (PST) Sender: Warner Losh Subject: Re: [RFC] external compiler support Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20130227175006.A604A58096@chaos.jnpr.net> Date: Wed, 27 Feb 2013 11:37:05 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20130227003517.GB7348@lor.one-eyed-alien.net> <28404C12-67F3-44F0-AB28-02B749472873@bsdimp.com> <51BB3E17-128A-4989-B272-D8B40D4B854B@bsdimp.com> <20130227175006.A604A58096@chaos.jnpr.net> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQlkSzOAX+Ii0jXTsv2Xqv8EioGELW6fxQS8HpAXtYa2Rjzo3hFEj2F61VufCIvifzDpggyI Cc: Brooks Davis , freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2013 18:37:15 -0000 On Feb 27, 2013, at 10:50 AM, Simon J. Gerraty wrote: >=20 > On Wed, 27 Feb 2013 09:08:05 -0700, Warner Losh writes: >>> I think this will work, but it is kludgy. I had created a = __X=3D >>=20 >> I also am having trouble finding my full patch, but a partial patch = can be fou >=20 > I prefer this approach too, but would use a more explicit variable = than > __X (which I could easily imagine someone thinking they could safely = use > within their own makefile for some purpose). > Eg. we currently have stuff like: >=20 > CC?=3D ${BUILD_TOOL_PREFIX}/${CROSS_TARGET_PREFIX}gcc >=20 > since these aren't variables that anyone needs to manipulate regularly > a little verbosity doesn't hurt. That stray / will kill you :) The __X thing (which I'll grant could be better named, but it is in a = file that needs to be very pure and I don't know if POSIX allows __ = prefix for purely internal things on make or not) was intended to = encompass everything you'd need, whether that is just = /usr/local/arm-freebsd/bin or something more complicated like = /usr/local/bin/arm-linux-gnueabi- whatever. > Further, having them composed from other bits can also be useful > (eg. most dev machines here use nfs mounted toolchains, but others use > local toolchains). >=20 > So (probably taking things too far - I didn't come up with all this = ;-) >=20 > BUILD_TOOL_PREFIX?=3D ${TOOLCHAIN_PREFIX}/${TOOLCHAIN_${MACHINE}}/bin > CROSS_TARGET_PREFIX?=3D ${CROSS_TARGET}- > CROSS_TARGET?=3D ${CROSS_TARGET_${MACHINE}} >=20 > and a toolchain.mk sets CROSS_TARGET_* for all the supported machines. Yea, that likely does take things a bit far. > Of course as you note: >=20 >> I've also started looking into using clang --mumble to doing cross = builds too, >=20 > can simplify things (for some value of "--mumble); I managed to get > clang to produce i386 apps on amd64, but the "--mumble" wasn't obvious > or documented (that I could find) and infact the man page implied = other=20 > things that don't work. Yea, they only half work right now. '-ccc-host-triple arm-none-freebsd = -msoft-float -march armv5' might be a typical --mumble that one would = want to do. It generates the right .s file, but uses the wrong = assembler. Warner=