Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 May 2014 04:53:30 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Baptiste Daroussin <bapt@freebsd.org>, src-committers@freebsd.org, Ian Lepore <ian@freebsd.org>, svn-src-all@freebsd.org, Glen Barber <gjb@freebsd.org>, Nathan Whitehorn <nwhitehorn@freebsd.org>, svn-src-head@freebsd.org, Tijl Coosemans <tijl@freebsd.org>
Subject:   Re: svn commit: r266553 - head/release/scripts
Message-ID:  <20140529015330.GG3991@kib.kiev.ua>
In-Reply-To: <E694D0DC-C9BE-4C95-A4E5-B73F36DB9963@bsdimp.com>
References:  <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> <20140528152820.GA3991@kib.kiev.ua> <D5376A56-2CB2-4CFD-BBC6-0E97902D880E@bsdimp.com> <20140528154728.GB3991@kib.kiev.ua> <E694D0DC-C9BE-4C95-A4E5-B73F36DB9963@bsdimp.com>

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

--PpAOPzA3dXsRhoo+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, May 28, 2014 at 01:53:28PM -0600, Warner Losh wrote:
>=20
> On May 28, 2014, at 9:47 AM, Konstantin Belousov <kostikbel@gmail.com> wr=
ote:
>=20
> > On Wed, May 28, 2014 at 09:35:27AM -0600, Warner Losh wrote:
> >>=20
> >> On May 28, 2014, at 9:28 AM, Konstantin Belousov <kostikbel@gmail.com>=
 wrote:
> >>=20
> >>> On Wed, May 28, 2014 at 08:26:58AM -0600, Warner Losh wrote:
> >>>>=20
> >>>> Then we disagree on this point. However, the disagreement here is
> >>>> kinda foundational: to build a set of libraries or sys root, you have
> >>>> to have a MACHINE_ARCH to make it work. Even in our current system, =
we
> >>>> set MACHINE_ARCH to i386 or powerpc when building the 32-bit binaries
> >>>> (note: we don?t do this for mips). This means that if we do grow x32
> >>>> support, we?ll need to grow a MACHINE_ARCH for it. That?s my point:
> >>>> all ABIs have MACHINE_ARCH associated with them, and those are the
> >>>> names users are used to specifying, and are the ones that are the mo=
st
> >>>> natural for script writers to use. With nathan?s patches, we?re to t=
he
> >>>> point where those are used, though there?s also the option of using
> >>>> the non-standard names if you want (e.g. amd64:32 instead of x32).
> >>>>=20
> >>>=20
> >>> I am not sure if this comment would add anything to the discussion,
> >>> but other build systems do not require MACHINE_ARCH.  In our terms,
> >>> other build systems are happy to build:
> >>> i386 binary when MACHINE is amd64 and CFLAGS contains -m32;
> >>> x32 binary when MACHINE is amd64 and CFLAGS contains -mx32.
> >>>=20
> >>> For HEAD and stable/10 we finally reached the point where -m32 works,
> >>> on amd64; it worked on powerpc64 from inception, AFAIU Nathan. At lea=
st
> >>> this is true for dependencies limited to the base system, and not to =
the
> >>> ports (the later is since ports do not know about multiarch).
> >>>=20
> >>> It is limitation of our build that we require MACHINE_ARCH to build
> >>> other natively supported ABI binary on the host. Ideally, the hacks t=
hat
> >>> treat lib32 build as the cross-compilation would go away eventually.
> >>=20
> >> I doubt it. The MACHINE_ARCH is used to select which files to build.
> > Do I understand you right that the comment references e.g. a selection
> > of arch-specific subdir in lib/libc or libexec/rtld-elf for inclusion
> > into the build ? If yes, I cannot disagree with the statement.
>=20
> As far as I can tell, that?s the only reason we?re doing it..  But it is =
a critically important reason...
>=20
> > My note was about our build system which currently requires
> > full-fledged cross-build to even create i386 binary on amd64 vs. other
> > builds which consider this as a (often minor) variations of the host
> > target. Sure, some variances must be allowed, e.g. to select proper .S
> > file for the ABI, but we do not need cross-build to get i386 on amd64.
>=20
> lib32 uses -m32 and some other flags to achieve its ends. So it doesn?t c=
reate a full i386 compiler, etc. It just uses the amd64 one with special fl=
ags/args. So I don?t think it requires a full-fledged cross-build environme=
nt, or I misunderstand what you mean by that phrase.

We install the headers for the MACHINE_ARCH into the compat32 build tree,
and use them instead of the target MACHINE headers.  The fact that
<toolchain> -m32 works as the cross-compiler just saves the build
time.

>=20
> But none of this changes the fact that we have a unique MACHINE_ARCH valu=
e per ABI.
>=20
> Warner



--PpAOPzA3dXsRhoo+
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iQIcBAEBAgAGBQJThpMaAAoJEJDCuSvBvK1Bi+4P/jdQaU0MKqPlnvqsw4gIo7Cl
3t7UAhdstmhdXCVmxExkAC3jt/4bxo/DJgf9LTTB3KIuOvTk3oas5SmfKGPcObl2
230+zoTAsAtAFFDLDwcOkpHMS7CGf13t7QuqWNbp6G6OdxGrdWdcFEYSycVlIGJ8
YWg/icRyGVnG6YBFjrb5oam+sOJICfV77jN6HxO+3DztZi7DRhctRqy4rzPQq3ma
bL2SlBVwaB+cR3apoN5LYF7Z3NgI7H2S6ro/0SmHwSTcaS59uiaMpsTLXUDPRcwP
J7QAwMm8z1P1j4+Zdqdr8fMoJrM1fsc7cfPUQ8JA0DEWn+pns1Sq0vkxOgWMV5Do
ulaHUZVJktx5S8Hv8xA//V8drTwTrvn7R9Sb5hKPhEQfwy4GYiRf+HBnzCYugXMY
zWwqzQxqAnBmB86Uivq1G1Al/CJo48YfCH2aoJVvdmrCr61ArHqE98Yn4pVGeRv3
gE3HOeNC4rGfZw1/p0lHbmjwG7+ZU8xP/hgb9TNmoybjTbMqYcFLiGP3oTSZ/gmJ
20OcMhF0LZlOFC0+/dMIPwYNDOrWY6XdRRZRUQRO2gMVLpQ6m6jIA2owQ5koSEbM
XQNACblvF0Pem8bNEBERe4PGLiezSathDAt2rQTTGVykIsOw177VjJr3I2M7SDvb
nkgfavv1ODH4xGBeyOyZ
=TWjf
-----END PGP SIGNATURE-----

--PpAOPzA3dXsRhoo+--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140529015330.GG3991>