[PATCH] D21119: [profile] Fix a profile runtime build bug for darwin

David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 22:23:24 PDT 2016


davidxl created this revision.
davidxl added a reviewer: vsk.
davidxl added a subscriber: llvm-commits.

EXTRA_FLAGS was never passed to rt build for darwin. This means HAS_ATOMICS and HAS_FCTNL macros were not properly set for darwin runtime build -- end up with build using stub functions.

Also getpid() requires including <unistd.h> on darwin too.

http://reviews.llvm.org/D21119

Files:
  lib/profile/CMakeLists.txt
  lib/profile/InstrProfilingUtil.c

Index: lib/profile/CMakeLists.txt
===================================================================
--- lib/profile/CMakeLists.txt
+++ lib/profile/CMakeLists.txt
@@ -82,6 +82,7 @@
     STATIC
     OS ${PROFILE_SUPPORTED_OS}
     ARCHS ${PROFILE_SUPPORTED_ARCH}
+    CFLAGS ${EXTRA_FLAGS}
     SOURCES ${PROFILE_SOURCES}
     PARENT_TARGET profile)
 else()
Index: lib/profile/InstrProfilingUtil.c
===================================================================
--- lib/profile/InstrProfilingUtil.c
+++ lib/profile/InstrProfilingUtil.c
@@ -16,9 +16,7 @@
 #else
 #include <sys/stat.h>
 #include <sys/types.h>
-#if defined(__linux__)
 #include <unistd.h>
-#endif
 #include <fcntl.h>
 #include <errno.h>
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21119.59998.patch
Type: text/x-patch
Size: 713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160608/33478f19/attachment.bin>


More information about the llvm-commits mailing list