Module: xenomai-jki
Branch: for-upstream
Commit: 571bbe773cd8ba494435c98cec830449aaeaa210
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=571bbe773cd8ba494435c98cec830449aaeaa210

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Wed May  8 16:26:15 2013 +0200

Work around gcc-4.6 bug

This avoid that gcc bug 56712 lets the initialization of the native skin
fail. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56712 for the
background. Affects in particular Ubuntu 12.04 LTS.

The current code only requires the noclone attribute as workaround for
the native skin. But we are better conservative and add it to all
constructors in case their structure changes in an unfortunate way in
the future.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 include/asm-arm/fptest.h    |    2 +-
 src/skins/common/rt_print.c |    2 +-
 src/skins/native/init.c     |    4 ++--
 src/skins/posix/init.c      |    2 +-
 src/skins/posix/thread.c    |    2 +-
 src/skins/psos+/init.c      |    2 +-
 src/skins/rtdm/init.c       |    2 +-
 src/skins/uitron/init.c     |    2 +-
 src/skins/vrtx/init.c       |    4 ++--
 src/skins/vxworks/init.c    |    4 ++--
 10 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/asm-arm/fptest.h b/include/asm-arm/fptest.h
index be2bd15..1541185 100644
--- a/include/asm-arm/fptest.h
+++ b/include/asm-arm/fptest.h
@@ -32,7 +32,7 @@ static inline void fp_linux_end(void)
 
 static int have_vfp;
 
-static void __attribute__((constructor)) fp_init(void)
+static void __attribute__((constructor, noclone)) fp_init(void)
 {
        char buffer[1024];
        FILE *f = fopen("/proc/cpuinfo", "r");
diff --git a/src/skins/common/rt_print.c b/src/skins/common/rt_print.c
index 5f5c62e..5977a17 100644
--- a/src/skins/common/rt_print.c
+++ b/src/skins/common/rt_print.c
@@ -738,7 +738,7 @@ static void forked_child_init(void)
                spawn_printer_thread();
 }
 
-static __attribute__((constructor)) void __rt_print_init(void)
+static __attribute__((constructor, noclone)) void __rt_print_init(void)
 {
        const char *value_str;
        unsigned long long period;
diff --git a/src/skins/native/init.c b/src/skins/native/init.c
index e380ca6..9e4dbf3 100644
--- a/src/skins/native/init.c
+++ b/src/skins/native/init.c
@@ -38,7 +38,7 @@ static void __flush_tsd(void *tsd)
        free(tsd);
 }
 
-static __attribute__ ((constructor))
+static __attribute__ ((constructor, noclone))
 void __init_native_tskey(void)
 {
        /* Allocate a TSD key for indexing self task pointers. */
@@ -50,7 +50,7 @@ void __init_native_tskey(void)
 }
 #endif /* !HAVE___THREAD */
 
-static __attribute__ ((constructor))
+static __attribute__ ((constructor, noclone))
 void __init_xeno_interface(void)
 {
        int err;
diff --git a/src/skins/posix/init.c b/src/skins/posix/init.c
index 10de01e..5b1ad4e 100644
--- a/src/skins/posix/init.c
+++ b/src/skins/posix/init.c
@@ -40,7 +40,7 @@ static int fork_handler_registered;
 int __wrap_pthread_setschedparam(pthread_t, int, const struct sched_param *);
 void pse51_clock_init(int);
 
-static __attribute__ ((constructor))
+static __attribute__ ((constructor, noclone))
 void __init_posix_interface(void)
 {
        struct sched_param parm;
diff --git a/src/skins/posix/thread.c b/src/skins/posix/thread.c
index bc6680e..d4013ce 100644
--- a/src/skins/posix/thread.c
+++ b/src/skins/posix/thread.c
@@ -336,7 +336,7 @@ int __wrap_pthread_kill(pthread_t thread, int sig)
        return err;
 }
 
-static __attribute__((constructor)) void pse51_thread_init(void)
+static __attribute__((constructor, noclone)) void pse51_thread_init(void)
 {
        pthread_attr_init(&default_attr);
 #ifdef _CS_GNU_LIBPTHREAD_VERSION
diff --git a/src/skins/psos+/init.c b/src/skins/psos+/init.c
index 5af37f8..c7c76a0 100644
--- a/src/skins/psos+/init.c
+++ b/src/skins/psos+/init.c
@@ -28,7 +28,7 @@ xnsysinfo_t __psos_sysinfo;
 
 unsigned psos_long_names;
 
-static __attribute__ ((constructor))
+static __attribute__ ((constructor, noclone))
 void __init_xeno_interface(void)
 {
        u_long err, tid;
diff --git a/src/skins/rtdm/init.c b/src/skins/rtdm/init.c
index 393d953..1794ea4 100644
--- a/src/skins/rtdm/init.c
+++ b/src/skins/rtdm/init.c
@@ -25,7 +25,7 @@
 
 int __rtdm_muxid = -1;
 
-static __attribute__ ((constructor))
+static __attribute__ ((constructor, noclone))
 void __init_rtdm_interface(void)
 {
        /* The following call may fail; binding errors will be
diff --git a/src/skins/uitron/init.c b/src/skins/uitron/init.c
index 5253729..5b8cd45 100644
--- a/src/skins/uitron/init.c
+++ b/src/skins/uitron/init.c
@@ -24,7 +24,7 @@
 
 int __uitron_muxid = -1;
 
-static __attribute__ ((constructor))
+static __attribute__ ((constructor, noclone))
 void __init_xeno_interface(void)
 {
        T_CTSK pk_ctsk;
diff --git a/src/skins/vrtx/init.c b/src/skins/vrtx/init.c
index c1f67f4..12ab798 100644
--- a/src/skins/vrtx/init.c
+++ b/src/skins/vrtx/init.c
@@ -36,7 +36,7 @@ static void __flush_tsd(void *tsd)
        free(tsd);
 }
 
-static __attribute__ ((constructor))
+static __attribute__ ((constructor, noclone))
 void __init_vrtx_tskey(void)
 {
        /* Allocate a TSD key for indexing self task pointers. */
@@ -48,7 +48,7 @@ void __init_vrtx_tskey(void)
 }
 #endif /* !HAVE___THREAD */
 
-static __attribute__ ((constructor))
+static __attribute__ ((constructor, noclone))
 void __init_xeno_interface(void)
 {
        __vrtx_muxid =
diff --git a/src/skins/vxworks/init.c b/src/skins/vxworks/init.c
index f277736..b1716e8 100644
--- a/src/skins/vxworks/init.c
+++ b/src/skins/vxworks/init.c
@@ -36,7 +36,7 @@ static void __flush_tsd(void *tsd)
        free(tsd);
 }
 
-static __attribute__ ((constructor))
+static __attribute__ ((constructor, noclone))
 void __init_vxworks_tskey(void)
 {
        /* Allocate a TSD key for indexing self task pointers. */
@@ -48,7 +48,7 @@ void __init_vxworks_tskey(void)
 }
 #endif /* !HAVE___THREAD */
 
-static __attribute__ ((constructor))
+static __attribute__ ((constructor, noclone))
 void __init_xeno_interface(void)
 {
        __vxworks_muxid = xeno_bind_skin(VXWORKS_SKIN_MAGIC,


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

Reply via email to