Revision: 11242
Author:   [email protected]
Date:     Thu Apr  5 08:22:51 2012
Log: Fix glibc presence checks that are incorrectly triggered in some cases.

This allows compilation of V8 using uClibc.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9702067
Patch from Daniel Kalmar <[email protected]>.
http://code.google.com/p/v8/source/detail?r=11242

Modified:
 /branches/bleeding_edge/src/platform-linux.cc

=======================================
--- /branches/bleeding_edge/src/platform-linux.cc       Thu Apr  5 07:10:39 2012
+++ /branches/bleeding_edge/src/platform-linux.cc       Thu Apr  5 08:22:51 2012
@@ -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>
@@ -535,7 +535,7 @@

 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);

@@ -560,9 +560,9 @@
   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