Skip to contentSkip to conversation

undefined reference to `fuse_main_real_compat25' when build with --enable-registry

DISCUSSION Mauro S. 3 participants 10 messages Feb 7, 2023 – Feb 22, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mauro S.

author
#1 lore raw

Hi all,

I'm bulding Xenomai 3.2.2 for x86_64.

When I configure the library with --enable-registry, I get the error

..
CCLD rtcanrecv
libcopperplate.so: undefined reference to `fuse_main_real_compat25'
collect2: error: ld returned 1 exit status
..

libfuse-dev package is installed (the configure script finds fuse), and it has the function fuse_main_real_compat25 exported

readelf -Ws /usr/lib/x86_64-linux-gnu/libfuse.so | grep
fuse_main_real_compat25
318: 000000000001a500 14 FUNC GLOBAL DEFAULT 12
fuse_main_real_compat25@@FUSE_2.6

Seems that during Xenomai build the libcopperplate.so is not linked to libfuse.so. I tried to solve by myself but I'm not very familiar with autotools, so I gave up.

Thanks in advance, regards

Signature · 1 line
Mauro S.
#2 lore raw
Quoted 21 lines

-----Original Message-----
From: Mauro S. <[email protected]>
Sent: Tuesday, February 7, 2023 9:46 PM
To: [email protected]
Subject: undefined reference to `fuse_main_real_compat25' when build with - -enable-registry

Hi all,

I'm bulding Xenomai 3.2.2 for x86_64.

When I configure the library with --enable-registry, I get the error

..
CCLD rtcanrecv
libcopperplate.so: undefined reference to `fuse_main_real_compat25'
collect2: error: ld returned 1 exit status
..

Quoted 7 lines

libfuse-dev package is installed (the configure script finds fuse), and it has the function fuse_main_real_compat25 exported

readelf -Ws /usr/lib/x86_64-linux-gnu/libfuse.so | grep
fuse_main_real_compat25
318: 000000000001a500 14 FUNC GLOBAL DEFAULT 12
fuse_main_real_compat25@@FUSE_2.6

I do not know if it might be related to fuse version. In configure.ac , it selects fuse version 25 but you are using 26?

if test x$use_registry = xy; then
PKG_CHECK_MODULES(FUSE, fuse)
FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=25" AC_DEFINE(CONFIG_XENO_REGISTRY,1,[config]) AC_DEFINE_UNQUOTED(CONFIG_XENO_REGISTRY_ROOT,"$registry_root",[config])
Fi

Regards

Hongzhan Chen

Quoted 8 lines

Seems that during Xenomai build the libcopperplate.so is not linked to libfuse.so. I tried to solve by myself but I'm not very familiar with autotools, so I gave up.

Thanks in advance, regards
--
Mauro S.

#3 lore raw
Quoted 29 lines · Hongzhan
Quoted 21 lines

-----Original Message-----
From: Mauro S. <[email protected]>
Sent: Tuesday, February 7, 2023 9:46 PM
To: [email protected]
Subject: undefined reference to `fuse_main_real_compat25' when build with - -enable-registry

Hi all,

I'm bulding Xenomai 3.2.2 for x86_64.

When I configure the library with --enable-registry, I get the error

..
CCLD rtcanrecv
libcopperplate.so: undefined reference to `fuse_main_real_compat25'
collect2: error: ld returned 1 exit status
..

Quoted 7 lines

libfuse-dev package is installed (the configure script finds fuse), and it has the function fuse_main_real_compat25 exported

readelf -Ws /usr/lib/x86_64-linux-gnu/libfuse.so | grep
fuse_main_real_compat25
318: 000000000001a500 14 FUNC GLOBAL DEFAULT 12
fuse_main_real_compat25@@FUSE_2.6

Quoted 8 lines

I do not know if it might be related to fuse version. In configure.ac , it selects fuse version 25 but you are using 26?

if test x$use_registry = xy; then
PKG_CHECK_MODULES(FUSE, fuse)
FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=25" AC_DEFINE(CONFIG_XENO_REGISTRY,1,[config]) AC_DEFINE_UNQUOTED(CONFIG_XENO_REGISTRY_ROOT,"$registry_root",[config])
Fi

That's a good hint. I vaguely recall similar issues when building against a newer version and trying to run that against an older one on the target.

Jan

Signature · 2 lines
Siemens AG, Technology
Competence Center Embedded Linux
author
#4 lore raw

Il 08/02/23 09:21, Jan Kiszka ha scritto:

