Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jul 2016 18:32:54 -0700
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Warner Losh <imp@FreeBSD.org>, andrew@FreeBSD.org, Justin Hibbits <jhibbits@freebsd.org>
Subject:   Re: svn commit: r302670 - in head: . gnu/usr.bin/binutils gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb share/mk
Message-ID:  <b318434f-f296-18f4-d208-876da61f5805@FreeBSD.org>
In-Reply-To: <201607121857.u6CIvPBG060470@repo.freebsd.org>
References:  <201607121857.u6CIvPBG060470@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--2QGa0M3KW7asCqJqELsXmN0hkwiJIoE5D
Content-Type: multipart/mixed; boundary="pWClTuKmXwdOrR73xXBX8GgkD93SNRbHh"
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org, Warner Losh <imp@FreeBSD.org>, andrew@FreeBSD.org,
 Justin Hibbits <jhibbits@freebsd.org>
Message-ID: <b318434f-f296-18f4-d208-876da61f5805@FreeBSD.org>
Subject: Re: svn commit: r302670 - in head: . gnu/usr.bin/binutils
 gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb share/mk
References: <201607121857.u6CIvPBG060470@repo.freebsd.org>
In-Reply-To: <201607121857.u6CIvPBG060470@repo.freebsd.org>

--pWClTuKmXwdOrR73xXBX8GgkD93SNRbHh
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 7/12/2016 11:57 AM, Bryan Drewery wrote:
> Author: bdrewery
> Date: Tue Jul 12 18:57:25 2016
> New Revision: 302670
> URL: https://svnweb.freebsd.org/changeset/base/302670
>=20
> Log:
>   Create one list of replacements for MACHINE_CPUARCH as MACHINE_CPUARC=
H_SUB.
>  =20
>   This also adds missing s/aarch64/arm64 to the sys.mk version and also=


This breaks the arm64 build, but I think it's correct.

Let's first start with what even is MACHINE_CPUARCH? It's unclear.
Looking at r209024 we get:

>     Introduce MACHINE_CPUARCH.  Many different MACHINE_ARCHs will be bu=
ilt
>     from one MACHINE_CPUARCH.  This will allow us to move to a more
>     standard MACHINE_ARCH for mips and arm which exist in many differen=
t
>     endian variants, and for powerpc where both 32 and 64 bit binaries =
are
>     generated from the same sources.

If we look at the current targets list we have:

> # make targets
> Supported TARGET/TARGET_ARCH pairs for world and kernel targets
>     amd64/amd64
>     arm/arm
>     arm/armeb
>     arm/armv6
>     arm64/aarch64
>     i386/i386
>     mips/mipsel
>     mips/mips
>     mips/mips64el
>     mips/mips64
>     mips/mipsn32
>     pc98/i386
>     powerpc/powerpc
>     powerpc/powerpc64
>     sparc64/sparc64

So one TARGET can have multiple TARGET_ARCH.  So MACHINE_CPUARCH sounds
like TARGET.

In all but the arm64 cases it seems that MACHINE_CPUARCH =3D=3D MACHINE
(meaning TARGET_CPUARCH =3D=3D TARGET).

