From patchwork Wed Nov 16 18:38:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 126014 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 4BB99B7199 for ; Thu, 17 Nov 2011 05:39:12 +1100 (EST) Received: (qmail 25311 invoked by alias); 16 Nov 2011 18:39:08 -0000 Received: (qmail 25189 invoked by uid 22791); 16 Nov 2011 18:39:06 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_GJ, T_TVD_MIME_NO_HEADERS 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; Wed, 16 Nov 2011 18:38:45 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 32E2383B; Wed, 16 Nov 2011 19:38:44 +0100 (CET) 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 GIBSdfngngkD; Wed, 16 Nov 2011 19:38:42 +0100 (CET) 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 1F8F783A; Wed, 16 Nov 2011 19:38:42 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id pAGIcfwr011869; Wed, 16 Nov 2011 19:38:41 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Richard Henderson Subject: [libitm] Support Solaris 8 and 9/x86 with Sun as Date: Wed, 16 Nov 2011 19:38:41 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (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 libitm failed to build on Solaris 8 and 9/x86 with the native assembler, which lacks support for .hidden. The following patch deals with that by explicitly using the PIC code sequence, as inspired by libffi/src/x86/sysv.S. It allows libitm to build on i386-pc-solaris2.8, and testsuite results are even better than those using gas, insofar as PASS: libitm.c++/eh-1.C execution test now passes while it fails with gas. The failure with gas may be due to the fact that 32-bit Solaris/x86 requires datarel encoding in .eh_frame, while the .cfi* directives generate pcrel encoding instead. Ok for mainline? Rainer 2011-11-14 Rainer Orth * config/generic/asmcfi.h: Fix comment. * config/x86/sjlj.S (_ITM_beginTransaction): Provide PIC code sequence without .hidden support. (GTM_longjmp) [__ELF__]: Only use .hidden if HAVE_ATTRIBUTE_VISIBILITY. # HG changeset patch # Parent a4b91d01cafd53f7eb10bf132dea527d85a3e228 Support Solaris 8 and 9/x86 with Sun as diff --git a/libitm/config/generic/asmcfi.h b/libitm/config/generic/asmcfi.h --- a/libitm/config/generic/asmcfi.h +++ b/libitm/config/generic/asmcfi.h @@ -41,4 +41,4 @@ #define cfi_def_cfa(r,n) #define cfi_register(o,n) -#endif /* HAVE_ASM_CFI */ +#endif /* HAVE_AS_CFI_PSEUDO_OP */ diff --git a/libitm/config/x86/sjlj.S b/libitm/config/x86/sjlj.S --- a/libitm/config/x86/sjlj.S +++ b/libitm/config/x86/sjlj.S @@ -60,7 +60,18 @@ _ITM_beginTransaction: movl %edi, 20(%esp) movl %ebp, 24(%esp) leal 8(%esp), %edx +#if defined HAVE_ATTRIBUTE_VISIBILITY || !defined __PIC__ call GTM_begin_transaction +#else + subl $4, %esp + movl %ebx, 24(%esp) + call 1f +1: popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx + call GTM_begin_transaction@PLT + movl 24(%esp), %ebx + addl $4, %esp +#endif addl $28, %esp cfi_def_cfa_offset(4) ret @@ -108,7 +119,9 @@ GTM_longjmp: #ifdef __ELF__ .type GTM_longjmp, @function +#ifdef HAVE_ATTRIBUTE_VISIBILITY .hidden GTM_longjmp +#endif .size GTM_longjmp, .-GTM_longjmp #endif