Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1649231ybz; Thu, 16 Apr 2020 12:58:47 -0700 (PDT) X-Google-Smtp-Source: APiQypJgjSbdRz+KDOqUB2ec+7qIxzJlULBazcd0ff/sKIKDFWOl3B6Ey2JrMOt7xZT4UVpvfbnS X-Received: by 2002:a50:8a03:: with SMTP id i3mr31860322edi.121.1587067127637; Thu, 16 Apr 2020 12:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587067127; cv=none; d=google.com; s=arc-20160816; b=Y6GMR/I3DA79p30nx3l+KxUVQ1/Md+N9ONoTksWNw+fVpBlfH8c90NgYZeHF1HIK1f DRCr8sjH/99mW0YI9lqTeoEXNRpr5SUQIqSD9HdRVhUmRLfzotI6oeXLvJAxSkOPkSHl pqtOC0tnYz2Iri2FbKSg6jSladPfPbfP4ES/kejS9sFw4GCzJyfw1fIYevNZVbhD4LyY rtnUjoQx2SWpqsDK7iiRQonMgvmeMPSZfKXHpCm0sc3YerP1E8A1W2Z5K7ga4PISiALN 5F/yZwEVprv27EWQsgGY4vEpdAnSXUaw6TJEKQF/nek9NlJNnjMvxN/bOwGkJ3IpL4jU 9dOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XmCyTTRyvr1I+ffyWtNIaBDoYhhhJP1WkoUKOepA72A=; b=TYhwyHXCw1YKxDc3KzN1pd15+ysIc3Fi5VhCVVxJGM1i+OsrsIsg6oP26h2KknCThG I0hEccDDq7SjTYzRstHM4D4cbeEB0GG6pdLmECPWulrHLG7sn4qYd5A3rExsXRDqbwWv ynF1vDK/DKoxXgvKeEVIz4ywMx4YK01JXphGmGUC5m8KbZSxIseeXqx0ZNaRt0pVJcHy KxYrA79hkOWd3wuf3T55DMYL3NCygtdhGewinue34K2WCE8aIGbHwb1Tj5m+By6LIj9H 0VPOsd62WFQGAfxGXVCYI0DXK409ckLUXznFIHqDIkSOUI2fEjK9wBewicw/HGUUsTmj SZQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wWkONcDg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m17si2024840eds.553.2020.04.16.12.58.24; Thu, 16 Apr 2020 12:58:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wWkONcDg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2897836AbgDPNje (ORCPT + 99 others); Thu, 16 Apr 2020 09:39:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:41342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2896344AbgDPNbB (ORCPT ); Thu, 16 Apr 2020 09:31:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 074F6208E4; Thu, 16 Apr 2020 13:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587043861; bh=6ZRLT6P2DBwcHCCE0TDUfG/2p1fU0nYUoF36kWscEpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wWkONcDgxykMHBXjbOR3yRURsXCMGUN9Uv34F+LNqqgfdIB8wPipwoAyyX3FsMXCR EF3FjnZepegEmoBH+pd/q4iNfpfg+BeChaB+pdLZNgKi/jK6TQuk9Q2EsGukfuiou/ 4c8+E9IcQdmB/ZBwBYKh+xZGrlKCdnA7oP03A6nM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Clement Courbet , Nathan Chancellor , Michael Ellerman Subject: [PATCH 4.19 131/146] powerpc: Make setjmp/longjmp signature standard Date: Thu, 16 Apr 2020 15:24:32 +0200 Message-Id: <20200416131300.399910196@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200416131242.353444678@linuxfoundation.org> References: <20200416131242.353444678@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Clement Courbet commit c17eb4dca5a353a9dbbb8ad6934fe57af7165e91 upstream. Declaring setjmp()/longjmp() as taking longs makes the signature non-standard, and makes clang complain. In the past, this has been worked around by adding -ffreestanding to the compile flags. The implementation looks like it only ever propagates the value (in longjmp) or sets it to 1 (in setjmp), and we only call longjmp with integer parameters. This allows removing -ffreestanding from the compilation flags. Fixes: c9029ef9c957 ("powerpc: Avoid clang warnings around setjmp and longjmp") Cc: stable@vger.kernel.org # v4.14+ Signed-off-by: Clement Courbet Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200330080400.124803-1-courbet@google.com Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/setjmp.h | 6 ++++-- arch/powerpc/kernel/Makefile | 3 --- arch/powerpc/xmon/Makefile | 3 --- 3 files changed, 4 insertions(+), 8 deletions(-) --- a/arch/powerpc/include/asm/setjmp.h +++ b/arch/powerpc/include/asm/setjmp.h @@ -12,7 +12,9 @@ #define JMP_BUF_LEN 23 -extern long setjmp(long *) __attribute__((returns_twice)); -extern void longjmp(long *, long) __attribute__((noreturn)); +typedef long jmp_buf[JMP_BUF_LEN]; + +extern int setjmp(jmp_buf env) __attribute__((returns_twice)); +extern void longjmp(jmp_buf env, int val) __attribute__((noreturn)); #endif /* _ASM_POWERPC_SETJMP_H */ --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -5,9 +5,6 @@ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' -# Avoid clang warnings around longjmp/setjmp declarations -CFLAGS_crash.o += -ffreestanding - subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror ifdef CONFIG_PPC64 --- a/arch/powerpc/xmon/Makefile +++ b/arch/powerpc/xmon/Makefile @@ -1,9 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for xmon -# Avoid clang warnings around longjmp/setjmp declarations -subdir-ccflags-y := -ffreestanding - subdir-ccflags-$(CONFIG_PPC_WERROR) += -Werror GCOV_PROFILE := n