From patchwork Mon Aug 9 15:22:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1515145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=FsK6iDpr; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gk0GG4Hl8z9shx; Tue, 10 Aug 2021 01:23:18 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mD77S-0004pr-Ef; Mon, 09 Aug 2021 15:23:14 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mD77Q-0004pk-Kf for kernel-team@lists.ubuntu.com; Mon, 09 Aug 2021 15:23:12 +0000 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.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-1.canonical.com (Postfix) with ESMTPS id 148BA3F22F for ; Mon, 9 Aug 2021 15:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628522592; bh=9ojaaK3UixJS/MDsZR8ZBCiyim2U43j+r4481t8cEYE=; h=From:To:Subject:Date:Message-Id:MIME-Version:Content-Type; b=FsK6iDprcj1geiYv6Kln4teI9puHEKVkFPAh63gA8PVReHAc2yRpCfOcJOgj6zVZq h6n1xfi/zRM6xbgs3GADgrDP8CyptBCxSgRImxqXtHW7ITthN6+WkdRJGIficwJSVe BSaY4Dw5BP55WYVRnZuFueBSfVLRXSbAvFn7nbFsuQ/lKDkcUs7F3yrQ7zstHM7jdg 5YzsFRnm75xnlWQmG3a+NHKBu2LlzrM7MIYAOqv1ILV+7jhOnzGaPL2o9tGoH9r1RV 0SmCF+RXtTvhSu8+D+8nHIsh1LjKLUHzl/RSGBraLjv74YLMFnrRur50PH7eYv0m8Z yC2GWKMSKjbCw== Received: by mail-ed1-f71.google.com with SMTP id p2-20020a50c9420000b02903a12bbba1ebso9024015edh.6 for ; Mon, 09 Aug 2021 08:23:12 -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:subject:date:message-id:mime-version :content-transfer-encoding; bh=9ojaaK3UixJS/MDsZR8ZBCiyim2U43j+r4481t8cEYE=; b=BKWOO4tVKofdjpfUhF9f0llqXTuAmb2M8JioZhFLbYhIvzmdLwGYYm3bzQsOrVY7Dj pWUYcIFbFPn+ovqnJt1IX7yjVbh1XXLqu+7xLW63rcxDMlxipnrsYB1+1RNC0P0akUo5 qPwNj0B5vLzz8Kv9dX4/V63zft0Bcwh7hWqYang4Lj7yxY4Ej/5Bcc0yKGtpXvCeeOit 91ZukrCKnJLtrERtBKcEIQRWiHmTKVRa2JWXHhaU9m4S0/uqbXq2Me8OfDNxuGLAJnS+ xQBViWBNzwSxWS7BOWLcCRhAeNuU4f5Y4yA4X3LwH8YNflCKk/npum7uGr2XBYSR5bDQ mmcg== X-Gm-Message-State: AOAM533lL9yEcmzDLDu7szD3muQbgUGQ1OBJ517txWhUxfZJn26BlY59 7c0aaEz0lebtkbsPy+vcJB060RuxeYyKH6SH79OljIZ62gQu0ZOWDhKefoWB522yv6g61c0GHjx 3dPVzm+o9FAxbVVnG4aje2EPfavNUO55UZFuMnnspZQ== X-Received: by 2002:a17:906:1416:: with SMTP id p22mr22877881ejc.364.1628522591751; Mon, 09 Aug 2021 08:23:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQVzuT1YTCIJHG3KFApUGmMng4hmkI2/3QJSS8TrrmNOieu2LVdcIm01JVMO8WGfLfWsaHwQ== X-Received: by 2002:a17:906:1416:: with SMTP id p22mr22877857ejc.364.1628522591468; Mon, 09 Aug 2021 08:23:11 -0700 (PDT) Received: from gollum.fritz.box ([194.191.244.86]) by smtp.gmail.com with ESMTPSA id i11sm5960281ejx.82.2021.08.09.08.23.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 08:23:11 -0700 (PDT) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [I/linux][PATCH] UBUNTU: SAUCE: arm: Fix instruction set selection for GCC 11 Date: Mon, 9 Aug 2021 17:22:38 +0200 Message-Id: <20210809152238.712588-1-juergh@canonical.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1939308 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 which (in our case) is '--with-float=hard'? $ 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: /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 moving the option '-msoft-float' up before the 'arch-$(CONFIG_CPU_)' instruction selection macros. Signed-off-by: Juerg Haefliger Acked-by: Dimitri John Ledkov Acked-by: Kamal Mostafa --- arch/arm/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 415c3514573a..efa9518223b0 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__