To clarify the relation between disabling TLS support and allowing to
dlopen Xenomai skin library, introduce an explicit configure switch.
This way we will also have a control to disable auto-shadowing in the
POSIX skin for dlopen scenarios.

Signed-off-by: Jan Kiszka <>
--- |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ b/
index 1d7f5fa..679af96 100644
--- a/
+++ b/
@@ -758,15 +758,30 @@ LIBS="$LIBS -lrt"
 AC_CHECK_FUNCS([shm_open shm_unlink])
+AC_MSG_CHECKING(whether to enable dlopen support for skin libraries)
+       AC_HELP_STRING([--enable-dlopen-skins], [Disable TLS features and
+automatic main thread mapping by the POSIX skin to allows dlopen'ing Xenomai
+       [case "$enableval" in
+       y | yes) CONFIG_XENO_LIBS_DLOPEN=y ;;
+       *) unset CONFIG_XENO_LIBS_DLOPEN ;;
+       esac])
+if test x$CONFIG_XENO_LIBS_DLOPEN = xy; then
-                          [do not use TLS features (allows for dlopen'ing 
Xenomai libs)]),
+                          [do not use TLS features]),
 dnl Check whether the compiler supports the __thread keyword.
-if test "x$use__thread" != xno; then
+if test "x$use__thread" != xno -a "x$CONFIG_XENO_LIBS_DLOPEN" != xy; then
        AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
        [cat > conftest.c <<\EOF
 __thread int a __attribute__ ((tls_model ("initial-exec"))) = 42;

Xenomai-core mailing list

Reply via email to