Linux Perf Users
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: Trevor Allison <tallison@redhat.com>, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf build: Add LDFLAGS to dlfilters .so link
Date: Sat, 4 Jul 2026 09:16:45 -0700	[thread overview]
Message-ID: <akkx7cDfBb1pBdIw@google.com> (raw)
In-Reply-To: <20260626183423.ADD211F000E9@smtp.kernel.org>

On Fri, Jun 26, 2026 at 06:34:23PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] Adding `$(LDFLAGS)` to the unconditionally built `dlfilters` shared library link rule breaks statically linked `perf` builds.
> --
> 
> commit 18f2c24db710920618ef1d894a2b24abff4dbeb9
> Author: Trevor Allison <tallison@redhat.com>
> 
> perf build: Add LDFLAGS to dlfilters .so link
>     
> Build-time linker flags were not applied when linking dlfilters.
> Pass LDFLAGS for consistency with the other link rules.
> 
> > diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> > index 476b8dcaef58c..f2294a6d89604 100644
> > --- a/tools/perf/Makefile.perf
> > +++ b/tools/perf/Makefile.perf
> > @@ -677,7 +677,7 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c include/perf/perf_dlfilter.h
> >  .SECONDARY: $(DLFILTERS:.so=.o)
> >  
> >  $(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o
> > -	$(QUIET_LINK)$(CC) $(EXTRA_CFLAGS) -shared -o $@ $<
> > +	$(QUIET_LINK)$(CC) $(LDFLAGS) $(EXTRA_CFLAGS) -shared -o $@ $<
> 
> [Severity: Low]
> Does this break static builds of perf?
> 
> If a user builds perf statically by setting LDFLAGS="-static", this rule
> will pass both "-static" and "-shared" to the linker. Since these flags are
> mutually exclusive, this results in a fatal linker error.

Oops, I missed this message and merged it.  It indeed caused a failure 
in the build test.  It seems we should skip building dlfilters when the
LDFLAGS has -static or remove -static from the LDFLAGS for dlfilters.

Thanks,
Namhyung

  reply	other threads:[~2026-07-04 16:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 18:27 [PATCH] perf build: Add LDFLAGS to dlfilters .so link Trevor Allison
2026-06-26 18:34 ` sashiko-bot
2026-07-04 16:16   ` Namhyung Kim [this message]
2026-07-03 20:37 ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=akkx7cDfBb1pBdIw@google.com \
    --to=namhyung@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tallison@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox