lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7cjy8+Ys-Y_35V7O=KGQL0v3+B9z6hhytmAiKKN9pO9yow@mail.gmail.com>
Date: Tue, 25 Jun 2024 10:48:06 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: James Clark <james.clark@....com>
Cc: Ian Rogers <irogers@...gle.com>, Peter Zijlstra <peterz@...radead.org>, 
	Ingo Molnar <mingo@...hat.com>, Arnaldo Carvalho de Melo <acme@...nel.org>, Mark Rutland <mark.rutland@....com>, 
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>, 
	Adrian Hunter <adrian.hunter@...el.com>, Kan Liang <kan.liang@...ux.intel.com>, 
	John Garry <john.g.garry@...cle.com>, Will Deacon <will@...nel.org>, 
	Mike Leach <mike.leach@...aro.org>, Leo Yan <leo.yan@...ux.dev>, Guo Ren <guoren@...nel.org>, 
	Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>, 
	Albert Ou <aou@...s.berkeley.edu>, Suzuki K Poulose <suzuki.poulose@....com>, 
	Yicong Yang <yangyicong@...ilicon.com>, Jonathan Cameron <jonathan.cameron@...wei.com>, 
	Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, 
	Wedson Almeida Filho <wedsonaf@...il.com>, Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
	Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...sung.com>, 
	Alice Ryhl <aliceryhl@...gle.com>, Nick Terrell <terrelln@...com>, 
	Ravi Bangoria <ravi.bangoria@....com>, Kees Cook <keescook@...omium.org>, 
	Andrei Vagin <avagin@...gle.com>, Athira Jajeev <atrajeev@...ux.vnet.ibm.com>, 
	Oliver Upton <oliver.upton@...ux.dev>, Ze Gao <zegao2021@...il.com>, 
	linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, linux-csky@...r.kernel.org, 
	linux-riscv@...ts.infradead.org, coresight@...ts.linaro.org, 
	rust-for-linux@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH v3 7/8] perf python: Switch module to linking libraries
 from building source

Hello,

On Tue, Jun 25, 2024 at 5:24 AM James Clark <james.clark@....com> wrote:
>
>
>
> On 24/06/2024 23:26, Namhyung Kim wrote:
> > 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 <irogers@...gle.com>
> >> Reviewed-by: James Clark <james.clark@....com>
> >> ---
> >>  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
> >
>
> I think I tested the whole set with a static build so it should be ok.

Ok, thanks for checking that!

Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