From owner-freebsd-arch@FreeBSD.ORG Mon Nov 17 12:27:32 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2A7B5AB; Mon, 17 Nov 2014 12:27:31 +0000 (UTC) Received: from mail-pd0-x229.google.com (mail-pd0-x229.google.com [IPv6:2607:f8b0:400e:c02::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9E2BD28; Mon, 17 Nov 2014 12:27:31 +0000 (UTC) Received: by mail-pd0-f169.google.com with SMTP id fp1so3803604pdb.0 for ; Mon, 17 Nov 2014 04:27:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=Q2HZkvTvXX8FOVg48t6ruDkhBDTYyz7H9MWIwlGzXjc=; b=Hr1KLhFT/ci01bh0XYFis3IfNmj9F836y5A37WY5ybTPes4+WUPQGqw164B2WxgQ5F 3IEG5o0JzgdvnqpNNoyS3QgdHzyLxIuZVQJSb/GWKSll5u/JI4VNy9aSWBGVfsHYIP2s fu1R/aSnexvWhtIHCIffg+87Bv3RKxVdstn4ysYbSVrrI/ivGYxlNybKkojo7ZbYmDTQ GFKc+sgulVN+EjgpTbj6W0Lst77rsRwIQYF/Qq7xjdjdgD/+mmhlT8jGcDdqAEjU9dYS +DuEQehE3hB2byl1yeAOFgvalVUyeOb4mcdGX6Wp8fIbNpLUnCzlCbvGnOCrP0QnNWBX SQaA== X-Received: by 10.68.68.226 with SMTP id z2mr28916091pbt.107.1416227251320; Mon, 17 Nov 2014 04:27:31 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:59da:de8a:308b:f2b? ([2601:8:ab80:7d6:59da:de8a:308b:f2b]) by mx.google.com with ESMTPSA id hy15sm8849902pad.11.2014.11.17.04.27.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 04:27:30 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_65506A37-AD99-4E0A-B0FA-F9D4E31046A7"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: mips misbehaving, not respecting make.conf From: Garrett Cooper In-Reply-To: Date: Mon, 17 Nov 2014 04:27:29 -0800 Message-Id: <25214F2D-5B60-480E-906C-EDE19F2CE3AB@gmail.com> References: <1416179733.1098.1200.camel@bruno> <735BCED8-EBC1-4B65-AA34-1866ECDF3070@gmail.com> To: Warner Losh X-Mailer: Apple Mail (2.1878.6) Cc: sbruno@freebsd.org, freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 12:27:32 -0000 --Apple-Mail=_65506A37-AD99-4E0A-B0FA-F9D4E31046A7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 16, 2014, at 16:01, Warner Losh wrote: > On Nov 16, 2014, at 4:36 PM, Garrett Cooper = wrote: >=20 >> On Nov 16, 2014, at 15:15, Sean Bruno wrote: >>=20 >>> I have set make.conf to use AS=3D/nxb-bin/usr/bin/as and >>> CC=3D/nxb-bin/usr/bin/cc >>>=20 >>> Yet, while monitoring, I still see the ports build process >>> using /usr/bin/as and /usr/bin/ld and /usr/libexec/cc1 >>>=20 >>> I don't see this on armv6 when building in a jail + qemu. >>>=20 >>> I'm trying to understand what is missing from our gcc toolchain here >>> that is causing the builds to ignore my directives. >>=20 >> It all kinds of boils down to this bug with the configuration of our = base system copy of gcc: = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D192394 . >=20 > I=92ve never seen this happen in the decade or so I=92ve been doing = cross builds. I=92ve seen gcc breakage, but always from stupid C or C++ = tricks, not from how we have things setup. There are a lot of nifty features in the binutils/gcc configuration that = we don=92t tweak, for better or for worse. -sysroot is one item (that I = brought up before), but it=92s not Sean=92s problem. Still, it needs to = be fixed because we still ship gcc today on the tier-2/-3 platforms and = I=92ve hit bugs in the past where it picks up the wrong headers with = gcc, but not clang. >> The prefixing/sysroot isn=92t being setup properly, which means that = you have to use $PATH to tell gcc and friends which tool you want to use = (which make buildworld, etc does). One way to fix this (if we used = autoconf in the base system build) would be to reconfigure it with a = particular sysroot: >>=20 >> $ ./configure --help | grep -A 3 sysroot >> --with-build-sysroot=3Dsysroot >> use sysroot as the system root during the = build >> --with-sysroot=3DDIR Search for usr/lib, usr/include, et al, within = DIR. >> --with-gnu-ld assume the C compiler uses GNU ld default=3Dno >> --with-libiconv-prefix[=3DDIR] search for libiconv in DIR/include = and DIR/lib >> --without-libiconv-prefix don't search for libiconv in includedir = and libdir >> $ svn info configure | grep ^URL: >> URL: svn+ssh://ngie@svn.freebsd.org/base/head/contrib/gcc/configure >=20 > The native-xtools builds should be setup to use the right binaries. I = don=92t think this is sean=92s problem. Correct (as I noted in my later reply). The thing is that we override = PREFIX with binutils/gcc and there aren=92t really any blatant comments = in the source code pointing out why things are being done that way. You = have to use svn blame and svn log to find the right commit that = describes the feature. Cheers! ------------------------------------------------------------------------ r55220 | obrien | 1999-12-29 06:42:46 -0800 (Wed, 29 Dec 1999) | 6 lines Allow the specification of a prefix for gcc to find all the various = bits. If one wishes to anchor the compiler toolchain tree somewhere other than = /, all one needs to do is set "TOOLS_PREFIX" to a different rooting. Submitted by: marcel (in a different format and reworked by me) --Apple-Mail=_65506A37-AD99-4E0A-B0FA-F9D4E31046A7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUaemxAAoJEMZr5QU6S73eU10H/0TRgoBA4hRLI2MMFOPd+gKD QZNd22P3XqyMJPOQblfP5BQEs3+bZoe5CiA1lsV7D/axV8P1ArqyJokYhq0fLy/0 vSq/GlMvHn5gLihF3+MvqZqs1so130DJJpGAmN64MRRAtg0cshjbFR/vM+8Yh4/O KUxk1OgQhkfMqwmE/WYj0QJrOYrEXVapTGZ+3WzDgFOczfwZKkvk83hLcZFARV1X r4IsJHMKrZR6NqrVQSqnxOPr1b0D6Vq6kCZ9Z5A6K8afhHU86z/cydgY7IsmTgt2 0lpfM/UJRxSFbn4+nJwU65YHBM2Bn10ijXvQkg4elt7pEjUp9mYYXr5+05w8bo0= =yNCT -----END PGP SIGNATURE----- --Apple-Mail=_65506A37-AD99-4E0A-B0FA-F9D4E31046A7--