From owner-svn-src-all@freebsd.org Wed Jan 3 20:20:36 2018 Return-Path: Delivered-To: svn-src-all@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 EAAA9EAD797 for ; Wed, 3 Jan 2018 20:20:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (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 B136864359 for ; Wed, 3 Jan 2018 20:20:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22a.google.com with SMTP id w188so3312715iod.10 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=Y65ewf+NpSkOxh0VCkJ5wBd5DOvNdfaBo7HoN2LkFfUa0v9UB+KFdDMBjqCmDtEdfh oCxjkpPEBW1NsaTux1dHX23UFL8BCyMnS+GfbYhWT9GgN5LoK2O3clkLRpwwLBcnLwDE JYJX4zKDFv9dFhCoOU0150Adn0IIaf4iZvQiqxzMY0ZMqfq/wdwq7nbECXq198IG8DI4 XFAWZXaG1IS9YOIKQ14FXh0nmMFd8P0nwblSlhSJ4GtDRqPDbxRWGNfAE1b5cPSOgRMw rL9IoM7SlSgakmpdPd0nkvrapKJ/qdegaw5DzNEn2d4ffxFx/iPS1JxZlU0tZ2gGHBXr abKA== X-Gm-Message-State: AKGB3mJG5nZb1izVFGtZ2Fdvpfd3gOQ2F6qm/QEgocJvVPyoHsdhZWFp Mx3KrY4Nfijh6dxQTTtWwC/8q9wX9y6TShPnVk7CRA== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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