Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jan 2018 10:43:54 -0800
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r327523 - in head/stand/mips/beri: boot2 loader
Message-ID:  <dd3b0864-96df-8252-ff31-018bdea3fd30@FreeBSD.org>
In-Reply-To: <201801031735.w03HZcFL082840@repo.freebsd.org>
References:  <201801031735.w03HZcFL082840@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)
--9QFbdP79QaMRBzkLnEpFPK0UZxWj9iFRD
Content-Type: multipart/mixed; boundary="kDsDxgNUvCdjCitpP16g67rCdkFoE9hCl";
 protected-headers="v1"
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: John Baldwin <jhb@FreeBSD.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Message-ID: <dd3b0864-96df-8252-ff31-018bdea3fd30@FreeBSD.org>
Subject: Re: svn commit: r327523 - in head/stand/mips/beri: boot2 loader
References: <201801031735.w03HZcFL082840@repo.freebsd.org>
In-Reply-To: <201801031735.w03HZcFL082840@repo.freebsd.org>

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

On 1/3/2018 9:35 AM, John Baldwin wrote:
> Author: jhb
> Date: Wed Jan  3 17:35:38 2018
> New Revision: 327523
> URL: https://svnweb.freebsd.org/changeset/base/327523
>=20
> Log:
>   Don't clobber system LDFLAGS for beri boot loaders.
>  =20
>   Prior to r325114, bsd.init.mk was included after assignments to CFLAG=
S and
>   LDFLAGS in these Makefiles.  After r325114, bare assignments (=3D rat=
her than
>   +=3D) lost system-assigned default values that are needed when compil=
ing with
>   an external toolchain.  CFLAGS in both Makefiles already uses +=3D.  =
This
>   commit changes LDFLAGS to use +=3D.  While here, depend on the LDFLAG=
S update
>   in the parent Makefile.inc to set -nostdlib.
>  =20


Hmm, I'm not sure it is even right for these files to be including
bsd.init.mk.

It says at the top:
  # The include file <bsd.init.mk> includes <bsd.opts.mk>,
  # ../Makefile.inc and <bsd.own.mk>; this is used at the
  # top of all <bsd.*.mk> files that actually "build something".

There's a bunch of other files doing this as well.

The biggest problem here is that including bsd.init.mk is like including
bsd.prog.mk first and then putting the rest of the Makefile after it. It
changes a lot of assumptions in share/mk files. And this particular file
still includes bsd.prog.mk, so things really could go wrong.  I speak of
things like dependency handling and beforebuild handling.
I think it's more likely these files just need src.opts.mk.

>   Sponsored by:	DARPA / AFRL
>=20
> Modified:
>   head/stand/mips/beri/boot2/Makefile
>   head/stand/mips/beri/loader/Makefile
>=20
> Modified: head/stand/mips/beri/boot2/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/stand/mips/beri/boot2/Makefile	Wed Jan  3 17:28:01 2018	(r3275=
22)
> +++ head/stand/mips/beri/boot2/Makefile	Wed Jan  3 17:35:38 2018	(r3275=
23)
> @@ -53,8 +53,7 @@ CFLAGS+=3D	-I${LDRSRC}			\
>  		-fno-pic -mno-abicalls		\
>  		-g
> =20
> -LDFLAGS=3D	-nostdlib			\
> -		-static				\
> +LDFLAGS+=3D	-static				\
>  		-Wl,-N				\
>  		-G0				\
>  		-L${.CURDIR}
>=20
> Modified: head/stand/mips/beri/loader/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/stand/mips/beri/loader/Makefile	Wed Jan  3 17:28:01 2018	(r327=
522)
> +++ head/stand/mips/beri/loader/Makefile	Wed Jan  3 17:35:38 2018	(r327=
523)
> @@ -85,8 +85,7 @@ CFLAGS+=3D	-G0					\
>  		-mno-abicalls				\
>  		-g
> =20
> -LDFLAGS=3D	-nostdlib				\
> -		-static					\
> +LDFLAGS+=3D	-static					\
>  		-T ${.CURDIR}/loader.ldscript		\
>  		-L${.CURDIR}				\
>  		-e __start
>=20


--=20
Regards,
Bryan Drewery


--kDsDxgNUvCdjCitpP16g67rCdkFoE9hCl--

--9QFbdP79QaMRBzkLnEpFPK0UZxWj9iFRD
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

iQEcBAEBAgAGBQJaTSRqAAoJEDXXcbtuRpfPvLYH/iARgeKrcFRyUWjnWOvnqT1c
ZnpnUxKatCtDVDMC+khhtHhUjvb+kFC07JjMMCaebd33quxF/ohKIQKv8varCVw9
Cy7FEERbiqwBhCeEDokbooRgIW26vbYzCKCt3d1gpdP76CamJqA8Sm6x6K9+qQ9S
udZ39AAAAv5IrIbVAUjro7h4y5JK+DuL2CCxv6O2HpLBHs7JTxchPdI24iaEHMy3
L1mZAtq29s4JlgQXFM1qnOhtLyEcTP8KrtSdJUxUdr7edtd1AMBkFNamFf30Hc/2
ka5M+mqErI/V9RwMIYEoRVaizCGJJAVnFHmHpUw1yZ7GN4ynIY19JLpEhNITyXs=
=iEAA
-----END PGP SIGNATURE-----

--9QFbdP79QaMRBzkLnEpFPK0UZxWj9iFRD--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?dd3b0864-96df-8252-ff31-018bdea3fd30>