Linux Perf Users
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Leo Yan <leo.yan@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	Trevor Allison <tallison@redhat.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf build: Fix static build of dlfilters
Date: Mon, 13 Jul 2026 10:38:41 -0700	[thread overview]
Message-ID: <alUioShYpMSzbmf2@google.com> (raw)
In-Reply-To: <20260713-perf_fix_static_build-v1-1-460be1f9e4d6@arm.com>

Hi Leo,

On Mon, Jul 13, 2026 at 11:23:01AM +0100, Leo Yan wrote:
> Commit e1065ed188cf ("perf build: Add LDFLAGS to dlfilters .so link")
> passes LDFLAGS when linking dlfilter shared objects. That breaks static
> builds because LDFLAGS can contain -static, leading to an invalid link
> command.
> 
> dlfilters are always built as shared objects, even for a static perf
> binary. Filter out -static for the dlfilter .so link while preserving
> the rest of LDFLAGS.
> 
> Fixes: e1065ed188cf ("perf build: Add LDFLAGS to dlfilters .so link")
> Signed-off-by: Leo Yan <leo.yan@arm.com>

Actually I posted the same patch.  Can I get your Tested-by?

https://lore.kernel.org/r/20260707000357.823509-1-namhyung@kernel.org

Thanks,
Namhyung

> ---
>  tools/perf/Makefile.perf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 2b53d9e0c73b3382724b1f776880aaa8fa505f59..0031112c036e830e50711d5cb0b3867cba36e374 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -680,7 +680,7 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c include/perf/perf_dlfilter.h
>  .SECONDARY: $(DLFILTERS:.so=.o)
>  
>  $(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o
> -	$(QUIET_LINK)$(CC) $(LDFLAGS) $(EXTRA_CFLAGS) -shared -o $@ $<
> +	$(QUIET_LINK)$(CC) $(filter-out -static,$(LDFLAGS)) $(EXTRA_CFLAGS) -shared -o $@ $<
>  
>  ifndef NO_JVMTI
>  LIBJVMTI_IN := $(OUTPUT)jvmti/jvmti-in.o
> 
> ---
> base-commit: ef3af1df4f3372bd8ad47619452a283048b3bc8d
> change-id: 20260713-perf_fix_static_build-6db03942fee1
> 
> Best regards,
> -- 
> Leo Yan <leo.yan@arm.com>
> 

  reply	other threads:[~2026-07-13 17:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 10:23 [PATCH] perf build: Fix static build of dlfilters Leo Yan
2026-07-13 17:38 ` Namhyung Kim [this message]
2026-07-13 18:14   ` Leo Yan
2026-07-13 20:54     ` 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=alUioShYpMSzbmf2@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --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