All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Problem compiling 2.5.1
@ 2010-02-04 13:43 Ivan Kalatchev
  2010-02-04 14:10 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Kalatchev @ 2010-02-04 13:43 UTC (permalink / raw)
  To: Xenomai-help

[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]

I have compiler error when compiling xenomai-2.5.1. Again probably because
my tool chain is outdated - gcc 3.4.4.

 

make[3]: Entering directory
`/mnt/drive-1/build/xenomai-2.5.1/src/skins/native'

/bin/sh ../../../libtool --tag=CC   --mode=compile arm-linux-gcc
-DHAVE_CONFIG_H -I. -I../../../src/include  -O2 -D_GNU_SOURCE -D_REENTRANT
-Wall -pipe -march=armv5 -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes
-I../../../include    -MT libnative_la-timer.lo -MD -MP -MF
.deps/libnative_la-timer.Tpo -c -o libnative_la-timer.lo `test -f 'timer.c'
|| echo './'`timer.c

libtool: compile:  arm-linux-gcc -DHAVE_CONFIG_H -I. -I../../../src/include
-O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -march=armv5 -D__XENO__
-D__IN_XENO__ -Wstrict-prototypes -I../../../include -MT
libnative_la-timer.lo -MD -MP -MF .deps/libnative_la-timer.Tpo -c timer.c
-fPIC -DPIC -o .libs/libnative_la-timer.o

{standard input}: Assembler messages:

{standard input}:102: Error: bad instruction `lsrs sl,r7,#30'

make[3]: *** [libnative_la-timer.lo] Error 1

make[3]: Leaving directory
`/mnt/drive-1/build/xenomai-2.5.1/src/skins/native'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/mnt/drive-1/build/xenomai-2.5.1/src/skins'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/mnt/drive-1/build/xenomai-2.5.1/src'

make: *** [all-recursive] Error 1

 

Is there way to modify assembler code so that code would compile ?  

 

Regards,

 

Ivan Kalatchev

Senior Software Developer

ESG Canada Inc.

 

20 Hyperion Court, 

Kingston, ON, Canada

K7K 7K2

Tel: 1 613 548-8287 ext. 247

 


[-- Attachment #2: Type: text/html, Size: 6162 bytes --]

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

* Re: [Xenomai-help] Problem compiling 2.5.1
  2010-02-04 13:43 [Xenomai-help] Problem compiling 2.5.1 Ivan Kalatchev
@ 2010-02-04 14:10 ` Gilles Chanteperdrix
  2010-02-04 14:18   ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2010-02-04 14:10 UTC (permalink / raw)
  To: Ivan Kalatchev; +Cc: Xenomai-help

