Reviewers: danno, Paul Lind, kisg,

Description:
Fix glibc presence checks that are incorrectly triggered in some cases.

This allows compilation of V8 using uClibc.

BUG=
TEST=


Please review this at http://codereview.chromium.org/9702067/

Affected files:
  M src/platform-linux.cc


Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index 8be9609d4522b5a0a2575671f6c0f7d174293971..8098a5de22c2b47758d212f4d3860e31013bff95 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -46,9 +46,9 @@
 #include <sys/stat.h>   // open
 #include <fcntl.h>      // open
 #include <unistd.h>     // sysconf
-#ifdef __GLIBC__
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
 #include <execinfo.h>   // backtrace, backtrace_symbols
-#endif  // def __GLIBC__
+#endif  // defined(__GLIBC__) && !defined(__UCLIBC__)
 #include <strings.h>    // index
 #include <errno.h>
 #include <stdarg.h>
@@ -553,7 +553,7 @@ void OS::SignalCodeMovingGC() {

 int OS::StackWalk(Vector<OS::StackFrame> frames) {
   // backtrace is a glibc extension.
-#ifdef __GLIBC__
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
   int frames_size = frames.length();
   ScopedVector<void*> addresses(frames_size);

@@ -578,9 +578,9 @@ int OS::StackWalk(Vector<OS::StackFrame> frames) {
   free(symbols);

   return frames_count;
-#else  // ndef __GLIBC__
+#else  // defined(__GLIBC__) && !defined(__UCLIBC__)
   return 0;
-#endif  // ndef __GLIBC__
+#endif  // defined(__GLIBC__) && !defined(__UCLIBC__)
 }




--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to