Configure: disabled gcc atomics with Sun C (ticket #1261).
Oracle Developer Studio 12.5 introduced GCC-compatible __sync builtins. Unfortunately, these builtins are neither GCC-compatible (they generate warnings when used with volatile), nor working (unexpectedly fail on unpredictable combinations of code layout and compiler flags). As such, the gcc builtin atomic operations configure test explicitly disabled when compiling with Sun C.
This commit is contained in:
parent
2cabd63422
commit
be7d7499e5
1 changed files with 19 additions and 15 deletions
34
auto/cc/conf
34
auto/cc/conf
|
@ -178,21 +178,25 @@ if [ "$NGX_PLATFORM" != win32 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
ngx_feature="gcc builtin atomic operations"
|
if [ "$NGX_CC_NAME" = "sunc" ]; then
|
||||||
ngx_feature_name=NGX_HAVE_GCC_ATOMIC
|
echo "checking for gcc builtin atomic operations ... disabled"
|
||||||
ngx_feature_run=yes
|
else
|
||||||
ngx_feature_incs=
|
ngx_feature="gcc builtin atomic operations"
|
||||||
ngx_feature_path=
|
ngx_feature_name=NGX_HAVE_GCC_ATOMIC
|
||||||
ngx_feature_libs=
|
ngx_feature_run=yes
|
||||||
ngx_feature_test="long n = 0;
|
ngx_feature_incs=
|
||||||
if (!__sync_bool_compare_and_swap(&n, 0, 1))
|
ngx_feature_path=
|
||||||
return 1;
|
ngx_feature_libs=
|
||||||
if (__sync_fetch_and_add(&n, 1) != 1)
|
ngx_feature_test="long n = 0;
|
||||||
return 1;
|
if (!__sync_bool_compare_and_swap(&n, 0, 1))
|
||||||
if (n != 2)
|
return 1;
|
||||||
return 1;
|
if (__sync_fetch_and_add(&n, 1) != 1)
|
||||||
__sync_synchronize();"
|
return 1;
|
||||||
. auto/feature
|
if (n != 2)
|
||||||
|
return 1;
|
||||||
|
__sync_synchronize();"
|
||||||
|
. auto/feature
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$NGX_CC_NAME" = "ccc" ]; then
|
if [ "$NGX_CC_NAME" = "ccc" ]; then
|
||||||
|
|
Loading…
Reference in a new issue