Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp138585rdb; Tue, 5 Dec 2023 00:35:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHA3wez6m+O8Jn/pEUJfaWcQ5xIPO8Hw+mubKOKFX6WM0VE2gfQKrenG1yMEcVtYdaVoCt6 X-Received: by 2002:a05:6808:4447:b0:3b8:b063:6bbe with SMTP id ep7-20020a056808444700b003b8b0636bbemr6503913oib.109.1701765318117; Tue, 05 Dec 2023 00:35:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701765318; cv=none; d=google.com; s=arc-20160816; b=IF8DOkpr+CbEXHXxjZELkTZUlXwdPSeLzayUG8nuqk0Jd8ARRty2d2JTQQdsLLG8XB dgmbo+gCcka1fefReYUC3UYRm+wPvUAjyTuILc4+hKioMObskIspQruh8h645U0uOzRN YRuExJV1PfslzSNyntaqvr5EYHcq3141hOsruVL8lkKSYmFrgngmmqQW9/RU+35IXRxW gofYBfwOYqIsTilHCPOKJ+6B9HMeBAqJRFdgFxtTz/CBGwuWluFSU6E15wm9PHQlD0E7 Yz/ISB5RKT47lYWPjcyDfxrMOLuWIJgu8k0Ve4AE/i1CSPhumbfjsJ36FVNiKVxgb8/W QzgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=NuG/6/Yb8lCUL8zFD4dfH32Me2vLPL01Z8/hfRvZ+5Q=; fh=vQaRzZWP3ZVrKl73jr72U1CkfJKgEXSToFjvKKu6vCs=; b=o5o354p8RDHzm8eQZ5IFdm63i/iPTQSO8euuNxJMR2n0vwE5DGA1LCOoX7orRFO+qj GabgIvBH5P4rV1Ccy50CVfOPcavI16EjKpChflUrZFFJwAqUdrEEHPNfCzOvJh1HZhp+ 8SdNSViwsGw9cGIPacj01QLueuL16L9TFyqNt4/5ijQt8zAalX/LprbxzLhUwm300iki fRea3JcFa4GE1PLf7/GMpxNvzLN6UxD2oJIdpz8ijUgTurZkawzkEaiDPN2UV8vAC3Ng 4Gwks1XkO+UtmMfEaeDuB/qf7frYn6/sXLWLvav52gPrU9tdYRPgjvXTgDG3PXizKwUD K6XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=zbNV8n7F; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=cu6M4cDD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id b15-20020a056a000a8f00b006cde67e5101si9563492pfl.55.2023.12.05.00.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 00:35:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=zbNV8n7F; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=cu6M4cDD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id B563B802138E; Mon, 4 Dec 2023 22:35:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344390AbjLEGfC (ORCPT + 99 others); Tue, 5 Dec 2023 01:35:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344386AbjLEGfA (ORCPT ); Tue, 5 Dec 2023 01:35:00 -0500 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA64E130 for ; Mon, 4 Dec 2023 22:35:05 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id B93893200A39; Tue, 5 Dec 2023 01:35:01 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Tue, 05 Dec 2023 01:35:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1701758101; x=1701844501; bh=Nu G/6/Yb8lCUL8zFD4dfH32Me2vLPL01Z8/hfRvZ+5Q=; b=zbNV8n7Fo/M7Fhfb9S /Zj0Pybk3s74kElk47wi1vWdwOGJECAbQh/Dw9IkxaX05aBnAURLkDpMRjxZwn76 eYX++Ae6lxX2p6zghqBIgnBkn8+KcdJ56QtYRcglV2zxKBR+OX/vnDIkaghnz+3A MK3rb/kOyKZf1sEav96h0WowCLaOHWfIxIsvWuhFU8l4MOR5rix08RvOQmoqrT/6 TJbXVTwgpBj5/7h+tctjongW9UTMpjFO/Yfm++6ZDRDY2geWNJKvi60BRFZteQSr lN3zHgB6k7yILkROoJ717qoojsFm5T5jjderNZQlmx3A/U7RHWbdVS8hS3zsXKRb +jSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1701758101; x=1701844501; bh=NuG/6/Yb8lCUL 8zFD4dfH32Me2vLPL01Z8/hfRvZ+5Q=; b=cu6M4cDDuig0gcodZ84Nr8YBHIk/e ZdPv4PBhc3A2hKmkT6JlNd1XTuNDwvf3AzavlzwRd5g3mWsApH/0PBnUkaEp9ESb a6FRmjCHqbosnpCh+UXPo5atyselG3EC/BLhaimiHjtcJVP3daCBt5+4HID0gRLc tq5i4IckvVx6UPwDZiSCYPu/TSHIX6ptV46ognEnUsC1OWKLk48eUa14iz2yEke9 BWbuZRrOSxbeSuhlQMk2Xtd2Xv6lo90BtxHh91ojV6WB9HbzVqHWh3wUudkDextN HM2cyvKrL20Js8s0HAoE+JofceHmqe1DBe0ijKfMzndaDWZibBw7+AUHA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudejjedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E03AAB60089; Tue, 5 Dec 2023 01:35:00 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1178-geeaf0069a7-fm-20231114.001-geeaf0069 MIME-Version: 1.0 Message-Id: <36a25113-731c-4b28-a695-f3fbb0996d6e@app.fastmail.com> In-Reply-To: <20231204223317.GA2053629@dev-arch.thelio-3990X> References: <20231204181304.GA2043538@dev-arch.thelio-3990X> <20231204223317.GA2053629@dev-arch.thelio-3990X> Date: Tue, 05 Dec 2023 07:34:40 +0100 From: "Arnd Bergmann" To: "Nathan Chancellor" , "Naresh Kamboju" Cc: clang-built-linux , "Linux ARM" , "open list" , "Linux Regressions" , lkft-triage@lists.linaro.org, "Russell King" , "Nick Desaulniers" , "Sylvestre Ledru" Subject: Re: clang-nightly: vdso/compat_gettimeofday.h:152:15: error: instruction variant requires ARMv6 or later Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 04 Dec 2023 22:35:16 -0800 (PST) On Mon, Dec 4, 2023, at 23:33, Nathan Chancellor wrote: > On Mon, Dec 04, 2023 at 11:13:04AM -0700, Nathan Chancellor wrote: > >> I am still investigating into what (if anything) can be done to resolve >> this on the kernel side. We could potentially revert commit >> ddc72c9659b5 ("kbuild: clang: do not use CROSS_COMPILE for target >> triple") but I am not sure that will save us from that change, as >> tuxmake's CROSS_COMPILE=arm-linux-gnueabihf will cause us to have an >> armv7 CPU even though we may not be building for armv7. > > Okay, this is a pretty awful situation the more I look into it :( > > The arm64 compat vDSO build is easy enough to fix because we require use > of the integrated assembler, which means we can add '-mcpu=generic' (the > default in LLVM for those files based on my debugging) to those files > and be done with it: > > diff --git a/arch/arm64/kernel/vdso32/Makefile > b/arch/arm64/kernel/vdso32/Makefile > index 1f911a76c5af..5f5cb722cfc2 100644 > --- a/arch/arm64/kernel/vdso32/Makefile > +++ b/arch/arm64/kernel/vdso32/Makefile > @@ -9,6 +9,10 @@ include $(srctree)/lib/vdso/Makefile > ifeq ($(CONFIG_CC_IS_CLANG), y) > CC_COMPAT ?= $(CC) > CC_COMPAT += --target=arm-linux-gnueabi > +# Some distributions (such as Debian) change the default CPU for the > +# arm-linux-gnueabi target triple, which can break the build. > Explicitly set > +# the CPU to generic, which is the default for Linux in LLVM. > +CC_COMPAT += -mcpu=generic > else > CC_COMPAT ?= $(CROSS_COMPILE_COMPAT)gcc > endif I'm still trying to follow what is actually going on. I see that we pass VDSO_CAFLAGS += -march=armv8-a which is meant to tell the compiler that we want it to use ARMv8 compatible instructions. Is the problem that clang ignores this flag, or do we not pass it correctly? I would have expected -march=armv8-a to be better than -mcpu=generic here, as it allows the compiler to use a wider set of instructions that is still guaranteed to be available on everything it will run on. > Sylvestre, I strongly believe you should consider reverting that change > or give us some compiler flag that allows us to fallback to upstream > LLVM's default CPU selection logic. I think that hardcoding Debian's > architecture defintions based on the target triple into the compiler > could cause issues for other projects as well. For example, > '--target=arm-linux-gnueabi -march=armv7-a' won't actually target ARMv7: > > $ echo 'int main(void) { asm("dsb"); return 0; }' | \ > clang --target=arm-linux-gnueabi -march=armv7-a \ > -x c -c -o /dev/null -v - > ... > "/usr/bin/clang-17" -cc1 -triple armv7-unknown-linux-gnueabi ... > ... > > vs. > > $ echo 'int main(void) { asm("dsb"); return 0; }' | \ > clang --target=arm-linux-gnueabi -march=armv7-a \ > -x c -c -o /dev/null -v - > ... > "/bin/clang-18" -cc1 -triple armv5e-unknown-linux-gnueabi ... > ... Right, the kernel definitely relies on -march= taking precedence over the default CPU, the same way that we tell the compiler to pick a non-default endianess or ABI. Arnd