Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1079278lqh; Sun, 5 May 2024 15:36:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUjt/bjdt0RgvTCxnuJHKmPvvXyan37oXNy2rUZvemtwyfSoml7Z6Y5oeWvuV6Z83EjhnsMb1FFnMAiwqWB2QG2wI5+SX9ek8GipcqlQg== X-Google-Smtp-Source: AGHT+IGWHNwAqCe6EMnSYw/PfliE8F7kOW618KvUb6tHZ0SmHt+l/dI9ia5xXRgXBjj2OIfw/YHY X-Received: by 2002:a17:903:2308:b0:1e4:c75e:aae2 with SMTP id d8-20020a170903230800b001e4c75eaae2mr13032351plh.59.1714948592961; Sun, 05 May 2024 15:36:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714948592; cv=pass; d=google.com; s=arc-20160816; b=VFb7PA2QHBdfTFReuPIL+nvoeRDM0wsf6fcfEdNbTzD0EgGSuqNpnk7g7GA4o0BjdF +VMF23G2z4GD0pHqQjl6yH+tv5K8LeSoZ3++B9upcLXvwn81d7q7QXwh591LrhlKB/TZ FfqbSK8f+nTW6GLJtXYD8+64a7t2bvsUlsaT3UZcoY0vssB0qO7xBrucj8hy0uvs3Yz8 neqJGkuPcOH2ssIIMSJYmJM9D2z1UenhSoLABBu99UFzNkS2nyztCD/sInAvGej6DnAO sFB35yKptVfbm5lUytGEyTzkOh9qOrcFcibmlogig5Dhib/h4s0W8rpJfJHhPl9NybQd M/ZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=UDfHgKH7ibLzm7oFWgEzPw6RAhJEpu3hHeujVOt/ioE=; fh=AqQwPn1t9ju9TyWpGV0lZMHMyxowQh5KL4ZjMU/J448=; b=nQfXm2YzqzFLb8pwHlbNSRZwfapyneQvJA64YDl21u+4e6YzrdN18b8RNQWwAXwb8m B1C2T6OT9On0GizmDzmraceQ5hJs09v1bHd/VoBawJ5/PS0RwM5+VcAM/BGDWBDlZIKD o6Cg9bRIJp/FnJZikiDnX40EerIOpPVU9YhQr/MLUi8jxxP0Yb8/0gPwQDurTZL5YrB1 KFay/RUxbbI2ncG8dd+d4/j5Qk09NI4wkyctiRFOgoWZ4FOqLBpwgAhxHerDjvwSAXdy 0AEW8CLBkfLvYg1RWjUMItYdPJIUu2nRGO9v52l0xSVpzAboeShTGefn6RAA6T4mK/Dn 7Ntg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bkZzbUlR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169185-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l15-20020a170903120f00b001eb0eb07841si5883114plh.203.2024.05.05.15.36.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 15:36:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bkZzbUlR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169185-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8E3432811C4 for ; Sun, 5 May 2024 22:36:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EF44140361; Sun, 5 May 2024 22:36:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bkZzbUlR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9162B757E0; Sun, 5 May 2024 22:36:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714948582; cv=none; b=s0tCDHRn+YSTeIw/yv2CzuSXlivFKFo/RBGoF8yeDqpnwuwPMSqHfQN8HWkCz7GMldNjp5e/r9d+DEoWs5qO0RlNSlYMV9oCaQgJzd8yB+vd3XvUbOEqzJWYovpxiMWJQGRpijS5RYb7cfPSwlwe46CWSDjrRkHAJJHIql2Xz84= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714948582; c=relaxed/simple; bh=6DdcTaAGg/9kv6PU0U5dfTC1o4/Oa9oCpynq/HkvFyg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MdwboIfGaKubT9LqCev3OrsWh8AMm9UaR4m+12L2sNwfu5ZfwQViQkp9RSI5DGci4oRfE8YZWI5BtkLcoolekGWA3Sl60Nv10xYsWG5MRN+aDJoOLnaVZmgx9ZkcUyTk8UZv9jCP76mvqfLJBwLJ/qk/XH22kaCrx+WksKm8N7A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bkZzbUlR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 502F4C113CC; Sun, 5 May 2024 22:36:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714948582; bh=6DdcTaAGg/9kv6PU0U5dfTC1o4/Oa9oCpynq/HkvFyg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bkZzbUlR5RiWYKmj0+xKiIBrCK6V2XGHNdOfsQMdc7kC5oIk9ujoB87YNhvkJN1UF JcfJJ3MTUi0+GI8SZ1NIjNoJmCSwTiOl+/H69DHkXDeuU1GeolP/qIal/UgOBagwT/ Tk49pP7TLrNccuT1KdQp5mjeg4Ds7VTS9ESjxQZkC2/AoNjJOoMER7RyQgov8hEorC WrIPwjlrRXc/tqBVezQGmPp6meCil7wpvacxv6f7YJMAqQLiRgLnwOywCY79fejLLD vZ3OFwLCPseKuBUDjUcSFYUwCv58YzIwnSwkANcjvTqwCOxXo1uHjO1197ooL6HjP3 ErQiXXbMyXlrg== Message-ID: <4f947691-bf25-460b-bc08-da29de3fdaa6@kernel.org> Date: Sun, 5 May 2024 23:36:14 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH] bpftool, selftests/hid/bpf: fix 29 clang warnings To: John Hubbard , Shuah Khan Cc: Jiri Kosina , Benjamin Tissoires , Justin Stitt , Peter Hutterer , Jason Gerecke , Joshua Dickens , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org, linux-input@vger.kernel.org, Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev References: <20240505215636.63592-1-jhubbard@nvidia.com> From: Quentin Monnet Content-Language: en-GB In-Reply-To: <20240505215636.63592-1-jhubbard@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 05/05/2024 22:56, John Hubbard wrote: > When building either tools/bpf/bpftool, or tools/testing/selftests/hid, > (the same Makefile is used for these), clang generates many instances of > a warning that is useless here: > > "clang: warning: -lLLVM-17: 'linker' input unused" > > Silence this in both locations, by disabling that warning when building > with clang. > > Signed-off-by: John Hubbard > --- > tools/bpf/bpftool/Makefile | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile > index e9154ace80ff..c7457921d136 100644 > --- a/tools/bpf/bpftool/Makefile > +++ b/tools/bpf/bpftool/Makefile > @@ -133,6 +133,10 @@ CFLAGS += -DUSE_LIBCAP > LIBS += -lcap > endif > > +ifneq ($(LLVM),) > + CFLAGS += -Wno-unused-command-line-argument > +endif Thanks! If possible, I'd rather keep the warning enabled, and fix the command line instead. Looking at the error and the Makefile, we may not need the -lLLVM in the CFLAGS at all, but only in $(LIBS). On my setup, I can build successfully, without the warnings, with the following patch: ------ diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index b67454b45a49..dfa4f1bebbb3 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -147,7 +147,7 @@ ifeq ($(feature-llvm),1) # If LLVM is available, use it for JIT disassembly CFLAGS += -DHAVE_LLVM_SUPPORT LLVM_CONFIG_LIB_COMPONENTS := mcdisassembler all-targets - CFLAGS += $(shell $(LLVM_CONFIG) --cflags --libs $(LLVM_CONFIG_LIB_COMPONENTS)) + CFLAGS += $(shell $(LLVM_CONFIG) --cflags) LIBS += $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS)) ifeq ($(shell $(LLVM_CONFIG) --shared-mode),static) LIBS += $(shell $(LLVM_CONFIG) --system-libs $(LLVM_CONFIG_LIB_COMPONENTS)) ------ Could you please check whether that works on your side, too? Quentin