So 1. I think MACHINE_CPUARCH is really just MACHINE.
and 2. I think the proper MACHINE_CPUARCH for AArch64 is arm64 since
that is what the TARGET is.  There's a lot of code using MACHINE_CPUARCH
=3D=3D aarc64 instead of MACHINE_CPUARCH =3D=3D arm64 (and directories na=
med
"aarch64" rather than "arm64", so I am willing to revert or modify this
but it seems to be inconsistent.

For now I am just reverting this, but I think the commit is worth having
in here if we are going to keep MACHINE_CPUARCH as it keeps the
replacement list in 1 place.

>   adds back armv6hf for universe since it was added to the sys.mk versi=
on
>   in r300438.
>  =20
>   MFC after:	3 days
>   Sponsored by:	EMC / Isilon Storage Division
>   Differential Revision:	https://reviews.freebsd.org/D7159
>=20
> Modified:
>   head/Makefile
>   head/gnu/usr.bin/binutils/Makefile.inc0
>   head/gnu/usr.bin/cc/Makefile.tgt
>   head/gnu/usr.bin/gdb/Makefile.inc
>   head/gnu/usr.bin/gdb/libgdb/Makefile
>   head/share/mk/sys.mk
>=20
> Modified: head/Makefile
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/Makefile	Tue Jul 12 17:58:58 2016	(r302669)
> +++ head/Makefile	Tue Jul 12 18:57:25 2016	(r302670)
> @@ -235,7 +235,7 @@ _MAKE+=3D	MK_META_MODE=3Dno
>  _TARGET_ARCH=3D	${TARGET:S/pc98/i386/:S/arm64/aarch64/}
>  .elif !defined(TARGET) && defined(TARGET_ARCH) && \
>      ${TARGET_ARCH} !=3D ${MACHINE_ARCH}
> -_TARGET=3D		${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/a=
rm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/riscv64/riscv/}
> +_TARGET=3D		${TARGET_ARCH:${MACHINE_CPUARCH_SUB:ts:}}
>  .endif
>  .if defined(TARGET) && !defined(_TARGET)
>  _TARGET=3D${TARGET}
>=20
> Modified: head/gnu/usr.bin/binutils/Makefile.inc0
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/gnu/usr.bin/binutils/Makefile.inc0	Tue Jul 12 17:58:58 2016	(r=
302669)
> +++ head/gnu/usr.bin/binutils/Makefile.inc0	Tue Jul 12 18:57:25 2016	(r=
302670)
> @@ -7,7 +7,7 @@
>  VERSION=3D	"2.17.50 [FreeBSD] 2007-07-03"
> =20
>  .if defined(TARGET_ARCH)
> -TARGET_CPUARCH=3D${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(e=
b)?/arm/:C/powerpc64/powerpc/}
> +TARGET_CPUARCH=3D${TARGET_ARCH:${MACHINE_CPUARCH_SUB:ts:}}
>  .else
>  TARGET_CPUARCH=3D${MACHINE_CPUARCH}
>  .endif
>=20
> Modified: head/gnu/usr.bin/cc/Makefile.tgt
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/gnu/usr.bin/cc/Makefile.tgt	Tue Jul 12 17:58:58 2016	(r302669)=

> +++ head/gnu/usr.bin/cc/Makefile.tgt	Tue Jul 12 18:57:25 2016	(r302670)=

> @@ -4,7 +4,7 @@
>  # MACHINE_CPUARCH, but there's no easy way to export make functions...=

> =20
>  .if defined(TARGET_ARCH)
> -TARGET_CPUARCH=3D${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(e=
b)?/arm/:C/powerpc64/powerpc/}
> +TARGET_CPUARCH=3D${TARGET_ARCH:${MACHINE_CPUARCH_SUB:ts:}}
>  .else
>  TARGET_CPUARCH=3D${MACHINE_CPUARCH}
>  .endif
>=20
> Modified: head/gnu/usr.bin/gdb/Makefile.inc
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/gnu/usr.bin/gdb/Makefile.inc	Tue Jul 12 17:58:58 2016	(r302669=
)
> +++ head/gnu/usr.bin/gdb/Makefile.inc	Tue Jul 12 18:57:25 2016	(r302670=
)
> @@ -23,7 +23,7 @@ OBJ_RL=3D ${OBJ_ROOT}/../lib/libreadline/r
>  # MACHINE_CPUARCH, but there's no easy way to export make functions...=

> =20
>  .if defined(TARGET_ARCH)
> -TARGET_CPUARCH=3D${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(e=
b)?/arm/:C/powerpc64/powerpc/}
> +TARGET_CPUARCH=3D${TARGET_ARCH:${MACHINE_CPUARCH_SUB:ts:}}
>  .else
>  TARGET_CPUARCH=3D${MACHINE_CPUARCH}
>  .endif
>=20
> Modified: head/gnu/usr.bin/gdb/libgdb/Makefile
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/gnu/usr.bin/gdb/libgdb/Makefile	Tue Jul 12 17:58:58 2016	(r302=
669)
> +++ head/gnu/usr.bin/gdb/libgdb/Makefile	Tue Jul 12 18:57:25 2016	(r302=
670)
> @@ -4,7 +4,7 @@
>  # MACHINE_CPUARCH, but there's no easy way to export make functions...=

> =20
>  .if defined(TARGET_ARCH)
> -TARGET_CPUARCH=3D${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(e=
b)?/arm/:C/powerpc64/powerpc/}
> +TARGET_CPUARCH=3D${TARGET_ARCH:${MACHINE_CPUARCH_SUB:ts:}}
>  .else
>  TARGET_CPUARCH=3D${MACHINE_CPUARCH}
>  .endif
>=20
> Modified: head/share/mk/sys.mk
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/share/mk/sys.mk	Tue Jul 12 17:58:58 2016	(r302669)
> +++ head/share/mk/sys.mk	Tue Jul 12 18:57:25 2016	(r302670)
> @@ -13,7 +13,13 @@ unix		?=3D	We run FreeBSD, not UNIX.
>  # and/or endian.  This is called MACHINE_CPU in NetBSD, but that's use=
d
>  # for something different in FreeBSD.
>  #
> -MACHINE_CPUARCH=3D${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?=
(eb|hf)?/arm/:C/powerpc64/powerpc/:C/riscv64/riscv/}
> +MACHINE_CPUARCH_SUB=3D \
> +		C/mips(n32|64)?(el)?/mips/ \
> +		C/arm(v6)?(eb|hf)?/arm/ \
> +		C/aarch64/arm64/ \
> +		C/powerpc64/powerpc/ \
> +		C/riscv64/riscv/
> +MACHINE_CPUARCH=3D${MACHINE_ARCH:${MACHINE_CPUARCH_SUB:ts:}}
>  .endif
> =20
> =20
>=20


--=20
Regards,
Bryan Drewery


--pWClTuKmXwdOrR73xXBX8GgkD93SNRbHh--

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJXhZpKAAoJEDXXcbtuRpfPoKgH/ipLhWCIJYiHy7JV82WOG4WB
fieMICHRJaumxER5Mul2Appv5OqaWrjkFMR89x2DPkoODDdn9iEj8QZTJEGAXakv
FWuf4TXkw+gihvMB26ncktp24BLjMc8TDCCW/2+7YmtrhkheLPbFrC0m1h/IUVr3
Glmq2ZOuHHrmbxPviEN4Ym3j7q4SPUGHhAcvzAdNzW5jlRx8okelVosURVwDgZSp
2gYYHgp+hiwKfLZo27uXyBwtK+Z0eUA1feOMlWL2hDppF6RUYYJAPBAellUDujtM
5RWLOkoOyRdeXaWm0a9U6xA4dILM740vtmUmkQNSoAVDQdpiSniyin/nu+2UTes=
=S9xR
-----END PGP SIGNATURE-----

--2QGa0M3KW7asCqJqELsXmN0hkwiJIoE5D--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b318434f-f296-18f4-d208-876da61f5805>