Module: xenomai-3
Branch: next
Commit: 91f7a0c72e20e0eb5df56dfc44d410b4cff0c99c
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=91f7a0c72e20e0eb5df56dfc44d410b4cff0c99c

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Sep 22 10:13:52 2016 +0200

scripts/xeno-config: do not wrap main() with --auto-init-solib

For the auto-init feature to make sense, the main() symbol has to be
defined in the main executable, so there is no need to wrap it when
emitting linker flags for an auto-boostrapped shared library.

---

 scripts/xeno-config-cobalt.in  |   10 +++++++---
 scripts/xeno-config-mercury.in |   10 +++++++---
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/scripts/xeno-config-cobalt.in b/scripts/xeno-config-cobalt.in
index 38f8208..802b778 100644
--- a/scripts/xeno-config-cobalt.in
+++ b/scripts/xeno-config-cobalt.in
@@ -262,10 +262,14 @@ if test x$do_ldflags = xy; then
     done
     wrap_main=
     if test x$do_autoinit = xy; then
-       test x$do_autoinit_solib = xy && codegen=-pic
-       wrap_main="${XENO_LIBRARY_DIR}/xenomai/bootstrap${codegen}.o 
-Wl,--wrap=main -Wl,--dynamic-list=${XENO_LIBRARY_DIR}/dynlist.ld"
+       if test x$do_autoinit_solib = xy; then
+           codegen=-pic
+       else
+           wrap_main="-Wl,--wrap=main 
-Wl,--dynamic-list=${XENO_LIBRARY_DIR}/dynlist.ld"
+       fi
+       bootstrap="${XENO_LIBRARY_DIR}/xenomai/bootstrap${codegen}.o"
     fi
-    echo "$ldflags $copperplate $wrap_main $XENO_POSIX_LDFLAGS"
+    echo "$ldflags $copperplate $bootstrap $wrap_main $XENO_POSIX_LDFLAGS"
 fi
 
 exit 0
diff --git a/scripts/xeno-config-mercury.in b/scripts/xeno-config-mercury.in
index 5dab4ba..a0aa75b 100644
--- a/scripts/xeno-config-mercury.in
+++ b/scripts/xeno-config-mercury.in
@@ -206,10 +206,14 @@ if test x$do_ldflags = xy; then
     done
     wrap_main=
     if test x$do_autoinit = xy; then
-       test x$do_autoinit_solib = xy && codegen=-pic
-       wrap_main="${XENO_LIBRARY_DIR}/xenomai/bootstrap${codegen}.o 
-Wl,--wrap=main -Wl,--dynamic-list=${XENO_LIBRARY_DIR}/dynlist.ld"
+       if test x$do_autoinit_solib = xy; then
+           codegen=-pic
+       else
+           wrap_main="-Wl,--wrap=main 
-Wl,--dynamic-list=${XENO_LIBRARY_DIR}/dynlist.ld"
+       fi
+       bootstrap="${XENO_LIBRARY_DIR}/xenomai/bootstrap${codegen}.o"
     fi
-    echo "$ldflags $copperplate $wrap_main $XENO_BASE_LDFLAGS"
+    echo "$ldflags $copperplate $bootstrap $wrap_main $XENO_BASE_LDFLAGS"
 fi
 
 exit 0


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to