Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: orbea <orbea@riseup.net>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [PATCH] bindings: cxx: link using the libtool archives
Date: Thu, 21 Mar 2024 06:34:46 -0700	[thread overview]
Message-ID: <20240321063446.0cfd3229@Akita> (raw)
In-Reply-To: <CAMRc=Mc1JOf97jQKPL_k3u=NWJBf2aGGDPTw5kaem3t3SzSxig@mail.gmail.com>

On Wed, 20 Mar 2024 17:43:46 +0100
Bartosz Golaszewski <brgl@bgdev.pl> wrote:

> On Wed, Mar 20, 2024 at 2:50 PM <orbea@riseup.net> wrote:
> >
> > From: orbea <orbea@riseup.net>
> >
> > When linking with internal dependencies that were built with
> > libtool the most reliable method is to use the libtool archive
> > (.la) files.
> >
> > When building with slibtool it fails when it doesn't find the
> > -lgpiod linker flag, but if libgpiod is already installed to the
> > system it will be built using the system version instead of the
> > newly built libraries.
> >
> > Gentoo issue: https://bugs.gentoo.org/913899
> >
> > Signed-off-by: orbea <orbea@riseup.net>
> > ---
> >  bindings/cxx/Makefile.am          | 2 +-
> >  bindings/cxx/examples/Makefile.am | 2 +-
> >  bindings/cxx/tests/Makefile.am    | 6 +++---
> >  3 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/bindings/cxx/Makefile.am b/bindings/cxx/Makefile.am
> > index 1eafaa2..e2a89cf 100644
> > --- a/bindings/cxx/Makefile.am
> > +++ b/bindings/cxx/Makefile.am
> > @@ -24,8 +24,8 @@ libgpiodcxx_la_CXXFLAGS = -Wall -Wextra -g
> > -std=gnu++17 libgpiodcxx_la_CXXFLAGS += -fvisibility=hidden
> > -I$(top_srcdir)/include/ libgpiodcxx_la_CXXFLAGS +=
> > $(PROFILING_CFLAGS) libgpiodcxx_la_LDFLAGS = -version-info $(subst
> > .,:,$(ABI_CXX_VERSION)) -libgpiodcxx_la_LDFLAGS += -lgpiod
> > -L$(top_builddir)/lib libgpiodcxx_la_LDFLAGS += $(PROFILING_LDFLAGS)
> > +libgpiodcxx_la_LIBADD = $(top_builddir)/lib/libgpiod.la
> >
> >  include_HEADERS = gpiod.hpp
> >
> > diff --git a/bindings/cxx/examples/Makefile.am
> > b/bindings/cxx/examples/Makefile.am index 64ced20..eca4d64 100644
> > --- a/bindings/cxx/examples/Makefile.am
> > +++ b/bindings/cxx/examples/Makefile.am
> > @@ -3,7 +3,7 @@
> >
> >  AM_CXXFLAGS = -I$(top_srcdir)/bindings/cxx/ -I$(top_srcdir)/include
> >  AM_CXXFLAGS += -Wall -Wextra -g -std=gnu++17
> > -AM_LDFLAGS = -lgpiodcxx -L$(top_builddir)/bindings/cxx/
> > +LDADD = $(top_builddir)/bindings/cxx/libgpiodcxx.la
> >
> >  noinst_PROGRAMS = \
> >         async_watch_line_value \
> > diff --git a/bindings/cxx/tests/Makefile.am
> > b/bindings/cxx/tests/Makefile.am index 02b5b6d..4d40d33 100644
> > --- a/bindings/cxx/tests/Makefile.am
> > +++ b/bindings/cxx/tests/Makefile.am
> > @@ -4,9 +4,9 @@
> >  AM_CXXFLAGS = -I$(top_srcdir)/bindings/cxx/ -I$(top_srcdir)/include
> >  AM_CXXFLAGS += -I$(top_srcdir)/tests/gpiosim/
> >  AM_CXXFLAGS += -Wall -Wextra -g -std=gnu++17 $(CATCH2_CFLAGS)
> > -AM_LDFLAGS = -lgpiodcxx -L$(top_builddir)/bindings/cxx/
> > -AM_LDFLAGS += -lgpiosim -L$(top_builddir)/tests/gpiosim/
> > -AM_LDFLAGS += -pthread
> > +AM_LDFLAGS = -pthread
> > +LDADD = $(top_builddir)/bindings/cxx/libgpiodcxx.la
> > +LDADD += $(top_builddir)/tests/gpiosim/libgiosim.la  
> 
> Please test your changes, this is a typo and it doesn't build. It
> should have been "libgpiosim".
> 
> I fixed it up when applying.
> 
> Thanks,
> Bartosz
> 
> >
> >  noinst_PROGRAMS = gpiod-cxx-test
> >
> > --
> > 2.43.2
> >
> >  

Thank you and apologies, I neglected to mention that I was having a
hard time getting the tests to build because the check2 in Gentoo
doesn't seem compatible with what you expect. Maybe its too new?

(Sending this twice because I forgot to CC the list)

  reply	other threads:[~2024-03-21 13:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 13:49 [PATCH] bindings: cxx: link using the libtool archives orbea
2024-03-20 15:18 ` Bartosz Golaszewski
2024-03-20 16:00   ` orbea
2024-03-20 16:42     ` Bartosz Golaszewski
2024-03-20 16:43 ` Bartosz Golaszewski
2024-03-21 13:34   ` orbea [this message]
2024-03-21 15:00     ` Bartosz Golaszewski

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=20240321063446.0cfd3229@Akita \
    --to=orbea@riseup.net \
    --cc=brgl@bgdev.pl \
    --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