[compiler-rt] r200547 - [sanitizer] Attempt to fix Android build.

Sergey Matveev earthdok at google.com
Fri Jan 31 06:28:33 PST 2014


Author: smatveev
Date: Fri Jan 31 08:28:32 2014
New Revision: 200547

URL: http://llvm.org/viewvc/llvm-project?rev=200547&view=rev
Log:
[sanitizer] Attempt to fix Android build.

Added:
    compiler-rt/trunk/lib/msan/lit_tests/Linux/ioctl_sound.cc
      - copied, changed from r200544, compiler-rt/trunk/lib/msan/lit_tests/ioctl_sound.cc
Removed:
    compiler-rt/trunk/lib/msan/lit_tests/ioctl_sound.cc
Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Copied: compiler-rt/trunk/lib/msan/lit_tests/Linux/ioctl_sound.cc (from r200544, compiler-rt/trunk/lib/msan/lit_tests/ioctl_sound.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/lit_tests/Linux/ioctl_sound.cc?p2=compiler-rt/trunk/lib/msan/lit_tests/Linux/ioctl_sound.cc&p1=compiler-rt/trunk/lib/msan/lit_tests/ioctl_sound.cc&r1=200544&r2=200547&rev=200547&view=diff
==============================================================================
    (empty)

Removed: compiler-rt/trunk/lib/msan/lit_tests/ioctl_sound.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/lit_tests/ioctl_sound.cc?rev=200546&view=auto
==============================================================================
--- compiler-rt/trunk/lib/msan/lit_tests/ioctl_sound.cc (original)
+++ compiler-rt/trunk/lib/msan/lit_tests/ioctl_sound.cc (removed)
@@ -1,26 +0,0 @@
-// RUN: %clangxx_msan -m64 -O0 -g %s -o %t && %t
-// RUN: %clangxx_msan -m64 -O3 -g %s -o %t && %t
-
-#include <assert.h>
-#include <fcntl.h>
-#include <sound/asound.h>
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-#include <sanitizer/msan_interface.h>
-
-int main(int argc, char **argv) {
-  int fd = open("/dev/snd/controlC0", O_RDONLY);
-  if (fd < 0) {
-    printf("Unable to open sound device.");
-    return 0;
-  }
-  snd_ctl_card_info info;
-  assert(__msan_test_shadow(&info, sizeof(info)) != -1);
-  assert(ioctl(fd, SNDRV_CTL_IOCTL_CARD_INFO, &info) >= 0);
-  assert(__msan_test_shadow(&info, sizeof(info)) == -1);
-  close(fd);
-  return 0;
-}

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc?rev=200547&r1=200546&r2=200547&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc Fri Jan 31 08:28:32 2014
@@ -356,7 +356,9 @@ static void ioctl_table_fill() {
   _(VT_SENDSIG, NONE, 0);
   _(VT_SETMODE, READ, struct_vt_mode_sz);
   _(VT_WAITACTIVE, NONE, 0);
+#endif
 
+#if SANITIZER_LINUX && !SANITIZER_ANDROID
   // <sound/asound.h>. READWRITE is used correctly in this group.
   _(SNDRV_HWDEP_IOCTL_PVERSION, WRITE, sizeof(int))
   _(SNDRV_HWDEP_IOCTL_INFO, WRITE, struct_snd_hwdep_info_sz)
@@ -479,9 +481,7 @@ static void ioctl_table_fill() {
   _(SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES, NONE, 0)
   _(SNDRV_EMUX_IOCTL_MEM_AVAIL, READ, sizeof(int))
   _(SNDRV_EMUX_IOCTL_MISC_MODE, READWRITE, struct_snd_emux_misc_mode_sz)
-#endif
 
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
   // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
   _(CYGETDEFTHRESH, WRITE, sizeof(int));
   _(CYGETDEFTIMEOUT, WRITE, sizeof(int));

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=200547&r1=200546&r2=200547&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 Fri Jan 31 08:28:32 2014
@@ -119,7 +119,7 @@
 #include <sys/sockio.h>
 #endif
 
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX && !SANITIZER_ANDROID
 #include <sound/asound.h>
 #include <sound/asound_fm.h>
 #include <sound/hdsp.h>
@@ -825,8 +825,7 @@ namespace __sanitizer {
   unsigned IOCTL_TIOCSERGETMULTI = TIOCSERGETMULTI;
   unsigned IOCTL_TIOCSERSETMULTI = TIOCSERSETMULTI;
   unsigned IOCTL_TIOCSSERIAL = TIOCSSERIAL;
-#endif
-#if SANITIZER_LINUX
+
   unsigned IOCTL_SNDRV_HWDEP_IOCTL_PVERSION = SNDRV_HWDEP_IOCTL_PVERSION;
   unsigned IOCTL_SNDRV_HWDEP_IOCTL_INFO = SNDRV_HWDEP_IOCTL_INFO;
   unsigned IOCTL_SNDRV_HWDEP_IOCTL_DSP_STATUS = SNDRV_HWDEP_IOCTL_DSP_STATUS;

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=200547&r1=200546&r2=200547&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 Fri Jan 31 08:28:32 2014
@@ -1055,8 +1055,7 @@ namespace __sanitizer {
   extern unsigned IOCTL_TIOCSERGETMULTI;
   extern unsigned IOCTL_TIOCSERSETMULTI;
   extern unsigned IOCTL_TIOCSSERIAL;
-#endif
-#if SANITIZER_LINUX
+
   extern unsigned IOCTL_SNDRV_HWDEP_IOCTL_PVERSION;
   extern unsigned IOCTL_SNDRV_HWDEP_IOCTL_INFO;
   extern unsigned IOCTL_SNDRV_HWDEP_IOCTL_DSP_STATUS;





More information about the llvm-commits mailing list