Ivan Kalatchev wrote:
> I have compiler error when compiling xenomai-2.5.1. Again probably because
> my tool chain is outdated - gcc 3.4.4.
> (...)
> {standard input}:102: Error: bad instruction `lsrs sl,r7,#30'
> (...)
> 
> Is there way to modify assembler code so that code would compile ?  

Ok. lsrs looks like a valid instruction, but s1 looks strange as a
register name. The problem may be to call the variable "s", could you
try to call it "sign" instead ? This way:

diff --git a/include/asm-arm/arith.h b/include/asm-arm/arith.h
index 9af5c5c..4ea5aae 100644
--- a/include/asm-arm/arith.h
+++ b/include/asm-arm/arith.h
@@ -32,6 +32,7 @@ rthal_arm_nodiv_llimd(const long long op,

 #include <asm-generic/xenomai/arith.h>

+#if __LINUX_ARM_ARCH__ >= 4
 #define rthal_arm_nodiv_ullimd_str			\
 	"umull %[tl], %[rl], %[opl], %[fracl]\n\t"	\
 	"umull %[rm], %[rh], %[oph], %[frach]\n\t"	\
@@ -49,8 +50,6 @@ rthal_arm_nodiv_llimd(const long long op,
 	"umlal %[rm], %[rh], %[opl], %[integ]\n\t"	\
 	"mla %[rh], %[oph], %[integ], %[rh]\n\t"

-
-#if __LINUX_ARM_ARCH__ >= 4
 static inline __attribute__((__const__)) unsigned long long
 rthal_arm_nodiv_ullimd(const unsigned long long op,
 		       const unsigned long long frac,
@@ -101,19 +100,19 @@ rthal_arm_nodiv_llimd(const long long op,
 	__rthal_u64tou32(op, oph, opl);
 	__rthal_u64tou32(frac, frach, fracl);
 	
-	__asm__ ("lsrs %[s], %[oph], #30\n\t"
+	__asm__ ("lsrs %[sign], %[oph], #30\n\t"
 		 "beq 1f\n\t"
 		 "rsbs  %[opl], %[opl], #0\n\t"
 		 "rsc  %[oph], %[oph], #0\n"
 		 "1:\t"
 		 rthal_arm_nodiv_ullimd_str
-		 "teq %[s], #0\n\t"
+		 "teq %[sign], #0\n\t"
 		 "beq 2f\n\t"
 		 "rsbs  %[rm], %[rm], #0\n\t"
 		 "rsc  %[rh], %[rh], #0\n"
 		 "2:\t"
 		 : [rl]"=r"(rl), [rm]"=r"(rm), [rh]"=r"(rh),
-		   [tl]"=r"(tl), [th]"=r"(th), [s]"=r"(s)
+		   [tl]"=r"(tl), [th]"=r"(th), [sign]"=r"(s)
 		 : [opl]"r"(opl), [oph]"r"(oph),
 		   [fracl]"r"(fracl), [frach]"r"(frach),
 		   [integ]"r"(integ)


If it does not work, tell me and we will disable this implementation of
rthal_nodiv_llimd for gcc versions < 4.

-- 
					    Gilles.


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

* Re: [Xenomai-help] Problem compiling 2.5.1
  2010-02-04 14:10 ` Gilles Chanteperdrix
@ 2010-02-04 14:18   ` Gilles Chanteperdrix
  2010-02-04 14:49     ` Ivan Kalatchev
  0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2010-02-04 14:18 UTC (permalink / raw)
  To: Ivan Kalatchev; +Cc: Xenomai-help

Gilles Chanteperdrix wrote:
> Ivan Kalatchev wrote:
>> I have compiler error when compiling xenomai-2.5.1. Again probably because
>> my tool chain is outdated - gcc 3.4.4.
>> (...)
>> {standard input}:102: Error: bad instruction `lsrs sl,r7,#30'
>> (...)
>>
>> Is there way to modify assembler code so that code would compile ?  
> 
> Ok. lsrs looks like a valid instruction, but s1 looks strange as a

It is "sl", not "s1", and sl is a valid name for r10. The problem is
indeed lsrs, it is in fact a synonym for the equivalent mov with shifted
second operand in older assembly sources. So, please try the following
patch:

diff --git a/include/asm-arm/arith.h b/include/asm-arm/arith.h
index 9af5c5c..e86975c 100644
--- a/include/asm-arm/arith.h
+++ b/include/asm-arm/arith.h
@@ -32,6 +32,7 @@ rthal_arm_nodiv_llimd(const long long op,

 #include <asm-generic/xenomai/arith.h>

+#if __LINUX_ARM_ARCH__ >= 4
 #define rthal_arm_nodiv_ullimd_str			\
 	"umull %[tl], %[rl], %[opl], %[fracl]\n\t"	\
 	"umull %[rm], %[rh], %[oph], %[frach]\n\t"	\
@@ -49,8 +50,6 @@ rthal_arm_nodiv_llimd(const long long op,
 	"umlal %[rm], %[rh], %[opl], %[integ]\n\t"	\
 	"mla %[rh], %[oph], %[integ], %[rh]\n\t"

-
-#if __LINUX_ARM_ARCH__ >= 4
 static inline __attribute__((__const__)) unsigned long long
 rthal_arm_nodiv_ullimd(const unsigned long long op,
 		       const unsigned long long frac,
@@ -101,7 +100,7 @@ rthal_arm_nodiv_llimd(const long long op,
 	__rthal_u64tou32(op, oph, opl);
 	__rthal_u64tou32(frac, frach, fracl);
 	
-	__asm__ ("lsrs %[s], %[oph], #30\n\t"
+	__asm__ ("movs %[s], %[oph], lsr #30\n\t"
 		 "beq 1f\n\t"
 		 "rsbs  %[opl], %[opl], #0\n\t"
 		 "rsc  %[oph], %[oph], #0\n"


-- 
					    Gilles.


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

* Re: [Xenomai-help] Problem compiling 2.5.1
  2010-02-04 14:18   ` Gilles Chanteperdrix
