aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2017-05-15 20:09:43 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2017-05-15 20:09:43 +0300
commit38e87ea0415eda38c3e5b926d20b49f6849e3013 (patch)
tree8b9238d70b4d1866b722e5da1ec83566bbaaf30b
parente1725761cb04a09e989d7803a1aa8b1707664d22 (diff)
downloadnginx-38e87ea0415eda38c3e5b926d20b49f6849e3013.tar.gz
nginx-38e87ea0415eda38c3e5b926d20b49f6849e3013.zip
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.
-rw-r--r--auto/cc/conf34
1 files changed, 19 insertions, 15 deletions
diff --git a/auto/cc/conf b/auto/cc/conf
index 49af718c3..afbca62bc 100644
--- a/auto/cc/conf
+++ b/auto/cc/conf
@@ -178,21 +178,25 @@ if [ "$NGX_PLATFORM" != win32 ]; then
fi
- ngx_feature="gcc builtin atomic operations"
- ngx_feature_name=NGX_HAVE_GCC_ATOMIC
- ngx_feature_run=yes
- ngx_feature_incs=
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="long n = 0;
- if (!__sync_bool_compare_and_swap(&n, 0, 1))
- return 1;
- if (__sync_fetch_and_add(&n, 1) != 1)
- return 1;
- if (n != 2)
- return 1;
- __sync_synchronize();"
- . auto/feature
+ if [ "$NGX_CC_NAME" = "sunc" ]; then
+ echo "checking for gcc builtin atomic operations ... disabled"
+ else
+ ngx_feature="gcc builtin atomic operations"
+ ngx_feature_name=NGX_HAVE_GCC_ATOMIC
+ ngx_feature_run=yes
+ ngx_feature_incs=
+ ngx_feature_path=
+ ngx_feature_libs=
+ ngx_feature_test="long n = 0;
+ if (!__sync_bool_compare_and_swap(&n, 0, 1))
+ return 1;
+ if (__sync_fetch_and_add(&n, 1) != 1)
+ return 1;
+ if (n != 2)
+ return 1;
+ __sync_synchronize();"
+ . auto/feature
+ fi
if [ "$NGX_CC_NAME" = "ccc" ]; then