[compiler-rt] r240468 - Working on reconciling out-of-tree patches to compiler-rt for building for iOS.

Chris Bieneman beanz at apple.com
Tue Jun 23 14:39:52 PDT 2015


Author: cbieneman
Date: Tue Jun 23 16:39:52 2015
New Revision: 240468

URL: http://llvm.org/viewvc/llvm-project?rev=240468&view=rev
Log:
Working on reconciling out-of-tree patches to compiler-rt for building for iOS.

Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.

This change ifdefs out headers and functionality that aren't available on iOS.

Note: this change does not enable building for iOS, as there are more changes to come.

Reviewers: glider, kubabrecka, bogner, samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

Differential Revision: http://reviews.llvm.org/D10514

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h?rev=240468&r1=240467&r2=240468&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h Tue Jun 23 16:39:52 2015
@@ -38,9 +38,15 @@
 # else
 #  define SANITIZER_IOS    0
 # endif
+# if TARGET_IPHONE_SIMULATOR
+#  define SANITIZER_IOSSIM 1
+# else
+#  define SANITIZER_IOSSIM 0
+# endif
 #else
 # define SANITIZER_MAC     0
 # define SANITIZER_IOS     0
+# define SANITIZER_IOSSIM  0
 #endif
 
 #if defined(_WIN32)

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc?rev=240468&r1=240467&r2=240468&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc Tue Jun 23 16:39:52 2015
@@ -34,8 +34,6 @@
 #include <grp.h>
 #include <limits.h>
 #include <net/if.h>
-#include <net/if_arp.h>
-#include <net/route.h>
 #include <netdb.h>
 #include <poll.h>
 #include <pthread.h>
@@ -54,6 +52,10 @@
 #include <time.h>
 #include <wchar.h>
 
+#if !SANITIZER_IOS
+#include <net/route.h>
+#endif
+
 #if !SANITIZER_ANDROID
 #include <sys/mount.h>
 #include <sys/timeb.h>
@@ -75,6 +77,7 @@
 #include <linux/sysctl.h>
 #include <linux/utsname.h>
 #include <linux/posix_types.h>
+#include <net/if_arp.h>
 #endif
 
 #if SANITIZER_FREEBSD
@@ -337,12 +340,12 @@ namespace __sanitizer {
   unsigned path_max = PATH_MAX;
 
   // ioctl arguments
-  unsigned struct_arpreq_sz = sizeof(struct arpreq);
   unsigned struct_ifreq_sz = sizeof(struct ifreq);
   unsigned struct_termios_sz = sizeof(struct termios);
   unsigned struct_winsize_sz = sizeof(struct winsize);
 
 #if SANITIZER_LINUX
+  unsigned struct_arpreq_sz = sizeof(struct arpreq);
   unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf);
   unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession);
   unsigned struct_cdrom_read_audio_sz = sizeof(struct cdrom_read_audio);

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h?rev=240468&r1=240467&r2=240468&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h Tue Jun 23 16:39:52 2015
@@ -828,12 +828,12 @@ struct __sanitizer_cookie_io_functions_t
 #define IOC_NR(nr) (((nr) >> IOC_NRSHIFT) & IOC_NRMASK)
 #define IOC_SIZE(nr) (((nr) >> IOC_SIZESHIFT) & IOC_SIZEMASK)
 
-  extern unsigned struct_arpreq_sz;
   extern unsigned struct_ifreq_sz;
   extern unsigned struct_termios_sz;
   extern unsigned struct_winsize_sz;
 
 #if SANITIZER_LINUX
+  extern unsigned struct_arpreq_sz;
   extern unsigned struct_cdrom_msf_sz;
   extern unsigned struct_cdrom_multisession_sz;
   extern unsigned struct_cdrom_read_audio_sz;





More information about the llvm-commits mailing list