summaryrefslogtreecommitdiff
path: root/patches/gcc/linaro-4.9-2017.01/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-02-28 19:08:24 (GMT)
committerGitHub <noreply@github.com>2017-02-28 19:08:24 (GMT)
commitc8b355ea925cfea1f6ff00e2edef4f0afa0f76a7 (patch)
treeee8b04c33cf0797e985d0f5476d310e9abb8ba78 /patches/gcc/linaro-4.9-2017.01/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch
parented7e671013eae3ffa7e683de9470b5cf80d3cb4f (diff)
parent99283866cc84102f22324a751a2ba3afb9221cb6 (diff)
Merge pull request #622 from stilor/missing-linaro-patches
Add patches to Linaro GCC
Diffstat (limited to 'patches/gcc/linaro-4.9-2017.01/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch')
-rw-r--r--patches/gcc/linaro-4.9-2017.01/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/patches/gcc/linaro-4.9-2017.01/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch b/patches/gcc/linaro-4.9-2017.01/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch
new file mode 100644
index 0000000..55f3228
--- /dev/null
+++ b/patches/gcc/linaro-4.9-2017.01/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch
@@ -0,0 +1,37 @@
+From 3c536954a67a883630f4a7513a27f02a892c3dcb Mon Sep 17 00:00:00 2001
+From: Evgeniy Stepanov <eugeni.stepanov@gmail.com>
+Date: Tue, 21 Oct 2014 21:08:13 +0000
+Subject: [PATCH] [sanitizer] Fix build with _FILE_OFFSET_BITS=64.
+
+Sanitizer source is not affected by _FILE_OFFSET_BITS in general,
+but this one file must be built with 32-bit off_t. More details in the code.
+
+git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220328 91177308-0d34-0410-b5e6-96231b3b80d8
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ lib/sanitizer_common/sanitizer_platform_limits_posix.cc | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+index bbc1108..fc09522 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -13,7 +13,15 @@
+
+ #include "sanitizer_platform.h"
+ #if SANITIZER_LINUX || SANITIZER_MAC
++// Tests in this file assume that off_t-dependent data structures match the
++// libc ABI. For example, struct dirent here is what readdir() function (as
++// exported from libc) returns, and not the user-facing "dirent", which
++// depends on _FILE_OFFSET_BITS setting.
++// To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below.
++#ifdef _FILE_OFFSET_BITS
++#undef _FILE_OFFSET_BITS
++#endif
+
+ #include "sanitizer_internal_defs.h"
+ #include "sanitizer_platform_limits_posix.h"
+
+--
+2.1.4
+