From owner-freebsd-arch@FreeBSD.ORG Wed Jul 9 00:06:39 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 311D233A; Wed, 9 Jul 2014 00:06:39 +0000 (UTC) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (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 66ADC25A7; Wed, 9 Jul 2014 00:06:38 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id x13so5622713wgg.33 for ; Tue, 08 Jul 2014 17:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=z4beO/t85BkxN7bBRn4uwFcF4nWkGvTin/IDkDyk1R4=; b=Wt8YyZ8s+NypViLSgo8rIxWCjs6KmCbiTu9NuPsN0Z4XnTSG81wxbVxM82q48adg9z 5k1bmPlvysZdsIA9MTudvGVVVdwkKbwNgG85h0ucoJ5u47xoWWXUMPVsXYzS8YYmg0kC VDGFG8w0bJFVL9GIjwRWrr4soEHPuYfsteI6rzMZBE0Sw5ErchTvTxbj2+aLFN32qOMM GJJbETqMMbHatWfBiO86vMcG0GFXxIaR392ZXaA86ujfYWNPLBQgjhUB37KJyexQYuCD 7C1MpbiOGrLDzx/mVHmoh0EiuDl9LP+9bfGKoU/UGG16NkH9vGPKQipVdYc2cC7LTRvc rxyQ== X-Received: by 10.180.102.100 with SMTP id fn4mr7605559wib.22.1404864396596; Tue, 08 Jul 2014 17:06:36 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id de6sm18751401wjc.16.2014.07.08.17.06.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jul 2014 17:06:35 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 9 Jul 2014 02:06:33 +0200 From: Baptiste Daroussin To: Warner Losh Subject: Re: Total confusion over toolchain/xdev behavior Message-ID: <20140709000628.GA56040@ivaldir.etoilebsd.net> References: <1404688077.1059.115.camel@bruno> <1404766292.65432.43.camel@revolution.hippie.lan> <20B72004-1499-4F99-A7C7-13173C50C7C6@bsdimp.com> <20140707235237.GG97203@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: sbruno@FreeBSD.org, Ian Lepore , freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2014 00:06:39 -0000 --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 07, 2014 at 07:29:01PM -0600, Warner Losh wrote: >=20 > On Jul 7, 2014, at 5:52 PM, Baptiste Daroussin wrote: >=20 > > On Mon, Jul 07, 2014 at 05:27:25PM -0600, Warner Losh wrote: > >>=20 > >> On Jul 7, 2014, at 2:51 PM, Ian Lepore wrote: > >>=20 > >>> On Sun, 2014-07-06 at 16:07 -0700, Sean Bruno wrote: > >>>> Objective: install an xcompile toolchain into a jail for use by > >>>> poudriere during arm/mips/sparc/power ports pkgs builds. The build > >>>> should be possible from a non-root user. > >>>>=20 > >>>> As far as I can tell, the xdev target is completely busted for non-c= lang > >>>> arch's right now as it tries to build clang no matter what I do. Its > >>>> missing some pretty key documentation to making it work correctly, s= o a > >>>> lot of my attempts have been "guess and check" with verbose make. > >>>>=20 > >>>> --------------------------------------------------------------------= --- > >>>> Attempt #1: > >>>> I have been trying non-root xdev builds: > >>>> MAKEOBJDIRPREFIX=3D/var/tmp make -s -j8 xdev XDEV=3Dmips XDEV_ARCH= =3Dmips > >>>> -- dies because it tries to compile CLANG. > >>>> --------------------------------------------------------------------= --- > >>>>=20 > >>>> Attempt #2: > >>>> Apply a hack from Baptiste that isn't quite right, but at least gets > >>>> farther, note the missing variable causing "//usr/mips-freebsd" > >>>> http://people.freebsd.org/~sbruno/src.ops.mk.diff > >>>>=20 > >>>> =3D=3D=3D> gnu/usr.bin/cc/gcov (all) > >>>> mtree populating //usr/mips-freebsd > >>>> mkdir: //usr/mips-freebsd: Permission denied > >>>> *** Error code 1 > >>>> --------------------------------------------------------------------= --- > >>>>=20 > >>>> Attempt #3: Add XDTP > >>>> MAKEOBJDIRPREFIX=3D/var/tmp make -s xdev XDEV=3Dmips XDEV_ARCH=3Dmips > >>>> XDTP=3D/var/tmp/mips_cc > >>>>=20 > >>>> Try defining a XDTP=3D/var/tmp/mips_cc with the above patch applied,= get's > >>>> a bit farther but compile failure in locating critical include files. > >>>>=20 > >>>> =3D=3D=3D> gnu/lib/libstdc++ (obj,depend,all,install) > >>>> In file included from /home/sbruno/bsd/fbsd_head/gnu/lib/libstdc > >>>> ++/../../../contrib/libstdc++/src/bitmap_allocator.cc:30: > >>>> /home/sbruno/bsd/fbsd_head/gnu/lib/libstdc++/../../../contrib/libstdc > >>>> ++/include/ext/bitmap_allocator.h:37:54: error: cstddef: No such fil= e or > >>>> directory > >>>> --------------------------------------------------------------------= --- > >>>>=20 > >>>> Attempt #4: Add the additional XDDESTDIR > >>>> MAKEOBJDIRPREFIX=3D/var/tmp make -s xdev XDEV=3Dmips XDEV_ARCH=3Dmips > >>>> XDTP=3D/var/tmp/mips_cc XDESTDIR=3D/var/tmp/mips_dst > >>>> -- Same results as attempt #3 > >>>> --------------------------------------------------------------------= --- > >>>>=20 > >>>> Even attempting to do stuff for *clang* enabled architectures bails > >>>> because its not respecting prefixes: > >>>> MAKEOBJDIRPREFIX=3D/var/tmp make -s -j 8 xdev XDEV=3Darm XDEV_ARCH= =3Darmv6 > >>>> -- bails because it tries to: > >>>> =3D=3D=3D> usr.bin/clang/tblgen (all) > >>>> mtree populating //usr/armv6-freebsd > >>>> mtree: etc/ntp: Permission denied > >>>> _xi-cross-tools > >>>> =3D=3D=3D> xdev gnu/usr.bin/binutils (install) > >>>> =3D=3D=3D> gnu/usr.bin/binutils/libiberty (install) > >>>> =3D=3D=3D> gnu/usr.bin/binutils/libbfd (install) > >>>> =3D=3D=3D> gnu/usr.bin/binutils/libopcodes (install) > >>>> =3D=3D=3D> gnu/usr.bin/binutils/libbinutils (install) > >>>> =3D=3D=3D> gnu/usr.bin/binutils/addr2line (install) > >>>> =3D=3D=3D> gnu/usr.bin/binutils/as (install) > >>>> =3D=3D=3D> gnu/usr.bin/binutils/ld (install) > >>>> install: //usr/armv6-freebsd/usr/bin/ld: Permission denied > >>>> *** Error code 71 > >>>>=20 > >>>> --------------------------------------------------------------------= --- > >>>> Adding XDTP and XDDESTDIR results in a little more progress but obvi= ous > >>>> failures to attempt and install things directly into my host system: > >>>>=20 > >>>> MAKEOBJDIRPREFIX=3D/var/tmp make -s xdev XDEV=3Darm XDEV_ARCH=3Darmv6 > >>>> XDDESTDIR=3D/var/tmp/arm_cc XDTP=3D/var/tmp/armv6_cc > >>>> =3D=3D=3D> secure/lib/libssh (install) > >>>> =3D=3D=3D> usr.bin/lex/lib (obj,depend,all,install) > >>>> mkdir: ../../../../usr: Permission denied > >>>> *** Error code 1 > >>>>=20 > >>>> Stop. > >>>> make[1]: stopped in /home/sbruno/bsd/fbsd_head > >>>> *** Error code 1 > >>>>=20 > >>>> Stop. > >>>> make: stopped in /home/sbruno/bsd/fbsd_head > >>>=20 > >>> It looks to me like the permission part of the problem is being caused > >>> by a lack of DESTDIR=3D. Without that, it's trying to install to /us= r and > >>> you don't have permission for that. Maybe the confusion is because t= he > >>> xdev target inherently builds-and-installs, unlike most other targets > >>> that separate those two actions. > >>=20 > >> OK. After some detective work, it looks like libstdc++ needs to be don= e before libsupc++ is done. I=E2=80=99ve added this dependency in r268377 a= nd was able to do a full xdev build with a clean obj dir: > >>=20 > >> rm -rf $HOME/F $MAKEOBJDIRPREFIX/mips-freebsd > >> mkdir $HOME/F > >> make xdev DESTDIR=3D$HOME/F XDEV=3Dmips XDEV_ARCH=3Dmips WITHOUT_CLAN= G=3Dt WITHOUT_CLANG_BOOTSTRAP=3Dt WITH_GCC=3Dt WITH_GCC_BOOTSTRAP=3Dt WITH_= GNUCXX=3Dt -j 20 > >=20 > > We can avoid most of the above by using a patch like the following: > > http://people.freebsd.org/~bapt/Makefile.inc1.diff > > Extending the same thing xi-cross-tools and xb-cross-tools (expect the > > WITH_GNUCXX=3Dt because it it not set in src.opts.mk when it imho shoul= d.) >=20 > The patch looks good to my eye. Did you want me to expand it, or do you w= ant to > do the honors? >=20 > About the rest=E2=80=A6 Yea, you may be right=E2=80=A6. MK_GNUCXX is an = odd duck, and that=E2=80=99s > likely the problem that should be fixed in a different way. It is really = an internal > variable that should be set based on the actual compiler type (possibly w= ith an > override for the odd-duck pair of clang and libstdc++ which may not be wo= rth > supporting). It is telling us we=E2=80=99re doing something horribly wron= g and we should listen > to that rather than add another compiler-related kludge to the build syst= em. I=E2=80=99ll work > on that bit. >=20 > Also an aside: The horribly long command line was to try to get to the bo= ttom of > the breakage, not to promote it as the proper way of doing things. I haven't committed because it isn't complete yet :) I have updated it to the following: http://people.freebsd.org/~bapt/Makefile.inc1.diff but it is not enough as I end up with: /tmp/tmips//usr/mips64-freebsd/usr/bin/ld: cannot find -lsupc++ So it goes further but it is not yet enough regards, Bapt --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlO8h4QACgkQ8kTtMUmk6Ez+VgCeLY/j9EGjjCLGFlD8cW9fm459 ijUAoKMiogHH5CHO0T2ysw3gR525xpiM =Bbmx -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j--