Commit f1560b7bbeb57042a32dfde487c3d21bd9ef6a51

Rainer Orth 2015-01-16T11:31:37

x86: Solaris fixes * Solaris/x86 /bin/as doesn't support .org, so I've just disabled the uses in src/x86/{sysv, unix64}.S, as on Darwin. * Solaris/x86 needs to use EH_FRAME_FLAGS so manually and compiler generated .eh_frame sections match, otherwise libffi.so fails to link: * Solaris/x86 /bin/as has different COMDAT syntax; I've disabled it for the moment.

diff --git a/src/x86/sysv.S b/src/x86/sysv.S
index ebbea5d..58432d9 100644
--- a/src/x86/sysv.S
+++ b/src/x86/sysv.S
@@ -65,7 +65,7 @@
    actual table.  The entry points into the table are all 8 bytes.
    The use of ORG asserts that we're at the correct location.  */
 /* ??? The clang assembler doesn't handle .org with symbolic expressions.  */
-#if defined(__clang__) || defined(__APPLE__)
+#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
 # define E(BASE, X)	.balign 8
 #else
 # define E(BASE, X)	.balign 8; .org BASE + X * 8
@@ -793,7 +793,7 @@ ENDF(C(ffi_closure_raw_THISCALL))
         .section __TEXT,__textcoal_nt,coalesced,pure_instructions;	\
         .weak_definition X;						\
         .private_extern X
-#elif defined __ELF__
+#elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__))
 # define COMDAT(X)							\
 	.section .text.X,"axG",@progbits,X,comdat;			\
 	.globl	X;							\
@@ -823,9 +823,9 @@ ENDF(C(__x86.get_pc_thunk.dx))
 .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
 EHFrame0:
 #elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE)
-.section .eh_frame,"a",@unwind
+.section .eh_frame,EH_FRAME_FLAGS,@unwind
 #else
-.section .eh_frame,"a",@progbits
+.section .eh_frame,EH_FRAME_FLAGS,@progbits
 #endif
 
 #ifdef HAVE_AS_X86_PCREL
diff --git a/src/x86/unix64.S b/src/x86/unix64.S
index f9f9163..c83010c 100644
--- a/src/x86/unix64.S
+++ b/src/x86/unix64.S
@@ -60,7 +60,7 @@
    actual table.  The entry points into the table are all 8 bytes.
    The use of ORG asserts that we're at the correct location.  */
 /* ??? The clang assembler doesn't handle .org with symbolic expressions.  */
-#if defined(__clang__) || defined(__APPLE__)
+#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
 # define E(BASE, X)	.balign 8
 #else
 # define E(BASE, X)	.balign 8; .org BASE + X * 8