From: "Börge Strümpfel" <boerge.struempfel@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Boerge Struempfel <bstruempfel@ultratronik.de>
Subject: Re: [libgpiod][PATCH 1/1] dbus: manager: fix linker not finding libgpiod.so
Date: Fri, 7 Feb 2025 16:45:00 +0100 [thread overview]
Message-ID: <CAEktqcu3+to5VBA5SSM51gsZqCROyRtRXCW09_6L16vXaWhAnw@mail.gmail.com> (raw)
In-Reply-To: <CAMRc=McDT-apAk2=Me0Ahz4t_EWvhzGF8uemtuEbBtFT2Nu0Ww@mail.gmail.com>
Hi Bart,
On Thu, Feb 6, 2025 at 9:48 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> On Thu, Feb 6, 2025 at 12:46 AM Börge Strümpfel
> <boerge.struempfel@gmail.com> wrote:
> >
> > Hi Bart,
> >
> > While preparing a patch to add gpio-manager to mainline Buildroot, I
> > encountered this issue again. That is, I can successfully compile the
> > gpio-manager manually (using autotools/gcc/ld provided by ubuntu 2024) however,
> > when using the Buildroot infrastructure, I get a compiler error, stating that
> > the libgpiod.so.3 cannot be found.
> >
> > After further investigation, I'm increasingly unsure on how the
> > libgpiod.so.3 is supposed to be found by the linker in the first place:
> >
> > From what I see, gpio-manager depends on:
> > - bindings/glib/libgpiod-glib
> > - dbus/lib/libgpiodbus
>
> Correct.
>
> > - lib/libgpiod
>
> This one is an indirect dependency, it's already pulled in by libgpiod-glib.so.
>
Yes. You are right - there are no direct calls into the libgpiod
library only via
libgpiod-glib.so. I also verified that the libgpiod is properly build and linked
against the libgpiod.so.
> >
> > However, I see no direct reference in dbus/manager/Makefile.am, nor can I see
> > an indirect reference via the Makefile.am files used to generate:
> > - bindings/glib/libgpiod-glib.la
> > - dbus/lib/libgpiodbus.la
> >
> > Am I missing something obvious?
> >
>
> These are generated in different directories, the Makefiles in there
> take care of this.
>
> > Furthermore upon review, I believe the solution I proposed last October was
> > flawed - I should have used:
> > LDADD += $(top_builddir)/lib/libgpiod.la
>
> On Ubuntu, I see that gpio-manager is only linked against
> libgpiod-glib.so and libgpiodbus.so. However if I cross-compile on
> yocto, it's linked against libgpiod.so as well. I don't know exactly
> what the differences in linker setup are but yocto is able to find
> libgpiod without problems. Before we add an unnecessary flag, may I
> suggest looking into how yocto does the linking?
Here is what I have figured out so far:
- whether libgpiod.so is linked to the final execuatble seems to be
at least partially
dependent on the version of autotools and/or libtools. (Tested
by backporting
yocto's autotools and libtools)
- there is a fix in the yocto recipe for finding the libgpiod.so bit
it conserns only
gobject introspection, which is not the problem I am facing with buildroot
- The behaviour of the problem I am facing in buildroot does not depend on
gobject introspection as far as I can tell, since the error happens
independent
of it. (which is good in my understanding, since it is what I would expect)
- there is a flag in the libtool "link_all_deplibs" which yocto sets
to "unknown" and
which in buildroot is set to "no" after the configure step (I
couldn't figure out the
reason for this yet) If I manually tweek this value in buildroot
between the configure
and build steps, the gpio-manager is build successfully (with or
without an explicit
link to libgpiod.so depending on the version of libtools used).
However setting
this flag to "no" in yocto, still leads to a successful build.
Therefore I don't think,
this is the root-cause of this problem.
By now I fully agree with you, that gpio-manager should not get libgpiod.so as
a dependency even if I don't know yet where this error is coming from.
Kind Regards, and thanks for your support,
Boerge
prev parent reply other threads:[~2025-02-07 15:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 16:49 [libgpiod][PATCH 1/1] dbus: manager: fix linker not finding libgpiod.so Boerge Struempfel
2024-11-04 9:38 ` Bartosz Golaszewski
2024-11-04 11:18 ` Börge Strümpfel
2025-02-05 23:46 ` Börge Strümpfel
2025-02-06 8:48 ` Bartosz Golaszewski
2025-02-07 15:45 ` Börge Strümpfel [this message]
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=CAEktqcu3+to5VBA5SSM51gsZqCROyRtRXCW09_6L16vXaWhAnw@mail.gmail.com \
--to=boerge.struempfel@gmail.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=bstruempfel@ultratronik.de \
--cc=linux-gpio@vger.kernel.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).