On Wed, 30 Aug 2023 at 18:44, Sebastian Kuzminsky <s...@highlab.com> wrote:

> I'm confused by this command line.
>
> The "-o ../bin/rtapi_app" indicates that we're building rtapi_app from a
> bunch of object files and libraries.  Is it really rtapi_app that needs
> to be linked against libgpiod, isn't it the hal_gpiod driver?

Adding the -lgpiod to rtapi_app is what fixed the same problem on Buster.
(Note that it all works just fine on Buster, just not bookworm. This
could be a gcc / c++ version difference)

It is possible that hal_gpio _also_ needs a -lgpiod though I am not
sure how to arrange that.

I was clued-in to the rtapi_app dependency by the error message:

hal_gpio: dlopen: /home/andypugh/linuxcnc-dev/rtlib/hal_gpio.so:
undefined symbol: gpiod_line_find
<stdin>:1: waitpid failed /home/andypugh/linuxcnc-dev/bin/rtapi_app hal_gpio
<stdin>:1: /home/andypugh/linuxcnc-dev/bin/rtapi_app exited without
becoming ready
<stdin>:1: insmod for hal_gpio failed, returned -1

Which mentions rtapi_app.

As I said, this fixes it in Buster, but not Bookworm.

> the other possibility that comes to mind is the order of
> arguments on the linker command line.  Some linkers (but I think not
> all?) require that the "-lwhatever" libraries come *later* in the
> command line than the object files that require them.  When the linker
> comes to to a -l argument, it tries to satisfy any *currently unknown*
> symbols from the named library.

That's certainly worth a try.

> If none of rtapi_app's input files needed symbols from libgpiod, then
> the linker will not link rtapi_app against libgpiod.  See for example
> how the -ltirpc in the linker command line did not cause rtapi_app to be
> linked to libtirpc.

Or pthread.

But they all _were_ linked when compiling under Buster....


-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to