From patchwork Wed Nov 30 12:10:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Ostapenko X-Patchwork-Id: 85863 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp199041qgi; Wed, 30 Nov 2016 04:11:26 -0800 (PST) X-Received: by 10.99.175.69 with SMTP id s5mr58646095pgo.6.1480507886521; Wed, 30 Nov 2016 04:11:26 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 1si35620455plw.75.2016.11.30.04.11.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 04:11:26 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-443041-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-443041-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-443041-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type :references; q=dns; s=default; b=QVuLfJPblWFbTD/9I/N0kYB6B0lgWE7 GTboYQ3c4lKBoo5hKdMnHdKK199DAEi31ERHLkq84KfQg2eI84fjOTMRfbEzPrZ/ l8tXKx+AsAi+Ht2bl8uHr3wtvmDKQUvd1DhfsJRMiCxZ1iK2X40qZwEHdrVmV5EM zoOHrv2DhuRI= 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:to:cc :from:subject:message-id:date:mime-version:content-type :references; s=default; bh=4i4WYnIY7zKET8cEnZbu5fSPpKc=; b=qFKq5 150F1YggrDx5yemPowoQGOvXoWLEg1ruAvH6vr3XpuvpLpczR7Uj1nzezJjoRp/G Rxlxa7k+cP/4zFSwJc0NlzxOB2sBUDCN6lVr2qLK5+l17KP7rlPPAhTJbEydLf9c HAlAO0SriBVDSDpeMQ2FJ3lw6roHsT+k7ii3AE= Received: (qmail 114443 invoked by alias); 30 Nov 2016 12:11:07 -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 114426 invoked by uid 89); 30 Nov 2016 12:11:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=UD:sanitizer_platform_limits_posix.h, H*Ad:D*samsung.com, HContent-type:multipart, HContent-type:boundary X-HELO: mailout3.w1.samsung.com Received: from mailout3.w1.samsung.com (HELO mailout3.w1.samsung.com) (210.118.77.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Nov 2016 12:10:55 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OHG00DWSF63Q940@mailout3.w1.samsung.com> for gcc-patches@gcc.gnu.org; Wed, 30 Nov 2016 12:10:51 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20161130121050eucas1p18214980b04f92ba21af90dcc78bfbc0f~L0gvSYyzp1437914379eucas1p1x; Wed, 30 Nov 2016 12:10:50 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 1D.F5.11330.AC1CE385; Wed, 30 Nov 2016 12:10:50 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20161130121049eucas1p2c6dbe9a662a8df2bd4b2ca05c9b1a5f3~L0gultJvk1405114051eucas1p2m; Wed, 30 Nov 2016 12:10:49 +0000 (GMT) Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 96.A3.07726.BD1CE385; Wed, 30 Nov 2016 12:11:07 +0000 (GMT) Received: from [106.109.129.18] by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OHG008NDF61T200@eusync3.samsung.com>; Wed, 30 Nov 2016 12:10:49 +0000 (GMT) To: GCC Patches Cc: Jakub Jelinek , doko@ubuntu.com From: Maxim Ostapenko Subject: [PATCH][PR sanitizer/78532] Fix libsanitizer build failure on sparc64-linux-gnu. Message-id: <583EC1C9.4000700@samsung.com> Date: Wed, 30 Nov 2016 15:10:49 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 Content-type: multipart/mixed; boundary=------------020803070207010600080509 X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161130121049eucas1p2c6dbe9a662a8df2bd4b2ca05c9b1a5f3 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?TWFrc2ltIE9zdGFwZW5rbxtTUlItU1cgVG9vbHMgTGFiGw==?= =?UTF-8?B?7IK87ISx7KCE7J6QG0VuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?TWF4aW0gT3N0YXBlbmtvG1NSUi1TVyBUb29scyBMYWIbU2Ft?= =?UTF-8?B?c3VuZ8KgRWxlY3Ryb25pY3MbRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1Nw==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161130121049eucas1p2c6dbe9a662a8df2bd4b2ca05c9b1a5f3 X-RootMTR: 20161130121049eucas1p2c6dbe9a662a8df2bd4b2ca05c9b1a5f3 References: X-IsSubscribed: yes Hi, this patch restores libsanitizer build on sparc64-linux-gnu with Glibc 2.20+ on board. I verified that this patch fixes the build error locally with Glibc 2.24. Ok for mainline? libsanitizer/ChangeLog: 2016-11-30 Maxim Ostapenko PR sanitizer/78532 * sanitizer_common/sanitizer_platform_limits_posix.h (__sanitizer_sigaction): Adjust for sparc targets and various Glibc versions. diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h index d1a3051..066bf41 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h @@ -25,6 +25,10 @@ # define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle)) #endif // !SANITIZER_FREEBSD +#ifndef __GLIBC_PREREQ +#define __GLIBC_PREREQ(x, y) 0 +#endif + namespace __sanitizer { extern unsigned struct_utsname_sz; extern unsigned struct_stat_sz; @@ -628,7 +632,14 @@ namespace __sanitizer { #endif #ifndef __mips__ #if defined(__sparc__) +#if __GLIBC_PREREQ (2, 20) + // On sparc glibc 2.19 and earlier sa_flags was unsigned long, and + // __glibc_reserved0 didn't exist. + int __glibc_reserved0; + int sa_flags; +#else unsigned long sa_flags; +#endif #else int sa_flags; #endif