From patchwork Tue Nov 13 06:49:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 198549 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]) by ozlabs.org (Postfix) with SMTP id 70DFF2C00BD for ; Tue, 13 Nov 2012 17:50:22 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1353394223; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: Message-Id:To:Subject:From:Mime-Version:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=4cRcaU9adXYZQczvDTykBifSxzI=; b=a9Cvmvv5jvLb+ho JDcrH50FEbja9rmre2SnzXL86N8ot21xKT5wszbIiRYl+ebMKUnsAbuz5ey1YEF5 XQqHr9bgFvsViZbtrnq5zXHLFf0RV/uTbUqaRPGlb8c82JM7cbTudk+q0iFYFY2q fp01xR7YejYhW+0Z7lf9n83C5654= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:Message-Id:To:Subject:From:Mime-Version:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=AGk0U49pN1hs7uDzL0ldOAgqvAJjQUJdMzUjVCX/Hkt05sdrvtFQRJIfCcqhUD k5VivEd8J7aaKtcrWWXmX+gIJUy2buvfJ9NqYhHc540ocKVEbiJKeZ9P1jbQNarF L4yp02a6sGbiBiVH4Sw2UxzU14qXIJR1vbP4QGKkmf3Qw=; Received: (qmail 30097 invoked by alias); 13 Nov 2012 06:50:15 -0000 Received: (qmail 30057 invoked by uid 22791); 13 Nov 2012 06:50:10 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from shards.monkeyblade.net (HELO shards.monkeyblade.net) (149.20.54.216) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Nov 2012 06:49:58 +0000 Received: from localhost (cpe-66-108-117-132.nyc.res.rr.com [66.108.117.132]) by shards.monkeyblade.net (Postfix) with ESMTPSA id EA9DE5896E7 for ; Mon, 12 Nov 2012 22:50:00 -0800 (PST) Date: Tue, 13 Nov 2012 01:49:55 -0500 (EST) Message-Id: <20121113.014955.1285365295469482183.davem@davemloft.net> To: gcc-patches@gcc.gnu.org Subject: [PATCH] Get sparc building again after ASAN merge. From: David Miller Mime-Version: 1.0 X-IsSubscribed: yes 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 libsanitizer/ * asan/asan_linux.cc (GetPcSpBp): Add sparc support. --- libsanitizer/ChangeLog.asan | 4 ++++ libsanitizer/asan/asan_linux.cc | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/libsanitizer/ChangeLog.asan b/libsanitizer/ChangeLog.asan index 7fe3c0c..5592092 100644 --- a/libsanitizer/ChangeLog.asan +++ b/libsanitizer/ChangeLog.asan @@ -1,3 +1,7 @@ +2012-11-12 David S. Miller + + * asan/asan_linux.cc (GetPcSpBp): Add sparc support. + 2012-10-29 Wei Mi Initial checkin: migrate asan runtime from llvm. diff --git a/libsanitizer/asan/asan_linux.cc b/libsanitizer/asan/asan_linux.cc index 2922740..ea7ee9e 100644 --- a/libsanitizer/asan/asan_linux.cc +++ b/libsanitizer/asan/asan_linux.cc @@ -66,6 +66,20 @@ void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { *pc = ucontext->uc_mcontext.gregs[REG_EIP]; *bp = ucontext->uc_mcontext.gregs[REG_EBP]; *sp = ucontext->uc_mcontext.gregs[REG_ESP]; +# elif defined(__sparc__) + ucontext_t *ucontext = (ucontext_t*)context; + uptr *stk_ptr; +# if defined (__arch64__) + *pc = ucontext->uc_mcontext.mc_gregs[MC_PC]; + *sp = ucontext->uc_mcontext.mc_gregs[MC_O6]; + stk_ptr = (uptr *) (*sp + 2047); + *bp = stk_ptr[15]; +# else + *pc = ucontext->uc_mcontext.gregs[REG_PC]; + *sp = ucontext->uc_mcontext.gregs[REG_O6]; + stk_ptr = (uptr *) *sp; + *bp = stk_ptr[15]; +# endif #else # error "Unsupported arch" #endif