@ 2010-02-04 14:49     ` Ivan Kalatchev
  0 siblings, 0 replies; 4+ messages in thread
From: Ivan Kalatchev @ 2010-02-04 14:49 UTC (permalink / raw)
  To: 'Gilles Chanteperdrix'; +Cc: Xenomai-help

Thanks Gilles,

This modification worked. I have xenomai compiled fine now

Regards,

Ivan

> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: February-04-10 9:19 AM
> To: Ivan Kalatchev
> Cc: Xenomai-help@domain.hid
> Subject: Re: [Xenomai-help] Problem compiling 2.5.1
> 
> Gilles Chanteperdrix wrote:
> > Ivan Kalatchev wrote:
> >> I have compiler error when compiling xenomai-2.5.1. Again probably
> because
> >> my tool chain is outdated - gcc 3.4.4.
> >> (...)
> >> {standard input}:102: Error: bad instruction `lsrs sl,r7,#30'
> >> (...)
> >>
> >> Is there way to modify assembler code so that code would compile ?
> >
> > Ok. lsrs looks like a valid instruction, but s1 looks strange as a
> 
> It is "sl", not "s1", and sl is a valid name for r10. The problem is
> indeed lsrs, it is in fact a synonym for the equivalent mov with
> shifted
> second operand in older assembly sources. So, please try the following
> patch:
> 
> diff --git a/include/asm-arm/arith.h b/include/asm-arm/arith.h
> index 9af5c5c..e86975c 100644
> --- a/include/asm-arm/arith.h
> +++ b/include/asm-arm/arith.h
> @@ -32,6 +32,7 @@ rthal_arm_nodiv_llimd(const long long op,
> 
>  #include <asm-generic/xenomai/arith.h>
> 
> +#if __LINUX_ARM_ARCH__ >= 4
>  #define rthal_arm_nodiv_ullimd_str			\
>  	"umull %[tl], %[rl], %[opl], %[fracl]\n\t"	\
>  	"umull %[rm], %[rh], %[oph], %[frach]\n\t"	\
> @@ -49,8 +50,6 @@ rthal_arm_nodiv_llimd(const long long op,
>  	"umlal %[rm], %[rh], %[opl], %[integ]\n\t"	\
>  	"mla %[rh], %[oph], %[integ], %[rh]\n\t"
> 
> -
> -#if __LINUX_ARM_ARCH__ >= 4
>  static inline __attribute__((__const__)) unsigned long long
>  rthal_arm_nodiv_ullimd(const unsigned long long op,
>  		       const unsigned long long frac,
> @@ -101,7 +100,7 @@ rthal_arm_nodiv_llimd(const long long op,
>  	__rthal_u64tou32(op, oph, opl);
>  	__rthal_u64tou32(frac, frach, fracl);
> 
> -	__asm__ ("lsrs %[s], %[oph], #30\n\t"
> +	__asm__ ("movs %[s], %[oph], lsr #30\n\t"
>  		 "beq 1f\n\t"
>  		 "rsbs  %[opl], %[opl], #0\n\t"
>  		 "rsc  %[oph], %[oph], #0\n"
> 
> 
> --
> 					    Gilles.




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

end of thread, other threads:[~2010-02-04 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04 13:43 [Xenomai-help] Problem compiling 2.5.1 Ivan Kalatchev
2010-02-04 14:10 ` Gilles Chanteperdrix
2010-02-04 14:18   ` Gilles Chanteperdrix
2010-02-04 14:49     ` Ivan Kalatchev

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.