This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[libitm] Support Solaris 8 and 9/x86 with Sun as


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  <ro@CeBiTec.Uni-Bielefeld.DE>

	* 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
 
-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]