- Fix build break on Mac OS X by using the proper formatting for pointers
authoriposva@chromium.org <iposva@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 13 May 2009 16:37:39 +0000 (16:37 +0000)
committeriposva@chromium.org <iposva@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 13 May 2009 16:37:39 +0000 (16:37 +0000)
  by working around slightly "wrong" definition of uintptr_t on Mac OS X.
  Verified that this works on both ia32 and x64 on Linux and Mac OS X.

Review URL: http://codereview.chromium.org/115252

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1938 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

SConstruct
src/globals.h
src/platform-macos.cc

index 0c506790e803a9b2ccd2dc1739fa4778a36ac7cd..83b36c8340ef68fea4486ca2c66b5bf71fed5922 100644 (file)
@@ -671,8 +671,6 @@ def VerifyOptions(env):
     Abort("Shared Object soname not applicable for Windows.")
   if env['soname'] == 'on' and env['library'] == 'static':
     Abort("Shared Object soname not applicable for static library.")
-  if env['arch'] == 'x64' and env['os'] != 'linux':
-    Abort("X64 compilation only allowed on Linux OS.")
   for (name, option) in SIMPLE_OPTIONS.iteritems():
     if (not option.get('default')) and (name not in ARGUMENTS):
       message = ("A value for option %s must be specified (%s)." %
index 87c805ec109125dff56710a40341c37eb3247903..030d995354bce477d2e79908e782433b101f0aea 100644 (file)
@@ -77,18 +77,26 @@ typedef byte* Address;
 #define V8_UINT64_C(x)  (x ## UI64)
 #define V8_INT64_C(x)   (x ## I64)
 #define V8_PTR_PREFIX "ll"
-#else
+#else  // _MSC_VER
 #define V8_UINT64_C(x)  (x ## UL)
 #define V8_INT64_C(x)   (x ## L)
 #define V8_PTR_PREFIX "l"
-#endif
+#endif  // _MSC_VER
 #else  // V8_HOST_ARCH_64_BIT
 #define V8_PTR_PREFIX ""
-#endif
+#endif  // V8_HOST_ARCH_64_BIT
 
 #define V8PRIxPTR V8_PTR_PREFIX "x"
 #define V8PRIdPTR V8_PTR_PREFIX "d"
 
+// Fix for Mac OS X defining uintptr_t as "unsigned long":
+#if defined(__APPLE__) && defined(__MACH__)
+#undef V8PRIxPTR
+#undef V8PRIdPTR
+#define V8PRIxPTR "lx"
+#define V8PRIdPTR "ld"
+#endif
+
 // Code-point values in Unicode 4.0 are 21 bits wide.
 typedef uint16_t uc16;
 typedef int32_t uc32;
index 79515434e61656f2f3667b46beb74c1536ad2940..9dddfd391c9b566eed3414b53e6d006e0a3fda9e 100644 (file)
@@ -481,6 +481,13 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
     // Extracting the sample from the context is extremely machine dependent.
     ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
     mcontext_t& mcontext = ucontext->uc_mcontext;
+#if V8_HOST_ARCH_X64
+    UNIMPLEMENTED();
+    USE(mcontext);
+    sample.pc = 0;
+    sample.sp = 0;
+    sample.fp = 0;
+#elif V8_HOST_ARCH_IA32
 #if __DARWIN_UNIX03
     sample.pc = mcontext->__ss.__eip;
     sample.sp = mcontext->__ss.__esp;
@@ -490,6 +497,9 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
     sample.sp = mcontext->ss.esp;
     sample.fp = mcontext->ss.ebp;
 #endif  // __DARWIN_UNIX03
+#else
+#error Unsupported Mac OS X host architecture.
+#endif  // V8_TARGET_ARCH_IA32
   }
 
   // We always sample the VM state.