Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3327182rwb; Mon, 3 Oct 2022 13:11:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6tTVZZfawd157PAQzFByFjWjccl4SPTNUjAPwelDuR74febORy+lTUuRc40RR+83mGtTFw X-Received: by 2002:a63:1455:0:b0:438:e26b:ab1f with SMTP id 21-20020a631455000000b00438e26bab1fmr19830968pgu.183.1664827884248; Mon, 03 Oct 2022 13:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664827884; cv=none; d=google.com; s=arc-20160816; b=sHaegM72ONQC7auyovghbmIiPUEj1vwjvVxBEBr4XWu17m1O78SudyFbAheswHmgDc zYMID1XKra1fspXjBDPTrKLarOBt1RPraovTWkUk2lOTAQqZQDL2SdbrpRN9uPE3QGLj MK9maN1ut2TVLx/I3xw5A2PBvnQ/2MSf2OWqbUcf3Y1ddwyDPDdYlBkkjdUbv5YCBNzX 0i0uQ4K5oRKE5ouAM+9omx6OnFAx8ABA+Jr1n7SMl91x9CSaYoqEzxwx1p+bPMkJJQQE YC9JuX5dWLiV/QOuNMDIpr9OIhZYk9w52J8AujyQILz2ZFN7K1RBG5B8Iskf5icFhT3Z 2SeA== 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=vAhCLUQ8hRBrc0E4T8s6DDj3rqzBI1hNa+kL73zRESE=; b=rZ7j8nU4U+dvkMirIsVtczu/TeZ5rzuJzTAx8dL96unipd5pPHp9oYYEUkRDssBoeI rkNT4oLx0rkxfu+9iVFa1rfxT+HOZABImEd9B9VwsACkdKYYjLjYDUTSERxyM3EE09EB LMx3xDqfdkuMEIR50Rc6Bp7h2OIQEYt6DYQnCqtOKUkuZ9jbOpv8NWR7wJDloNYYGSOd 1TltIuPLd9nrU7hGkPn2MJj0e7YnMXSvi/eK7fPlPF17unz5Y1QgXP59wEt8R9Fy/hfJ u/e9TUg8rCQcoXzVjmdATPLYxCBdWtXGdnrDJrfFU1TbLbyNz8+jy4GiIKmfGYiM6Apm 76Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ahabk80h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f27-20020a63511b000000b004391b0971acsi11751052pgb.100.2022.10.03.13.11.11; Mon, 03 Oct 2022 13:11:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ahabk80h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229511AbiJCTiT (ORCPT + 99 others); Mon, 3 Oct 2022 15:38:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbiJCTiR (ORCPT ); Mon, 3 Oct 2022 15:38:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73A8E2CC8E for ; Mon, 3 Oct 2022 12:38:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1C64A611D2 for ; Mon, 3 Oct 2022 19:38:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECBCBC433C1; Mon, 3 Oct 2022 19:38:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664825895; bh=Z5uRFsHl6SPKbk0/WGTwqQLIH025+FbP7BaJo03laec=; h=From:To:Cc:Subject:Date:From; b=Ahabk80hG2D2R9f3jEm/UZHLcrRNXrBBZXdf+xFbTH6bZjGb/MXoxQkRJUWJmyryI T0JWyTzP2ZAldRAEdGY+DmJ6LUPapLPOc5+fca2BY9Yzld1eI/4YtEX/AoGljmX+6I cMUvj9+GT++0vGpBXH+HEJDehY33Q3RGUalTld27L35hIbOxulRxdISRb/1yxJZ0JY JG3Hrmjj5ILE1/ivTOj73AUhmtx94MbAoJXfxegDX4l60eObWurL9Mb0jzX8EAEwQd 6kiUEz3j5rG5kTZrqhZWr9xIK0ONbcbj8gRjMKYUpmdhnLtRJqUSEqOFlTJDjzX5XH bA7SET2mtPPYA== From: Nathan Chancellor To: Catalin Marinas , Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor Subject: [PATCH -next] arm64: alternatives: Use vdso/bits.h instead of linux/bits.h Date: Mon, 3 Oct 2022 12:37:59 -0700 Message-Id: <20221003193759.1141709-1-nathan@kernel.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building with CONFIG_LTO after commit ba00c2a04fa5 ("arm64: fix the build with binutils 2.27"), the following build error occurs: In file included from arch/arm64/kernel/module-plts.c:6: In file included from include/linux/elf.h:6: In file included from arch/arm64/include/asm/elf.h:8: In file included from arch/arm64/include/asm/hwcap.h:9: In file included from arch/arm64/include/asm/cpufeature.h:9: In file included from arch/arm64/include/asm/alternative-macros.h:5: In file included from include/linux/bits.h:22: In file included from include/linux/build_bug.h:5: In file included from include/linux/compiler.h:248: In file included from arch/arm64/include/asm/rwonce.h:71: include/asm-generic/rwonce.h:67:9: error: expected string literal in 'asm' return __READ_ONCE(*(unsigned long *)addr); ^ arch/arm64/include/asm/rwonce.h:43:16: note: expanded from macro '__READ_ONCE' asm volatile(__LOAD_RCPC(b, %w0, %1) \ ^ arch/arm64/include/asm/rwonce.h:17:2: note: expanded from macro '__LOAD_RCPC' ALTERNATIVE( \ ^ Similar to the issue resolved by commit 0072dc1b53c3 ("arm64: avoid BUILD_BUG_ON() in alternative-macros"), there is a circular include dependency through when CONFIG_LTO is enabled due to appearing in the include chain before the contents of , which results in ALTERNATIVE() not getting expanded properly because it has not been defined yet. Avoid this issue by including , which includes the definition of the BIT() macro, instead of , as BIT() is the only macro from bits.h that is relevant to this header. Fixes: ba00c2a04fa5 ("arm64: fix the build with binutils 2.27") Link: https://github.com/ClangBuiltLinux/linux/issues/1728 Signed-off-by: Nathan Chancellor --- arch/arm64/include/asm/alternative-macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/alternative-macros.h b/arch/arm64/include/asm/alternative-macros.h index b5ac0b85c9bb..3622e9f4fb44 100644 --- a/arch/arm64/include/asm/alternative-macros.h +++ b/arch/arm64/include/asm/alternative-macros.h @@ -2,8 +2,8 @@ #ifndef __ASM_ALTERNATIVE_MACROS_H #define __ASM_ALTERNATIVE_MACROS_H -#include #include +#include #include #include base-commit: ba00c2a04fa5431d204a4183062b30372c062aa7 -- 2.37.3