[resending in plain text]

On Fri, Apr 5, 2013 at 10:24 AM, Konstantin Serebryany
<konstantin.s.serebry...@gmail.com> wrote:
> Hi Bernhard,
>
> The libsanitizer code is the exact copy of some revision of the upstream
> code in LLVM repo.
> libsanitizer/README.gcc:
>   Trivial and urgent fixes (portability, build fixes, etc.) may go directly
> to the
>   GCC tree.  All non-trivial changes, functionality improvements, etc.
> should go
>   through the upstream tree first and then be merged back to the GCC tree.
>
> These patches look trivial, but they will not apply to upstream trunk
> because we've changed how we use the guards.
> So, I'd ask you to apply the changes to upstream too (or, better, do it
> first), otherwise they will get lost during the next merge.
>
> I don't mind if you apply the patches to 4.8 branch, but I don't think I may
> approve it.
>
>
>
>
> On Thu, Apr 4, 2013 at 11:53 PM, Bernhard Reutner-Fischer
> <rep.dot....@gmail.com> wrote:
>>
>> 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  <al...@gcc.gnu.org>
>>
>>         * sanitizer_common/sanitizer_allocator.cc (libc_malloc,
>>         libc_free): Guard with !uClibc.
>>         * interception/interception_type_test.cc <OFF64_T>: add LFS guard.
>>         * sanitizer_common/sanitizer_platform_limits_posix.cc
>>         <struct_stat64_sz, struct_rlimit64_sz, struct_statfs64_sz>:
>> Likewise.
>>
>> Signed-off-by: Bernhard Reutner-Fischer <rep.dot....@gmail.com>
>> ---
>>  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 <features.h>
>>  #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
>>
>

Reply via email to