Re: configure can't detect proper pthread flags

Поиск
Список
Период
Сортировка
От Max Filippov
Тема Re: configure can't detect proper pthread flags
Дата
Msg-id CAMo8BfKg=Nd9s3V68yxxBbEtfao1C+EEAQVvnPK7ZwcaPn5-vw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: configure can't detect proper pthread flags  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: configure can't detect proper pthread flags  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
Hi Tom,

On Fri, Mar 20, 2015 at 3:50 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Max Filippov <jcmvbkbc@gmail.com> writes:
>> when PostgreSQL is cross-compiled in the Buildroot with uClibc toolchain
>> it may not correctly detect compiler/linker flags for threading. [1]
>> The reason is that config/acx_pthread.m4:146 uses compiler and linker
>> stdout and stderr to make decision if acx_pthread_ok should be yes or no:
>
>>   if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval
>> $ac_compile 2>&1 1>&5)`" = ""; then
>
>> and the toolchain emits the following warning at linking step:
>
>>   libcrypto.so: warning: gethostbyname is obsolescent, use
>> getnameinfo() instead.
>
>> git log doesn't tell much why it is done that way. Does anybody know?
>
> The short answer is that the linker you're using is written by pedantic
> idiots.

Well... That doesn't answer my question.

>  Notice that the gethostbyname call it's complaining about is
> somewhere inside libcrypto; it's *not* in Postgres, much less the test
> program being built here.

Actually it *is* in the program being built here, because it's being
linked with libcrypto. The full command line produced by the first eval
is this:

xtensa-linux-gcc -o conftest -Wall -Wmissing-prototypes
-Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
-fwrapv -fexcess-precision=standard -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls
-mtext-section-literals -Os -pthread -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE conftest.c
-lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm

and if I drop irrelevant libraries from that command its stdout+stderr
will probably be empty.

But I was curious why this test is written *that* way.

-- 
Thanks.
-- Max



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

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: configure can't detect proper pthread flags
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Lets delete src/test/performance