All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Userland-compile error
@ 2012-05-08  3:13 Vikram Dhillon
  2012-05-08 15:32 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 7+ messages in thread
From: Vikram Dhillon @ 2012-05-08  3:13 UTC (permalink / raw)
  To: xenomai

Hi all,

I recently compiled and installed a xenomai patched kernel but I am
currently having some issues compiling sample code that came with the
xenomai kernel. So here's what is happening:

=================================================================================================
root@domain.hid# make
XENO=/usr/xenomai/ KSRC=/usr/src/linux-2.6.38.8-xenomai/
--xeno-cflags is deprecated, use --skin=name --cflags instead
--xeno-ldflags is deprecated, use --skin=name --ldflags instead
gcc -DCONSUMER -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall
-Werror-implicit-function-declaration -pipe -D__XENO__
-I/usr/xenomai/include/posix    -Wl,@/usr/xenomai/lib/posix.wrappers
-L/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt   -Xlinker
-rpath -Xlinker /usr/xenomai/lib  satch.c   -o satch
/usr/bin/ld: /tmp/ccLV0g8I.o: undefined reference to symbol
'pthread_cancel@domain.hid'
/usr/bin/ld: note: 'pthread_cancel@domain.hid' is defined in DSO
/lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker
command line
/lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [satch] Error 1
=================================================================================================


Linker issue here, the program satch in posix directory won't compile,
first change in the posix makefile:
=================================================================================================
CFLAGS=-DCONSUMER $(shell $(XENOCONFIG) --skin=posix --cflags) $(APP_CFLAGS)
LDFLAGS=$(shell $(XENOCONFIG) --skin=posix --ldflags) $(APP_LDFLAGS)
=================================================================================================


Then, the program still doesn't compile so I actually had to remove
the lpthread switch in compiling:
=================================================================================================
vikram@domain.hid$ gcc -DCONSUMER
-I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall
-Werror-implicit-function-declaration -pipe -D__XENO__
-I/usr/xenomai/include/posix   -Wl,@/usr/xenomai/lib/posix.wrappers
-L/usr/xenomai/lib -lpthread_rt -lxenomai -lrt   -Xlinker -rpath
-Xlinker /usr/xenomai/lib  satch.c   -o satch
vikram@domain.hid$ ls
Makefile  Makefile~  README  satch  satch.c
vikram@domain.hid$ ./satch
Xenomai: binding failed: Operation not permitted.
=================================================================================================

Can anyone tell me what is causing the issue here? Thanks!

- Vikram


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] Userland-compile error
  2012-05-08  3:13 [Xenomai-help] Userland-compile error Vikram Dhillon
@ 2012-05-08 15:32 ` Gilles Chanteperdrix
  2012-05-08 16:23   ` Vikram Dhillon
  0 siblings, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2012-05-08 15:32 UTC (permalink / raw)
  To: Vikram Dhillon; +Cc: xenomai

On 05/08/2012 05:13 AM, Vikram Dhillon wrote:
> Hi all,
> 
> I recently compiled and installed a xenomai patched kernel but I am
> currently having some issues compiling sample code that came with the
> xenomai kernel. So here's what is happening:
> 
> =================================================================================================
> root@domain.hid# make
> XENO=/usr/xenomai/ KSRC=/usr/src/linux-2.6.38.8-xenomai/
> --xeno-cflags is deprecated, use --skin=name --cflags instead
> --xeno-ldflags is deprecated, use --skin=name --ldflags instead
> gcc -DCONSUMER -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall
> -Werror-implicit-function-declaration -pipe -D__XENO__
> -I/usr/xenomai/include/posix    -Wl,@/usr/xenomai/lib/posix.wrappers
> -L/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt   -Xlinker
> -rpath -Xlinker /usr/xenomai/lib  satch.c   -o satch
> /usr/bin/ld: /tmp/ccLV0g8I.o: undefined reference to symbol
> 'pthread_cancel@domain.hid'
> /usr/bin/ld: note: 'pthread_cancel@domain.hid' is defined in DSO
> /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker
> command line
> /lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
> collect2: ld returned 1 exit status
> make: *** [satch] Error 1
> =================================================================================================

