This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Copy libsanitizer from llvm at revision 167890
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Wei Mi <wmi at google dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 14 Nov 2012 05:36:08 -0800
- Subject: Re: [PATCH] Copy libsanitizer from llvm at revision 167890
- References: <20121114122609.GA9465@gmail.com> <20121114132548.GE1886@tucnak.redhat.com>
On Wed, Nov 14, 2012 at 5:25 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Nov 14, 2012 at 04:26:09AM -0800, H.J. Lu wrote:
>> 2012-11-14 H.J. Lu <hongjiu.lu@intel.com>
>>
>> * Copied from llvm at revision 167890.
>>
>> diff --git a/libsanitizer/asan/asan_allocator.cc b/libsanitizer/asan/asan_allocator.cc
>> index 3a92802..de37137 100644
>> --- a/libsanitizer/asan/asan_allocator.cc
>> +++ b/libsanitizer/asan/asan_allocator.cc
>> @@ -1,5 +1,7 @@
>> //===-- asan_allocator.cc -------------------------------------------------===//
>> //
>> +// The LLVM Compiler Infrastructure
>> +//
>
> I believe all these lines were striped off intentationally, Wei should know
> better. So we shouldn't reintroduce them.
>
I withdrew my patch. I am applying this. Instead,
--
H.J.
---
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.
--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
@@ -34,7 +36,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 +69,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;