All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrice Kadionik <kadionik@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Problem to cross-compile Xenomai	user-space	support
Date: Tue, 30 Mar 2010 11:40:26 +0200	[thread overview]
Message-ID: <4BB1C70A.4070400@domain.hid> (raw)
In-Reply-To: <4BB1C0DB.40709@domain.hid>

Le 30/03/2010 11:14, Gilles Chanteperdrix a écrit :
> Patrice Kadionik wrote:
>    
>> Le 30/03/2010 00:23, Gilles Chanteperdrix a écrit :
>>      
>>> Huan Fang wrote:
>>>
>>>        
>>>> eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
>>>> libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o  ../../skins/native/.libs/libnative.a -lpthread -lm
>>>> check-vdso.elf2flt(.text+0x16c): In function `main':
>>>> : undefined reference to `xeno_sem_heap'
>>>> check-vdso.elf2flt(.text+0x170): In function `main':
>>>> : undefined reference to `xeno_sem_heap'
>>>> collect2: ld returned 1 exit status
>>>> make[3]: *** [check-vdso] Erreur 1
>>>> make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
>>>> make[2]: *** [all-recursive] Erreur 1
>>>> make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
>>>> make[1]: *** [all-recursive] Erreur 1
>>>> make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
>>>> make: *** [all-recursive] Erreur 1
>>>>
>>>> what can I do? Please help
>>>>
>>>>          
>>> Please try xenomai 2.5.2
>>>
>>>
>>>
>>>        
>> Hi Gilles,
>>
>> I've done this with the 2.5.2 version and I have had the same problem.
>> It is the consequence of another one earlier in the compilation process.
>> After the xenomai configuration for NIOS II:
>> $ ./configure --host=nios2-linux
>>
>> the generated src/include/xeno_config.h configuration file has
>> CONFIG_XENO_FASTSYNCH not configured:
>> ...
>> /* config */
>> /* #undef CONFIG_XENO_FASTSYNCH */
>> ...
>>
>> If you make the compilation, it fails on the src/skins/common/sem_heap.c
>> compilation.
>> You have in this files 2 similar functions
>> line 100: static void xeno_init_sem_heaps_inner(void)
>> and
>> line 118: void xeno_init_sem_heaps(void)
>>
>> There is a mismatch in the src/skins/common/sem_heap.h file according to
>> the CONFIG_XENO_FASTSYNCH definition (during Xenomai configuration).
>> In this case it conflits with the macro #define xeno_init_sem_heaps()
>> line 9 in the src/skins/common/sem_heap.h file and the void
>> xeno_init_sem_heaps(void) in the src/skins/common/sem_heap.c
>>
>> I don't know what in the right correction to do in the
>> src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH
>> definition.
>>
>> If I suppress the line 9 (#define ...) in the
>> src/skins/common/sem_heap.h file, it compiles until problems for
>> src/testsuite/unit  tool:
>> cond-torture.c file. Line 56: problem with the  "if else" structure when
>> HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL is not defined (the case here).
>> check-vdso.c compilation: in the src/testsuite/unit/Makefile.in file,
>> the @CONFIG_XENO_FASTSYNCH_TRUE@ controls the check-vdso compilation. it
>> is not completely inhibited when CONFIG_XENO_FASTSYNCH is not configured
>> (the case here).
>>
>> I have corrected by hand these 2 problems and Xenomai v2.5.2 is OK on my
>> NIOS II board.
>>
>> Gilles, what is the right modification to make on the
>> src/skins/common/sem_heap.h file when CONFIG_XENO_FASTSYNCH is not
>> defined during Xenomai configration?
>>      
> We want everything to be compiled even without FASTSYNCH. So, please try
> the following patch:
>    

Gilles,

The patch is OK.
There is a last error on the src/testsuite/unit/cond-torture.c file. 
Line 56: problem with the  "if else" structure when 
HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL is not defined (the case here):
         if (pi != 0)
#ifdef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
                 pthread_mutexattr_setprotocol(&mattr, 
PTHREAD_PRIO_INHERIT);

         err = pthread_mutex_init(mutex, &mattr);
#else
         else {
                 err = ENOSYS;
                 goto out;
         }
         err = pthread_mutex_init(mutex, &mattr);

   out:
#endif
         pthread_mutexattr_destroy(&mattr);


Patrice

~


> diff --git a/src/skins/common/sem_heap.h b/src/skins/common/sem_heap.h
> index d799a37..16dedda 100644
> --- a/src/skins/common/sem_heap.h
> +++ b/src/skins/common/sem_heap.h
> @@ -3,10 +3,6 @@
>
>   #include<xeno_config.h>
>
> -#ifdef CONFIG_XENO_FASTSYNCH
>   void xeno_init_sem_heaps(void);
> -#else /* !CONFIG_XENO_FASTSYNCH */
> -#define xeno_init_sem_heaps()
> -#endif /* !CONFIG_XENO_FASTSYNCH */
>
>   #endif /* XENO_SEM_HEAP_H */
> diff --git a/src/testsuite/unit/Makefile.am b/src/testsuite/unit/Makefile.am
> index d94e53f..8966883 100644
> --- a/src/testsuite/unit/Makefile.am
> +++ b/src/testsuite/unit/Makefile.am
> @@ -92,8 +92,6 @@ cond_torture_native_LDADD = \
>   	../../skins/common/libxenomai.la \
>   	-lpthread -lm
>
> -if CONFIG_XENO_FASTSYNCH
> -
>   check_vdso_SOURCES = check-vdso.c
>
>   check_vdso_CPPFLAGS = \
> @@ -107,8 +105,6 @@ check_vdso_LDADD = \
>   	../../skins/common/libxenomai.la \
>   	-lpthread -lm
>
> -endif
> -
>   install-data-local:
>   	$(mkinstalldirs) $(DESTDIR)$(rundir)
>   	@sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in>
> $(DESTDIR)$(rundir)/.runinfo
> diff --git a/src/testsuite/unit/Makefile.in b/src/testsuite/unit/Makefile.in
> index 3d536a8..5125678 100644
> --- a/src/testsuite/unit/Makefile.in
> +++ b/src/testsuite/unit/Makefile.in
> @@ -64,13 +64,10 @@ arith_DEPENDENCIES = ../../skins/native/libnative.la \
>   arith_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
>   	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(arith_LDFLAGS) \
>   	$(LDFLAGS) -o $@
> -am__check_vdso_SOURCES_DIST = check-vdso.c
> -@domain.hid =  \
> -@domain.hid@	check_vdso-check-vdso.$(OBJEXT)
> +am_check_vdso_OBJECTS = check_vdso-check-vdso.$(OBJEXT)
>   check_vdso_OBJECTS = $(am_check_vdso_OBJECTS)
> -@domain.hid =  \
> -@domain.hid@	../../skins/native/libnative.la \
> -@domain.hid@	../../skins/common/libxenomai.la
> +check_vdso_DEPENDENCIES = ../../skins/native/libnative.la \
> +	../../skins/common/libxenomai.la
>   check_vdso_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
>   	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
>   	$(check_vdso_LDFLAGS) $(LDFLAGS) -o $@
> @@ -130,7 +127,7 @@ SOURCES = $(arith_SOURCES) $(check_vdso_SOURCES) \
>   	$(cond_torture_native_SOURCES) $(cond_torture_posix_SOURCES) \
>   	$(mutex_torture_native_SOURCES) $(mutex_torture_posix_SOURCES) \
>   	$(wakeup_time_SOURCES)
> -DIST_SOURCES = $(arith_SOURCES) $(am__check_vdso_SOURCES_DIST) \
> +DIST_SOURCES = $(arith_SOURCES) $(check_vdso_SOURCES) \
>   	$(cond_torture_native_SOURCES) $(cond_torture_posix_SOURCES) \
>   	$(mutex_torture_native_SOURCES) $(mutex_torture_posix_SOURCES) \
>   	$(wakeup_time_SOURCES)
> @@ -368,16 +365,16 @@ cond_torture_native_LDADD = \
>   	../../skins/common/libxenomai.la \
>   	-lpthread -lm
>
> -@domain.hid = check-vdso.c
> -@domain.hid = \
> -@domain.hid@	@XENO_USER_CFLAGS@ \
> -@domain.hid@	-I$(top_srcdir)/include
> +check_vdso_SOURCES = check-vdso.c
> +check_vdso_CPPFLAGS = \
> +	@XENO_USER_CFLAGS@ \
> +	-I$(top_srcdir)/include
>
> -@domain.hid = @XENO_USER_LDFLAGS@
> -@domain.hid = \
> -@domain.hid@	../../skins/native/libnative.la \
> -@domain.hid@	../../skins/common/libxenomai.la \
> -@domain.hid@	-lpthread -lm
> +check_vdso_LDFLAGS = @XENO_USER_LDFLAGS@
> +check_vdso_LDADD = \
> +	../../skins/native/libnative.la \
> +	../../skins/common/libxenomai.la \
> +	-lpthread -lm
>
>   EXTRA_DIST = runinfo.in
>   all: all-am
>
>
>    


-- 
--
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +
+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:patrice.kadionik@domain.hid +
+----------------------------------------------------------------------+



  reply	other threads:[~2010-03-30  9:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 20:24 [Xenomai-help] Problem to cross-compile Xenomai user-space support Chtourou Sonda
2010-03-28 13:26 ` Patrice Kadionik
2010-03-29 22:20   ` Huan Fang
2010-03-29 22:23     ` Gilles Chanteperdrix
2010-03-30  9:05       ` Patrice Kadionik
2010-03-30  9:14         ` Gilles Chanteperdrix
2010-03-30  9:40           ` Patrice Kadionik [this message]
2010-03-30  9:40         ` Gilles Chanteperdrix
2010-03-30  9:46           ` Patrice Kadionik
2010-03-30 10:46             ` Gilles Chanteperdrix
2010-03-30 15:00               ` Patrice Kadionik
2010-03-30  8:37     ` Patrice Kadionik
2010-03-30 17:37       ` Huan Fang
2010-03-30 17:48         ` Patrice Kadionik
  -- strict thread matches above, loose matches on Subject: below --
2010-03-30 15:40 Chtourou Sonda
2010-03-30 16:45 ` Patrice Kadionik
2010-03-31 10:55 Chtourou Sonda
2010-04-01 10:49 ` Patrice Kadionik

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=4BB1C70A.4070400@domain.hid \
    --to=kadionik@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --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.