Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ai2rl-0007qn-FY for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Mar 2016 16:39:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ai2rk-0006yb-Pf for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Mar 2016 16:39:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ai2rk-0006yV-Fq for pgsql-bugs@postgresql.org; Mon, 21 Mar 2016 16:39:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ai2rg-0005ng-8q for pgsql-bugs@postgresql.org; Mon, 21 Mar 2016 16:39:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u2LGdLoO022598; Mon, 21 Mar 2016 12:39:21 -0400 From: Tom Lane To: Daniel Golle cc: Alvaro Herrera , pgsql-bugs@postgresql.org Subject: Re: BUG #14033: cross-compilation to ARM fails In-reply-to: <20160321155226.GB1831@makrotopia.org> References: <20160319223826.GA333151@alvherre.pgsql> <15650.1458572026@sss.pgh.pa.us> <20160321155226.GB1831@makrotopia.org> Comments: In-reply-to Daniel Golle message dated "Mon, 21 Mar 2016 16:52:31 +0100" Date: Mon, 21 Mar 2016 12:39:21 -0400 Message-ID: <22597.1458578361@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Daniel Golle writes: > On Mon, Mar 21, 2016 at 10:53:46AM -0400, Tom Lane wrote: >> Specifically, I'd like to see config.log from the second >> (cross-compilation) configure run. > Having a closer look it seems to fail on the first run, see > https://github.com/openwrt/packages/blob/master/libs/postgresql/Makefile#L85 > for the two invocations of configure (build host is x86_64). Ah, that's something quite different from what we were assuming. AFAICS, configure is correctly detecting that it can build SSE code on that host as long as it uses -msse4.2, and it does show CFLAGS_SSE42='-msse4.2' in the "output variables" part of config.log: > ## ----------------- ## > ## Output variables. ## > ## ----------------- ## > ... > CFLAGS='-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard ' > CFLAGS_SSE42='-msse4.2' However, the actual make run doesn't use that switch when it goes to build pg_crc32c_sse42.c: > make[4]: Entering directory '/usr/src/openwrt/build_dir/target-arm_cortex-a9+vfpv3_musl-1.1.14_eabi/postgresql-9.5.1/src/port' > ... > gcc -I../../libpq -I../../src/port -DFRONTEND -I../../src/include -D_GNU_SOURCE -c -o pg_crc32c_sse42.o pg_crc32c_sse42.c -MMD -MP -MF .deps/pg_crc32c_sse42.Po Not only is that missing -msse4.2, but it's missing all of the switches that should have been inserted from configure's version of CFLAGS, too. So somehow, neither CFLAGS nor CFLAGS_SSE42 are getting propagated from configure's decisions to the src/port make run. (pokes around...) I can replicate that command line if I do this: make CFLAGS="-I../../libpq" as that completely overrides the makefile's attempts to set CFLAGS. And that's what I see your project script doing, at line 119. Don't do that. Quite aside from breaking the intended set of CFLAGS, this extra include is completely useless. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs