From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F090C2BD09 for ; Mon, 24 Jun 2024 22:26:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uDHj6BdkmFw542BzZNyyf5Yqw1H7EZRc8eoYibj747c=; b=fRmycWDYzrFZHmdpWQBpXLiKDz HaokpS1XjtoUpXu1sSfKn2boS7CMBkZgIBAmKtIKInhpNwEk0Ndqd95h11G5sTw9uCVlsvX84OHqz NQcNlg3LUDw4LEghRzqN8xO4+TZExGIMN3OzFex55Kin6tmXFlSQjAUbeEtrMlGOOkbs2uxfl13C4 +dh/3/QnUeGmdgI2P5T+iUooMwQjUdks0j/VC6aFCWlq13nxaPYxLapsQlBtJvJzRF6xcSbErnbqe 6c02ZfdO20cmvC1zLWTAa1hNUhW2zahgtyPo9aq70WzOKwUAtpOY2AmTLdLS+4YZQ0eGizzNZ7qoX pQb6Q0VQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLs8r-00000000qSY-3TRj; Mon, 24 Jun 2024 22:26:29 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLs8l-00000000qRJ-1j8l; Mon, 24 Jun 2024 22:26:25 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id AB44F61126; Mon, 24 Jun 2024 22:26:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFAECC2BBFC; Mon, 24 Jun 2024 22:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719267982; bh=A1zw7pChb50vCYHTi+cKNPAO0Oryfwi6Z4lff+lI6Js=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RmN/u75HA1sFMpeGPdJhkl4iIpVo2QC3mcj4pV3sSro9zUXSg77efg3iJbqMAgsva e2eLM/YOePlu2m1GZRn17m/S1YU3iOvZAYvmUcCV8oZwNzTgE194CKbUQKvz6/2ANQ F8IUUTej+bXUYcut+Ihvlv2di7ARhVVTb06R/XFMS+S+6WuKAuqmqpcBG6yeQTdIlb M/rXFi6XnrPpCOabmhSZBP8sx5LHAf5mYRT9YivXxIcvXZ5Niz1JGKDmyncJerdOUk G+MECTVMOxUllUNDbx260XaCoth/cIZmho3/G3JBlmxTNJ54cG+acw5a+nB/73TKk6 L3pS82Zv27FWQ== Date: Mon, 24 Jun 2024 15:26:19 -0700 From: Namhyung Kim To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Guo Ren , Paul Walmsley , Palmer Dabbelt , Albert Ou , Suzuki K Poulose , Yicong Yang , Jonathan Cameron , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?B?QmrDtnJu?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Nick Terrell , Ravi Bangoria , Kees Cook , Andrei Vagin , Athira Jajeev , Oliver Upton , Ze Gao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org, coresight@lists.linaro.org, rust-for-linux@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH v3 7/8] perf python: Switch module to linking libraries from building source Message-ID: References: <20240613233122.3564730-1-irogers@google.com> <20240613233122.3564730-8-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240613233122.3564730-8-irogers@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240624_152623_577325_C8D3ABC1 X-CRM114-Status: GOOD ( 16.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 13, 2024 at 04:31:21PM -0700, Ian Rogers wrote: > setup.py was building most perf sources causing setup.py to mimic the > Makefile logic as well as flex/bison code to be stubbed out, due to > complexity building. By using libraries fewer functions are stubbed > out, the build is faster and the Makefile logic is reused which should > simplify updating. The libraries are passed through LDFLAGS to avoid > complexity in python. > > Force the -fPIC flag for libbpf.a to ensure it is suitable for linking > into the perf python module. > > Signed-off-by: Ian Rogers > Reviewed-by: James Clark > --- > tools/perf/Makefile.config | 5 + > tools/perf/Makefile.perf | 6 +- > tools/perf/util/python.c | 271 ++++++++++++++----------------------- > tools/perf/util/setup.py | 33 +---- > 4 files changed, 110 insertions(+), 205 deletions(-) > > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config > index 7f1e016a9253..639be696f597 100644 > --- a/tools/perf/Makefile.config > +++ b/tools/perf/Makefile.config > @@ -910,6 +910,11 @@ else > endif > CFLAGS += -DHAVE_LIBPYTHON_SUPPORT > $(call detected,CONFIG_LIBPYTHON) > + ifeq ($(filter -fPIC,$(CFLAGS)),) Nitpick: mixed TAB and SPACEs. > + # Building a shared library requires position independent code. > + CFLAGS += -fPIC > + CXXFLAGS += -fPIC > + endif I'm curious if it's ok for static libraries too.. Thanks, Namhyung > endif > endif > endif