From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64867C4345F for ; Wed, 17 Apr 2024 15:11:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1E1A6B0093; Wed, 17 Apr 2024 11:11:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DA44F6B0095; Wed, 17 Apr 2024 11:11:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C6C946B0098; Wed, 17 Apr 2024 11:11:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A6F196B0093 for ; Wed, 17 Apr 2024 11:11:15 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 75538A0ECE for ; Wed, 17 Apr 2024 15:11:15 +0000 (UTC) X-FDA: 82019362110.07.B522805 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf24.hostedemail.com (Postfix) with ESMTP id 68343180021 for ; Wed, 17 Apr 2024 15:11:13 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf24.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713366673; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YyaWaneRPA80B8qg5FgrXlZK8mif1gf7zcikJFtMJKM=; b=5M3I3vF6TQvypCEhNmqzQCTQq+wOmPP4i+gmUjaeXeJqDip7V8amAlBU0AUeMRgbFQ+v18 +lXUuTUCRz+oLgtuK2Ej8MvpBZNtza/Sjj/xpb2Cg4/KLDdTgZMPZTUOlIa/mpmDQVAUAU ErsnaI98xf13E4dlhk5nUW/oQ/RgIq0= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf24.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713366673; a=rsa-sha256; cv=none; b=TDremW6xpwEs2PkykfGoeEl3zFtPDOyb1oAhH7phylnMCcEkf3dpgS9/6BoDjro9RqTH4d pdkx7xI5VPu6QkIBreJ5pAyVb5N3OHbKrP5gP2BKxd6YFfgBwsAhz9qOUmrNbRr9EaNhrC PUNd4nWNNlFBCyiA3w7CWzfkB3xbUsk= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4679B2F; Wed, 17 Apr 2024 08:11:40 -0700 (PDT) Received: from [10.1.37.181] (XHFQ2J9959.cambridge.arm.com [10.1.37.181]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 66D213F738; Wed, 17 Apr 2024 08:11:11 -0700 (PDT) Message-ID: <1f384d41-4c65-4efb-a171-26b54dacfb30@arm.com> Date: Wed, 17 Apr 2024 16:11:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: clang: error: unknown argument '-static-libasan'; did you mean '-static-libsan'? Content-Language: en-GB To: Arnd Bergmann , kernel test robot Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Andrew Morton , llvm@lists.linux.dev, Linux Memory Management List References: <202404141807.LgsqXPY5-lkp@intel.com> <31b4e05d-62c6-44cd-8038-7ac8d21320c3@arm.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 68343180021 X-Stat-Signature: p4nejnaxioi437gh9bq7uhig8x5wmj5g X-HE-Tag: 1713366673-181328 X-HE-Meta: U2FsdGVkX1/5lOK0jE5C5KBs8BXAOBBmyJMgkLfTaVQjIMxmzh7xfTIhr0+M1D7VpB3MKM+2/judcaRLh2sP75B62uoJfcR7mmbak/eZbAPnHSmAqdItajhuWYox5mX/yzdiaco068D+QmboiJpY6y9hxqfO8tVpnQYe6EpKj2L3SuiZ/FO8t8Q7JsSr/UbcEdqM00yLyRiZS9zu7UaXQ8u1BK4T0iXHB8DqTEkNRNZgQq4lkYK1HDZ4ljTi0SS6h6Pr03q2GkBAC44aXdgAm6XI1G81NDtrLmKc1tdWJiD37sqOMXxPYr0kgRpL/LgLPuuieS4kaKykIXblLM78qL9+qwLlhDwUsqFGGQy4OOF9MhpU4AgLAGYZglDKGn5xr6PLh+U4QVG/r6E0ceGTr7U0UgNVIDsWgmli2F/UW3SFAKEMEjwEpowfep2xNhM3UxoWdD85xS1I2tznOpuQXtx9Azaf20di4wCN7grxwW8AbltRXOxtHAIN4qIMLunOMqlpdG1foMJi0yvI1oJyvRsmxGAmGKmj9j1kRI5Z0QsdGi+U63MK5FUvTNUTWIX39VYeRei15Pv9XIK7tXoMrmU+yXpLGjq5JeKXxNGnfG/vQglc0jv8WmhfDRP69+OZ7OGxjEOc/cxwwAN0rQIYs1Wk2+h1k1MDX9HKJAbry6HP0INHguoYRvNbGtnmCQiCrq6sjslQgl6qHD1zURpe6CknUIyuO45KC/ptK3Upn6RRMBr8CZHLbTL6W7forlS4ectTXWKc5yn+LChfd4TNvbjZ2119pSeL7DOWPeaPt7MXsGnI8qmao6qdqT2xHWsDXqmEz1frIUBfUjkZclRAPFB4wzKT1e3SawrIRj4A7LqywCTI/LELj7i2gHH2/dwAEm/nhPc1w8sp/4Cz1YbSeb13KNepp2wQWNRO69LHIO9zcJrI0FdYdTtFUirS0ElpH7xEWgQihEX8EZ5ueEq PAqhg+Ux NFALQgFyfrT3sH+HfgWElRK9QbMqzofd+LgcrBsK95nKkPLlkDV4vT0XE/BJUlQ/IzUFW4sdxBUsg1P2Ht8ydhWnMhoMDuD8Cb3fHBf+x+hBcGfNDYbWxM+rMh8m2ptMz7n4V+3A9lzoFAjnSEseebNJD5BoRsVm8RP3HNCeEwpKoEG9U2aro+FK9OqMdM0dpij6/I09jBim1IPWPnwD43/VA+OCIT4wRIECfnqOXSm9jbFCjGgC+fZVT2Qpi7gcz0D1Gc0U9VzbglV+wEylXI+4ZvRnZo32Xly3O4NrbJ7xIMB4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 16/04/2024 15:42, Arnd Bergmann wrote: > On Tue, Apr 16, 2024, at 16:33, Ryan Roberts wrote: >> On 16/04/2024 08:42, kernel test robot wrote: >>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>> head: 7efd0a74039fb6b584be2cb91c1d0ef0bd796ee1 >>> commit: c652df8a4a9d7853fa1100b244024fd6f1a9c18a selftests: link libasan statically for tests with -fsanitize=address >>> compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) >>> >>> If you fix the issue in a separate patch/commit (i.e. not just a new version of >>> the same patch/commit), kindly add following tags >>> | Reported-by: kernel test robot >>> | Closes: https://lore.kernel.org/r/202404141807.LgsqXPY5-lkp@intel.com/ >>> >>> All errors (new ones prefixed by >>): >>> >>> # tools/testing/selftests/fchmodat2$ make CC=clang >>> clang -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan -isystem usr/include fchmodat2_test.c -o tools/testing/selftests/fchmodat2/fchmodat2_test >>> clang: error: unknown argument '-static-libasan'; did you mean '-static-libsan'? >>> make: *** [../lib.mk:181: tools/testing/selftests/fchmodat2/fchmodat2_test] Error 1 >>> >>> # tools/testing/selftests/openat2$ make CC=clang >>> clang -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan openat2_test.c helpers.c helpers.h -o tools/testing/selftests/openat2/openat2_test >>> clang: error: unknown argument '-static-libasan'; did you mean '-static-libsan'? >>> clang: error: cannot specify -o when generating multiple output files >>> make: *** [../lib.mk:181: tools/testing/selftests/openat2/openat2_test] Error 1 >>> >> >> Hi Arnd, >> >> This change went in quite a while ago and is on;y just blowing up. I saw your >> comment in another thread [1] that Andrew merged your change to set -Wextra. >> Perhaps that's what has caused this to show up only now? *although I don't >> actually see -Wextra in the command line). >> >> I guess the problem is that `-static-libasan` is only supported by gcc. But I'm >> Makefile-illiterate. Can anyone advise on what's the best way to make this >> argument gcc-only? > > Thanks for letting me know about the problem, I had indeed missed > build-testing any of tools/testing, so this might not be > the only problem there. > > I'm not entirely sure how much of the Kbuild infrastructure we > can rely on here. If the .config file gets included, this should > work: Thanks for the pointers. Unfortunately neither don't works as we don't have any of the Kbuild infrastructure. I'm not really sure what to do here. The best I've come up with so far is to just remove asan from these binaries. They are pretty simple selftests. I'm not sure its adding a whole lot of value anyway. Does anyone have any advice? > > --- a/tools/testing/selftests/fchmodat2/Makefile > +++ b/tools/testing/selftests/fchmodat2/Makefile > @@ -1,6 +1,12 @@ > # SPDX-License-Identifier: GPL-2.0-or-later > > -CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan $(KHDR_INCLUDES) > +CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined $(KHDR_INCLUDES) > +ifdef CONFIG_CC_IS_GCC > +CFLAGS += -static-libasan > +else > +CFLAGS += -static-libsan > +endif > + > TEST_GEN_PROGS := fchmodat2_test > > include ../lib.mk > > Alternatively, if the cc-option macro is available, you could > try this one > > CFLAGS += $(call cc-option, -static-libasan) $(call cc-option, -static-libsan) > > Arnd