Skip to contentSkip to conversation

Problem compiling 2.5.1

Xenomai-help Ivan Kalatchev 2 participants 4 messages Feb 4, 2010

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 7 lines · Ivan Kalatchev

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:

include/asm-arm/arith.h +4 -5
index 9af5c5c..4ea5aae 100644
@@ -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.

Signature · 1 line
					    Gilles.
#2 lore raw
Quoted 10 lines · Gilles Chanteperdrix
Quoted 7 lines · Ivan Kalatchev

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:

include/asm-arm/arith.h +2 -3
index 9af5c5c..e86975c 100644
@@ -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"
Signature · 1 line
					    Gilles.
#3 lore raw

Thanks Gilles,

This modification worked. I have xenomai compiled fine now

Regards,

Ivan

Quoted 60 lines

-----Original Message-----
From: Gilles Chanteperdrix [mailto:[email protected]]
Sent: February-04-10 9:19 AM
To: Ivan Kalatchev
Cc: [email protected]
Subject: Re: [Xenomai-help] Problem compiling 2.5.1

Quoted 2 lines · Gilles Chanteperdrix
Quoted 1 line · Ivan Kalatchev

I have compiler error when compiling xenomai-2.5.1. Again probably

because

Quoted 8 lines
Quoted 6 lines

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:

include/asm-arm/arith.h +2 -4
index 9af5c5c..e86975c 100644
@@ -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.