Revision
975
Author
kvv@apple.com
Date
2011-11-10 13:15:16 -0800 (Thu, 10 Nov 2011)

Log Message

- darwintrace: build failure on 10.6, undefined symbol __posix_spawn

Modified Paths

Diff

Modified: branches/PR-10412052/CHANGES (974 => 975)


--- branches/PR-10412052/CHANGES	2011-11-10 21:14:58 UTC (rev 974)
+++ branches/PR-10412052/CHANGES	2011-11-10 21:15:16 UTC (rev 975)
@@ -1,5 +1,8 @@
 Darwin Build Scripts Change History
 -----------------------------------
+Release 26.x [9-Nov-2011]
+	- darwintrace: build failure on 10.6, undefined symbol __posix_spawn
+
 Release 26.1 [7-Nov-2011]
 	- darwintrace: compiler warning build fix
 

Modified: branches/PR-10412052/darwintrace/darwintrace.c (974 => 975)


--- branches/PR-10412052/darwintrace/darwintrace.c	2011-11-10 21:14:58 UTC (rev 974)
+++ branches/PR-10412052/darwintrace/darwintrace.c	2011-11-10 21:15:16 UTC (rev 975)
@@ -573,7 +573,11 @@
 }
 DARWINTRACE_INTERPOSE(darwintrace_execve, execve)
 
-extern int __posix_spawn(pid_t * __restrict, const char * __restrict,
+#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \
+    __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_7
+/* weak import __posix_spawn which only exists on 10.7 or later */
+extern __attribute__((weak_import))
+int __posix_spawn(pid_t * __restrict, const char * __restrict,
                          void *,
                          char *const argv[ __restrict], char *const envp[ __restrict]);
 
@@ -592,6 +596,7 @@
   return result;
 }
 DARWINTRACE_INTERPOSE(darwintrace_posix_spawn, __posix_spawn)
+#endif
 
 /* 
    if darwintrace has been initialized, trap