Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2309747ybb; Fri, 27 Mar 2020 03:09:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs6diDyQgxjeMqhaUqLtt3RAUjTQNs/6nSGpVkpgsLB3vM+tCBVxxXKjHPgTvdSwU3rg59J X-Received: by 2002:aca:4710:: with SMTP id u16mr3199571oia.108.1585303760303; Fri, 27 Mar 2020 03:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585303760; cv=none; d=google.com; s=arc-20160816; b=c5lOcTm3tB0NRWwfGxeBO3YY965kpopGkWO39lr4gl6T8JcfdzCpC5EMBZZLRn2FGY Yq/hLig5F17yRyf1fvwIbba0QKv8sgNJZECZtgfgqUEMRr7n1Csk5mChAAlsZ6NOS6Ii P8nO08+Ep8mYkyYiy7hcujW6owqDKSHOmlSoqXsG03CeF1mtsnJ82Sf4dPwd8BGzYaSI NEi/YZmBp73DbJdflOgydgZ89+N6XCU+e0FrSRoyaAA6wzV2tTkJWB2quFdD8dL64yqE XkjHi3n4FhmOKUtKmY/QZcnsL/Cxra8loxpVxldWkuoBCPn0NYm+ZaNObd/5fRfhrQfc UsKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:cc:from:subject:mime-version :message-id:date:dkim-signature; bh=a9Dk/kbnbTaFBBTCzZO5pdMTQ5WVDyWCyCYn/tuqlvo=; b=RlD/YN7X+ffKjOazhs2UecY9kMTxdAb5tPDptex3lAk0A+r3AjJlff+Ckd3MLj1BvY bKCIM6UkNvozZnvfg7JrwyyrEsLmG5K6knvsVkNkoEfdtGcM/dIbjCqKqnbdxT61dVMw DTeuPcdzIHsJVZcYKT5Y8o0y0ssh5uIgTgMfStgT6Cuj3H3BnGtSTRYhco5ix8uHxUNp XtFS1sJC2cghfHPhkkquKCmUUc82f+CTP6d3OpZs3uc0zhRY9NLB9OllfLSo8xfijn5i uUNxqalFYQYO6DAc5zm/Feq5DUKJTmXUT4Ak2l5xn65cCXIlAuq7XFZ5451cvsjs4H+n bu3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FJmHc86j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6si2137954otf.248.2020.03.27.03.09.07; Fri, 27 Mar 2020 03:09:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FJmHc86j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726215AbgC0KIn (ORCPT + 99 others); Fri, 27 Mar 2020 06:08:43 -0400 Received: from mail-wm1-f73.google.com ([209.85.128.73]:38289 "EHLO mail-wm1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbgC0KIn (ORCPT ); Fri, 27 Mar 2020 06:08:43 -0400 Received: by mail-wm1-f73.google.com with SMTP id y1so4163320wmj.3 for ; Fri, 27 Mar 2020 03:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:cc; bh=a9Dk/kbnbTaFBBTCzZO5pdMTQ5WVDyWCyCYn/tuqlvo=; b=FJmHc86jTWilHccHv/Qtxijls7tX6vwQd9QVFRcr4ULmjCslDhbAUbT/QGLyMiPMYm tP+9f4g4yGrvQziUFuqcgvIvvPGmPltssF3bc/u+v48G3ILPSh5Bhc5oxTlslJVaKdM0 G/SkaNPT7mu6fQfidkpNkePPd1cE4RVebXj+4HE3Qt/B86Y1zGVKngXmZb+J4hpr1E6o /eP74Th/f9RC9r3NyHNJ708a7Je0jhvMkcY/xLS8hKJGeWuB+h0qUGbentWjZLRMAoXa Noapslt5eHx21oA4wFLj/DOS4EppFcYhlhx0CROLwFPc99KXzpLLyq/LJmuSGGZKkipk Us7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:cc; bh=a9Dk/kbnbTaFBBTCzZO5pdMTQ5WVDyWCyCYn/tuqlvo=; b=izNjzcqRjII1QZGL88PkKKDqjjmhXYiJDGrSbbC6EUD9YsprRJzr0FPW6xKMUNlIzY 90mDh+9rXM3+/QnBccfolytf5uhuoi9s0Qog58h1VHO1nlIhCHk1uec1Sz1fnfVJTgBR HdrGGdpsCL5/7OGy1SiKJ5+fK5MOa+cp+ks0LvxniwE52jl0zjKyCQNZpsJzYlrI1EEG ZC7jiHSI7WTZcIi/4o0r5wijdJtrLbwTfWQleVi+qL2XvX+lWJTWvlbvu3ueX+/CZiwA rmIIzvuwA65dJ9OP246hO73QjNIkUre//cj7BnMjupmCgjJVoxboUalVqLY/8fR9tAcw atnQ== X-Gm-Message-State: ANhLgQ1CyEMUhgV3IdpoNi+so6/4R0zc+ZfOUiuosGe5DsGIKDuxqAar vOjLI+vFCzIb//7KqlWT/pniQ/fu/yA7 X-Received: by 2002:adf:9e08:: with SMTP id u8mr3411115wre.155.1585303720723; Fri, 27 Mar 2020 03:08:40 -0700 (PDT) Date: Fri, 27 Mar 2020 11:07:56 +0100 Message-Id: <20200327100801.161671-1-courbet@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.25.1.696.g5e7596f4ac-goog Subject: [PATCH v1] powerpc: Make setjmp/longjump signature standard From: Clement Courbet Cc: Nick Desaulniers , Nathan Chancellor , Michael Ellerman , Clement Courbet , Benjamin Herrenschmidt , Paul Mackerras , Greg Kroah-Hartman , Thomas Gleixner , Segher Boessenkool , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Content-Type: text/plain; charset="UTF-8" To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Context: https://lore.kernel.org/patchwork/patch/1214060 https://lore.kernel.org/patchwork/patch/1216174 Signed-off-by: Clement Courbet --- arch/powerpc/include/asm/setjmp.h | 6 ++++-- arch/powerpc/kexec/Makefile | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/setjmp.h b/arch/powerpc/include/asm/setjmp.h index e9f81bb3f83b..84bb0d140d59 100644 --- a/arch/powerpc/include/asm/setjmp.h +++ b/arch/powerpc/include/asm/setjmp.h @@ -7,7 +7,9 @@ #define JMP_BUF_LEN 23 -extern long setjmp(long *) __attribute__((returns_twice)); -extern void longjmp(long *, long) __attribute__((noreturn)); +typedef long *jmp_buf; + +extern int setjmp(jmp_buf env) __attribute__((returns_twice)); +extern void longjmp(jmp_buf env, int val) __attribute__((noreturn)); #endif /* _ASM_POWERPC_SETJMP_H */ diff --git a/arch/powerpc/kexec/Makefile b/arch/powerpc/kexec/Makefile index 378f6108a414..86380c69f5ce 100644 --- a/arch/powerpc/kexec/Makefile +++ b/arch/powerpc/kexec/Makefile @@ -3,9 +3,6 @@ # Makefile for the linux kernel. # -# Avoid clang warnings around longjmp/setjmp declarations -CFLAGS_crash.o += -ffreestanding - obj-y += core.o crash.o core_$(BITS).o obj-$(CONFIG_PPC32) += relocate_32.o -- 2.25.1.696.g5e7596f4ac-goog