Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jul 2014 19:29:01 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Baptiste Daroussin <bapt@FreeBSD.org>
Cc:        sbruno@FreeBSD.org, Ian Lepore <ian@FreeBSD.org>, freebsd-arch@FreeBSD.org
Subject:   Re: Total confusion over toolchain/xdev behavior
Message-ID:  <DB29AF3B-C761-4112-A4F6-6CF20159C2E1@bsdimp.com>
In-Reply-To: <20140707235237.GG97203@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>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_3B88BDAA-FCB4-4A1D-A678-B33E78EBBB59
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252


On Jul 7, 2014, at 5:52 PM, Baptiste Daroussin <bapt@FreeBSD.org> wrote:

> On Mon, Jul 07, 2014 at 05:27:25PM -0600, Warner Losh wrote:
>>=20
>> On Jul 7, 2014, at 2:51 PM, Ian Lepore <ian@FreeBSD.org> 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-clang
>>>> 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, =
so 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 =
file 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 =
obvious
>>>> 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 =
/usr and
>>> you don't have permission for that.  Maybe the confusion is because =
the
>>> 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 =
done before libsupc++ is done. I=92ve added this dependency in r268377 =
and 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_CLANG=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 =
should.)

The patch looks good to my eye. Did you want me to expand it, or do you =
want to
do the honors?

About the rest=85 Yea, you may be right=85.  MK_GNUCXX is an odd duck, =
and that=92s
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 =
with an
override for the odd-duck pair of clang and libstdc++ which may not be =
worth
supporting). It is telling us we=92re doing something horribly wrong and =
we should listen
to that rather than add another compiler-related kludge to the build =
system.  I=92ll work
on that bit.

Also an aside: The horribly long command line was to try to get to the =
bottom of
the breakage, not to promote it as the proper way of doing things.

Warner

--Apple-Mail=_3B88BDAA-FCB4-4A1D-A678-B33E78EBBB59
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

iQIcBAEBCgAGBQJTu0ldAAoJEGwc0Sh9sBEArKUQAMJiIvxp2FgiVk/StHUEUjnx
HFXgtSfh3RwTyhaEsnRCz6iILGHNx893Or/23Yw5D7bL43rsDCuqEV3wZIZT5D5a
rXj+wudptfOhfpqru4bdtmSmtAXxeMkbpG+xoQilYnsU8r5TimjGuIHia/ZRS7ub
+DxW0dMZzbFaKjXDhgYHKSZks6sRUyP5axDYTqz0oRG1g4yBBLSGyhZvdyHFxADA
b3T5fVXR/3V3Yv9oUKO8pFb2i0iUok/3IZP8D0vPu70EuWvtpbQBe2cz3ZqxOD/k
vlJsjC/IVqDg2xglATp3RQfbo9GXmdCu65CAJobTOrwsOlsVV9BiQvWuv5xmxIUO
yxoPrUS7OfQJDsh0+6qkSe+jVKSVr+IwXd7qn/qlE/PEi5QNEmggS9grmPXgA0+q
oLnDw6y4x03jKFC29JC/g7gqrhdhQ+G0swmZKUB1YTJrAerHL37kFa97/CwoqESl
Aw2/FVazZKh0wmRtR2bv2Crl8BB1NDxgBhTtkhhayVAghQyusQZcwx4KZynV6+nY
Hd/opY3wgOGgzXzBeDHYnui20CzTky1/1zh3J9wBUOV0xmBW2wEEWwEzqsl2IKFy
xFIp8A+MOmsulte3A+ZxDDByqAOgAiPs0a7tQSAwoaqHzmfaApvSOrxodI0eHSMx
NnxZVRoV8Gbu+UJ9AcUq
=RhbQ
-----END PGP SIGNATURE-----

--Apple-Mail=_3B88BDAA-FCB4-4A1D-A678-B33E78EBBB59--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DB29AF3B-C761-4112-A4F6-6CF20159C2E1>