pgsql: Try to detect runtime unavailability of __builtin_mul_overflow(i

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Try to detect runtime unavailability of __builtin_mul_overflow(i
Date: 2017-12-16 20:57:00
Message-ID: E1eQJW0-0003wJ-Op@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Try to detect runtime unavailability of __builtin_mul_overflow(int64).

On some systems the results of 64 bit __builtin_mul_overflow()
operations can be computed at compile time, but not at runtime. The
known cases are arm buildfar animals using clang where the runtime
operation is implemented in a unavailable function.

Try to avoid compile-time computation by using volatile arguments to
__builtin_mul_overflow(). In that case we hopefully will get a link
error when unavailable, similar to what buildfarm animals dangomushi
and gull are reporting.

Author: Andres Freund
Discussion: https://postgr.es/m/20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c04d35f442a8c4fd5a20103b31839ec52fce3046

Modified Files
--------------
config/c-compiler.m4 | 12 ++++++++----
configure | 4 +++-
2 files changed, 11 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-12-17 00:32:07 Re: pgsql: Provide overflow safe integer math inline functions.
Previous Message Noah Misch 2017-12-16 18:05:36 pgsql: Avoid and detect SIGPIPE race in TAP tests.