Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753136AbdLHTND (ORCPT ); Fri, 8 Dec 2017 14:13:03 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:43539 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752944AbdLHTM7 (ORCPT ); Fri, 8 Dec 2017 14:12:59 -0500 From: Vineet Gupta To: CC: , Vineet Gupta Subject: [PATCH 2/2] ARC: provide for gcc "isolate path" induced generated abort calls Date: Fri, 8 Dec 2017 11:12:41 -0800 Message-ID: <1512760361-17663-2-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512760361-17663-1-git-send-email-vgupta@synopsys.com> References: <1512760361-17663-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.10.161.67] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1061 Lines: 38 gcc toggle -fisolate-erroneous-paths-dereference (default at -O2 onwards) isolates faulty code paths such as null pointer access, divide by zero etc. If gcc port doesnt implement __builtin_trap, an abort() is generated which causes kernel link error hence this patch. FWIW ARC gcc now has the builtin, but we need to handle this error for older toolchains. The code in question triggering gcc is in lib/mpi/mpih-div.o Signed-off-by: Vineet Gupta --- arch/arc/kernel/setup.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 9d27331fe69a..5e180090b17f 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -637,3 +638,8 @@ static int __init topology_init(void) } subsys_initcall(topology_init); + +void __weak abort(void) +{ + machine_halt(); +} -- 2.7.4