Re: xlc atomics

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: xlc atomics
Дата
Msg-id 20150704225443.GA24494@alap3.anarazel.de
обсуждение исходный текст
Ответ на xlc atomics  (Noah Misch <noah@leadboat.com>)
Ответы Re: xlc atomics  (Noah Misch <noah@leadboat.com>)
Re: xlc atomics  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
On 2015-07-04 18:40:41 -0400, Noah Misch wrote:
> (1) "IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72)".  Getting it working
> required the attached patch.  None of my xlc configurations have an <atomic.h>
> header, and a web search turned up no evidence of one in connection with xlc
> platforms.  Did you learn of a configuration needing atomic.h under xlc?  The
> rest of the changes are hopefully self-explanatory in light of the
> documentation cited in generic-xlc.h.  (Building on AIX has regressed in other
> ways unrelated to atomics; I will write more about that in due course.)

I wrote this entirely blindly, as evidenced here by the changes you
needed. At the time somebody had promised to soon put up an aix animal,
but that apparently didn't work out.

Will you apply? Having the ability to test change seems to put you in a
much better spot then me.

> (2) "IBM XL C/C++ for Linux, V13.1.2 (5725-C73, 5765-J08)" for ppc64le,
> http://www-01.ibm.com/support/docview.wss?uid=swg27044056&aid=1.  This
> compiler has a Clang-derived C frontend.  It defines __GNUC__ and offers
> GCC-style __sync_* atomics.

Phew. I don't see much reason to try to support this. Why would that be
interesting?

> Therefore, PostgreSQL selects generic-gcc.h.
> test_atomic_ops() fails because __sync_lock_test_and_set() of one-byte types
> segfaults at runtime.  I have reported this to the vendor.  Adding
> "pgac_cv_gcc_sync_char_tas=no" to the "configure" invocation is a good
> workaround.  I could add a comment about that to src/test/regress/sql/lock.sql
> for affected folks to see in regression.diffs.  To do better, we could make
> PGAC_HAVE_GCC__SYNC_CHAR_TAS perform a runtime test where possible.  Yet
> another option is to force use of generic-xlc.h on this compiler.

It seems fair enough to simply add another test and include
generic-xlc.h in that case. If it's indeed xlc, why not?

> (3) "IBM XL C/C++ for Linux, V13.1.2 (5725-C73, 5765-J08)" for ppc64le,
> modifying atomics.h to force use of generic-xlc.h.  While not a supported
> PostgreSQL configuration, I felt this would make an interesting data point.
> It worked fine after applying the patch developed for the AIX configuration.

Cool.

Greetings,

Andres Freund



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

Предыдущее
От: Noah Misch
Дата:
Сообщение: xlc atomics
Следующее
От: Noah Misch
Дата:
Сообщение: Re: xlc atomics