Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Nov 2017 13:44:03 -0800
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Guy Yur <guyyur@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: using native-xtools's make and MACHINE, MACHINE_ARCH values
Message-ID:  <9961305b-1b1e-8de0-8df8-94bc427cbbee@FreeBSD.org>
In-Reply-To: <CAC67Hz-LUi-sL4pWxpCCOpzPPfp7menwTqP_vusAkeN=-PUTUg@mail.gmail.com>
References:  <CAC67Hz-LUi-sL4pWxpCCOpzPPfp7menwTqP_vusAkeN=-PUTUg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--d0KnOamVpj5fRJHvfQxu5rDkwTOxTWww2
Content-Type: multipart/mixed; boundary="HmejCeRe7sWpRSTdGoJ0QgEaO5fQwbW9n";
 protected-headers="v1"
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Guy Yur <guyyur@gmail.com>, freebsd-questions@freebsd.org
Message-ID: <9961305b-1b1e-8de0-8df8-94bc427cbbee@FreeBSD.org>
Subject: Re: using native-xtools's make and MACHINE, MACHINE_ARCH values
References: <CAC67Hz-LUi-sL4pWxpCCOpzPPfp7menwTqP_vusAkeN=-PUTUg@mail.gmail.com>
In-Reply-To: <CAC67Hz-LUi-sL4pWxpCCOpzPPfp7menwTqP_vusAkeN=-PUTUg@mail.gmail.com>

--HmejCeRe7sWpRSTdGoJ0QgEaO5fQwbW9n
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 11/18/17 7:26 AM, Guy Yur wrote:
> Hi,
>=20
> I am trying to use native-xtools's make (amd64 targeting armv7)
> on an amd64 host in an armv7 chroot.

My guess is that it's because you're using a chroot rather than a jail.
When poudriere creates the jail with 'jail -c' it does not do things
like setup the make.conf or even setup nxb-bin hardlinks.  It only does
this stuff at Jail Startup time (bulk/testport/jail -s).
Checkout jail -s and jail -k rather than using a chroot.


> (qemu-arm-static and binmiscctl used for the arm binaries.)
> Running /nxb-bin/usr/bin/make -V MACHINE and -V MACHINE_ARCH it
> reports amd64, amd64 not arm, armv7.
> (12.0-CURRENT r325963)
>=20
> Do I need to override MACHINE and MACHINE_ARCH explicitly when
> running nxb's make or should it report the target values?
>=20
> bmake is compiled with -DMAKE_NATIVE in usr.bin/bmake/Makefile
> so it uses uname, sysctl to get the values.
> If I add -UMAKE_NATIVE -DMAKE_MACHINE=3D\"${MACHINE}\"
> -DMACHINE_ARCH=3D\"${MACHINE_ARCH}\" to the nxb's make
> compilation it reports arm and armv7.
> Turning off MAKE_NATIVE also affects other things so it is
> probably not be the correct change to make.
>=20


Poudriere sets MACHINE and MACHINE_ARCH in /etc/make.conf.  It seems ok
to me in a Jail.

> # grep MACHINE /etc/make.conf
> MACHINE=3Darm64
> MACHINE_ARCH=3Daarch64
> # /nxb-bin/usr/bin/make -V MACHINE -V MACHINE_ARCH
> arm64
> aarch64

If I change it to something else it takes the value.

> # grep MACHINE /etc/make.conf
> MACHINE=3Dmachine
> MACHINE_ARCH=3Dmachine_arch
> # /nxb-bin/usr/bin/make -V MACHINE -V MACHINE_ARCH
> machine
> machine_arch

As for chroot it's wrong:

> # /nxb-bin/usr/bin/make -V MACHINE -V MACHINE_ARCH
> amd64
> amd64


It's not using uname as far as I can tell.  The /etc/make.conf is setup
at Jail Startup time but the jail's /etc/login.conf is setup at 'jail
-c' time currently, which sets UNAME_m and UNAME_p so uname should be
fine anyway:


> # grep arm /etc/login.conf
>         :setenv=3DMAIL=3D/var/mail/$,BLOCKSIZE=3DK,UNAME_r=3D12.0-CURRE=
NT,UNAME_v=3DFreeBSD 12.0-CURRENT 1200051,OSVERSION=3D1200051,ABI_FILE=3D=
/usr/lib/crt1.o,UNAME_m=3Darm64,UNAME_p=3Daarch64:\


--=20
Regards,
Bryan Drewery


--HmejCeRe7sWpRSTdGoJ0QgEaO5fQwbW9n--

--d0KnOamVpj5fRJHvfQxu5rDkwTOxTWww2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQEzBAEBCgAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAloQqaMACgkQNddxu25G
l8/3XAgA0woUsJW4eVgnx2nbgKfxh0LxOj+jbKh1TXCHD/mXZFIq8IkvSCxcWQdu
GQ6pK23uis+NWUEHFuuTQCCG8qeQroVYB+IMoI6eag4tW/ptxQn1oeN/INKZ1aGP
iLYmtRvtoUdh82GBhs+v7naoAyRs85gPEOOAFKz4JLWHKFC60qYu7EjcasrvAkpl
20XAiis862NYq1lsOStSsV/b+mhekGvU9luVuAo/R7JQBmGgZqOp+x1r8o8qTWT4
y7eXrx7x16ojp4uhOnkW0k/pm9UBf9ZYJjq9KR6k4oBpDVsRCHAeKyPC4zBOvgDU
2VOCfGSbG3e/WLrqkuBeF0if5q0AjQ==
=WlIA
-----END PGP SIGNATURE-----

--d0KnOamVpj5fRJHvfQxu5rDkwTOxTWww2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9961305b-1b1e-8de0-8df8-94bc427cbbee>