comparison auto/cc/conf @ 6999:4925a6d13746

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 15 May 2017 20:09:43 +0300
parents 775f621eacae
children 9bcc5cc94ff4
comparison
equal deleted inserted replaced
6998:775f621eacae 6999:4925a6d13746
176 if [ $ngx_found = yes ]; then 176 if [ $ngx_found = yes ]; then
177 MAIN_LINK="-Wl,-E" 177 MAIN_LINK="-Wl,-E"
178 fi 178 fi
179 179
180 180
181 ngx_feature="gcc builtin atomic operations" 181 if [ "$NGX_CC_NAME" = "sunc" ]; then
182 ngx_feature_name=NGX_HAVE_GCC_ATOMIC 182 echo "checking for gcc builtin atomic operations ... disabled"
183 ngx_feature_run=yes 183 else
184 ngx_feature_incs= 184 ngx_feature="gcc builtin atomic operations"
185 ngx_feature_path= 185 ngx_feature_name=NGX_HAVE_GCC_ATOMIC
186 ngx_feature_libs= 186 ngx_feature_run=yes
187 ngx_feature_test="long n = 0; 187 ngx_feature_incs=
188 if (!__sync_bool_compare_and_swap(&n, 0, 1)) 188 ngx_feature_path=
189 return 1; 189 ngx_feature_libs=
190 if (__sync_fetch_and_add(&n, 1) != 1) 190 ngx_feature_test="long n = 0;
191 return 1; 191 if (!__sync_bool_compare_and_swap(&n, 0, 1))
192 if (n != 2) 192 return 1;
193 return 1; 193 if (__sync_fetch_and_add(&n, 1) != 1)
194 __sync_synchronize();" 194 return 1;
195 . auto/feature 195 if (n != 2)
196 return 1;
197 __sync_synchronize();"
198 . auto/feature
199 fi
196 200
197 201
198 if [ "$NGX_CC_NAME" = "ccc" ]; then 202 if [ "$NGX_CC_NAME" = "ccc" ]; then
199 echo "checking for C99 variadic macros ... disabled" 203 echo "checking for C99 variadic macros ... disabled"
200 else 204 else