Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jan 2008 23:05:00 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/contrib/gcc gthr-posix.h
Message-ID:  <200801052305.m05N50pX048001@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
marius      2008-01-05 23:05:00 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_7_0)
    contrib/gcc          gthr-posix.h 
  Log:
  Merge from RELENG_7: 1.1.1.8.2.1
  
  On FreeBSD GCC 4.2.x checks for the existence of pthread_cancel() in
  order to determine whether a program is running with multithreading
  support. This check causes __gthread_active_p() to always return 1
  however, regardless of whether the program was actually compiled with
  -pthread or not, due to the fact that the FreeBSD libc contains a
  pthread_cancel() stub. Fix this by using the __gthread_active_p()
  version that GCC uses for Solaris and which actively checks for a
  working POSIX threads implementation (if such functions exist) instead
  of checking for the mere existence of corresponding functions.
  
  On platforms without TLS support, i.e. on arm and sparc64 due to the
  lack of GNU TLS support for these archs in binutils 2.15., the false
  positives returned by __gthread_active_p() for non-threaded programs
  cause the exception handling implementation GCC uses in this case to
  crash. This is because GCC assumes that the POSIX threading functions
  actually work when __gthread_active_p() returns 1 while in fact the
  corresponding stubs in libc just immediately return.
  Given that __gthread_active_p() is also used in a couple of other
  places besides exception handling, this bug has great potential to
  also cause problems in other areas and on all archs.
  
  Approved by:    re (kensmith)
  
  Revision     Changes    Path
  1.1.1.8.4.1  +7 -4      src/contrib/gcc/gthr-posix.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801052305.m05N50pX048001>