linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: "Börge Strümpfel" <boerge.struempfel@gmail.com>
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: Thu, 6 Feb 2025 09:48:30 +0100	[thread overview]
Message-ID: <CAMRc=McDT-apAk2=Me0Ahz4t_EWvhzGF8uemtuEbBtFT2Nu0Ww@mail.gmail.com> (raw)
In-Reply-To: <CAEktqct2w3FBdce5993s9PNf+OtuCT_T69q5tSn6y_hRwuiNVA@mail.gmail.com>

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.

>
> 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?

Bart

  reply	other threads:[~2025-02-06  8:48 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 [this message]
2025-02-07 15:45         ` Börge Strümpfel

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='CAMRc=McDT-apAk2=Me0Ahz4t_EWvhzGF8uemtuEbBtFT2Nu0Ww@mail.gmail.com' \
    --to=brgl@bgdev.pl \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=boerge.struempfel@gmail.com \
    --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).