Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 1/1] package/linux-tools: use PKG_CONFIG_LIBDIR in perf make flags
@ 2025-04-03 22:44 Vasileios Amoiridis
  2025-04-19 21:40 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 3+ messages in thread
From: Vasileios Amoiridis @ 2025-04-03 22:44 UTC (permalink / raw)
  To: buildroot; +Cc: Vasileios Amoiridis

After commit 440cf77625e300e683ca0edc39fbc4b6f3175feb ("perf:
build: Setup PKG_CONFIG_LIBDIR for cross compilation") in the
Linux Kernel it is needed to add PKG_CONFIG_LIBDIR in the
make flags to avoid warnings from the Kernel, such as:

        Makefile.perf:207: Missing PKG_CONFIG_LIBDIR,
        PKG_CONFIG_PATH and PKG_CONFIG_SYSROOT_DIR for
        cross compilation,
        Makefile.perf:208: set PKG_CONFIG_LIBDIR for using
        Multiarch libs.

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
---
 package/linux-tools/linux-tool-perf.mk.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in
index d67318571a..1526652ce4 100644
--- a/package/linux-tools/linux-tool-perf.mk.in
+++ b/package/linux-tools/linux-tool-perf.mk.in
@@ -20,6 +20,7 @@ endif
 
 PERF_MAKE_FLAGS = \
 	$(LINUX_MAKE_FLAGS) \
+	PKG_CONFIG_LIBDIR=$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/share/pkgconfig \
 	JOBS=$(PARALLEL_JOBS) \
 	ARCH=$(PERF_ARCH) \
 	DESTDIR=$(TARGET_DIR) \
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH v4 1/1] package/linux-tools: use PKG_CONFIG_LIBDIR in perf make flags
  2025-04-03 22:44 [Buildroot] [PATCH v4 1/1] package/linux-tools: use PKG_CONFIG_LIBDIR in perf make flags Vasileios Amoiridis
@ 2025-04-19 21:40 ` Thomas Petazzoni via buildroot
  2025-05-05 22:15   ` Vasileios Amoiridis
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-04-19 21:40 UTC (permalink / raw)
  To: Vasileios Amoiridis; +Cc: buildroot

Hello Vasileios,

On Fri,  4 Apr 2025 00:44:17 +0200
Vasileios Amoiridis <vassilisamir@gmail.com> wrote:

> After commit 440cf77625e300e683ca0edc39fbc4b6f3175feb ("perf:
> build: Setup PKG_CONFIG_LIBDIR for cross compilation") in the
> Linux Kernel it is needed to add PKG_CONFIG_LIBDIR in the
> make flags to avoid warnings from the Kernel, such as:
> 
>         Makefile.perf:207: Missing PKG_CONFIG_LIBDIR,
>         PKG_CONFIG_PATH and PKG_CONFIG_SYSROOT_DIR for
>         cross compilation,
>         Makefile.perf:208: set PKG_CONFIG_LIBDIR for using
>         Multiarch libs.
> 
> Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>

Thanks for the patch!

> diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in
> index d67318571a..1526652ce4 100644
> --- a/package/linux-tools/linux-tool-perf.mk.in
> +++ b/package/linux-tools/linux-tool-perf.mk.in
> @@ -20,6 +20,7 @@ endif
>  
>  PERF_MAKE_FLAGS = \
>  	$(LINUX_MAKE_FLAGS) \
> +	PKG_CONFIG_LIBDIR=$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/share/pkgconfig \

However, this value is incorrect I believe.

Indeed, linux-tool-perf.mk.in is cross-compiling perf for the target,
so pkg-config should look for cross-compiled libraries... and here
you're pointing to natively compiled libraries installed in
$(HOST_DIR), so this is not correct.

I'm not sure what the correct fix is, as PKG_CONFIG_LIBDIR is passed
internally in our pkg-config wrapper, it's really just the kernel
Makefile being over-zealous here. Maybe we could play with the kernel
accepting a $(CROSS_COMPILE)pkg-config, and have such a script in a
private directory, added in the PATH when building perf? Another option
is to define PKG_CONFIG_LIBDIR, replicating what our pkg-config uses as
a value.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH v4 1/1] package/linux-tools: use PKG_CONFIG_LIBDIR in perf make flags
  2025-04-19 21:40 ` Thomas Petazzoni via buildroot
@ 2025-05-05 22:15   ` Vasileios Amoiridis
  0 siblings, 0 replies; 3+ messages in thread
From: Vasileios Amoiridis @ 2025-05-05 22:15 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

On Sat, Apr 19, 2025 at 11:40:47PM +0200, Thomas Petazzoni wrote:
> Hello Vasileios,
> 
> On Fri,  4 Apr 2025 00:44:17 +0200
> Vasileios Amoiridis <vassilisamir@gmail.com> wrote:
> 
> > After commit 440cf77625e300e683ca0edc39fbc4b6f3175feb ("perf:
> > build: Setup PKG_CONFIG_LIBDIR for cross compilation") in the
> > Linux Kernel it is needed to add PKG_CONFIG_LIBDIR in the
> > make flags to avoid warnings from the Kernel, such as:
> > 
> >         Makefile.perf:207: Missing PKG_CONFIG_LIBDIR,
> >         PKG_CONFIG_PATH and PKG_CONFIG_SYSROOT_DIR for
> >         cross compilation,
> >         Makefile.perf:208: set PKG_CONFIG_LIBDIR for using
> >         Multiarch libs.
> > 
> > Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
> 
> Thanks for the patch!
> 
> > diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in
> > index d67318571a..1526652ce4 100644
> > --- a/package/linux-tools/linux-tool-perf.mk.in
> > +++ b/package/linux-tools/linux-tool-perf.mk.in
> > @@ -20,6 +20,7 @@ endif
> >  
> >  PERF_MAKE_FLAGS = \
> >  	$(LINUX_MAKE_FLAGS) \
> > +	PKG_CONFIG_LIBDIR=$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/share/pkgconfig \
> 
> However, this value is incorrect I believe.
> 

Hi Thomas,

Thanks for the reply and you are right here, I totally missed it.

> Indeed, linux-tool-perf.mk.in is cross-compiling perf for the target,
> so pkg-config should look for cross-compiled libraries... and here
> you're pointing to natively compiled libraries installed in
> $(HOST_DIR), so this is not correct.
> 
> I'm not sure what the correct fix is, as PKG_CONFIG_LIBDIR is passed
> internally in our pkg-config wrapper, it's really just the kernel
> Makefile being over-zealous here. Maybe we could play with the kernel
> accepting a $(CROSS_COMPILE)pkg-config, and have such a script in a
> private directory, added in the PATH when building perf? Another option
> is to define PKG_CONFIG_LIBDIR, replicating what our pkg-config uses as
> a value.
> 

Solution no.2 which is about re-defining the PKG_CONFIG_LIBDIR as we do
in the pkg-config could solve this "issue" but I would like to see if
there is a better way than replicating.

Solution no.1 though I feel a bit confused with what you mean. What I
understand from the $(CROSS_COMPILE)pkg-config is that we should
put into the PATH the $(CROSS_COMPILE)pkg-config binary. What do you
mean exactly by script?

Cheers,
Vasilis

> Thomas
> -- 
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-05 22:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03 22:44 [Buildroot] [PATCH v4 1/1] package/linux-tools: use PKG_CONFIG_LIBDIR in perf make flags Vasileios Amoiridis
2025-04-19 21:40 ` Thomas Petazzoni via buildroot
2025-05-05 22:15   ` Vasileios Amoiridis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox