Re: configure can't detect proper pthread flags

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: configure can't detect proper pthread flags
Дата
Msg-id 559D5BA5.4060506@iki.fi
обсуждение исходный текст
Ответ на Re: configure can't detect proper pthread flags  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: configure can't detect proper pthread flags  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 07/08/2015 04:38 PM, Tom Lane wrote:
> Heikki Linnakangas <hlinnaka@iki.fi> writes:
>> I suggest that we revert that work-around for that GCC bug, and stop
>> testing the pthread flags as soon as we find one that works.
>
> OK ...
>
>> Then we can
>> also remove the test for whether the compiler produces any warnings.
>
> Don't see how that follows?

That test was added after the GCC-bug workaround, because that 
workaround caused warnings. The upstream philosophy is to have a list of 
flags, and try them in order until you find one that works. With the 
workaround that we added, after it finds one flag that makes the pthread 
test program to compile, it adds every flag in the list to the command 
line as long as they donn't make the test program to fail again. For 
example, after it found out that "-pthread" makes the compilation to 
work, it appended "-pthreads -mthreads -mt -lpthread --thread-safe" to 
PTHREAD_CFLAGS, as long as none of those caused a compiler error. They 
could cause warnings though. That's why we had to add the test to check 
for warnings.

The only scenario where you might now get warnings if we switch to 
upstream version, and didn't before, is if one of the flags makes 
pthreads to work, but also creates compiler warnings, while another flag 
later in the list would make it work without warnings. That's not 
totally inconceivable, but I doubt it happens. In any case, there's 
nothing PostgreSQL-specific about that, so if that happens, I'd like to 
find out so that we can complain to the upstream.

I'll commit the upstream version, and we'll see what the buildfarm thinks.

- Heikki




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

Предыдущее
От: Robbie Harwood
Дата:
Сообщение: Re: [PATCH] libpq: Allow specifying multiple host names to try to connect to
Следующее
От: Tom Lane
Дата:
Сообщение: Re: configure can't detect proper pthread flags