From owner-svn-src-head@freebsd.org Wed Jan 3 20:20:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A179EAD798 for ; Wed, 3 Jan 2018 20:20:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF87F6435B for ; Wed, 3 Jan 2018 20:20:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id 87so3326642ior.5 for ; Wed, 03 Jan 2018 12:20:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=JiaLgBzg2ANEHo95qJq0njTmtnsNam3rr50WCSvPs0A=; b=KBAkzTyri08ZAJUFHXuac12I5dpPRWz4ijkIGKuDX7Zf7EVWwPHN6R+Ozc11i6W2Td hTHhM41Lpi46+0cdxJqIdnGWkZbo+eLtHxon+xkqU0BT6oMjy6tEzgvgVFqN2Y3ZnXGg 4r8Beej4jrsqRzoTde9Ec8YKzJcY5jkLB6F8BfCE8NyAvNZz7fVTbbLjZN70mwYMnsOd QCz8sI5N6hsALtaoQxNvsY7TnzOdRLzyETi+wFOmpwAYPnMA0cOyPArVtkKnSATjvepl ClTgx0OgICZf0ZrqPkIUANItzyp62BzzYUK9ttwzV8zRhocYCz2Mbozd/xddYz2pe0Mh XiNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=JiaLgBzg2ANEHo95qJq0njTmtnsNam3rr50WCSvPs0A=; b=U/SmDk++yp0X/Jfn1EVM8oqsn+F5O/b6QMqlDkYHJPcGegl1qEPXCgZQWcUc8SYu8b kGvPbU+zhb+uESTfae7cB/KfHfHuQiav4bDAIl+EB0W6ykbWNsap0Pkkukx/VmxmHZo0 /DSLK9RBj5G+//z44pzzAq/eONNmq5mBOvavi5IaNnoUF0hCCjcr0dLkXCO9pp+mavWk /N0C1xTZTYl+5lMqvlk9bu3UkWhktjVHWHhJ55trHrDlb1S10kCU0FttKHP3D4Cj7/ha onf+bZQ6i3R5vGgV9GibojkHmSgdXaTvVw91osvJn+PMDhU231TinSzqxG0lfDr5glK/ GU4A== X-Gm-Message-State: AKGB3mJs6yMElIMNucwMVD66HU3LmzJ8nxD88pVq4HY311KrRD/Sh4VB zhJuFiHCHIGNCeMRSeNsaNzD43DU+a3LkgMUtmBsNg== X-Google-Smtp-Source: ACJfBoupcf/bAk/ywTXc922yib+SVCVivei/RV5tMbuf3LVjiDYAhzuYu5x+1WGZ32C/M8uGW+Ad3iZwU1su7OaW2MY= X-Received: by 10.107.13.67 with SMTP id 64mr2913560ion.301.1515010835852; Wed, 03 Jan 2018 12:20:35 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Wed, 3 Jan 2018 12:20:35 -0800 (PST) X-Originating-IP: [50.235.217.130] Received: by 10.79.108.204 with HTTP; Wed, 3 Jan 2018 12:20:35 -0800 (PST) In-Reply-To: References: <201801031735.w03HZcFL082840@repo.freebsd.org> From: Warner Losh Date: Wed, 3 Jan 2018 13:20:35 -0700 X-Google-Sender-Auth: KnttN7usQFwxSapU9ojCjnkIThA Message-ID: Subject: Re: svn commit: r327523 - in head/stand/mips/beri: boot2 loader To: Bryan Drewery Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jan 2018 20:20:37 -0000 On Jan 3, 2018 11:44 AM, "Bryan Drewery" 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 includes , # ../Makefile.inc and ; this is used at the # top of all 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