Index: src/platform-linux.cc |
diff --git a/src/platform-linux.cc b/src/platform-linux.cc |
index dbfe13d2ad61838ba442432ae039c3f3d6842b6c..5c252bbf884b9c176644fdbfd47214f96ed516db 100644 |
--- a/src/platform-linux.cc |
+++ b/src/platform-linux.cc |
@@ -28,8 +28,6 @@ |
// Platform specific code for Linux goes here. For the POSIX comaptible parts |
// the implementation is in platform-posix.cc. |
-#include "platform.h" |
- |
#include <pthread.h> |
#include <semaphore.h> |
#include <signal.h> |
@@ -59,8 +57,8 @@ |
// GLibc on ARM defines mcontext_t has a typedef for 'struct sigcontext'. |
// Old versions of the C library <signal.h> didn't define the type. |
-#if V8_OS_ANDROID && !defined(__BIONIC_HAVE_UCONTEXT_T) && \ |
- V8_HOST_ARCH_ARM && !defined(__BIONIC_HAVE_STRUCT_SIGCONTEXT) |
+#if defined(__ANDROID__) && !defined(__BIONIC_HAVE_UCONTEXT_T) && \ |
+ defined(__arm__) && !defined(__BIONIC_HAVE_STRUCT_SIGCONTEXT) |
#include <asm/sigcontext.h> |
#endif |
@@ -69,6 +67,7 @@ |
#include "v8.h" |
#include "platform-posix.h" |
+#include "platform.h" |
#include "v8threads.h" |
#include "vm-state-inl.h" |
@@ -80,7 +79,7 @@ namespace internal { |
static Mutex* limit_mutex = NULL; |
-#if V8_HOST_ARCH_ARM |
+#ifdef __arm__ |
static bool CPUInfoContainsString(const char * search_string) { |
const char* file_name = "/proc/cpuinfo"; |
// This is written as a straight shot one pass parser |
@@ -223,23 +222,39 @@ bool OS::ArmUsingHardFloat() { |
// GCC versions 4.4 and below don't support hard-fp. |
// GCC versions 4.5 may support hard-fp without defining __ARM_PCS or |
// __ARM_PCS_VFP. |
+ |
+#define GCC_VERSION (__GNUC__ * 10000 \ |
+ + __GNUC_MINOR__ * 100 \ |
+ + __GNUC_PATCHLEVEL__) |
+#if GCC_VERSION >= 40600 |
#if defined(__ARM_PCS_VFP) |
return true; |
-#elif V8_CC_GNU && (V8_GNUC_PREREQ(4, 6) || !V8_GNUC_PREREQ(4, 5)) |
+#else |
+ return false; |
+#endif |
+ |
+#elif GCC_VERSION < 40500 |
return false; |
+ |
+#else |
+#if defined(__ARM_PCS_VFP) |
+ return true; |
#elif defined(__ARM_PCS) || defined(__SOFTFP) || !defined(__VFP_FP__) |
return false; |
#else |
#error "Your version of GCC does not report the FP ABI compiled for." \ |
"Please report it on this issue" \ |
"http://code.google.com/p/v8/issues/detail?id=2140" |
+ |
+#endif |
#endif |
+#undef GCC_VERSION |
} |
-#endif // V8_HOST_ARCH_ARM |
+#endif // def __arm__ |
-#if V8_HOST_ARCH_MIPS |
+#ifdef __mips__ |
bool OS::MipsCpuHasFeature(CpuFeature feature) { |
const char* search_string = NULL; |
const char* file_name = "/proc/cpuinfo"; |
@@ -290,7 +305,7 @@ bool OS::MipsCpuHasFeature(CpuFeature feature) { |
// Did not find string in the proc file. |
return false; |
} |
-#endif // V8_HOST_ARCH_MIPS |
+#endif // def __mips__ |
const char* OS::LocalTimezone(double time) { |