This is a strange error, are you sure you are not mixing a 64 bits
toolchain with 32 bits libraries? Did xenomai compilation run correctly
otherwise? Do xenomai tests run, such as latency for instance?

> 
> 
> Linker issue here, the program satch in posix directory won't compile,
> first change in the posix makefile:
> =================================================================================================
> CFLAGS=-DCONSUMER $(shell $(XENOCONFIG) --skin=posix --cflags) $(APP_CFLAGS)
> LDFLAGS=$(shell $(XENOCONFIG) --skin=posix --ldflags) $(APP_LDFLAGS)
> =================================================================================================
> 
> 
> Then, the program still doesn't compile so I actually had to remove
> the lpthread switch in compiling:
> =================================================================================================
> vikram@domain.hid$ gcc -DCONSUMER
> -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall
> -Werror-implicit-function-declaration -pipe -D__XENO__
> -I/usr/xenomai/include/posix   -Wl,@/usr/xenomai/lib/posix.wrappers
> -L/usr/xenomai/lib -lpthread_rt -lxenomai -lrt   -Xlinker -rpath
> -Xlinker /usr/xenomai/lib  satch.c   -o satch
> vikram@domain.hid$ ls
> Makefile  Makefile~  README  satch  satch.c
> vikram@domain.hid$ ./satch
> Xenomai: binding failed: Operation not permitted.
> =================================================================================================
> 
> Can anyone tell me what is causing the issue here? Thanks!

This one usually means that you are not running the example as root user.

> 
> - Vikram
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
> 


-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] Userland-compile error
  2012-05-08 15:32 ` Gilles Chanteperdrix
@ 2012-05-08 16:23   ` Vikram Dhillon
  2012-05-08 17:17     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 7+ messages in thread
From: Vikram Dhillon @ 2012-05-08 16:23 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Hello Gilles,

On Tue, May 8, 2012 at 11:32 AM, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:
>> =================================================================================================
>> root@domain.hid# make
>> XENO=/usr/xenomai/ KSRC=/usr/src/linux-2.6.38.8-xenomai/
>> --xeno-cflags is deprecated, use --skin=name --cflags instead
>> --xeno-ldflags is deprecated, use --skin=name --ldflags instead
>> gcc -DCONSUMER -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall
>> -Werror-implicit-function-declaration -pipe -D__XENO__
>> -I/usr/xenomai/include/posix    -Wl,@/usr/xenomai/lib/posix.wrappers
>> -L/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt   -Xlinker
>> -rpath -Xlinker /usr/xenomai/lib  satch.c   -o satch
>> /usr/bin/ld: /tmp/ccLV0g8I.o: undefined reference to symbol
>> 'pthread_cancel@domain.hid'
>> /usr/bin/ld: note: 'pthread_cancel@domain.hid' is defined in DSO
>> /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker
>> command line
>> /lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
>> collect2: ld returned 1 exit status
>> make: *** [satch] Error 1
>> =================================================================================================
>
> This is a strange error, are you sure you are not mixing a 64 bits
> toolchain with 32 bits libraries? Did xenomai compilation run correctly
> otherwise? Do xenomai tests run, such as latency for instance?
>


Yes, the compile and latency tests actually work just fine, I can
execute them, the error occurs when I try to compile a program from
the examples or something that I wrote. Don't worry about the second
error, that was just to demonstrate that after removing lpthread from
compile switches, the program compiles. I'm using Ubuntu 12.04 if that
provides any help, the debian package xeno-config also gives that
deprecated error so that may just be a problem with the debian
package.

- Vikram


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] Userland-compile error
  2012-05-08 16:23   ` Vikram Dhillon
@ 2012-05-08 17:17     ` Gilles Chanteperdrix
  2012-05-08 17:34       ` Vikram Dhillon
  0 siblings, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2012-05-08 17:17 UTC (permalink / raw)
  To: Vikram Dhillon; +Cc: xenomai

On 05/08/2012 06:23 PM, Vikram Dhillon wrote:
> Hello Gilles,
> 
> On Tue, May 8, 2012 at 11:32 AM, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>>> =================================================================================================
>>> root@domain.hid# make
>>> XENO=/usr/xenomai/ KSRC=/usr/src/linux-2.6.38.8-xenomai/
>>> --xeno-cflags is deprecated, use --skin=name --cflags instead
>>> --xeno-ldflags is deprecated, use --skin=name --ldflags instead
>>> gcc -DCONSUMER -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall
>>> -Werror-implicit-function-declaration -pipe -D__XENO__
>>> -I/usr/xenomai/include/posix    -Wl,@/usr/xenomai/lib/posix.wrappers
>>> -L/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt   -Xlinker
>>> -rpath -Xlinker /usr/xenomai/lib  satch.c   -o satch
>>> /usr/bin/ld: /tmp/ccLV0g8I.o: undefined reference to symbol
>>> 'pthread_cancel@domain.hid'
>>> /usr/bin/ld: note: 'pthread_cancel@domain.hid' is defined in DSO
>>> /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker
>>> command line
>>> /lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
>>> collect2: ld returned 1 exit status
>>> make: *** [satch] Error 1
>>> =================================================================================================
>>
>> This is a strange error, are you sure you are not mixing a 64 bits
>> toolchain with 32 bits libraries? Did xenomai compilation run correctly
>> otherwise? Do xenomai tests run, such as latency for instance?
>>
> 
> 
> Yes, the compile and latency tests actually work just fine, I can
> execute them, the error occurs when I try to compile a program from
> the examples or something that I wrote. Don't worry about the second
> error, that was just to demonstrate that after removing lpthread from
> compile switches, the program compiles.

You do not answer all my questions. What machine are you running? Is it
an x86_64 or a 32 bits machine?

 I'm using Ubuntu 12.04 if that
> provides any help, the debian package xeno-config also gives that
> deprecated error so that may just be a problem with the debian
> package.

If you install xenomai from sources, you should not install debian
package. You will have conflict between the two.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] Userland-compile error
  2012-05-08 17:17     ` Gilles Chanteperdrix
@ 2012-05-08 17:34       ` Vikram Dhillon
  2012-05-08 17:36         ` Gilles Chanteperdrix
  2012-05-08 17:40         ` Gilles Chanteperdrix
  0 siblings, 2 replies; 7+ messages in thread
From: Vikram Dhillon @ 2012-05-08 17:34 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On Tue, May 8, 2012 at 1:17 PM, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:
> On 05/08/2012 06:23 PM, Vikram Dhillon wrote:
>> Hello Gilles,
>>
>> On Tue, May 8, 2012 at 11:32 AM, Gilles Chanteperdrix
>> <gilles.chanteperdrix@xenomai.org> wrote:
>>>> =================================================================================================
>>>> root@domain.hid# make
>>>> XENO=/usr/xenomai/ KSRC=/usr/src/linux-2.6.38.8-xenomai/
>>>> --xeno-cflags is deprecated, use --skin=name --cflags instead
>>>> --xeno-ldflags is deprecated, use --skin=name --ldflags instead
>>>> gcc -DCONSUMER -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall
>>>> -Werror-implicit-function-declaration -pipe -D__XENO__
>>>> -I/usr/xenomai/include/posix    -Wl,@/usr/xenomai/lib/posix.wrappers
>>>> -L/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt   -Xlinker
>>>> -rpath -Xlinker /usr/xenomai/lib  satch.c   -o satch
>>>> /usr/bin/ld: /tmp/ccLV0g8I.o: undefined reference to symbol
>>>> 'pthread_cancel@domain.hid'
>>>> /usr/bin/ld: note: 'pthread_cancel@domain.hid' is defined in DSO
>>>> /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker
>>>> command line
>>>> /lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
>>>> collect2: ld returned 1 exit status
>>>> make: *** [satch] Error 1
>>>> =================================================================================================
>>>
>>> This is a strange error, are you sure you are not mixing a 64 bits
>>> toolchain with 32 bits libraries? Did xenomai compilation run correctly
>>> otherwise? Do xenomai tests run, such as latency for instance?
>>>
>>
>>
>> Yes, the compile and latency tests actually work just fine, I can
>> execute them, the error occurs when I try to compile a program from
>> the examples or something that I wrote. Don't worry about the second
>> error, that was just to demonstrate that after removing lpthread from
>> compile switches, the program compiles.
>
> You do not answer all my questions. What machine are you running? Is it
> an x86_64 or a 32 bits machine?
>
>  I'm using Ubuntu 12.04 if that
>> provides any help, the debian package xeno-config also gives that
>> deprecated error so that may just be a problem with the debian
>> package.
>
> If you install xenomai from sources, you should not install debian
> package. You will have conflict between the two.
>
> --
>                                                                Gilles.

I have a 32-bit machine. Even after removing the debian package for
xeno-config, I have the same error.

- Vikram


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] Userland-compile error
  2012-05-08 17:34       ` Vikram Dhillon
@ 2012-05-08 17:36         ` Gilles Chanteperdrix
  2012-05-08 17:40         ` Gilles Chanteperdrix
  1 sibling, 0 replies; 7+ messages in thread
From: Gilles Chanteperdrix @ 2012-05-08 17:36 UTC (permalink / raw)
  To: Vikram Dhillon; +Cc: xenomai

On 05/08/2012 07:34 PM, Vikram Dhillon wrote:
> On Tue, May 8, 2012 at 1:17 PM, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>> On 05/08/2012 06:23 PM, Vikram Dhillon wrote:
>>> Hello Gilles,
>>>
>>> On Tue, May 8, 2012 at 11:32 AM, Gilles Chanteperdrix
>>> <gilles.chanteperdrix@xenomai.org> wrote:
>>>>> =================================================================================================
>>>>> root@domain.hid# make
>>>>> XENO=/usr/xenomai/ KSRC=/usr/src/linux-2.6.38.8-xenomai/
>>>>> --xeno-cflags is deprecated, use --skin=name --cflags instead
>>>>> --xeno-ldflags is deprecated, use --skin=name --ldflags instead
>>>>> gcc -DCONSUMER -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall
>>>>> -Werror-implicit-function-declaration -pipe -D__XENO__
>>>>> -I/usr/xenomai/include/posix    -Wl,@/usr/xenomai/lib/posix.wrappers
>>>>> -L/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt   -Xlinker
>>>>> -rpath -Xlinker /usr/xenomai/lib  satch.c   -o satch
>>>>> /usr/bin/ld: /tmp/ccLV0g8I.o: undefined reference to symbol
>>>>> 'pthread_cancel@domain.hid'
>>>>> /usr/bin/ld: note: 'pthread_cancel@domain.hid' is defined in DSO
>>>>> /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker
>>>>> command line
>>>>> /lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
>>>>> collect2: ld returned 1 exit status
>>>>> make: *** [satch] Error 1
>>>>> =================================================================================================
>>>>
>>>> This is a strange error, are you sure you are not mixing a 64 bits
>>>> toolchain with 32 bits libraries? Did xenomai compilation run correctly
>>>> otherwise? Do xenomai tests run, such as latency for instance?
>>>>
>>>
>>>
>>> Yes, the compile and latency tests actually work just fine, I can
>>> execute them, the error occurs when I try to compile a program from
>>> the examples or something that I wrote. Don't worry about the second
>>> error, that was just to demonstrate that after removing lpthread from
>>> compile switches, the program compiles.
>>
>> You do not answer all my questions. What machine are you running? Is it
>> an x86_64 or a 32 bits machine?
>>
>>  I'm using Ubuntu 12.04 if that
>>> provides any help, the debian package xeno-config also gives that
>>> deprecated error so that may just be a problem with the debian
>>> package.
>>
>> If you install xenomai from sources, you should not install debian
>> package. You will have conflict between the two.
>>
>> --
>>                                                                Gilles.
> 
> I have a 32-bit machine. Even after removing the debian package for
> xeno-config, I have the same error.

You should remove all xenomai debian packages.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] Userland-compile error
  2012-05-08 17:34       ` Vikram Dhillon
  2012-05-08 17:36         ` Gilles Chanteperdrix
@ 2012-05-08 17:40         ` Gilles Chanteperdrix
  1 sibling, 0 replies; 7+ messages in thread
From: Gilles Chanteperdrix @ 2012-05-08 17:40 UTC (permalink / raw)
  To: Vikram Dhillon; +Cc: xenomai

On 05/08/2012 07:34 PM, Vikram Dhillon wrote:
> On Tue, May 8, 2012 at 1:17 PM, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>> On 05/08/2012 06:23 PM, Vikram Dhillon wrote:
>>> Hello Gilles,
>>>
>>> On Tue, May 8, 2012 at 11:32 AM, Gilles Chanteperdrix
>>> <gilles.chanteperdrix@xenomai.org> wrote:
>>>>> =================================================================================================
>>>>> root@domain.hid# make
>>>>> XENO=/usr/xenomai/ KSRC=/usr/src/linux-2.6.38.8-xenomai/
>>>>> --xeno-cflags is deprecated, use --skin=name --cflags instead
>>>>> --xeno-ldflags is deprecated, use --skin=name --ldflags instead
>>>>> gcc -DCONSUMER -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall
>>>>> -Werror-implicit-function-declaration -pipe -D__XENO__
>>>>> -I/usr/xenomai/include/posix    -Wl,@/usr/xenomai/lib/posix.wrappers
>>>>> -L/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt   -Xlinker
>>>>> -rpath -Xlinker /usr/xenomai/lib  satch.c   -o satch
>>>>> /usr/bin/ld: /tmp/ccLV0g8I.o: undefined reference to symbol
>>>>> 'pthread_cancel@domain.hid'
>>>>> /usr/bin/ld: note: 'pthread_cancel@domain.hid' is defined in DSO
>>>>> /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker
>>>>> command line
>>>>> /lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
>>>>> collect2: ld returned 1 exit status
>>>>> make: *** [satch] Error 1
>>>>> =================================================================================================
>>>>
>>>> This is a strange error, are you sure you are not mixing a 64 bits
>>>> toolchain with 32 bits libraries? Did xenomai compilation run correctly
>>>> otherwise? Do xenomai tests run, such as latency for instance?
>>>>
>>>
>>>
>>> Yes, the compile and latency tests actually work just fine, I can
>>> execute them, the error occurs when I try to compile a program from
>>> the examples or something that I wrote. Don't worry about the second
>>> error, that was just to demonstrate that after removing lpthread from
>>> compile switches, the program compiles.
>>
>> You do not answer all my questions. What machine are you running? Is it
>> an x86_64 or a 32 bits machine?
>>
>>  I'm using Ubuntu 12.04 if that
>>> provides any help, the debian package xeno-config also gives that
>>> deprecated error so that may just be a problem with the debian
>>> package.
>>
>> If you install xenomai from sources, you should not install debian
>> package. You will have conflict between the two.
>>
>> --
>>                                                                Gilles.
> 
> I have a 32-bit machine. Even after removing the debian package for
> xeno-config, I have the same error.

Things you can try:
- try and compile a simple example not using xenomai, calling
pthread_cancel and linking it with -lpthread, passing -Wl,-t on gcc
command line to see what libpthread.so is used.
- when you compile xenomai, look at how for instance cyclictest is
compiled, and see if the flags used to compile your examples are the same.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-05-08 17:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-08  3:13 [Xenomai-help] Userland-compile error Vikram Dhillon
2012-05-08 15:32 ` Gilles Chanteperdrix
2012-05-08 16:23   ` Vikram Dhillon
2012-05-08 17:17     ` Gilles Chanteperdrix
2012-05-08 17:34       ` Vikram Dhillon
2012-05-08 17:36         ` Gilles Chanteperdrix
2012-05-08 17:40         ` Gilles Chanteperdrix

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.