Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17924441ybl; Thu, 2 Jan 2020 14:55:33 -0800 (PST) X-Google-Smtp-Source: APXvYqytSXu+s5ahEU6/WuTHv/p2KIeKmvs7OGWbaU6zovLNOiWAucJyadzDZuNI6H+qJh7ZQRJs X-Received: by 2002:a05:6830:1bda:: with SMTP id v26mr91251824ota.314.1578005733336; Thu, 02 Jan 2020 14:55:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005733; cv=none; d=google.com; s=arc-20160816; b=Cbr88IGj+Je7SOC505r9FcUFs2RqR6paasMdZc/upPURBjTjcEcQoa31agnmL3hupD D0bczXEtuMUm8vEl1wO17g89oIg9LPWUoUlGw9WScP1LRMwyVdmpcyO2Ms3huJkfPLjc 9YShdyVi01vuhAKjcQ6ST9CZInQoQ2BA/0Eob05WeKkcRXGrhI3F5XMSUxeckPXOrLpd bpzYWYiiW2inj9F8IHr0MOpm6H7o6vd2JW4dX6x8ymzF3zY8/ZV2r+SfC8C3olAMEH67 4fqvVNjncKK4STkhoboG0XsArh+T1yoLzkc7Q0SrvTLkvs1TaZWhIllZCS4xRRw9ZRKS WPbA== 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=VM/H3UfK0xwfUgVC5/XN+ngtmvgG4TxQlycJTmlWRDk=; b=Vd9O0aCWj/QPcIxevVuOXYr9yz497dRnHRuwrCOKeNW6lkDvchZU7HyMCBnDan28BS 2SueRaQ0P8PmqPG/VawHVHkYs04lA0bqirrQZ9SnCTz9eFSNKixmZG/guW9Vrgd7UyXo W/5652ciNx8VekxOyXYnX8+CLYCcRU6a0Tis6JnnOSHczv/H/q610BfoinDpibY0hSz/ HrIu6V2rpQz63ftaREXvYL9I4Ef+NGwaqP2zGNFv4E6FxUyY13VozEJux5Q1InvVwmF5 eQRqylEfHeQfGIwM6mfVGjzt5iZZ1ofwmsyg1uNtmWfvKYuuis/OA9QfS3urFa2n7i9G tKyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ps1dkUPy; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si29266429otk.290.2020.01.02.14.55.21; Thu, 02 Jan 2020 14:55:33 -0800 (PST) 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=@kernel.org header.s=default header.b=Ps1dkUPy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728928AbgABWVC (ORCPT + 99 others); Thu, 2 Jan 2020 17:21:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:39384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728048AbgABWU7 (ORCPT ); Thu, 2 Jan 2020 17:20:59 -0500 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 3199021582; Thu, 2 Jan 2020 22:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003658; bh=d8OYjwglSwSZ+zYIi3BgcyA/ugNN0+pst0NzjE764HM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ps1dkUPy8v3AZAvxVQH/sWXAGGq9VCWookRVWGToP6evkSE07wKag1oRiJvtpuHrc XtoXX1Zb8vFKTIsNMfKAst8QNRyXUL+HR7EbHDjmolo0CyvZwykAEPkwfpjRqxxPN8 GXtLgiZT3HmCWsh0CDFJTIkmCo5ycetlOkpxXPr8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Axtens , Nathan Chancellor , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 061/114] powerpc: Dont add -mabi= flags when building with Clang Date: Thu, 2 Jan 2020 23:07:13 +0100 Message-Id: <20200102220035.195017102@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@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: Nathan Chancellor [ Upstream commit 465bfd9c44dea6b55962b5788a23ac87a467c923 ] When building pseries_defconfig, building vdso32 errors out: error: unknown target ABI 'elfv1' This happens because -m32 in clang changes the target to 32-bit, which does not allow the ABI to be changed. Commit 4dc831aa8813 ("powerpc: Fix compiling a BE kernel with a powerpc64le toolchain") added these flags to fix building big endian kernels with a little endian GCC. Clang doesn't need -mabi because the target triple controls the default value. -mlittle-endian and -mbig-endian manipulate the triple into either powerpc64-* or powerpc64le-*, which properly sets the default ABI. Adding a debug print out in the PPC64TargetInfo constructor after line 383 above shows this: $ echo | ./clang -E --target=powerpc64-linux -mbig-endian -o /dev/null - Default ABI: elfv1 $ echo | ./clang -E --target=powerpc64-linux -mlittle-endian -o /dev/null - Default ABI: elfv2 $ echo | ./clang -E --target=powerpc64le-linux -mbig-endian -o /dev/null - Default ABI: elfv1 $ echo | ./clang -E --target=powerpc64le-linux -mlittle-endian -o /dev/null - Default ABI: elfv2 Don't specify -mabi when building with clang to avoid the build error with -m32 and not change any code generation. -mcall-aixdesc is not an implemented flag in clang so it can be safely excluded as well, see commit 238abecde8ad ("powerpc: Don't use gcc specific options on clang"). pseries_defconfig successfully builds after this patch and powernv_defconfig and ppc44x_defconfig don't regress. Reviewed-by: Daniel Axtens Signed-off-by: Nathan Chancellor [mpe: Trim clang links in change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20191119045712.39633-2-natechancellor@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index dfcb698ec8f3..e43321f46a3b 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -90,11 +90,13 @@ MULTIPLEWORD := -mmultiple endif ifdef CONFIG_PPC64 +ifndef CONFIG_CC_IS_CLANG cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1) cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mcall-aixdesc) aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1) aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2 endif +endif ifneq ($(cc-name),clang) cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align @@ -134,6 +136,7 @@ endif endif CFLAGS-$(CONFIG_PPC64) := $(call cc-option,-mtraceback=no) +ifndef CONFIG_CC_IS_CLANG ifdef CONFIG_CPU_LITTLE_ENDIAN CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc)) AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2) @@ -142,6 +145,7 @@ CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1) CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcall-aixdesc) AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1) endif +endif CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc)) CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) -- 2.20.1