From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10692 invoked by alias); 4 Apr 2013 19:54:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10665 invoked by uid 89); 4 Apr 2013 19:54:17 -0000 X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-bk0-f54.google.com (HELO mail-bk0-f54.google.com) (209.85.214.54) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 04 Apr 2013 19:54:14 +0000 Received: by mail-bk0-f54.google.com with SMTP id q16so1753109bkw.13 for ; Thu, 04 Apr 2013 12:54:12 -0700 (PDT) X-Received: by 10.205.108.72 with SMTP id eb8mr5540399bkc.111.1365105252553; Thu, 04 Apr 2013 12:54:12 -0700 (PDT) Received: from s42.loc (91-119-221-41.dynamic.xdsl-line.inode.at. [91.119.221.41]) by mx.google.com with ESMTPS id s10sm7063627bkt.10.2013.04.04.12.54.10 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 04 Apr 2013 12:54:11 -0700 (PDT) Received: from cow by s42.loc with local (Exim 4.80) (envelope-from ) id 1UNqEb-0004Jt-WC; Thu, 04 Apr 2013 21:54:10 +0200 From: Bernhard Reutner-Fischer To: gcc-patches@gcc.gnu.org Cc: Bernhard Reutner-Fischer , jakub@redhat.com, dodji@redhat.com, kcc@google.com, dvyukov@google.com Subject: [PATCH 3/3] libsanitizer: add LFS guards Date: Fri, 05 Apr 2013 00:25:00 -0000 Message-Id: <1365105210-16552-4-git-send-email-rep.dot.nop@gmail.com> In-Reply-To: <1365105210-16552-1-git-send-email-rep.dot.nop@gmail.com> References: <1365105210-16552-1-git-send-email-rep.dot.nop@gmail.com> X-IsSubscribed: yes X-SW-Source: 2013-04/txt/msg00278.txt.bz2 uClibc can be built without Largefile support, add the corresponding guards. uClibc does not have __libc_malloc()/__libc_free(), add guard. libsanitizer/ChangeLog 2013-03-24 Bernhard Reutner-Fischer * sanitizer_common/sanitizer_allocator.cc (libc_malloc, libc_free): Guard with !uClibc. * interception/interception_type_test.cc : add LFS guard. * sanitizer_common/sanitizer_platform_limits_posix.cc : Likewise. Signed-off-by: Bernhard Reutner-Fischer --- libsanitizer/interception/interception_type_test.cc | 2 +- libsanitizer/sanitizer_common/sanitizer_allocator.cc | 4 +++- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libsanitizer/interception/interception_type_test.cc b/libsanitizer/interception/interception_type_test.cc index f664eee..91fab63 100644 --- a/libsanitizer/interception/interception_type_test.cc +++ b/libsanitizer/interception/interception_type_test.cc @@ -22,7 +22,7 @@ COMPILER_CHECK(sizeof(SSIZE_T) == sizeof(ssize_t)); COMPILER_CHECK(sizeof(PTRDIFF_T) == sizeof(ptrdiff_t)); COMPILER_CHECK(sizeof(INTMAX_T) == sizeof(intmax_t)); -#ifndef __APPLE__ +#if !defined __APPLE__ && (defined __USE_LARGEFILE64 && defined __off64_t_defined) COMPILER_CHECK(sizeof(OFF64_T) == sizeof(off64_t)); #endif diff --git a/libsanitizer/sanitizer_common/sanitizer_allocator.cc b/libsanitizer/sanitizer_common/sanitizer_allocator.cc index a54de9d..e17cf22 100644 --- a/libsanitizer/sanitizer_common/sanitizer_allocator.cc +++ b/libsanitizer/sanitizer_common/sanitizer_allocator.cc @@ -9,11 +9,13 @@ // run-time libraries. // This allocator that is used inside run-times. //===----------------------------------------------------------------------===// + +#include #include "sanitizer_common.h" // FIXME: We should probably use more low-level allocator that would // mmap some pages and split them into chunks to fulfill requests. -#if defined(__linux__) && !defined(__ANDROID__) +#if defined(__linux__) && !defined(__ANDROID__) && !defined __UCLIBC__ extern "C" void *__libc_malloc(__sanitizer::uptr size); extern "C" void __libc_free(void *ptr); # define LIBC_MALLOC __libc_malloc diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc index c4be1aa..c5e8f19 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -32,7 +32,9 @@ namespace __sanitizer { unsigned struct_utsname_sz = sizeof(struct utsname); unsigned struct_stat_sz = sizeof(struct stat); +#ifdef __USE_LARGEFILE64 unsigned struct_stat64_sz = sizeof(struct stat64); +#endif unsigned struct_rusage_sz = sizeof(struct rusage); unsigned struct_tm_sz = sizeof(struct tm); @@ -43,7 +45,7 @@ namespace __sanitizer { unsigned struct_epoll_event_sz = sizeof(struct epoll_event); #endif // __linux__ -#if defined(__linux__) && !defined(__ANDROID__) +#if defined(__linux__) && !defined(__ANDROID__) && defined __USE_LARGEFILE64 unsigned struct_rlimit64_sz = sizeof(struct rlimit64); unsigned struct_statfs64_sz = sizeof(struct statfs64); #endif // __linux__ && !__ANDROID__ -- 1.7.10.4