From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68F923C5DA8; Fri, 13 Mar 2026 16:24:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773419076; cv=none; b=FF/dGDLrvKi0/DJ5eJ2Nb3Ue0ChCh4J4Wc8RGABbRscxe6uPCibczPz6kT/EkWqCjmyLAW2OoTSYHKgkvdntpx4JrbsIVjjwut35C6Bka8Zto/NeEQ9oabLZZufbBydCtH41/tVEiHN/+QxPVDGRRW+AF7r1wwMaK6vAvQP3xUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773419076; c=relaxed/simple; bh=ZoX97Hc2cK3IVDnJOkD+OkVB773v7eoLiEHIgnkqf+U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aKTdfwAueq6ZZcgUE5AoN5nJCjUXcbk7Srv+9VTxoRsY8v6NLANW0jglqf1gbvLP25LqOeg5FG4+WDLLRJp8Nx9QsPEyChbW8ckdYxghS3fe8T9cB44KBtyXCbcPHWR/RBzw6AbhXnYEtQmwkMHGvfPTm5MhUfZBAEPzJfXzEZE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 9629E1E7D; Fri, 13 Mar 2026 09:24:26 -0700 (PDT) Received: from localhost (e132581.arm.com [10.1.196.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 599123F7BD; Fri, 13 Mar 2026 09:24:32 -0700 (PDT) Date: Fri, 13 Mar 2026 16:24:30 +0000 From: Leo Yan To: Quentin Monnet Cc: Ian Rogers , Arnaldo Carvalho de Melo , Namhyung Kim , James Clark , Kees Cook , Nathan Chancellor , Nicolas Schier , Nick Desaulniers , Bill Wendling , Justin Stitt , 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 , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Adrian Hunter , Masami Hiramatsu , William Breathitt Gray , Barry Song , Qinxin Xia , Bartosz Golaszewski , Kent Gibson , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Andrew Morton , Willy Tarreau , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Josh Poimboeuf , Robert Moore , Len Brown , Srinivas Pandruvada , Tejun Heo , David Vernet , Andrea Righi , Changwoo Min , Mark Brown , Steven Rostedt , Gabriele Monaco , Shuah Khan , Jiri Kosina , Benjamin Tissoires , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH v4 05/30] bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS Message-ID: <20260313162430.GR4153946@e132581.arm.com> References: <20260311-tools_build_fix_zero_init-v4-0-9e35bdb99cb3@arm.com> <20260311-tools_build_fix_zero_init-v4-5-9e35bdb99cb3@arm.com> <20260313155600.GP4153946@e132581.arm.com> Precedence: bulk X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Mar 13, 2026 at 04:07:27PM +0000, Quentin Monnet wrote: [...] > >>> + > >>> +# This must be done before appending EXTRA_CFLAGS to CFLAGS to avoid > >>> +# including flags that are not applicable to the host compiler. > >>> +HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\ > >>> + $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS))) > >>> + > >>> ifneq ($(EXTRA_CFLAGS),) > >>> CFLAGS += $(EXTRA_CFLAGS) > >>> endif > >>> @@ -88,8 +94,6 @@ ifneq ($(EXTRA_LDFLAGS),) > >>> LDFLAGS += $(EXTRA_LDFLAGS) > >>> endif > >>> > >>> -HOST_CFLAGS := $(subst -I$(LIBBPF_INCLUDE),-I$(LIBBPF_BOOTSTRAP_INCLUDE),\ > >>> - $(subst $(CLANG_CROSS_FLAGS),,$(CFLAGS))) > >>> HOST_LDFLAGS := $(LDFLAGS) > >> > >> Should HOST_LDFLAGS be similarly moved? Otherwise, it seems target > >> flags in EXTRA_LDFLAGS will be added for the host. > > > > Though this series is irrelevant to LDFLAGS, I am fine to move > > HOST_LDFLAGS together. > > > If we move the HOST_LDFLAGS earlier so that they no longer receive the > EXTRA_LDFLAGS, then we lose the possibility to use any EXTRA variable to > pass additional flags to HOST_LDFLAGS. So OK to move, but maybe add a > "HOST_LDFLAGS += $(HOST_EXTRALDFLAGS)" to it for consistency with the > processing of HOST_CFLAGS? Adding HOST_EXTRALDFLAGS seems a bit over designed to me, as there is no use case for it currently. To avoid complexity, let's keep this patch as it is, we can add HOST_EXTRALDFLAGS if later have requirement. P.s. I saw that you already replied the same comment in the previous version. I should have confirmed at that time, sorry for the duplicate discussion.