Quoted 39 lines · Hongzhan
Quoted 29 lines
Quoted 21 lines

-----Original Message-----
From: Mauro S. <[email protected]>
Sent: Tuesday, February 7, 2023 9:46 PM
To: [email protected]
Subject: undefined reference to `fuse_main_real_compat25' when build with - -enable-registry

Hi all,

I'm bulding Xenomai 3.2.2 for x86_64.

When I configure the library with --enable-registry, I get the error

..
CCLD rtcanrecv
libcopperplate.so: undefined reference to `fuse_main_real_compat25'
collect2: error: ld returned 1 exit status
..

Quoted 7 lines

libfuse-dev package is installed (the configure script finds fuse), and it has the function fuse_main_real_compat25 exported

   readelf -Ws /usr/lib/x86_64-linux-gnu/libfuse.so | grep
fuse_main_real_compat25
    318: 000000000001a500    14 FUNC    GLOBAL DEFAULT   12

fuse_main_real_compat25@@FUSE_2.6

Quoted 8 lines

I do not know if it might be related to fuse version. In configure.ac , it selects fuse version 25 but you are using 26?

if test x$use_registry = xy; then
PKG_CHECK_MODULES(FUSE, fuse)
FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=25" AC_DEFINE(CONFIG_XENO_REGISTRY,1,[config]) AC_DEFINE_UNQUOTED(CONFIG_XENO_REGISTRY_ROOT,"$registry_root",[config])
Fi

Quoted 6 lines

That's a good hint. I vaguely recall similar issues when building against a newer version and trying to run that against an older one on the target.

Jan

Hi all,

Yes, I'm using libfuse compiled with FUSE_USE_VERSION=26. I'm building in Yocto.

I tried to
- change FUSE_USE_VERSION=26 in Xenomai: does not work
- change FUSE_USE_VERSION=25 in fuse and rebuild it: does not work

