Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp32833lqb; Tue, 16 Apr 2024 08:05:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtqPsRgFHekQH7suBWU8I8LOzlG7qHZlNS7oEkQeCSnsCy60MT49ID/cl/Hu1bD6RB3evt6BXe8QGNk5wDAA2xuKZAL1p66sav5uzmYQ== X-Google-Smtp-Source: AGHT+IG7E2Gz5se+y5wrgrAjHG6AWnpwi+Hqq0nPNpsefc9p0O2h3LszYdeF9nKISnHZan0aueOl X-Received: by 2002:a17:907:7208:b0:a51:bddf:eaf2 with SMTP id dr8-20020a170907720800b00a51bddfeaf2mr12906584ejc.18.1713279915660; Tue, 16 Apr 2024 08:05:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713279915; cv=pass; d=google.com; s=arc-20160816; b=KUITChNgOrjoXDwnY2JFZuz6dAfscZA7nydcJI99ctNOewqZq8k5MCA2SICMS0/7za dvTCvHiWmoXycwwEEuNP3oq1H26M2TXwW9KonPSnL2TpYXIINQi8ui63ogHIbu1B3VoF TyUOASSBdGEi5m/VCtBzCPicporo5CYRFkT+CZSdEjM5s0CBVg+638a0xBuF2KwoocY8 uJPATW6HOK43UlxVFdezTUT8hLMAm39enq6E3b1Jb9Lh5DMqIXQh/jaT10Q5zutuFyXA 20HlLrIWhaZbOESjdnvRgMaN4p0kaDOGm2296tTHjP63+9IiH9nSfrLHxam3x9Lc8tLw TCyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=ApDEEOzWKbr2lAoaPzmlzkmuB1oGm6TlwwUuSX/oB4U=; fh=1JXk9SGbqlNo2wCuDHRnn0MWQIeVhCKYW0bF+oyCSFw=; b=GTbU0T2K49QbT5rNgKahRY8DOTJarUdp9mnjX7bWQ0dk8S2Wx5XAdAoyhgWBySFDN8 FbPI1d8iHyjTyRXnNJh8RPJlC+qiVKbtKYbn1SstXyNSrG8PWUSNB6yq3CMGbVZpPG3X ng8taRT3rh1YWVQr4hGmkXOpdLFhXKNuOsWMbfKw9b51t1ptD3ZR/wzB/QZcMdo2afg6 f02IdE6sKHctmU5SqSSJAHVue91THM/AgTzyTcebY4HpcasNUZJjNeVhN5FreMqvPYiU PquJXN1t7mU2Wp7TrWMezZvYPNFp7IO75tv1D4ch+BwJgSn2I0aLoEeCtNfOVGVY1vGK hJTw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=b2SsN4HJ; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-147087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b4-20020a170906490400b00a522c013936si5236754ejq.87.2024.04.16.08.05.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 08:05:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=b2SsN4HJ; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-147087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147087-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 62F661F2187C for ; Tue, 16 Apr 2024 15:05:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B44D12FF80; Tue, 16 Apr 2024 15:05:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="b2SsN4HJ" Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 86DFB12A174 for ; Tue, 16 Apr 2024 15:05:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713279909; cv=none; b=fmxMK/PMD5qNBPTXPSNHtJqRGv/CgNxGN46xjuGBzp19qUSDjFuxN26TzTmqNGU0Z9lSe3aBPgJv0MbXD7M6JZcfjJHHLHG+cKWQht0YdWHBrZualKvOewVH+FHX1S1019pyKwgVFYpcpmO/Y8FgyO0mtmdlgRnB9XzZpsj8KY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713279909; c=relaxed/simple; bh=TZeXcbtKOMozMWJ/kUHSgG1n49qX5lbSr1iuS7NKbrk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bbb1/Uud9TGINAgjJcnIR3FLQJgF3m8QJbhUMHLMw+HLVtEdTkNvcNAjq5AngYkNuiPQhMaoMEGYy+EZK4WQf97nj7o97zBfpDipypZaUbcalpvwEBlDL7y6UUAy5lb0g6u/pg2HCMdeG1Dz3zbwEpjOWMa675OseZkjduAydRY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=b2SsN4HJ; arc=none smtp.client-ip=209.85.166.180 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=google.com Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-36aff988d73so146435ab.0 for ; Tue, 16 Apr 2024 08:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713279907; x=1713884707; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ApDEEOzWKbr2lAoaPzmlzkmuB1oGm6TlwwUuSX/oB4U=; b=b2SsN4HJqmF8/DlY40a4MIfpFTt0nc0phvFoHv6I+3lHshEU8HJSVlUGvVQDH0gXnm 8qB2PqokDUg6BR/TlxjjVx3elydri24CMBd1Be3sk+2HAh/I1Vl1RJuGnWPVssHDMFtj AG/pTKLeoheOUJLDBjrikDjXHG1dO79z6AfRLbmsMgGJzIIgEyziVt9lEqncdbiZ/T5U dqQb2Xv7TSZpVlfqXlwqCRy6GxmJJ0LMUzHttV+PlL/A8IDh3Uh25Dzw1rkiRcmR2qn5 QWSbswPlh57itqRvOTYCkOHHO1Zk+WQa4UwrFNykzPyqm8UOaKVgOQusKsx6EsTVStkH pQ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713279908; x=1713884708; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ApDEEOzWKbr2lAoaPzmlzkmuB1oGm6TlwwUuSX/oB4U=; b=f0gKqh+9ehsqahQUku7uQOFBjDs2AQ3i0eA7aN4GYrj/gBcrGVvMiGhxzgfAujzw8V 0yX6a4Sa0SChZ9ii4kt4JjyjkCZt4zBCriKWs7iwh7LpbeqCB15skt1wfG/wpdFrNsuT wJfQdGFYbfbhrxR0cGXtMXz1h+wWlab9Y6h5eSpIATqvOFaclILqLon8NAa+k2RqyWxl KGPoCXoE42idewExvxTqG5nAiMS5rqsJaDN6cilsKftW3dny7i/IKUjVUO7WbBqm1tk+ QOZ5rwUiScQi3/quqpR2Z372CA+YTKWrXNpVgUQ1AmDiDNI0PTWcTXep2q208aGsPuIm cMtQ== X-Forwarded-Encrypted: i=1; AJvYcCUicfVp7xCZR725B8nHzyhzQvH7xDnl0t6AoYbe6iA8RpfH+xqThyyHVi/GwDXNvblDo4h2hZKu/8xHjXzIkjKAUhF++fFlZuyviTc8 X-Gm-Message-State: AOJu0YxlSr1czgAUEViMk8s1ITPnVgFT7U3y6By/zlXLIv51DfaQwP+w mMAxSRW8VXyRKqwtdOOeRslEY9gZdwDGrLTyricLvzLKQs6W5EQyGYi6Coy9ZNysvF/E71Fw67D ghdhXJEoSRWlwdJ+NA57XOC05BjsbqHr7nMQQOkLUgCw2rAQx3q9P X-Received: by 2002:a92:c5cd:0:b0:36a:fcc9:64ec with SMTP id s13-20020a92c5cd000000b0036afcc964ecmr186375ilt.1.1713279907511; Tue, 16 Apr 2024 08:05:07 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240415095532.4930-1-cp0613@linux.alibaba.com> In-Reply-To: <20240415095532.4930-1-cp0613@linux.alibaba.com> From: Ian Rogers Date: Tue, 16 Apr 2024 08:04:55 -0700 Message-ID: Subject: Re: [PATCH] tools/perf: Fix compiling with libelf on rv32 To: cp0613@linux.alibaba.com Cc: palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 15, 2024 at 2:57=E2=80=AFAM wrote: > > From: Chen Pei > > When cross-compiling perf with libelf, the following error occurred: > > In file included from tests/genelf.c:14: > tests/../util/genelf.h:50:2: error: #error "unsupported architect= ure" > 50 | #error "unsupported architecture" > | ^~~~~ > tests/../util/genelf.h:59:5: warning: "GEN_ELF_CLASS" is not defi= ned, evaluates to 0 [-Wundef] > 59 | #if GEN_ELF_CLASS =3D=3D ELFCLASS64 > > Fix this by adding GEN-ELF-ARCH and GEN-ELF-CLASS definitions for rv32. > > Signed-off-by: Chen Pei Reviewed-by: Ian Rogers Thanks, Ian > --- > tools/perf/util/genelf.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h > index 5f18d20ea903..4e2e4f40e134 100644 > --- a/tools/perf/util/genelf.h > +++ b/tools/perf/util/genelf.h > @@ -43,6 +43,9 @@ int jit_add_debug_info(Elf *e, uint64_t code_addr, void= *debug, int nr_debug_ent > #elif defined(__riscv) && __riscv_xlen =3D=3D 64 > #define GEN_ELF_ARCH EM_RISCV > #define GEN_ELF_CLASS ELFCLASS64 > +#elif defined(__riscv) && __riscv_xlen =3D=3D 32 > +#define GEN_ELF_ARCH EM_RISCV > +#define GEN_ELF_CLASS ELFCLASS32 > #elif defined(__loongarch__) > #define GEN_ELF_ARCH EM_LOONGARCH > #define GEN_ELF_CLASS ELFCLASS64 > -- > 2.25.1 > >