mirror of git://gcc.gnu.org/git/gcc.git
re PR libgomp/28008 (build failure due to PTHREAD_STACK_MIN not being declared)
PR libgomp/28008 * env.c (initialize_env): Avoid using PTHREAD_STACK_MIN when undefined. Use GOMP_STACKSIZE not OMP_STACKSIZE for environment. From-SVN: r114643
This commit is contained in:
parent
184f4c5647
commit
c3b11a40d0
|
@ -1,3 +1,9 @@
|
||||||
|
2006-06-14 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
PR libgomp/28008
|
||||||
|
* env.c (initialize_env): Avoid using PTHREAD_STACK_MIN when
|
||||||
|
undefined. Use GOMP_STACKSIZE not OMP_STACKSIZE for environment.
|
||||||
|
|
||||||
2006-06-09 Richard Henderson <rth@redhat.com>
|
2006-06-09 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
* env.c (gomp_nthreads_var): Change to unsigned long.
|
* env.c (gomp_nthreads_var): Change to unsigned long.
|
||||||
|
|
|
@ -166,21 +166,27 @@ initialize_env (void)
|
||||||
pthread_attr_init (&gomp_thread_attr);
|
pthread_attr_init (&gomp_thread_attr);
|
||||||
pthread_attr_setdetachstate (&gomp_thread_attr, PTHREAD_CREATE_DETACHED);
|
pthread_attr_setdetachstate (&gomp_thread_attr, PTHREAD_CREATE_DETACHED);
|
||||||
|
|
||||||
if (parse_unsigned_long ("OMP_STACKSIZE", &stacksize))
|
if (parse_unsigned_long ("GOMP_STACKSIZE", &stacksize))
|
||||||
{
|
{
|
||||||
|
int err;
|
||||||
|
|
||||||
stacksize *= 1024;
|
stacksize *= 1024;
|
||||||
|
err = pthread_attr_setstacksize (&gomp_thread_attr, stacksize);
|
||||||
|
|
||||||
|
#ifdef PTHREAD_STACK_MIN
|
||||||
|
if (err == EINVAL)
|
||||||
|
{
|
||||||
if (stacksize < PTHREAD_STACK_MIN)
|
if (stacksize < PTHREAD_STACK_MIN)
|
||||||
gomp_error ("Stack size less than minimum of %luk",
|
gomp_error ("Stack size less than minimum of %luk",
|
||||||
PTHREAD_STACK_MIN / 1024ul
|
PTHREAD_STACK_MIN / 1024ul
|
||||||
+ (PTHREAD_STACK_MIN % 1024 != 0));
|
+ (PTHREAD_STACK_MIN % 1024 != 0));
|
||||||
else
|
else
|
||||||
{
|
|
||||||
int err = pthread_attr_setstacksize (&gomp_thread_attr, stacksize);
|
|
||||||
if (err == EINVAL)
|
|
||||||
gomp_error ("Stack size larger than system limit");
|
gomp_error ("Stack size larger than system limit");
|
||||||
else if (err != 0)
|
|
||||||
gomp_error ("Stack size change failed: %s", strerror (err));
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
if (err != 0)
|
||||||
|
gomp_error ("Stack size change failed: %s", strerror (err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue