acimpoeru / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

Clang build error #149

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compile glog with clang

What is the expected output? What do you see instead?
/usr/lib64/gcc/x86_64-suse-linux/4.5/include/unwind.h:43:46: error: unknown
machine mode '__unwind_word__'
typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__)));

What version of the product are you using? On what operating system?
glog 0.32, linux, clang 3.0

Please provide any additional information below.

To fix:

--- glog-0.3.2/src/stacktrace_x86_64-inl.h  (version 94413)
+++ glog-0.3.2/src/stacktrace_x86_64-inl.h  (working copy)
@@ -31,6 +31,10 @@
 //
 // Produce stack trace using libgcc

+#ifdef __clang__
+#define __unwind_word__ __word__
+#endif
+
 extern "C" {
 #include <stdlib.h> // for NULL
 #include <unwind.h> // ABI defined unwinder

Original issue reported on code.google.com by chen3feng on 20 Feb 2013 at 4:22

GoogleCodeExporter commented 8 years ago
It's like this issue was fixed by clang?

http://llvm.org/bugs/show_bug.cgi?id=8703

Original comment by shinichi...@gmail.com on 20 Feb 2013 at 4:52

GoogleCodeExporter commented 8 years ago
I just tested with up to clang 3.2, this issue is not fixed.
Maybe it will be fixed in future release.

So, I think this change should be better.

// For clang 3.2 and earlier
#ifdef __clang__
#if __clang_major__ < 3 || __clang_major__ == 3 && __clang_minor__ <= 2
#define __unwind_word__ __word__
#endif  // __clang__ version
#endif  // __clang__

Original comment by chen3feng on 20 Feb 2013 at 12:06