Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHv1R-000109-TT for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Jun 2016 15:33:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bHv1R-00019b-71 for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Jun 2016 15:33:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bHv0n-0000SH-MS for pgsql-bugs@postgresql.org; Tue, 28 Jun 2016 15:33:17 +0000 Received: from smtprelay0232.b.hostedemail.com ([64.98.42.232] helo=smtprelay.b.hostedemail.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bHv0k-0007Sf-80 for pgsql-bugs@postgresql.org; Tue, 28 Jun 2016 15:33:16 +0000 Received: from filter.hostedemail.com (10.5.19.248.rfc1918.com [10.5.19.248]) by smtprelay03.b.hostedemail.com (Postfix) with ESMTP id 9A4221A7011; Tue, 28 Jun 2016 15:33:12 +0000 (UTC) X-Session-Marker: 616C76686572726540616C76682E6E6F2D69702E6F7267 X-Spam-Summary: 20,1.5,0,,d41d8cd98f00b204,alvherre@alvh.no-ip.org,:::,RULES_HIT:41:146:196:355:379:599:800:960:967:973:982:988:989:1042:1260:1263:1277:1311:1312:1313:1314:1345:1359:1437:1515:1516:1518:1519:1534:1542:1593:1594:1595:1596:1711:1730:1747:1777:1792:2282:2328:2393:2525:2553:2561:2564:2682:2685:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3653:3865:3866:3867:3868:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4384:4470:4605:4659:5007:6117:6119:6261:7862:7903:7904:8957:8985:9025:9121:9165:9389:10004:10400:10848:11232:11233:11256:11257:11658:11914:12043:12050:12296:12324:12438:12517:12519:12555:12679:12740:13161:13229:13439:13846:13891:13894:13895:14181:14721:21080:21365:21433:21434:30003:30022:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:8,LUA_SUMMARY:none X-HE-Tag: goat87_905fd97f4b806 X-Filterd-Recvd-Size: 2923 Received: from alvin.alvh.no-ip.org (unknown [216.155.90.98]) (Authenticated sender: alvherre@alvh.no-ip.org) by omf02.b.hostedemail.com (Postfix) with ESMTPA; Tue, 28 Jun 2016 15:33:12 +0000 (UTC) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 41B126A5; Tue, 28 Jun 2016 11:33:09 -0400 (CLT) Date: Tue, 28 Jun 2016 11:33:09 -0400 From: Alvaro Herrera To: dpa-postgres@aegee.org Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14217: Respect $CFLAGS from /usr/local/etc/config.site Message-ID: <20160628153309.GA23675@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160628090414.17235.40306@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -0.4 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org dpa-postgres@aegee.org wrote: > The following bug has been logged on the website: > > Bug reference: 14217 > Logged by: Dilian Palauzov > Email address: dpa-postgres@aegee.org > PostgreSQL version: 9.6beta2 > Operating system: Linux > Description: > > configure generated by Autoconf loads the file $prefix/etc/config.site and > if CFLAGS is defined there, its value is used when building the project. > > Because in postgresql configure.in contains on line 400 "unset CFLAGS" the > value of $CFLAGS from config.site is discarded when building postgresql, > contrary to $LDFLAGS from config.site. This report is correct; we're not doing the right thing here. The autoconf manual explicitely says: Site files are also good places to set default values for other output variables, such as CFLAGS, if you need to give them non-default values: anything you would normally do, repetitively, on the command line. If you use non-default values for prefix or exec_prefix (wherever you locate the site file), you can set them in the site file if you specify it with the CONFIG_SITE environment variable. https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Site-Defaults.html The way it works today completely ignores settings in config.site, which is clearly bogus per the above manual, but I doubt that blanket removal of the "unset" is the right solution. The line was added by this commit: commit 801427abc2924195b35be19abe4f64dbbea82263 Author: Peter Eisentraut AuthorDate: Sat Nov 1 20:48:51 2003 +0000 CommitDate: Sat Nov 1 20:48:51 2003 +0000 Unset CFLAGS before reading template. This should be more robust. When --enable-debug is used, then the default CFLAGS for non-GCC is just -g without -O. Backpatch enhancement of Autoconf inline test that detects problems with the HP C compiler. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs