Only emit DWARF unwind info when building with GCC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
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__