Received: by 2002:ab2:5d18:0:b0:1ef:7a0f:c32d with SMTP id j24csp428629lqk; Sat, 9 Mar 2024 18:06:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWULaLc+KLOtdLNkkOgHogHUQCxVVES6Ai+5mQ7eaYaurH9kEqiVtP9vzW5c/OFhvCw40subMzPKZYY9GcU6xrO/E9nANwblwdkSwxwBQ== X-Google-Smtp-Source: AGHT+IFTGVV4XGFRyMOGof9GTp8BXBstQFYYNssJ8VFJFjd6LJJw3pHJnxdXYKmcxPz+NF38oSAu X-Received: by 2002:a05:6a21:99a1:b0:1a1:4a4c:9f5e with SMTP id ve33-20020a056a2199a100b001a14a4c9f5emr1813673pzb.49.1710036396390; Sat, 09 Mar 2024 18:06:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1710036396; cv=pass; d=google.com; s=arc-20160816; b=odOKwgG4VEbtEa9YykRsZIovwik0n4K28lqPm8em5EsNbrgwo2wF8NEQWsfwISmOvF jH2f8H4WJAvT6x5J/WP74hP3SyBCODqzSnSjH/t0Jm0TtMlBwvmcP93CTwWFtrmry6uM UqEsNyiOyF1jadxElyz4UkHHjggFRS9ajVjqRQv3TA4TxsBkCAyXzukmC8gT8Xi7UPA4 8NM6LCJOYG1ttp5uk9QNJ7aCu+s7JmUF41b4+qp6xbj2FQgGByW1lXC8nKP8kjD2HyNw kG2wmeN8lokHxpxeTWkVcn3c3OUrtxUD5yo87/8OtHEnIza5K38PgEJD+DfJFhdy6EVu q1pA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=T7XIYLAkcLSrj5FLrGjKI8q+UW4mZzYyudvGuQ4/TZo=; fh=9x13rz62k+yLeVfYD0o/WsWgbF6fEquG8dyjUREREvA=; b=A0VSeyGgjUDlS46dm06M+z9Gl8fFaW4pQaQIWMeFA4/9HDxviDEsqNv16j7V/20n01 Dpthv4gNcGrDbF94obPNeZELWoOBiSe/WEF6wzWLHFL+VZ1zQMez31nC4H2SZbHhIc8Q 3nBusZBjSJkiA4TdMHJ6qANkq8dFaGiveaA5j1axcB3joKAZhwu08++JnX/DM4Kwg10T Y7eqrJ4F/7AKow/lIULUrzQA0dPOeqmrkA+2m77IFtPivNHduknAG7E9OF4CTIGQmp/P xZhMBmZ2qiv4rb8WGHhe4JmCIIy1G2yqpzOSN7VXAeLPB2tlEhftfC5YpJ82ZmjX8O8R eS+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kMIRydFx; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-98087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i68-20020a639d47000000b005dc4b0e5f57si2364618pgd.804.2024.03.09.18.06.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 18:06:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98087-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=@google.com header.s=20230601 header.b=kMIRydFx; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-98087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 1054D281463 for ; Sun, 10 Mar 2024 02:06:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00CBA8F5F; Sun, 10 Mar 2024 02:05:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="kMIRydFx" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41392525B for ; Sun, 10 Mar 2024 02:05:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710036339; cv=none; b=DFNr8G6h8kcGb/3fV92FXonG2AsN2RmmTPY0Ne3bkHb2fmKOYQZPJcoZFTt69FrMYEX/f5+K6rFsexMw517y22LAHZ9LX/XHfhyZNAkqD6pddbGGFTdNrgh/v0OuCUmi6636nXN2+2CIoyhvJQMARtTdSfqlYbcGy7XZ4I/u60s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710036339; c=relaxed/simple; bh=D2uX+Mnk+6vztSUZd5hP00XWtGAz0CoTxvXAkzGNj1I=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=kAJ+vBJXxIkC9AtljqsX5vcI15/yVrPb8W6L3sK8jMSb/Xsn83lAo7mKo4Wyz+UuA7+QgcwF/glSUTzrazL2v+RTMjWy8AusJ32Lz4yM8nSK3LFJq8qwpzGRfE0wduIC8QrNIaStlkfldTRz2676R+cLi1gMNVsQp/sgUCUDnsA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=kMIRydFx; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-60a2386e932so7272847b3.1 for ; Sat, 09 Mar 2024 18:05:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710036336; x=1710641136; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=T7XIYLAkcLSrj5FLrGjKI8q+UW4mZzYyudvGuQ4/TZo=; b=kMIRydFxidKzY7BpYx9EUp/eSGgFea4GwwQrTWrZFWAG+5gWnMJU0Gbf6KDWEXRVbB yt7yTV4W7LoKxr4bwuLNicNelGV0VJdo8+Xxc3tr9qWqEormXicnooeGM+XBHP/F8Lpv MkZPbXBbSyvDxovJoSlKKkCQ8NeOEsoPsWWeQ/wCQOw3jDd+VazdaPjgJjjglqJ2YrqQ DzXZQwEmve8ZRYv9vrjP3ObWuuQVtRPblfKrVNINjUlnr0Z/lkXrGfycXXpfWJCveve2 LkbG7/7/jskn+XiPH/2MRqGAtT1mcFiev5F2k5tRA7Uy3qUjHzrB0948Z1PAUaO33IXn CXSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710036336; x=1710641136; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=T7XIYLAkcLSrj5FLrGjKI8q+UW4mZzYyudvGuQ4/TZo=; b=xAOlSNwlKVgeaIxg6EFFxIZ7fxm1Wu55Md2HtItOSRH2n3aNzUtsxO14Bj0kXzv1+0 tekNHUnv6wMbYLh0Y29Dyz9To5wWg5zi0Do4HuqJ0fz3qgzsNQX+A3MtRnixGgZToA6v FIcEogt/vCTSkjfOt3SOCkk55Bga+iiRGmnc2cKkSRyFiBkaAX0iBsTRZDtsNi/sRPrb bhEFpF6pFNqAZKiPT35ko9Yl//f3X/T6A1aDjqzQZZkb1y/tqxJB848hMiGQOn+LvEkQ olquh3yd4eD9DFGSNInveixIbeMaCzeGHRG8inm11F31kCTKGfqsOfmtVj+yQC4UyDC8 OO+g== X-Forwarded-Encrypted: i=1; AJvYcCXJMa+jgrSoDchsKjrlbweCT0dm2LyfGJi6zkT93ixhXztZDrR4uN6qsj7GnUnjLlnD6MQ8T7keB/amfKEses3+6e1wHoBgipA0ZIn5 X-Gm-Message-State: AOJu0YyBDFUvfeAeUUBHLO1Q0/5xjBi3utWEcYnOCmn+tXxMzXeHE15p MMiDzyNXAsdog1a90C4pVinDkVuT6hUwC/mFB1mlEYfJN5iepMal1MgD1TcbJcBrct48ZCg1eol P0Pl4SQ== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:a63d:1b65:e810:3ad3]) (user=irogers job=sendgmr) by 2002:a0d:d7cd:0:b0:608:72fe:b8a1 with SMTP id z196-20020a0dd7cd000000b0060872feb8a1mr953360ywd.4.1710036336387; Sat, 09 Mar 2024 18:05:36 -0800 (PST) Date: Sat, 9 Mar 2024 18:04:57 -0800 In-Reply-To: <20240310020509.647319-1-irogers@google.com> Message-Id: <20240310020509.647319-3-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240310020509.647319-1-irogers@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Subject: [PATCH v1 02/13] libbpf: Make __printf define conditional From: Ian Rogers To: Arnd Bergmann , Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Ian Rogers , Adrian Hunter , Paolo Bonzini , Shuah Khan , Kees Cook , "Gustavo A. R. Silva" , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andrew Morton , Liam Howlett , Miguel Ojeda , Will Deacon , Mark Brown , David Laight , "Michael S. Tsirkin" , Shunsuke Mie , Yafang Shao , Kui-Feng Lee , James Clark , Nick Forrington , Leo Yan , German Gomez , Rob Herring , John Garry , Sean Christopherson , Anup Patel , Fuad Tabba , Andrew Jones , Chao Peng , Haibo Xu , Peter Xu , Vishal Annapurve , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-hardening@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" libbpf depends upon linux/err.h which has a linux/compiler.h dependency. In the kernel includes, as opposed to the tools version, linux/compiler.h includes linux/compiler_attributes.h which defines __printf. As the libbpf.c __printf definition isn't guarded by an ifndef, this leads to a duplicate definition compilation error when trying to update the tools/include/linux/compiler.h. Fix this by adding the missing ifndef. Signed-off-by: Ian Rogers --- tools/lib/bpf/libbpf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index afd09571c482..2152360b4b18 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -66,7 +66,9 @@ */ #pragma GCC diagnostic ignored "-Wformat-nonliteral" -#define __printf(a, b) __attribute__((format(printf, a, b))) +#ifndef __printf +# define __printf(a, b) __attribute__((format(printf, a, b))) +#endif static struct bpf_map *bpf_object__add_map(struct bpf_object *obj); static bool prog_is_subprog(const struct bpf_object *obj, const struct bpf_program *prog); -- 2.44.0.278.ge034bb2e1d-goog