From: Johannes Schauer Marin Rodrigues <josch@mister-muffin.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH] rtla: Fix cross building
Date: Wed, 01 Feb 2023 21:25:25 +0100	[thread overview]
Message-ID: <167528312574.2091069.14376812810556043323@localhost> (raw)
In-Reply-To: <20230201143144.37b258c2@gandalf.local.home>
Hi,
Quoting Steven Rostedt (2023-02-01 20:31:44)
> On Fri, 20 Jan 2023 08:08:09 +0100
> Johannes Schauer Marin Rodrigues <josch@mister-muffin.de> wrote:
> 
> > For a successful cross-build, the host-architecture version of
> > pkg-config must be used or otherwise host architecture headers of
> > libtracefs and libtraceevent will not be found.
> > 
> > Signed-off-by: Johannes Schauer Marin Rodrigues <josch@mister-muffin.de>
> > ---
> >  tools/tracing/rtla/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/tracing/rtla/Makefile b/tools/tracing/rtla/Makefile
> > index 22e28b76f800..26ebd46ec29c 100644
> > --- a/tools/tracing/rtla/Makefile
> > +++ b/tools/tracing/rtla/Makefile
> > @@ -18,7 +18,7 @@ endef
> >  $(call allow-override,CC,$(CROSS_COMPILE)gcc)
> >  $(call allow-override,AR,$(CROSS_COMPILE)ar)
> >  $(call allow-override,STRIP,$(CROSS_COMPILE)strip)
> > -$(call allow-override,PKG_CONFIG,pkg-config)
> > +$(call allow-override,PKG_CONFIG,$(CROSS_COMPILE)pkg-config)
> >  $(call allow-override,LD_SO_CONF_PATH,/etc/ld.so.conf.d/)
> >  $(call allow-override,LDCONFIG,ldconfig)
> >  
> 
> I don't usually have pkg-config as part of my cross build path. I have just
> overridden it to use different commands, by defining the variable of
> PKG_CONFIG, but I have not had any issues. But my compiler path never
> included pkg-config.
I found this problem when cross-compiling the linux Debian package. You can
find a build log (on amd64 for arm64) of how this fails on our Debian
crossbuild QA service:
https://crossqa.debian.net/build/linux_6.1.7-1_arm64_20230122165920.log
At the very bottom of that log you can see the following error message:
********************************************
** NOTICE: Failed build dependencies
**
** Required Libraries:
**   libtraceevent version 1.5 or higher
**   libtracefs version 1.3 or higher
**
** Consider installing the latest libtracefs from your
** distribution, e.g., 'dnf install libtraceevent-devel libtracefs-devel' on Fedora,
** or from source:
**
**  https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ 
**  https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ 
**
********************************************
This error goes away after applying my patch. You can see that the both
libraries do get installed for arm64 at the top of the log. But they are not
found because the wrong pkg-config is used.
Thanks!
cheers, josch
next prev parent reply	other threads:[~2023-02-01 20:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20  7:08 [PATCH] rtla: Fix cross building Johannes Schauer Marin Rodrigues
2023-02-01 19:31 ` Steven Rostedt
2023-02-01 20:25   ` Johannes Schauer Marin Rodrigues [this message]
2023-02-01 20:54     ` Steven Rostedt
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=167528312574.2091069.14376812810556043323@localhost \
    --to=josch@mister-muffin.de \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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;
as well as URLs for NNTP newsgroup(s).