From patchwork Mon May 12 15:19:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: max X-Patchwork-Id: 348060 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1F0D5140076 for ; Tue, 13 May 2014 01:19:20 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=J4WtXxCgQi8QOripc aMBrwm8uUucr8nwD7EWCf1h2HamWQe3ONNLM1Wd6TTHOC8TjIYVkBHvjbeC1EAcb pIxyKjDushpx8H9rcTkqNfxyYnK2NRRVXA5/5dfX7LvYvisRb+Epv+HjJvdPIBLS pUACAtLqgvKb9qc5Xp176YFaog= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=yYEi30V/fAOkfLYT55upNmP Ku80=; b=QgDWMoVMbRdjDQewQte2HG9hAgDIZh73vQw+WPHQa66Rl2n+IA12oH1 9emUkPSAzWmnRrKkwleRw7AO0ATegv3uogs+GLm3teO0+NFxEWpD5TYbVseYetb0 VimZwFU5lqlYkX5Q1cOix18EoCaMLGC6U5RaFNm4qfmQjMYILMFg= Received: (qmail 9594 invoked by alias); 12 May 2014 15:19:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 9551 invoked by uid 89); 12 May 2014 15:19:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mailout2.w1.samsung.com Received: from mailout2.w1.samsung.com (HELO mailout2.w1.samsung.com) (210.118.77.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (DES-CBC3-SHA encrypted) ESMTPS; Mon, 12 May 2014 15:19:09 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5G00EM8VVH7B80@mailout2.w1.samsung.com> for gcc-patches@gcc.gnu.org; Mon, 12 May 2014 16:18:53 +0100 (BST) Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id A2.D4.28663.866E0735; Mon, 12 May 2014 16:19:04 +0100 (BST) Received: from [106.109.8.94] by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N5G007LUVVPCH40@eusync3.samsung.com>; Mon, 12 May 2014 16:19:04 +0100 (BST) Message-id: <5370E664.3040101@partner.samsung.com> Date: Mon, 12 May 2014 19:19:00 +0400 From: Maxim Ostapenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-version: 1.0 To: Konstantin Serebryany , GCC Patches , Jakub Jelinek , Dodji Seketeli , Dmitry Vyukov , Marek Polacek , "H.J. Lu" , Yuri Gribov Cc: Slava Garbuzov Subject: Re: libsanitizer merge from upstream r208536 References: In-reply-to: Content-type: multipart/mixed; boundary=------------020600000904040500020705 X-IsSubscribed: yes Hi, I see a couple of errors when building for arm-linux-gnueabi (host is x86_64 Ubuntu 12.04 LTS, host compiler is gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)): 1) In file included from /home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:164:0: /home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:253:72: error: size of array 'assertion_failed__1128' is negative typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1] ^ /home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:247:30: note: in expansion of macro 'IMPL_COMPILER_ASSERT' #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__) ^ /home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1249:3: note: in expansion of macro 'COMPILER_CHECK' COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE)) ^ /home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:1128:1: note: in expansion of macro 'CHECK_TYPE_SIZE' CHECK_TYPE_SIZE(XDR::xdr_ops); ^ make[4]: *** [sanitizer_platform_limits_posix.lo] Error 1 2) /home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h:54:77: error: cast from type 'const volatile Type* {aka const volatile unsigned char*}' to type 'volatile Type* {aka volatile unsigned char*}' casts away qualifiers [-Werror=cast-qual] v = __sync_fetch_and_add((typename T::Type volatile*)&a->val_dont_use, 0); Attached patch seems to help. -Maxim diff --git a/libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h b/libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h index 75aa2c8..f2f05a8 100644 --- a/libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h +++ b/libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h @@ -51,7 +51,7 @@ INLINE typename T::Type atomic_load( // 64-bit load on 32-bit platform. // Gross, but simple and reliable. // Assume that it is not in read-only memory. - v = __sync_fetch_and_add((typename T::Type volatile*)&a->val_dont_use, 0); + v = __sync_fetch_and_add(const_cast(&a->val_dont_use), 0); } return v; } diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h index 97fda51..3ee8e33 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h @@ -273,10 +273,17 @@ namespace __sanitizer { #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID + +#if defined(__arm__) + const unsigned struct_xdr_ops_num_funs = 9; +#else + const unsigned struct_xdr_ops_num_funs = 10; +#endif + struct __sanitizer_XDR { int x_op; struct xdr_ops { - uptr fns[10]; + uptr fns[struct_xdr_ops_num_funs]; } *x_ops; uptr x_public; uptr x_private;