Check __x86_64__ instead of __WORDSIZE
authorH.J. Lu <hongjiu.lu@intel.com>
Wed, 14 Nov 2012 13:45:56 +0000 (13:45 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Wed, 14 Nov 2012 13:45:56 +0000 (05:45 -0800)
PR other/55292
Backport from upstream revision 167883
* sanitizer_common/sanitizer_linux.cc (internal_mmap): Check
__x86_64__ instead of __WORDSIZE.
(internal_filesize): Likwise.

From-SVN: r193500

libsanitizer/ChangeLog
libsanitizer/sanitizer_common/sanitizer_linux.cc

index c67c7f11db2bbb525fa107e60d955056a117bb2e..725e85c5c441c7680afe36b4a1dc183f51069d4f 100644 (file)
@@ -1,3 +1,11 @@
+2012-11-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR other/55292
+       Backport from upstream revision 167883
+       * sanitizer_common/sanitizer_linux.cc (internal_mmap): Check
+       __x86_64__ instead of __WORDSIZE.
+       (internal_filesize): Likwise.
+
 2012-11-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        * configure.ac (AC_CONFIG_AUX_DIR): Removed.
index ab6c5a4b82c4fa1f785306e5d03516a9895e8188..e90a68ca1c40fc4807f7e173996eaaa667252efe 100644 (file)
@@ -34,7 +34,7 @@ namespace __sanitizer {
 // --------------- sanitizer_libc.h
 void *internal_mmap(void *addr, uptr length, int prot, int flags,
                     int fd, u64 offset) {
-#if __WORDSIZE == 64
+#if defined __x86_64__
   return (void *)syscall(__NR_mmap, addr, length, prot, flags, fd, offset);
 #else
   return (void *)syscall(__NR_mmap2, addr, length, prot, flags, fd, offset);
@@ -67,7 +67,7 @@ uptr internal_write(fd_t fd, const void *buf, uptr count) {
 }
 
 uptr internal_filesize(fd_t fd) {
-#if __WORDSIZE == 64
+#if defined __x86_64__
   struct stat st;
   if (syscall(__NR_fstat, fd, &st))
     return -1;