From patchwork Mon Sep 12 17:04:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Pettersson X-Patchwork-Id: 668901 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 3sXvLH32ylz9sC4 for ; Tue, 13 Sep 2016 03:04:38 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=QUQ6NOpW; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :mime-version:content-type:content-transfer-encoding:message-id :date:to:subject; q=dns; s=default; b=fSz2Z4Aq8SesbD3EHbz1BmbpJe utqa9fBfeAPWywzNMylM5Oz+fNW19O/G2Zsv+U6gw2ixeBj/x+Mvf5bI04ydLsQN KOvy61Qf4mBS7ylYQvnE4/lx8fRZzVImzmwX7nak3aDTSfH9oqkUL/OhFXxMWtP6 1nnW8+2vyFZd60+xM= 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:from :mime-version:content-type:content-transfer-encoding:message-id :date:to:subject; s=default; bh=MZOSpwGBjjpMVP9FEDMGT+afOyM=; b= QUQ6NOpWjG9xkNb6QdZopK4Y9I1lGMWY5z674jHSZmO/rHP/QPxCCCRYuHjempKz 5Wnnj5Fmx6VLuRkpPQ2+MXqhvK3/m06iyAU2NesxhME2Lv9MH6S00TkZn9YfcP1i ZZ8D5vI876ZrfC+nKwLBhfNBZLfC5rPKS5PznoYeqY0= Received: (qmail 11468 invoked by alias); 12 Sep 2016 17:04:30 -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 11423 invoked by uid 89); 12 Sep 2016 17:04:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:armv7l, sk:armv7l-, __arch64__, mikael X-HELO: mail-lf0-f67.google.com Received: from mail-lf0-f67.google.com (HELO mail-lf0-f67.google.com) (209.85.215.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Sep 2016 17:04:28 +0000 Received: by mail-lf0-f67.google.com with SMTP id s29so6087955lfg.3 for ; Mon, 12 Sep 2016 10:04:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-transfer-encoding :message-id:date:to:subject; bh=pX0xu/ceO2b2Nh0FnMfyNKJdZBpWuhhEEHQ6+2c8mz4=; b=iEPVvCUKIvm4JPu1Zbq7UvfXjhWcZlnpyqEoJNyz9/tvuwqsKrewSasPSDXu3fk4Rp IcJ4DciLx6No+3RgsvWB3l0jEn5lQ0sJ3EdEiTUcFAL6+ZV0MGtMPXxjMtg1e/fOR4DP g8Zjv9IoAw2q4WRup1/5cpOZ8TeFiMWmD8H6jF364OswgbxW0/IkACDCbubqRo5LfX0V F59f5ed2mo5Nw/yn+WQCGE2XBHsMTE0y4gLxfYw5q+/yXSXusufV79eEEeZpcW0mmmwJ pnNWft9AIMCCz81G7ICXoiKT+vCIBL96bL66X7H52Y2sOhDSf3/J1rd1lBiryWYYzgve qLNQ== X-Gm-Message-State: AE9vXwNlapChsQ+n5AhVEKqgHQhMMau1TH+r4lCJeLhtUi1+bYhZoDMaiTTZw1zndlp0bA== X-Received: by 10.46.69.193 with SMTP id s184mr5965983lja.42.1473699865570; Mon, 12 Sep 2016 10:04:25 -0700 (PDT) Received: from cascade (h109n3-u-a31.ias.bredband.telia.com. [213.65.120.109]) by smtp.gmail.com with ESMTPSA id h13sm3081580ljh.27.2016.09.12.10.04.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 10:04:24 -0700 (PDT) From: Mikael Pettersson X-Google-Original-From: "Mikael Pettersson" Received: by cascade (sSMTP sendmail emulation); Mon, 12 Sep 2016 19:04:23 +0200 MIME-Version: 1.0 Message-ID: <22486.57366.795579.183733@gargle.gargle.HOWL> Date: Mon, 12 Sep 2016 19:04:22 +0200 To: gcc-patches@gcc.gnu.org Subject: [PATCH] unbreak libsanitizer build on sparc-linux (PR 67899) PR sanitizer/67899 is a bootstrap failure on sparc-linux, caused by a compilation error in libsanitizer. The root cause is that `struct sigaction' has changed layout in glibc twice recently, first an unintended ABI change in glibc-2.20, and then the correction in glibc-2.22 (backported to the .20 and .21 branches). (See glibc bz#18694). Around the time of the first change, libsanitizer was changed to match, but it wasn't updated for the correction. The end result is an ABI mismatch and assertion errors during compilation of libsanitizer. (The sa_flags field is of the wrong size and at the wrong offset.) Fixed by adjusting the SPARC part of libsanitizer's sigaction struct to match glibc (except for the broken .20 and .21 initial releases). Tested w/o regressions on sparc-linux-gnu (post-2.20 glibc), x86_64-linux-gnu, powerpc-linux-gnu, armv7l-linux-gnueabi, and m68k-linux-gnu. Is this Ok for trunk and 5/6 branches? (Note: I don't have commit rights so if this is approved I would need help to get it applied.) Thanks, /Mikael libsanitizer/ 2016-09-12 Mikael Pettersson PR sanitizer/67899 * sanitizer_common/sanitizer_platform_limits_posix.h (__sanitizer_sigaction): Adjust for sparc targets. --- gcc-7-20160911/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h.~1~ 2015-11-23 10:07:18.000000000 +0100 +++ gcc-7-20160911/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h 2016-09-12 18:34:21.446379317 +0200 @@ -606,11 +606,10 @@ namespace __sanitizer { #else __sanitizer_sigset_t sa_mask; #ifndef __mips__ -#if defined(__sparc__) - unsigned long sa_flags; -#else - int sa_flags; +#if defined(__sparc__) && defined(__arch64__) + int __glibc_reserved0; #endif + int sa_flags; #endif #endif #if SANITIZER_LINUX