I finally removed the can utils from the Xenomai build (I don't need it) and the build completes correctly.

Seems that the fuse symbols are not found only for can utils (don't know why).

Thanks, regards

Signature · 1 line
Mauro S.
author
#5 lore raw

Il 21/02/23 11:24, Mauro S. ha scritto:

Quoted 57 lines

Il 08/02/23 09:21, Jan Kiszka ha scritto:

Quoted 37 lines · Hongzhan
Quoted 36 lines
Quoted 21 lines

-----Original Message-----
From: Mauro S. <[email protected]>
Sent: Tuesday, February 7, 2023 9:46 PM
To: [email protected]
Subject: undefined reference to `fuse_main_real_compat25' when build with - -enable-registry

Hi all,

I'm bulding Xenomai 3.2.2 for x86_64.

When I configure the library with --enable-registry, I get the error

   ..
     CCLD     rtcanrecv
   libcopperplate.so: undefined reference to `fuse_main_real_compat25'
   collect2: error: ld returned 1 exit status
   ..

Quoted 7 lines

libfuse-dev package is installed (the configure script finds fuse), and it has the function fuse_main_real_compat25 exported

   readelf -Ws /usr/lib/x86_64-linux-gnu/libfuse.so | grep fuse_main_real_compat25
    318: 000000000001a500    14 FUNC    GLOBAL DEFAULT   12 fuse_main_real_compat25@@FUSE_2.6

I do not know if it might be related to fuse version. In configure.ac , it selects fuse version 25 but you are using 26?

if test x$use_registry = xy; then PKG_CHECK_MODULES(FUSE, fuse) FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=25" AC_DEFINE(CONFIG_XENO_REGISTRY,1,[config])

Quoted 9 lines
Quoted 2 lines

AC_DEFINE_UNQUOTED(CONFIG_XENO_REGISTRY_ROOT,"$registry_root",[config]) Fi

That's a good hint. I vaguely recall similar issues when building against a newer version and trying to run that against an older one on the target.

Jan

Hi all,

Yes, I'm using libfuse compiled with FUSE_USE_VERSION=26. I'm building in Yocto.

I tried to
- change FUSE_USE_VERSION=26 in Xenomai: does not work
- change FUSE_USE_VERSION=25 in fuse and rebuild it: does not work

Quoted 6 lines

I finally removed the can utils from the Xenomai build (I don't need it) and the build completes correctly.

Seems that the fuse symbols are not found only for can utils (don't know why).

Thanks, regards

Replying to myself: Xenomai does build but does not work:

/usr/lib/libcopperplate.so.0: undefined symbol: fuse_main_real_compat25

Strange thing is that /usr/lib/libcopperplate.so.0 does not depend by libfuse2 (that have the fuse_main_real_compat25 symbol exported)

LD_TRACE_LOADED_OBJECTS=1 /lib/ld-linux-x86-64.so.2 /usr/lib/libcopperplate.so.0

	linux-vdso.so.1 (0x00007ffe6ed14000)
	libcobalt.so.2 => /usr/lib/libcobalt.so.2 (0x00007f21fc308000)
	libmodechk.so.0 => /usr/lib/libmodechk.so.0 (0x00007f21fc303000)
	librt.so.1 => /lib/librt.so.1 (0x00007f21fc2f8000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x00007f21fc2d7000)
	libc.so.6 => /lib/libc.so.6 (0x00007f21fc10a000)
	/lib/ld-linux-x86-64.so.2 (0x00007f21fc355000)

Other hints? Thanks in advance, regards

Signature · 1 line
Mauro S.
#6 lore raw
Quoted 87 lines · Mauro S.

Il 21/02/23 11:24, Mauro S. ha scritto:

Quoted 60 lines

Il 08/02/23 09:21, Jan Kiszka ha scritto:

Quoted 43 lines · Hongzhan
Quoted 34 lines
Quoted 22 lines

-----Original Message-----
From: Mauro S. <[email protected]>
Sent: Tuesday, February 7, 2023 9:46 PM
To: [email protected]
Subject: undefined reference to `fuse_main_real_compat25' when build with -
-enable-registry

Hi all,

I'm bulding Xenomai 3.2.2 for x86_64.

When I configure the library with --enable-registry, I get the error

   ..
     CCLD     rtcanrecv
   libcopperplate.so: undefined reference to `fuse_main_real_compat25'
   collect2: error: ld returned 1 exit status
   ..

Quoted 8 lines

libfuse-dev package is installed (the configure script finds fuse), and
it has the function fuse_main_real_compat25 exported

   readelf -Ws /usr/lib/x86_64-linux-gnu/libfuse.so | grep fuse_main_real_compat25
    318: 000000000001a500    14 FUNC    GLOBAL DEFAULT   12 fuse_main_real_compat25@@FUSE_2.6

I do not know if it might be related to fuse version. In configure.ac , it selects fuse version 25 but you are using 26?

Quoted 7 lines

if test x$use_registry = xy; then
         PKG_CHECK_MODULES(FUSE, fuse) FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=25" AC_DEFINE(CONFIG_XENO_REGISTRY,1,[config])
AC_DEFINE_UNQUOTED(CONFIG_XENO_REGISTRY_ROOT,"$registry_root",[config]) Fi

Quoted 6 lines

That's a good hint. I vaguely recall similar issues when building against a newer version and trying to run that against an older one on the target.

Jan

Hi all,

Yes, I'm using libfuse compiled with FUSE_USE_VERSION=26. I'm building in Yocto.

I tried to
- change FUSE_USE_VERSION=26 in Xenomai: does not work
- change FUSE_USE_VERSION=25 in fuse and rebuild it: does not work

Quoted 8 lines

I finally removed the can utils from the Xenomai build (I don't need it) and the build completes correctly.

Seems that the fuse symbols are not found only for can utils (don't know why).

Thanks, regards

Replying to myself: Xenomai does build but does not work:

/usr/lib/libcopperplate.so.0: undefined symbol: fuse_main_real_compat25

Strange thing is that /usr/lib/libcopperplate.so.0 does not depend by libfuse2 (that have the fuse_main_real_compat25 symbol exported)

LD_TRACE_LOADED_OBJECTS=1 /lib/ld-linux-x86-64.so.2 /usr/lib/libcopperplate.so.0
    linux-vdso.so.1 (0x00007ffe6ed14000)
    libcobalt.so.2 => /usr/lib/libcobalt.so.2 (0x00007f21fc308000) libmodechk.so.0 => /usr/lib/libmodechk.so.0 (0x00007f21fc303000) librt.so.1 => /lib/librt.so.1 (0x00007f21fc2f8000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f21fc2d7000) libc.so.6 => /lib/libc.so.6 (0x00007f21fc10a000) /lib/ld-linux-x86-64.so.2 (0x00007f21fc355000)

Quoted 1 line

Other hints? Thanks in advance, regards

If only can-utils are affected, it should be possible to spot some delta in the Makefiles, the build logs or also the generated binaries of other tools. There are many more tools, and the can-utils do not reference fuse or the registry service explicitly.

And: Where does version 25 come from? Do you have it on the host, and something actually leaks into the yocto build so that the host libs are referenced?

Jan

Signature · 2 lines
Siemens AG, Technology
Competence Center Embedded Linux
author
#7 lore raw

Il 21/02/23 17:57, Jan Kiszka ha scritto:

Quoted 88 lines · Mauro S.
Quoted 87 lines

Il 21/02/23 11:24, Mauro S. ha scritto:

Quoted 60 lines

Il 08/02/23 09:21, Jan Kiszka ha scritto:

Quoted 40 lines · Hongzhan
Quoted 39 lines
Quoted 22 lines

-----Original Message-----
From: Mauro S. <[email protected]>
Sent: Tuesday, February 7, 2023 9:46 PM
To: [email protected]
Subject: undefined reference to `fuse_main_real_compat25' when build with -
-enable-registry

Hi all,

I'm bulding Xenomai 3.2.2 for x86_64.

When I configure the library with --enable-registry, I get the error

   ..
     CCLD     rtcanrecv
   libcopperplate.so: undefined reference to `fuse_main_real_compat25'
   collect2: error: ld returned 1 exit status
   ..

Quoted 8 lines

libfuse-dev package is installed (the configure script finds fuse), and
it has the function fuse_main_real_compat25 exported

   readelf -Ws /usr/lib/x86_64-linux-gnu/libfuse.so | grep
fuse_main_real_compat25
    318: 000000000001a500    14 FUNC    GLOBAL DEFAULT   12
fuse_main_real_compat25@@FUSE_2.6

I do not know if it might be related to fuse version. In configure.ac , it selects fuse version 25 but you are using 26?

if test x$use_registry = xy; then
         PKG_CHECK_MODULES(FUSE, fuse) FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=25" AC_DEFINE(CONFIG_XENO_REGISTRY,1,[config])

Quoted 9 lines
Quoted 2 lines

AC_DEFINE_UNQUOTED(CONFIG_XENO_REGISTRY_ROOT,"$registry_root",[config]) Fi

That's a good hint. I vaguely recall similar issues when building against a newer version and trying to run that against an older one on the target.

Jan

Hi all,

Yes, I'm using libfuse compiled with FUSE_USE_VERSION=26. I'm building in Yocto.

I tried to
- change FUSE_USE_VERSION=26 in Xenomai: does not work
- change FUSE_USE_VERSION=25 in fuse and rebuild it: does not work

Quoted 8 lines

I finally removed the can utils from the Xenomai build (I don't need it) and the build completes correctly.

Seems that the fuse symbols are not found only for can utils (don't know why).

Thanks, regards

Replying to myself: Xenomai does build but does not work:

/usr/lib/libcopperplate.so.0: undefined symbol: fuse_main_real_compat25

Strange thing is that /usr/lib/libcopperplate.so.0 does not depend by libfuse2 (that have the fuse_main_real_compat25 symbol exported)

LD_TRACE_LOADED_OBJECTS=1 /lib/ld-linux-x86-64.so.2 /usr/lib/libcopperplate.so.0
    linux-vdso.so.1 (0x00007ffe6ed14000)
    libcobalt.so.2 => /usr/lib/libcobalt.so.2 (0x00007f21fc308000) libmodechk.so.0 => /usr/lib/libmodechk.so.0 (0x00007f21fc303000) librt.so.1 => /lib/librt.so.1 (0x00007f21fc2f8000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f21fc2d7000) libc.so.6 => /lib/libc.so.6 (0x00007f21fc10a000) /lib/ld-linux-x86-64.so.2 (0x00007f21fc355000)

Quoted 7 lines
Quoted 1 line

Other hints? Thanks in advance, regards

If only can-utils are affected, it should be possible to spot some delta in the Makefiles, the build logs or also the generated binaries of other tools. There are many more tools, and the can-utils do not reference fuse or the registry service explicitly.

Yes, I will go in this direction doing diffs between build logs, ldflags order etc.

Quoted 3 lines

And: Where does version 25 come from? Do you have it on the host, and something actually leaks into the yocto build so that the host libs are referenced?

Version 25 is the libfuse API/ABI version that Xenomai wants to use, and it is indicated in Xenomai's configure.ac, as pointed out by Chen.

libfuse is built with version 26, but contains backward compatibility API/ABI for version 25, allowing the binaries to use it like Xenomai is doing. In fact, the libfuse2.so library contains the fuse_main_real_compat25, but canutils does not see it during the build, and libcopperplate does not find it at runtime because seems not linked to libfuse2.

I will do more investigations about it.

Thanks, regards

Quoted 3 lines

Jan

Signature · 1 line
Mauro S.
author
#8 lore raw

Il 22/02/23 08:19, Mauro S. ha scritto:

Quoted 102 lines

Il 21/02/23 17:57, Jan Kiszka ha scritto:

Quoted 87 lines · Mauro S.
Quoted 86 lines

Il 21/02/23 11:24, Mauro S. ha scritto:

Quoted 59 lines

Il 08/02/23 09:21, Jan Kiszka ha scritto:

Quoted 42 lines · Hongzhan
Quoted 34 lines
Quoted 22 lines

-----Original Message-----
From: Mauro S. <[email protected]>
Sent: Tuesday, February 7, 2023 9:46 PM
To: [email protected]
Subject: undefined reference to `fuse_main_real_compat25' when build with -
-enable-registry

Hi all,

I'm bulding Xenomai 3.2.2 for x86_64.

When I configure the library with --enable-registry, I get the error

    ..
      CCLD     rtcanrecv
    libcopperplate.so: undefined reference to `fuse_main_real_compat25'
    collect2: error: ld returned 1 exit status
    ..

Quoted 8 lines

libfuse-dev package is installed (the configure script finds fuse), and
it has the function fuse_main_real_compat25 exported

    readelf -Ws /usr/lib/x86_64-linux-gnu/libfuse.so | grep fuse_main_real_compat25
     318: 000000000001a500    14 FUNC    GLOBAL DEFAULT   12 fuse_main_real_compat25@@FUSE_2.6

I do not know if it might be related to fuse version. In configure.ac , it selects fuse version 25 but you are using 26?

Quoted 6 lines

if test x$use_registry = xy; then
          PKG_CHECK_MODULES(FUSE, fuse) FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=25" AC_DEFINE(CONFIG_XENO_REGISTRY,1,[config]) AC_DEFINE_UNQUOTED(CONFIG_XENO_REGISTRY_ROOT,"$registry_root",[config]) Fi

Quoted 6 lines

That's a good hint. I vaguely recall similar issues when building against a newer version and trying to run that against an older one on the target.

Jan

Hi all,

Yes, I'm using libfuse compiled with FUSE_USE_VERSION=26. I'm building in Yocto.

I tried to
- change FUSE_USE_VERSION=26 in Xenomai: does not work
- change FUSE_USE_VERSION=25 in fuse and rebuild it: does not work

Quoted 8 lines

I finally removed the can utils from the Xenomai build (I don't need it) and the build completes correctly.

Seems that the fuse symbols are not found only for can utils (don't know why).

Thanks, regards

Replying to myself: Xenomai does build but does not work:

/usr/lib/libcopperplate.so.0: undefined symbol: fuse_main_real_compat25

Strange thing is that /usr/lib/libcopperplate.so.0 does not depend by libfuse2 (that have the fuse_main_real_compat25 symbol exported)

LD_TRACE_LOADED_OBJECTS=1 /lib/ld-linux-x86-64.so.2 /usr/lib/libcopperplate.so.0
     linux-vdso.so.1 (0x00007ffe6ed14000)
     libcobalt.so.2 => /usr/lib/libcobalt.so.2 (0x00007f21fc308000) libmodechk.so.0 => /usr/lib/libmodechk.so.0 (0x00007f21fc303000) librt.so.1 => /lib/librt.so.1 (0x00007f21fc2f8000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f21fc2d7000) libc.so.6 => /lib/libc.so.6 (0x00007f21fc10a000) /lib/ld-linux-x86-64.so.2 (0x00007f21fc355000)

Quoted 7 lines
Quoted 1 line

Other hints? Thanks in advance, regards

If only can-utils are affected, it should be possible to spot some delta in the Makefiles, the build logs or also the generated binaries of other tools. There are many more tools, and the can-utils do not reference fuse or the registry service explicitly.

Yes, I will go in this direction doing diffs between build logs, ldflags order etc.

Quoted 3 lines

And: Where does version 25 come from? Do you have it on the host, and something actually leaks into the yocto build so that the host libs are referenced?

Quoted 8 lines

Version 25 is the libfuse API/ABI version that Xenomai wants to use, and it is indicated in Xenomai's configure.ac, as pointed out by Chen.

libfuse is built with version 26, but contains backward compatibility API/ABI for version 25, allowing the binaries to use it like Xenomai is doing. In fact, the libfuse2.so library contains the fuse_main_real_compat25, but canutils does not see it during the build, and libcopperplate does not find it at runtime because seems not linked to libfuse2.

I will do more investigations about it.

Thanks, regards

Ok, found the problem. First of all, canutils buld fails because libcopperplate does not find fuse_main_real_compat25 (as you stated, canutils does not need libfuse directly).

libcopperplate does not find fuse_main_real_compat25 because libregistry_la lacks the fuse ldflags. This patch solves the issue:

lib/copperplate/Makefile.am +3 -0
index 671e87d79..a68f2c80c 100644
@@ -34,6 +34,9 @@ libregistry_la_SOURCES = registry.c
 libregistry_la_CPPFLAGS =              \
        $(libcopperplate@CORE@_la_CPPFLAGS)     \
        @XENO_FUSE_CFLAGS@
+
+libregistry_la_LIBADD =                \
+       @FUSE_LIBS@
 endif
 
 if XENO_PSHARED

But for me it's strange that this error does happen only to me.
If you are ok with this patch, I can send it in mailong list, or just take it from this messsage if you prefer.

I also have another fix for sysregd utility, that I will send in a separate thread.

Regards

Signature · 1 line
Mauro S.
#9 lore raw
Quoted 142 lines · Mauro S.

Il 22/02/23 08:19, Mauro S. ha scritto:

Quoted 116 lines

Il 21/02/23 17:57, Jan Kiszka ha scritto:

Quoted 90 lines · Mauro S.
Quoted 89 lines

Il 21/02/23 11:24, Mauro S. ha scritto:

Quoted 62 lines

Il 08/02/23 09:21, Jan Kiszka ha scritto:

Quoted 44 lines · Hongzhan
Quoted 36 lines
Quoted 24 lines

-----Original Message-----
From: Mauro S. <[email protected]>
Sent: Tuesday, February 7, 2023 9:46 PM
To: [email protected]
Subject: undefined reference to `fuse_main_real_compat25' when build with -
-enable-registry

Hi all,

I'm bulding Xenomai 3.2.2 for x86_64.

When I configure the library with --enable-registry, I get the error

    ..
      CCLD     rtcanrecv
    libcopperplate.so: undefined reference to
`fuse_main_real_compat25'
    collect2: error: ld returned 1 exit status
    ..

Quoted 8 lines

libfuse-dev package is installed (the configure script finds fuse), and
it has the function fuse_main_real_compat25 exported

    readelf -Ws /usr/lib/x86_64-linux-gnu/libfuse.so | grep fuse_main_real_compat25
     318: 000000000001a500    14 FUNC    GLOBAL DEFAULT   12 fuse_main_real_compat25@@FUSE_2.6

I do not know if it might be related to fuse version. In configure.ac , it selects fuse version 25 but you are using 26?

Quoted 6 lines

if test x$use_registry = xy; then
          PKG_CHECK_MODULES(FUSE, fuse) FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=25" AC_DEFINE(CONFIG_XENO_REGISTRY,1,[config]) AC_DEFINE_UNQUOTED(CONFIG_XENO_REGISTRY_ROOT,"$registry_root",[config]) Fi

Quoted 7 lines

That's a good hint. I vaguely recall similar issues when building against a newer version and trying to run that against an older one on
the target.

Jan

Hi all,

Yes, I'm using libfuse compiled with FUSE_USE_VERSION=26. I'm building in Yocto.

I tried to
- change FUSE_USE_VERSION=26 in Xenomai: does not work
- change FUSE_USE_VERSION=25 in fuse and rebuild it: does not work

Quoted 8 lines

I finally removed the can utils from the Xenomai build (I don't need it) and the build completes correctly.

Seems that the fuse symbols are not found only for can utils (don't know why).

Thanks, regards

Replying to myself: Xenomai does build but does not work:

/usr/lib/libcopperplate.so.0: undefined symbol: fuse_main_real_compat25

Strange thing is that /usr/lib/libcopperplate.so.0 does not depend by libfuse2 (that have the fuse_main_real_compat25 symbol exported)

LD_TRACE_LOADED_OBJECTS=1 /lib/ld-linux-x86-64.so.2 /usr/lib/libcopperplate.so.0
     linux-vdso.so.1 (0x00007ffe6ed14000)
     libcobalt.so.2 => /usr/lib/libcobalt.so.2 (0x00007f21fc308000) libmodechk.so.0 => /usr/lib/libmodechk.so.0 (0x00007f21fc303000) librt.so.1 => /lib/librt.so.1 (0x00007f21fc2f8000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f21fc2d7000) libc.so.6 => /lib/libc.so.6 (0x00007f21fc10a000) /lib/ld-linux-x86-64.so.2 (0x00007f21fc355000)

Quoted 7 lines
Quoted 1 line

Other hints? Thanks in advance, regards

If only can-utils are affected, it should be possible to spot some delta in the Makefiles, the build logs or also the generated binaries of other tools. There are many more tools, and the can-utils do not reference fuse or the registry service explicitly.

Yes, I will go in this direction doing diffs between build logs, ldflags order etc.

Quoted 3 lines

And: Where does version 25 come from? Do you have it on the host, and something actually leaks into the yocto build so that the host libs are referenced?

Version 25 is the libfuse API/ABI version that Xenomai wants to use, and it is indicated in Xenomai's configure.ac, as pointed out by Chen.

libfuse is built with version 26, but contains backward compatibility API/ABI for version 25, allowing the binaries to use it like Xenomai is doing. In fact, the libfuse2.so library contains the fuse_main_real_compat25, but canutils does not see it during the build, and libcopperplate does not find it at runtime because seems not linked to libfuse2.

Quoted 4 lines

I will do more investigations about it.

Thanks, regards

Ok, found the problem. First of all, canutils buld fails because libcopperplate does not find fuse_main_real_compat25 (as you stated, canutils does not need libfuse directly).

libcopperplate does not find fuse_main_real_compat25 because libregistry_la lacks the fuse ldflags. This patch solves the issue:

lib/copperplate/Makefile.am +0 -0
index 671e87d79..a68f2c80c 100644
@@ -34,6 +34,9 @@ libregistry_la_SOURCES = registry.c
  libregistry_la_CPPFLAGS =              \
         $(libcopperplate@CORE@_la_CPPFLAGS)     \

        @XENO_FUSE_CFLAGS@

lib/copperplate/Makefile.am +3 -0
+
+libregistry_la_LIBADD =                \
+       @FUSE_LIBS@

 endif

Quoted 6 lines

 if XENO_PSHARED

But for me it's strange that this error does happen only to me. If you are ok with this patch, I can send it in mailong list, or just take it from this messsage if you prefer.

I don't recall all details, but I did recall something similar from the past:
https://source.denx.de/Xenomai/xenomai/-/commit/9287a691412ac1da0d611606499eb0201c2e0247

Reading "optimization", I could imagine that different compiler/linker versions have an impact here. Are you on gcc-12 or something similarly recent?

Quoted 3 lines

I also have another fix for sysregd utility, that I will send in a separate thread.

Yes, please.

Thanks for resolving this!

Jan

Signature · 2 lines
Siemens AG, Technology
Competence Center Embedded Linux
author
#10 lore raw

Il 22/02/23 12:55, Jan Kiszka ha scritto:

Quoted 154 lines · Mauro S.
Quoted 144 lines

Il 22/02/23 08:19, Mauro S. ha scritto:

Quoted 116 lines

Il 21/02/23 17:57, Jan Kiszka ha scritto:

Quoted 90 lines · Mauro S.
Quoted 89 lines

Il 21/02/23 11:24, Mauro S. ha scritto:

Quoted 62 lines

Il 08/02/23 09:21, Jan Kiszka ha scritto:

Quoted 44 lines · Hongzhan
Quoted 36 lines
Quoted 24 lines

-----Original Message-----
From: Mauro S. <[email protected]>
Sent: Tuesday, February 7, 2023 9:46 PM
To: [email protected]
Subject: undefined reference to `fuse_main_real_compat25' when build with -
-enable-registry

Hi all,

I'm bulding Xenomai 3.2.2 for x86_64.

When I configure the library with --enable-registry, I get the error

    ..
      CCLD     rtcanrecv
    libcopperplate.so: undefined reference to
`fuse_main_real_compat25'
    collect2: error: ld returned 1 exit status
    ..

Quoted 8 lines

libfuse-dev package is installed (the configure script finds fuse), and
it has the function fuse_main_real_compat25 exported

    readelf -Ws /usr/lib/x86_64-linux-gnu/libfuse.so | grep
fuse_main_real_compat25
     318: 000000000001a500    14 FUNC    GLOBAL DEFAULT   12
fuse_main_real_compat25@@FUSE_2.6

I do not know if it might be related to fuse version. In configure.ac , it selects fuse version 25 but you are using 26?

Quoted 6 lines

if test x$use_registry = xy; then
          PKG_CHECK_MODULES(FUSE, fuse) FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=25" AC_DEFINE(CONFIG_XENO_REGISTRY,1,[config])
AC_DEFINE_UNQUOTED(CONFIG_XENO_REGISTRY_ROOT,"$registry_root",[config]) Fi

Quoted 7 lines

That's a good hint. I vaguely recall similar issues when building against a newer version and trying to run that against an older one on
the target.

Jan

Hi all,

Yes, I'm using libfuse compiled with FUSE_USE_VERSION=26. I'm building in Yocto.

I tried to
- change FUSE_USE_VERSION=26 in Xenomai: does not work
- change FUSE_USE_VERSION=25 in fuse and rebuild it: does not work

Quoted 8 lines

I finally removed the can utils from the Xenomai build (I don't need it) and the build completes correctly.

Seems that the fuse symbols are not found only for can utils (don't know why).

Thanks, regards

Replying to myself: Xenomai does build but does not work:

/usr/lib/libcopperplate.so.0: undefined symbol: fuse_main_real_compat25

Strange thing is that /usr/lib/libcopperplate.so.0 does not depend by libfuse2 (that have the fuse_main_real_compat25 symbol exported)

LD_TRACE_LOADED_OBJECTS=1 /lib/ld-linux-x86-64.so.2 /usr/lib/libcopperplate.so.0
     linux-vdso.so.1 (0x00007ffe6ed14000)
     libcobalt.so.2 => /usr/lib/libcobalt.so.2 (0x00007f21fc308000) libmodechk.so.0 => /usr/lib/libmodechk.so.0 (0x00007f21fc303000) librt.so.1 => /lib/librt.so.1 (0x00007f21fc2f8000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f21fc2d7000) libc.so.6 => /lib/libc.so.6 (0x00007f21fc10a000) /lib/ld-linux-x86-64.so.2 (0x00007f21fc355000)

Quoted 7 lines
Quoted 1 line

Other hints? Thanks in advance, regards

If only can-utils are affected, it should be possible to spot some delta in the Makefiles, the build logs or also the generated binaries of other tools. There are many more tools, and the can-utils do not reference fuse or the registry service explicitly.

Yes, I will go in this direction doing diffs between build logs, ldflags order etc.

Quoted 3 lines

And: Where does version 25 come from? Do you have it on the host, and something actually leaks into the yocto build so that the host libs are referenced?

Version 25 is the libfuse API/ABI version that Xenomai wants to use, and it is indicated in Xenomai's configure.ac, as pointed out by Chen.

libfuse is built with version 26, but contains backward compatibility API/ABI for version 25, allowing the binaries to use it like Xenomai is doing. In fact, the libfuse2.so library contains the fuse_main_real_compat25, but canutils does not see it during the build, and libcopperplate does not find it at runtime because seems not linked to libfuse2.

Quoted 4 lines

I will do more investigations about it.

Thanks, regards

Ok, found the problem. First of all, canutils buld fails because libcopperplate does not find fuse_main_real_compat25 (as you stated, canutils does not need libfuse directly).

libcopperplate does not find fuse_main_real_compat25 because libregistry_la lacks the fuse ldflags. This patch solves the issue:

lib/copperplate/Makefile.am +3 -0
index 671e87d79..a68f2c80c 100644
@@ -34,6 +34,9 @@ libregistry_la_SOURCES = registry.c
  libregistry_la_CPPFLAGS =              \
         $(libcopperplate@CORE@_la_CPPFLAGS)     \
         @XENO_FUSE_CFLAGS@
+
+libregistry_la_LIBADD =                \
+       @FUSE_LIBS@
  endif
 
  if XENO_PSHARED
Quoted 4 lines

But for me it's strange that this error does happen only to me. If you are ok with this patch, I can send it in mailong list, or just take it from this messsage if you prefer.

I don't recall all details, but I did recall something similar from the past:
https://source.denx.de/Xenomai/xenomai/-/commit/9287a691412ac1da0d611606499eb0201c2e0247

Quoted 3 lines

Reading "optimization", I could imagine that different compiler/linker versions have an impact here. Are you on gcc-12 or something similarly recent?

No, I'm using gcc 9.5.0 (Yocto Dunfell)

Quoted 6 lines
Quoted 4 lines

I also have another fix for sysregd utility, that I will send in a separate thread.

Yes, please.

Sent it

Quoted 5 lines

Thanks for resolving this!

Jan

Signature · 1 line
Mauro S.