Author: Jonas Devlieghere Date: 2021-04-26T09:31:35-07:00 New Revision: 7d850db6b6438221555b800d31ef5dc63f50dc89
URL: https://github.com/llvm/llvm-project/commit/7d850db6b6438221555b800d31ef5dc63f50dc89 DIFF: https://github.com/llvm/llvm-project/commit/7d850db6b6438221555b800d31ef5dc63f50dc89.diff LOG: [lldb] Don't use ::fork or ::vfork on watchOS or tvOS Update lldb-server to not use fork or vfork on watchOS and tvOS as these functions are explicitly marked unavailable there. llvm-project/lldb/test/API/tools/lldb-server/main.cpp:304:11: error: 'fork' is unavailable: not available on watchOS if (fork() == 0) ^ WatchSimulator6.2.sdk/usr/include/unistd.h:447:8: note: 'fork' has been explicitly marked unavailable here pid_t fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; ^ llvm-project/lldb/test/API/tools/lldb-server/main.cpp:307:11: error: 'vfork' is unavailable: not available on watchOS if (vfork() == 0) ^ WatchSimulator6.2.sdk/usr/include/unistd.h:602:8: note: 'vfork' has been explicitly marked unavailable here pid_t vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; ^ Added: Modified: lldb/test/API/tools/lldb-server/main.cpp Removed: ################################################################################ diff --git a/lldb/test/API/tools/lldb-server/main.cpp b/lldb/test/API/tools/lldb-server/main.cpp index a161a95708ee..f113304cfd62 100644 --- a/lldb/test/API/tools/lldb-server/main.cpp +++ b/lldb/test/API/tools/lldb-server/main.cpp @@ -19,6 +19,9 @@ #include <thread> #include <time.h> #include <vector> +#if defined(__APPLE__) +#include <TargetConditionals.h> +#endif static const char *const PRINT_PID_COMMAND = "print-pid"; @@ -299,7 +302,7 @@ int main(int argc, char **argv) { else if (arg == "swap_chars") func_p = swap_chars; func_p(); -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(TARGET_OS_WATCH) && !defined(TARGET_OS_TV) } else if (arg == "fork") { if (fork() == 0) _exit(0); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits