From patchwork Thu Oct 28 14:37:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 69467 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id EC239B70AA for ; Fri, 29 Oct 2010 01:37:22 +1100 (EST) Received: (qmail 28711 invoked by alias); 28 Oct 2010 14:37:20 -0000 Received: (qmail 28701 invoked by uid 22791); 28 Oct 2010 14:37:19 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Oct 2010 14:37:12 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 8CCDAFA5 for ; Thu, 28 Oct 2010 16:37:10 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wPzp9aP8Nks2 for ; Thu, 28 Oct 2010 16:37:08 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id DA717FA4 for ; Thu, 28 Oct 2010 16:37:08 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id o9SEb8LG029038; Thu, 28 Oct 2010 16:37:08 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Subject: [testsuite] Always pass -pthread for TLS tests on Tru64 UNIX (PR target/46131) Date: Thu, 28 Oct 2010 16:37:08 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org As indicated in the PR, all TLS execution tests were failing on Tru64 UNIX. After some investigation, the problem became obvious: due to lack of native TLS support, Tru64 UNIX relies on emutls, which needs a couple of libpthread functions. Since the Tru64 UNIX linker lacks support for weak definitions, there are also dummy implementations of them in libgcc. But here the real functions are needed, so the affected TLS tests need to be linked with -pthread. Manual testing indicated that this fixes the problem as expected. This patch implements the proper solution by always passing -pthread in add_options_for_tls, just as on Solaris 8/9. Testing in progress, will commit once regtest finishes successfully. Rainer 2010-10-28 Rainer Orth PR target/46131 * lib/target-supports.exp (add_options_for_tls): Pass -pthread for *-*-osf*. diff -r 201f524dd582 gcc/testsuite/lib/target-supports.exp --- a/gcc/testsuite/lib/target-supports.exp Thu Oct 28 15:17:34 2010 +0200 +++ b/gcc/testsuite/lib/target-supports.exp Thu Oct 28 16:32:58 2010 +0200 @@ -613,6 +613,11 @@ # Add to FLAGS all the target-specific flags needed to use thread-local storage. proc add_options_for_tls { flags } { + # Tru64 UNIX uses emutls, which relies on a couple of pthread functions + # which only live in libpthread, so always pass -pthread for TLS. + if { [istarget *-*-osf*] } { + return "$flags -pthread" + } # On Solaris 8 and 9, __tls_get_addr/___tls_get_addr only lives in # libthread, so always pass -pthread for native TLS. # Need to duplicate native TLS check from