From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.itouring.de (mail.itouring.de [85.10.202.141]) (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 C9F31225A5B; Fri, 2 May 2025 09:53:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.10.202.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746179620; cv=none; b=JJ8odLwWneQWDQydK6zsvDCEdXX013lKDe+WITFwMFfcsWvf4j/lHb/IoobRHz97gKJf8GEQVtQuVJ/520ZLEN4C6BQJHAvNnMYVlzbdzPUsJl9+Q4ScQ++HQ4nplgzCi5VR4amp2R4GH3upZW29Dyo+vn3pFSyRnBEy7aXHnfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746179620; c=relaxed/simple; bh=JHMMMU1bX3h8bu/hi6tQeKJ8hxcjwpsysQUN8R7ylWc=; h=Subject:To:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=ZVn13RYlizyRVtaq+dBCOgJ2xud4/173Gp3ppwPd4BVeCb90JrzxRHij8m5V0OMRhDuxtNkLhc5uIKirWFaOnFHJimd7K2FiWHzKPYPQPej3iW1gaJEwX0ufapzWdGafhtOiOY0hLV71rM9/DrpHs3yK7EOlrlJjRwhzWT+kiKE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=applied-asynchrony.com; spf=pass smtp.mailfrom=applied-asynchrony.com; arc=none smtp.client-ip=85.10.202.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=applied-asynchrony.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=applied-asynchrony.com Received: from tux.applied-asynchrony.com (p5b07e9b7.dip0.t-ipconnect.de [91.7.233.183]) by mail.itouring.de (Postfix) with ESMTPSA id 909E8103765; Fri, 02 May 2025 11:53:35 +0200 (CEST) Received: from [192.168.100.223] (ragnarok.applied-asynchrony.com [192.168.100.223]) by tux.applied-asynchrony.com (Postfix) with ESMTP id 61134601893B6; Fri, 02 May 2025 11:53:35 +0200 (CEST) Subject: Re: [PATCH] bpftool: build bpf bits with -std=gnu11 To: Quentin Monnet , 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-kernel@vger.kernel.org References: <20250502085710.3980-1-holger@applied-asynchrony.com> <7326223e-0cb9-4d22-872f-cbf1ff42227d@kernel.org> From: =?UTF-8?Q?Holger_Hoffst=c3=a4tte?= Organization: Applied Asynchrony, Inc. Message-ID: <913f66a8-6745-0e30-b5b8-96d23bf05b90@applied-asynchrony.com> Date: Fri, 2 May 2025 11:53:35 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <7326223e-0cb9-4d22-872f-cbf1ff42227d@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit On 2025-05-02 11:26, Quentin Monnet wrote: > On 02/05/2025 09:57, Holger Hoffstätte wrote: >> A gcc-15-based bpf toolchain defaults to C23 and fails to compile various >> kernel headers due to their use of a custom 'bool' type. >> Explicitly using -std=gnu11 works with both clang and bpf-toolchain. >> >> Signed-off-by: Holger Hoffstätte > > Thanks! I tested that it still works with clang. > > Acked-by: Quentin Monnet Thanks! > I didn't manage to compile with gcc, though. I tried with gcc 15.1.1 but > option '--target=bpf' is apparently unrecognised by the gcc version on > my setup. > > Out of curiosity, how did you build using gcc for the skeleton? Was it > enough to run "CLANG=gcc make"? Does it pass the clang-bpf-co-re build > probe successfully? I'm on Gentoo where we have a gcc-14/15 based "bpf-toolchain" package, which is just gcc configured & packaged for the bpf target. Our bpftool package can be built with clang (default) or without, in which case it depend on the bpf-toolchain. The idea is to gradually allow bpf/xdp tooling to build/run without requiring clang. The --target definition is conditional and removed when not using clang: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-util/bpftool/bpftool-7.5.0.ebuild?id=bf70fbf7b0dc97fbc97af579954ea81a8df36113#n94 The bug for building with the new gcc-15 based toolchain where this patch originated is here: https://bugs.gentoo.org/955156 Hope this helps! cheers Holger