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

Author: Henning Schild <henning.sch...@siemens.com>
Date:   Tue May 16 15:50:00 2017 +0200

scripts/xeno-config: add -Wl,--no-as-needed

Linking with "--as-needed" could cause the linker to not list essential
wrapping libraries as needed for a shared library or a dynamically
linked binary. The result would be runtime ld.so errors for the binaries
or linking problems with the .so.
gcc defaults to "--no-as-needed" that is why we never needed to specify
that flag explicitly. But gcc from Ubuntu is patched to default to
"--as-needed".
This patch enforces "--no-as-needed", which will have no effect on most
toolchains. On Ubuntu it will override the default and make sure xenomai
applications get linked as expected.

Signed-off-by: Henning Schild <henning.sch...@siemens.com>

---

 scripts/xeno-config-cobalt.in  |    1 +
 scripts/xeno-config-mercury.in |    1 +
 2 files changed, 2 insertions(+)

diff --git a/scripts/xeno-config-cobalt.in b/scripts/xeno-config-cobalt.in
index 82815e1..ae313d3 100644
--- a/scripts/xeno-config-cobalt.in
+++ b/scripts/xeno-config-cobalt.in
@@ -282,6 +282,7 @@ if test x$do_ldflags = xy; then
        fi
        bootstrap="${XENO_LIBRARY_DIR}/xenomai/bootstrap${codegen}.o"
     fi
+    ldflags="-Wl,--no-as-needed $ldflags"
     echo "$ldflags $copperplate $bootstrap $wrap_main $XENO_POSIX_LDFLAGS"
 fi
 
diff --git a/scripts/xeno-config-mercury.in b/scripts/xeno-config-mercury.in
index a0aa75b..2d2842f 100644
--- a/scripts/xeno-config-mercury.in
+++ b/scripts/xeno-config-mercury.in
@@ -213,6 +213,7 @@ if test x$do_ldflags = xy; then
        fi
        bootstrap="${XENO_LIBRARY_DIR}/xenomai/bootstrap${codegen}.o"
     fi
+    ldflags="-Wl,--no-as-needed $ldflags"
     echo "$ldflags $copperplate $bootstrap $wrap_main $XENO_BASE_LDFLAGS"
 fi
 


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

Reply via email to