Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Sep 2016 16:54:46 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Ngie Cooper <ngie@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r305170 - head/lib/atf/libatf-c
Message-ID:  <20160901165446.GE29873@spindle.one-eyed-alien.net>
In-Reply-To: <201609010242.u812gBkP037525@repo.freebsd.org>
References:  <201609010242.u812gBkP037525@repo.freebsd.org>

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

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

On Thu, Sep 01, 2016 at 02:42:11AM +0000, Ngie Cooper wrote:
> Author: ngie
> Date: Thu Sep  1 02:42:11 2016
> New Revision: 305170
> URL: https://svnweb.freebsd.org/changeset/base/305170
>=20
> Log:
>   Don't bake all of CC/CPP/CXX into CFLAGS
>  =20
>   Capture executable names for CC, CPP, CXX (assumed to be the
>   first non-CCACHE_BIN word).
>  =20
>   This change strips out all of the cross-compiler arguments, (-target,
>   -B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it
>   doesn't infect the build and subsequently the test.
>  =20
>   Add comments noting why this logic is being added, and why the logic in
>   r305041 was necessary/what it was trying to achieve.
>  =20
>   This is required after recent changes made to the toolchain to always
>   specify --sysroot, -target, -B, etc with clang in buildworld (presumably
>   r304681).
>  =20
>   Reviewed by:	rodrigc (earlier version)
>   Reported by:	Jenkins (FreeBSD_HEAD job from 559+)
>   MFC after:	12 days
>   X-MFC with:	r304681, r305041
>   Sponsored by:	EMC / Isilon Storage Division
>   Differential Revision:	https://reviews.freebsd.org/D7732
>=20
> Modified:
>   head/lib/atf/libatf-c/Makefile
>=20
> Modified: head/lib/atf/libatf-c/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/lib/atf/libatf-c/Makefile	Thu Sep  1 02:05:46 2016	(r305169)
> +++ head/lib/atf/libatf-c/Makefile	Thu Sep  1 02:42:11 2016	(r305170)
> @@ -28,6 +28,18 @@
>  .include <src.opts.mk>
>  .include <bsd.init.mk>
> =20
> +# Store the toolchain executable in ATF_BUILD_{CC,CPP,CXX} to ensure oth=
er
> +# values -- like -target, -B ..., etc -- don't get leaked into the tests.
> +#
> +# Be sure to omit ${CCACHE_BIN} (if specified) from the variable as it g=
ets
> +# automatically appended to the variables in bsd.compiler.mk when
> +# ${MK_CCACHE_BUILD} !=3D no.
> +ATF_BUILD_CC:=3D		${CC:N${CCACHE_BIN}:[1]}
> +ATF_BUILD_CPP:=3D		${CPP:N${CCACHE_BIN}:[1]}
> +ATF_BUILD_CXX:=3D		${CXX:N${CCACHE_BIN}:[1]}
> +
> +# Only capture defines, includes, linker flags, optimization levels, war=
nings
> +# and preprocessor flags when building ATF_BUILD_{C,CPP,CXX}FLAGS.
>  ATF_BUILD_CFLAGS:=3D	${CFLAGS:M-[DILOWf]*}
>  ATF_BUILD_CPPFLAGS:=3D	${CPPFLAGS:M-[DILOWf]*}
>  ATF_BUILD_CXXFLAGS:=3D	${CXXFLAGS:M-[DILOWf]*}
> @@ -41,11 +53,11 @@ ATF=3D		${SRCTOP}/contrib/atf
>  .PATH:		${ATF}/atf-c
>  .PATH:		${ATF}/atf-c/detail
> =20
> -CFLAGS+=3D	-DATF_BUILD_CC=3D'"${CC}"'
> +CFLAGS+=3D	-DATF_BUILD_CC=3D'"${ATF_BUILD_CC}"'
>  CFLAGS+=3D	-DATF_BUILD_CFLAGS=3D'"${ATF_BUILD_CFLAGS}"'
> -CFLAGS+=3D	-DATF_BUILD_CPP=3D'"${CPP}"'
> +CFLAGS+=3D	-DATF_BUILD_CPP=3D'"${ATF_BUILD_CPP}"'
>  CFLAGS+=3D	-DATF_BUILD_CPPFLAGS=3D'"${ATF_BUILD_CPPFLAGS}"'
> -CFLAGS+=3D	-DATF_BUILD_CXX=3D'"${CXX}"'
> +CFLAGS+=3D	-DATF_BUILD_CXX=3D'"${ATF_BUILD_CXX}"'
>  CFLAGS+=3D	-DATF_BUILD_CXXFLAGS=3D'"${ATF_BUILD_CXXFLAGS}"'
>  CFLAGS+=3D	-I${ATF}
>  CFLAGS+=3D	-I${.CURDIR}
>=20

Are these the variables used to control the tests that try to compile
things?

I've run into to some problems with them on CheriBSD because the
external compiler isn't available on the test target, but isn't listed
as a dependency.  These tests should declare a dependency on CC, etc
as appropriate and be skipped if it isn't there.  I'm not actually
convinced this shouldn't just use cc, cpp, and c++.  (That would be
wrong for CheriBSD, but closer to right for current cases in FreeBSD).

-- Brooks

--mSxgbZZZvrAyzONB
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJXyF1VAAoJEKzQXbSebgfAnkgH/36zFJ20O8GhTr4Skl9giZI3
a2/kix/8+ogCWuDhBaU4zTAF2Pg2Dqk5fRac/Y9SdOO0pbHX0B3nh90xRTfVOPzI
mlbWQQtkOWVpgi0rxaK0MYzQnd+RYEuDKeruP2OvUkn7mzzuIFyJOLkdVhj56ZSL
PtX8uHkCTEQGGocBH0jeD6rzFyAMkwFp2Q1koZ+Y2Q8hZKXijpOEUTxc9j08Zdgf
4aAO5HF4stFyLY/SuL/oZjWs8ZKYODBtGIvdHdyi0ZuCxKu22x8W9lWuACj1+jAk
YwraEqLnNho/3B8n68md1HIm/9spdFqW4kTEog7/ux0hgeYp8AGkOYYzsX/R7H8=
=pRbJ
-----END PGP SIGNATURE-----

--mSxgbZZZvrAyzONB--



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