kumquat-buildroot/package/gcc/4.9.4/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch
Thomas Petazzoni 50c02bd72b gcc: bump 4.9 series to 4.9.4
Two patches are removed, as they have been upstreamed:

 - 130-fix_build_with_gcc-6.patch (svn commit 233721, Git commit
   8c3fa311caa86f61b4e28d1563d1110b44340fb2)

 - 920-libgcc-remove-unistd-header.patch (svn commit 226092, Git commit
   e940d7953f06af11d09229a29ecbcc1ba25b378d)

All other patches have simply been refreshed, with no manual edit
needed.

A build+runtime test has been done with an ARM, Cortex-A8, EABIhf, musl
configuration, booted under Qemu.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-08-04 22:45:48 +02:00

38 lines
1.5 KiB
Diff

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