Mercurial > octave
comparison m4/acinclude.m4 @ 28528:d5311ca8f945
maint: merge stable to default.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Thu, 02 Jul 2020 18:16:10 +0200 |
parents | 0c6dcf803529 9e7b2625e574 |
children | 20ee8aa92897 |
comparison
equal
deleted
inserted
replaced
28526:1151ed869686 | 28528:d5311ca8f945 |
---|---|
182 fi | 182 fi |
183 else | 183 else |
184 octave_cv_broken_stl_algo_h=no | 184 octave_cv_broken_stl_algo_h=no |
185 warn_stl_algo_h="UNEXPECTED: nth_element test failed. Refusing to fix except for g++ 4.8.2." | 185 warn_stl_algo_h="UNEXPECTED: nth_element test failed. Refusing to fix except for g++ 4.8.2." |
186 OCTAVE_CONFIGURE_WARNING([warn_stl_algo_h]) | 186 OCTAVE_CONFIGURE_WARNING([warn_stl_algo_h]) |
187 fi | |
188 ]) | |
189 dnl | |
190 dnl Check if pthread stack size accounts for thread-local storage. | |
191 dnl | |
192 dnl This program should succeed if the pthread library allocates memory | |
193 dnl for thread-local (__thread) variables independently of the | |
194 dnl requested thread stack size. | |
195 dnl | |
196 dnl It will fail if (as in the current version of glibc) the storage | |
197 dnl for thread-local variables is subtracted from the memory allocated | |
198 dnl for the thread stack. (This can cause problems for Java and for | |
199 dnl other libraries.) | |
200 dnl | |
201 dnl This bug is tracked in glibc at: | |
202 dnl https://sourceware.org/bugzilla/show_bug.cgi?id=11787 | |
203 dnl | |
204 AC_DEFUN([OCTAVE_CHECK_BROKEN_PTHREAD_STACKSIZE], [ | |
205 AC_CACHE_CHECK([whether pthread stack size does not account for thread-local storage], | |
206 [octave_cv_broken_pthread_stacksize], | |
207 [AC_LANG_PUSH(C) | |
208 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ | |
209 #include <stdio.h> | |
210 #include <string.h> | |
211 #include <pthread.h> | |
212 | |
213 static char __thread data[100 * 1024]; | |
214 | |
215 static void * threadfunc(void *arg) | |
216 { | |
217 return data; | |
218 } | |
219 ]], [[ | |
220 pthread_attr_t attr; | |
221 pthread_t thread; | |
222 int errnum; | |
223 | |
224 pthread_attr_init (&attr); | |
225 errnum = pthread_attr_setstacksize (&attr, 64 * 1024); | |
226 if (errnum != 0) | |
227 { | |
228 fprintf (stderr, "pthread_attr_setstacksize: %s\n", strerror(errnum)); | |
229 return 1; | |
230 } | |
231 errnum = pthread_create (&thread, &attr, &threadfunc, NULL); | |
232 if (errnum != 0) | |
233 { | |
234 fprintf (stderr, "pthread_create: %s\n", strerror(errnum)); | |
235 return 1; | |
236 } | |
237 errnum = pthread_join (thread, NULL); | |
238 if (errnum != 0) | |
239 { | |
240 fprintf (stderr, "pthread_join: %s\n", strerror(errnum)); | |
241 return 1; | |
242 } | |
243 | |
244 pthread_attr_destroy (&attr); | |
245 return 0; | |
246 ]])], | |
247 octave_cv_broken_pthread_stacksize=no, | |
248 octave_cv_broken_pthread_stacksize=yes, | |
249 octave_cv_broken_pthread_stacksize=no) | |
250 AC_LANG_POP(C) | |
251 ]) | |
252 if test $octave_cv_broken_pthread_stacksize = yes; then | |
253 AC_DEFINE(HAVE_BROKEN_PTHREAD_STACKSIZE, 1, | |
254 [Define to 1 if pthread stack size does not account for thread-local storage.]) | |
187 fi | 255 fi |
188 ]) | 256 ]) |
189 dnl | 257 dnl |
190 dnl Check whether CXSparse is version 2.2 or later | 258 dnl Check whether CXSparse is version 2.2 or later |
191 dnl FIXME: This test uses a version number. It potentially could | 259 dnl FIXME: This test uses a version number. It potentially could |