Date: Wed, 3 Jan 2018 13:20:35 -0700 From: Warner Losh <imp@bsdimp.com> To: Bryan Drewery <bdrewery@freebsd.org> Cc: John Baldwin <jhb@freebsd.org>, src-committers <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: <CANCZdfo98ucZ1JSy3-Ekeoesv=%2BG%2Bkwv1gjippkuQLfCN0msjg@mail.gmail.com> In-Reply-To: <dd3b0864-96df-8252-ff31-018bdea3fd30@FreeBSD.org> References: <201801031735.w03HZcFL082840@repo.freebsd.org> <dd3b0864-96df-8252-ff31-018bdea3fd30@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Jan 3, 2018 11:44 AM, "Bryan Drewery" <bdrewery@freebsd.org> wrote: 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 > > Log: > Don't clobber system LDFLAGS for beri boot loaders. > > Prior to r325114, bsd.init.mk was included after assignments to CFLAGS and > LDFLAGS in these Makefiles. After r325114, bare assignments (= rather than > +=) lost system-assigned default values that are needed when compiling with > an external toolchain. CFLAGS in both Makefiles already uses +=. This > commit changes LDFLAGS to use +=. While here, depend on the LDFLAGS update > in the parent Makefile.inc to set -nostdlib. > Hmm, I'm not sure it is even right for these files to be including bsd.init.mk It is the right thing. 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. No. They depend on Makefile.inc stuff being done and this was the easiest way to do that in dozens of files. Warner > Sponsored by: DARPA / AFRL > > Modified: > head/stand/mips/beri/boot2/Makefile > head/stand/mips/beri/loader/Makefile > > Modified: head/stand/mips/beri/boot2/Makefile > ============================================================ ================== > --- head/stand/mips/beri/boot2/Makefile Wed Jan 3 17:28:01 2018 (r327522) > +++ head/stand/mips/beri/boot2/Makefile Wed Jan 3 17:35:38 2018 (r327523) > @@ -53,8 +53,7 @@ CFLAGS+= -I${LDRSRC} \ > -fno-pic -mno-abicalls \ > -g > > -LDFLAGS= -nostdlib \ > - -static \ > +LDFLAGS+= -static \ > -Wl,-N \ > -G0 \ > -L${.CURDIR} > > Modified: head/stand/mips/beri/loader/Makefile > ============================================================ ================== > --- head/stand/mips/beri/loader/Makefile Wed Jan 3 17:28:01 2018 (r327522) > +++ head/stand/mips/beri/loader/Makefile Wed Jan 3 17:35:38 2018 (r327523) > @@ -85,8 +85,7 @@ CFLAGS+= -G0 \ > -mno-abicalls \ > -g > > -LDFLAGS= -nostdlib \ > - -static \ > +LDFLAGS+= -static \ > -T ${.CURDIR}/loader.ldscript \ > -L${.CURDIR} \ > -e __start > -- Regards, Bryan Drewery
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfo98ucZ1JSy3-Ekeoesv=%2BG%2Bkwv1gjippkuQLfCN0msjg>