From owner-cvs-all@FreeBSD.ORG Sat Jan 5 22:58:51 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B495C16A41B; Sat, 5 Jan 2008 22:58:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B275D13C45D; Sat, 5 Jan 2008 22:58:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m05MwpgA045504; Sat, 5 Jan 2008 22:58:51 GMT (envelope-from marius@repoman.freebsd.org) Received: (from marius@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m05MwpUL045503; Sat, 5 Jan 2008 22:58:51 GMT (envelope-from marius) Message-Id: <200801052258.m05MwpUL045503@repoman.freebsd.org> From: Marius Strobl Date: Sat, 5 Jan 2008 22:58:51 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_7 Cc: Subject: cvs commit: src/contrib/gcc gthr-posix.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2008 22:58:51 -0000 marius 2008-01-05 22:58:51 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) contrib/gcc gthr-posix.h Log: 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. This is committed to RELENG_7 directly in order to get a fix into RELENG_7_0 as soon as possible while allowing to loop the official fix back into the vendor branch and not taking gthr-posix.h off the vendor branch in HEAD. PR: 119289 Reviewed by: obrien (plus style fix) Approved by: re (kensmith) Revision Changes Path 1.1.1.8.2.1 +7 -4 src/contrib/gcc/gthr-posix.h