Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3359196pxt; Tue, 10 Aug 2021 01:32:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUFdHM79r2Z9etuW6uIV1/Zs8EjkvHXL3hM4OOmoYJCI1Mtt+nnXj/DukBJdyy3/k2znJA X-Received: by 2002:a05:6e02:13d3:: with SMTP id v19mr171863ilj.167.1628584320261; Tue, 10 Aug 2021 01:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628584320; cv=none; d=google.com; s=arc-20160816; b=CdW8y3hTgP437MVcQUGsE7VXwnojEKE4+2xzvma0/aMmItf+C24+/pJlUPz6ugW3iO GFNEBU7vHh4NslZSsHoDfu70oPj95xIA/jvQSjPKVQBpbzqqLaFsFZzHeTsyZz7dtqDQ v5ayADVvpvrvmpVyiE+kKd6ma88RABND3pkspLDmuiqj/6bmEuigVJvdJgTVj5rEu0j/ 8qHyFRCy87WhqgFhUyVZ6ao8a7RznqW+FhIn6kX9Innf4RrQgceBjY2QqY/FdJ5tY2MT P7bZddrDRT0u5DWLpfMQ3dMlIlSDnDEoZ6+jO/HAm9r1clZANWYevTHkyiVWOMsDkmy6 7rMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MU763fmLMazZScBz9AM5kFRHaPtpqcj/azSfoVGQWxI=; b=jTheDlj3uIlWNoaSA8W6mmZKFlsvRsOC9ZwzmnJ9C+AAG4ihTCJzSmCd6WEPYghN7n mFQf3kiJh+8IB5Ct0WBKefaGHfPw4Jz9uz4RXg2VPIlbNdId70lW7NmcmCBtJGq+L2rk ouTM3pva95lgQu4/Z+QiFxpWCKRSx8nA9c+2/IQusfSjejkn0MeYUHefmBRmhvbm+PMh QOtBOf7e0CZ2rXM7ImjM/DbilOEshjigXW8hiGQrvklOx4betPZ9hG/TFWYwNkIx6kRo a+7FKt60SU1Zdx5NjNJahvuQc/2gr9CZsD6Mxnc2wJYidNAoZaKYqQ3HQT47Cradv+kE wqTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=lpPKOAYV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a12si17455720jac.69.2021.08.10.01.31.48; Tue, 10 Aug 2021 01:32:00 -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=@canonical.com header.s=20210705 header.b=lpPKOAYV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236133AbhHJGO0 (ORCPT + 99 others); Tue, 10 Aug 2021 02:14:26 -0400 Received: from smtp-relay-canonical-0.canonical.com ([185.125.188.120]:58522 "EHLO smtp-relay-canonical-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbhHJGOY (ORCPT ); Tue, 10 Aug 2021 02:14:24 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id DA5E13F23A for ; Tue, 10 Aug 2021 06:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628576041; bh=MU763fmLMazZScBz9AM5kFRHaPtpqcj/azSfoVGQWxI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=lpPKOAYV+61CRKH6jIEVaRh5S0+PWNA3Oh5u9wiK3TITIeYg/Wj3AJBkIOxlvuxVT Pb47SV/ikBm0NsRD5LoK33ln3hYT/48hTs9AvDOqUG3gMrpg66XyG2+Z3uacTV7Jei K2BTSyxtQzPPLyVuLKpzBpHPodogB0cZK6WMNQm/GUBb0y8Q5u1/OdXCb2eEyHmntw p/KyDO9CdOZvhE9IZDnivFlyVA3ugaXM+eu8mOYTl/InKfYNRYNnQsKzrKYWaE5QBt aelOppvHz14lDTaqq1mDZG4E9QlF5e+Ey1cOqjABTeqXrrdqFKEUVo0XnX7hnw/8ee JgPvT4FIVHT+A== Received: by mail-wr1-f71.google.com with SMTP id m5-20020a5d6a050000b0290154e83dce73so1764536wru.19 for ; Mon, 09 Aug 2021 23:14:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MU763fmLMazZScBz9AM5kFRHaPtpqcj/azSfoVGQWxI=; b=pykz0ufNnNgzsGjMS63+bRQUJT1TsMekVjrVAHF5WQOP7DxS7zV+Ld2SARegEriG1m i9it+FitfGb9n+CxSlOvZce5XNlBPPN0R0epqid4FXRp7jXxzzOhBsL51YRVCQyYmQ/2 xSCCxXM2LNTqnfAJpVTXs7UrVVEBqBQfnb7DCUgQSAmX8Lc13SfUHCU9FxMlj12oTvQy lnCI4KlRz09luESInXYy1e1GAHVla93WXQwceDfJROesFDJDRgYowF5UPq+3SVL0rY1K M5uFOzr6LmzrItMMBseq+qLDwjrP0IJlLrY3QJ4bu2/vViPxQJ4H7t1r4tEnBcSC4mr4 xwiA== X-Gm-Message-State: AOAM533bUryEAoiwEHfpO8j+/aXBUv12WZVohyJmIl9hH5XKPpAnGnjs wDfp+c1Mxl8B9GK1SbYgOpUx09RuaQIHdk3B0XvOAkzRLcyV/E33W/uTRoXTksQA95DHKybNwc+ QHWlL9xBCqQZM9ZMPBGJFLO0p6soM1RVYynF5ILf0TQ== X-Received: by 2002:a7b:c7d1:: with SMTP id z17mr2817590wmk.50.1628576041458; Mon, 09 Aug 2021 23:14:01 -0700 (PDT) X-Received: by 2002:a7b:c7d1:: with SMTP id z17mr2817569wmk.50.1628576041270; Mon, 09 Aug 2021 23:14:01 -0700 (PDT) Received: from gollum.fritz.box ([194.191.244.86]) by smtp.gmail.com with ESMTPSA id h11sm14676563wrq.64.2021.08.09.23.14.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 23:14:00 -0700 (PDT) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk Cc: linux-kernel@vger.kernel.org, Juerg Haefliger Subject: [PATCH] ARM: Fix instruction set selection for GCC 11 Date: Tue, 10 Aug 2021 08:13:50 +0200 Message-Id: <20210810061350.754134-1-juergh@canonical.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org GCC 11 on ARM now complains like the following when trying to determine if an arch is supported. Presumably because it enforces the default option '--with-float=hard' which GCC 10 didn't do? $ arm-linux-gnueabihf-gcc-11 -march=armv7-a -c -x c /dev/null cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU Due to that, the kernel build system selects the wrong compiler options which throws errros like this during the build: /tmp/ccrHfZPj.s: Assembler messages: /tmp/ccrHfZPj.s:116: Error: selected processor does not support `dmb ish' in ARM mode /tmp/ccrHfZPj.s:150: Error: selected processor does not support `isb ' in ARM mode /tmp/ccrHfZPj.s:160: Error: selected processor does not support `mrrc p15,1,r4,r5,c14' in ARM mode /tmp/ccrHfZPj.s:245: Error: selected processor does not support `dmb ish' in ARM mode /tmp/ccrHfZPj.s:503: Error: selected processor does not support `dmb ish' in ARM mode /tmp/ccrHfZPj.s:527: Error: selected processor does not support `dmb ish' in ARM mode /tmp/ccrHfZPj.s:698: Error: selected processor does not support `dmb ish' in ARM mode /tmp/ccrHfZPj.s:731: Error: selected processor does not support `isb ' in ARM mode Fix that by adding '-msoft-float' to KBUILD_CFLAGS before the definition of the 'arch-$(CONFIG_CPU_)' instruction selection macros. Signed-off-by: Juerg Haefliger --- arch/arm/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 173da685a52e..d21198833997 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -56,6 +56,9 @@ endif # KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra) +# Need -msoft-float for gcc 11 for the below instruction set selection +KBUILD_CFLAGS += -msoft-float + # This selects which instruction set is used. # Note that GCC does not numerically define an architecture version # macro, but instead defines a whole series of macros which makes @@ -125,7 +128,7 @@ AFLAGS_ISA :=$(CFLAGS_ISA) endif # Need -Uarm for gcc < 3.x -KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm +KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -Uarm KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float CHECKFLAGS += -D__arm__ -- 2.30.2