Re: BUG #14033: cross-compilation to ARM fails

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14033: cross-compilation to ARM fails
Дата
Msg-id 22597.1458578361@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #14033: cross-compilation to ARM fails  (Daniel Golle <daniel@makrotopia.org>)
Ответы Re: BUG #14033: cross-compilation to ARM fails  (Daniel Golle <daniel@makrotopia.org>)
Список pgsql-bugs
Daniel Golle <daniel@makrotopia.org> 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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: sfrazer@lakeshoreint.com
Дата:
Сообщение: BUG #14039: Possible documentation bug regarding streaming replication slots
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14038: substring cuts unicode char in half, allowing to save broken utf8 into table