From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: martin mangard <martin@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] dlopen of libnative fails
Date: Fri, 29 Apr 2011 13:03:23 +0200 [thread overview]
Message-ID: <4DBA9AFB.4030401@domain.hid> (raw)
In-Reply-To: <BANLkTi=T7CtZUhLzbU2bz4Z8Ph=N=_Bs=g@domain.hid>
martin mangard wrote:
> Hello,
>
> I installed xenomai Version 2.5.6 on a x86 machine. I use dlopen in
> order to use the xenomai libraries.
>
>
> hXenomai=dlopen("/usr/lib/libxenocalls-2.5.6.so",RTLD_NOW);
> if(!hXenomai)
> {
> fprintf (stderr, "%s\n", dlerror());
> fflush(stderr);
> }
>
>
> dlopen aborts with the error: "/usr/lib/libnative.so.3: undefined
> symbol: xeno_current_mode_key"
>
> I configured xenomai with the option " --enable-dlopen-skins "
>
> What do I have to change in order be able to dlopen the libnative.so.3 library?
xeno_current_mod_key is defined in the libxenomai.so library. So, we
have two solutions:
either we make explicit the dependence between libnative.so and
libxenomai.so, as in the following patch:
index 3497f90..23beb50 100644
--- a/src/skins/native/Makefile.am
+++ b/src/skins/native/Makefile.am
@@ -2,6 +2,8 @@ lib_LTLIBRARIES = libnative.la
libnative_la_LDFLAGS = @XENO_DLOPEN_CONSTRAINT@ -version-info 3:0:0 -lpthread
+libnative_la_LIBADD = ../common/libxenomai.la
+
libnative_la_SOURCES = \
alarm.c \
buffer.c \
diff --git a/src/skins/native/Makefile.in b/src/skins/native/Makefile.in
index 2775661..011f380 100644
--- a/src/skins/native/Makefile.in
+++ b/src/skins/native/Makefile.in
@@ -58,7 +58,7 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
-libnative_la_LIBADD =
+libnative_la_DEPENDENCIES = ../common/libxenomai.la
am_libnative_la_OBJECTS = libnative_la-alarm.lo libnative_la-buffer.lo \
libnative_la-cond.lo libnative_la-event.lo \
libnative_la-heap.lo libnative_la-init.lo libnative_la-intr.lo \
@@ -249,6 +249,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
lib_LTLIBRARIES = libnative.la
libnative_la_LDFLAGS = @XENO_DLOPEN_CONSTRAINT@ -version-info 3:0:0 -lpthread
+libnative_la_LIBADD = ../common/libxenomai.la
libnative_la_SOURCES = \
alarm.c \
buffer.c \
I am not sure it will not break the parallel build though it does not
seem to break on a core i7 (make -j 8).
Or you explicitly dlopen libxenomai.so with RTLD_GLOBAL before dlopening
libnative.so. The drawback being that you pollute the process namespace
with libxenomai symbols.
--
Gilles.
next prev parent reply other threads:[~2011-04-29 11:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-29 9:24 [Xenomai-help] dlopen of libnative fails martin mangard
2011-04-29 11:03 ` Gilles Chanteperdrix [this message]
2011-04-29 12:30 ` martin mangard
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=4DBA9AFB.4030401@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=martin@domain.hid \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.