Commit 35ddb69c2b49746d940e919ca226ecc1be94f14a

Anthony Green 2013-01-08T07:53:37

Only emit DWARF unwind info when building with GCC

diff --git a/ChangeLog b/ChangeLog
index b9145d1..464dbe8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2013-01-08  Anthony Green  <green@moxielogic.com>
 
+	* src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info
+	when building with the GNU toolchain.
 	* testsuite/libffi.call/ffitest.h (CHECK): Fix for Solaris vendor
 	compiler.
 
diff --git a/src/x86/sysv.S b/src/x86/sysv.S
index f108dd8..69e7e8d 100644
--- a/src/x86/sysv.S
+++ b/src/x86/sysv.S
@@ -1,5 +1,6 @@
 /* -----------------------------------------------------------------------
-   sysv.S - Copyright (c) 1996, 1998, 2001-2003, 2005, 2008, 2010  Red Hat, Inc.
+   sysv.S - Copyright (c) 2013  The Written Word
+	  - Copyright (c) 1996,1998,2001-2003,2005,2008,2010  Red Hat, Inc.
    
    X86 Foreign Function Interface 
 
@@ -328,6 +329,9 @@ ffi_closure_raw_SYSV:
 	.size	ffi_closure_raw_SYSV, .-ffi_closure_raw_SYSV
 #endif
 
+#if defined __GNUC__
+/* Only emit dwarf unwind info when building with GNU toolchain.  */
+
 #if defined __PIC__
 # if defined __sun__ && defined __svr4__
 /* 32-bit Solaris 2/x86 uses datarel encoding for PIC.  GNU ld before 2.22
@@ -460,6 +464,7 @@ ffi_closure_raw_SYSV:
 .LEFDE3:
 
 #endif
+#endif
 
 #endif /* ifndef __x86_64__ */
 
diff --git a/src/x86/unix64.S b/src/x86/unix64.S
index 7a6619a..37094f1 100644
--- a/src/x86/unix64.S
+++ b/src/x86/unix64.S
@@ -1,6 +1,7 @@
 /* -----------------------------------------------------------------------
-   unix64.S - Copyright (c) 2002  Bo Thorsen <bo@suse.de>
-	      Copyright (c) 2008  Red Hat, Inc
+   unix64.S - Copyright (c) 2013  The Written Word
+	    - Copyright (c) 2008  Red Hat, Inc
+	    - Copyright (c) 2002  Bo Thorsen <bo@suse.de>
 
    x86-64 Foreign Function Interface 
 
@@ -324,6 +325,9 @@ ffi_closure_unix64:
 .LUW9:
 	.size	ffi_closure_unix64,.-ffi_closure_unix64
 
+#ifdef __GNUC__
+/* Only emit DWARF unwind info when building with the GNU toolchain.  */
+
 #ifdef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
 	.section	.eh_frame,"a",@unwind
 #else
@@ -419,6 +423,8 @@ ffi_closure_unix64:
 	.align 8
 .LEFDE3:
 
+#endif /* __GNUC__ */
+	
 #endif /* __x86_64__ */
 
 #if defined __ELF__ && defined __linux__