From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8724 Path: news.gmane.org!not-for-mail From: Denys Vlasenko Newsgroups: gmane.linux.lib.musl.general Subject: Re: Having hard time adding to CFLAGS Date: Fri, 23 Oct 2015 06:53:29 +0200 Message-ID: References: <20151022232330.GG10551@port70.net> <20151023030236.GB8645@brightrain.aerifal.cx> <20151023040909.GD8645@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1445576063 26827 80.91.229.3 (23 Oct 2015 04:54:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Oct 2015 04:54:23 +0000 (UTC) To: musl Original-X-From: musl-return-8737-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 23 06:54:13 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZpUMd-0001E1-QI for gllmg-musl@m.gmane.org; Fri, 23 Oct 2015 06:54:03 +0200 Original-Received: (qmail 3929 invoked by uid 550); 23 Oct 2015 04:54:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3897 invoked from network); 23 Oct 2015 04:54:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=+YwH2VaC9l/kkJIz9RXUoaA/y5pauZ7I9/Jkl1D+Gv8=; b=KE6a73E4Ae98N8io5H2d5+Jb6vTPi5pZod+krZDUZTVsTzrF5w+BbZh6QDisxGg9hF w7LHyj/GLXVBuLsZfIEaRRmp/OsAJzbjwr5Lh7q6pFDSHsNBV5CDZTObT/PquaHnJbCA ccu4MGL1HizJcwvgRWxLU/Beu6xGzFT261xpng9983quDpxpZM/rZp6eRsdmma4qUWhW ia79Dt5Zoq+Cd6vnBUxPkTyca7A2rLF2LVL1L5ahIFIo0qwIMClzj2O+H8tN+lch2WGU u7R3CdyqjmXw5X0i+/L8tagkvsCrRwrjDnfMFCTBFiVQz36QNnLSFBKhLK1soDMfznVG p8FA== X-Received: by 10.140.218.84 with SMTP id o81mr23196585qhb.22.1445576029198; Thu, 22 Oct 2015 21:53:49 -0700 (PDT) In-Reply-To: <20151023040909.GD8645@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:8724 Archived-At: On Fri, Oct 23, 2015 at 6:09 AM, Rich Felker wrote: > On Thu, Oct 22, 2015 at 11:02:36PM -0400, Rich Felker wrote: >> > the attached patch makes this work, but i >> > consider -Os to be not part of 'needed' >> >> > diff --git a/Makefile b/Makefile >> > index 844a017..f713286 100644 >> > --- a/Makefile >> > +++ b/Makefile >> > @@ -94,22 +94,22 @@ crt/crt1.o crt/Scrt1.o crt/rcrt1.o src/ldso/dlstart.lo: $(wildcard arch/$(ARCH)/ >> > >> > crt/rcrt1.o: src/ldso/dlstart.c >> > >> > -crt/Scrt1.o crt/rcrt1.o: CFLAGS += -fPIC >> > +crt/Scrt1.o crt/rcrt1.o: CFLAGS_ALL += -fPIC >> >> This is the correct fix. I was not aware that make variables set from >> the make command line would take precedence over the target-specific >> += concatenations. The intent has always been that editing CFLAGS >> should not break the build (unless you put really inapproriate stuff >> there, of course). > > I've committed this with one change (omitting the -O3 thing that's > really optional) and another related fix. > > Note however that overriding CFLAGS at make time is still a bad idea. > It will suppress all the warning options configure detected and other > useful but non-essential things like -fno-unwind-tables and > -fno-asynchronous-unwind-tables. We should probably discuss whether > this behavior is desirable. We could factor out all of the stuff > configure detects into a CFLAGS_AUTO and leave CFLAGS just containing > the user-provided options. Opinions? Make configure --help warn/explain what would happen if make CFLAGS=foo is run. Currently, it is confusing. See for yourself: Usage: $0 [OPTION]... [VAR=VALUE]... [TARGET] To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. ... ("ok, I got it. CFLAGS should go to configure's command line!") ... Some influential environment variables: CC C compiler command [detected] CFLAGS C compiler flags [-Os -pipe ...] CROSS_COMPILE prefix for cross compiler and tools [none] LIBCC compiler runtime library [detected] Use these variables to override the choices made by configure. ("What? You just said that CFLAGS should be on command line! Now you are saying it should be in the environment! What it is?")