From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8720 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 02:13:53 +0200 Message-ID: References: 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 1445559282 21450 80.91.229.3 (23 Oct 2015 00:14:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Oct 2015 00:14:42 +0000 (UTC) Cc: Rich Felker To: musl Original-X-From: musl-return-8733-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 23 02:14:30 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 1ZpQ04-00038D-Ng for gllmg-musl@m.gmane.org; Fri, 23 Oct 2015 02:14:28 +0200 Original-Received: (qmail 24030 invoked by uid 550); 23 Oct 2015 00:14:26 -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 24003 invoked from network); 23 Oct 2015 00:14:24 -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 :cc:content-type; bh=0m42KZODRwaPC1KmoqW+m0XWGWt885rBaft817TdewI=; b=Cc3xuxmC55Uyo0ap0FcAkv8MvaYu9xav7eVHm+t7jFjqnS0vPUHfzUnrxSy9REnebj U8V3AR0J9bUHc3gDM4mFkEtvbyq0usPQR7glVXrB/dCZ/BQtadP0BPX2Cu/T/zLEjQZM N4yGpa8LzvlFNUkk+LsAO6Y1wHwtIHanQO7XwmEozjVAadKtFjH39iKvRdIBnqMtbdhR CRmaHOGMRI3Ldzt1hGThJMFrOTWMIfSHI3M3i7nX2q4WqwCo3FnN+oz57NFWhAhVe3ef T2qehTf9BKXY5Fn2JhrCLUnQRKMORL8eoVInvPWbytINJ2uci4n/31x8PopWWizSq9QF 7G4Q== X-Received: by 10.55.200.220 with SMTP id t89mr22270023qkl.78.1445559253079; Thu, 22 Oct 2015 17:14:13 -0700 (PDT) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:8720 Archived-At: On Fri, Oct 23, 2015 at 1:04 AM, Josiah Worcester wrote: > On Thu, Oct 22, 2015 at 3:31 PM Denys Vlasenko > wrote: >> Evidently, my CFLAGS replaced needed flags instead of being added at the >> end. >> >> Can this be fixed? If user needs to use e.g. EXTRA_CFLAGS instead, >> please fix configure --help. > > > This appears to be an issue with how you're expecting CFLAGS to work. I don't expect CFLAGS to work in any particular way. I would use whichever variable musl build system's documentation tells me to in order to add my own flags to gcc. My point is, documentation does not tell me how to achieve that. > As > with almost anything with configure, all the optimization flags you want > need to be in CFLAGS. Normally, a program would have nothing in there > otherwise, so you'd be just getting the "-falign-functions=1" flag going to > GCC. If you want to optimize it, you would actually need CFLAGS="-Os ...". And I would need to know to add -fPIC etc, right? Now, how would I make -fPIC appear *only where it is needed*? The project may build some *.c files as part of a *library* and therefore need -fPIC, and some other *.c files as a part of a *binary*, where -fPIC is better not be used. > As for the "no -fPIC", I believe you're looking at the build for two > different objects. No, I don't.