Linux 2.4.9 and RTAI compilation problem

Ralf Corsepius corsepiu at faw.uni-ulm.de
Tue Sep 4 08:17:05 UTC 2001


On Die, 2001-09-04 at 02:46, Joel Sherrill wrote:
> 
> Everyone seems to have commented on everything but my immediate
> stumbling block. :)
> 
> I am sure someone has used this configuration before and has
> advice. Thanks in advance.
> 
> Joel Sherrill wrote:
> > 
> >   + Linux 2.4.9 kernel and rtai-24.1.6  on a Redhat 7.1 box.
> >     This seemed to be working out OK  as I managed to reboot
> >     the new kernel with RTAI patches but can't compile completely.
> >     I get these warnings (they start at #1) ..
> > 
> > arch/i386/rtai.c:298:45: warning: pasting "(" and "29" does not give a
> > valid preprocessing token
> > arch/i386/rtai.c:299:1: warning: pasting "(" and "30" does not give a
> > valid preprocessing token
> > arch/i386/rtai.c:299:23: warning: pasting "(" and "31" does not give a
> > valid preprocessing token

This sounds like rtai.c might be improperly using preprocessor macros. 

At least gcc >= 3.0 is sensitive to proper usage of ##-cpp-concats (I
can reproduce this issue with gcc-3.0.1). May-be RH-gcc-2.96 already
exhibited the 3.0 behavior (I'm not using RH and don't actually know.)

> > 
> >   and the build fails later with this:
> > 
> > ../../include/rtai_lxrt.h:325: impossible register constraint in `asm'
> > ../../include/rtai_lxrt.h:325: impossible register constraint in `asm'
> > ../tasklets.h:190: confused by earlier errors, bailing out
> > 
> > This has to be a common problem.  DO I have a bad compiler version
> > with Redhat 7.1 for using RTAI?
AFAIU, it depends on your POV :) This issue seems to be related to
cpp-concats and from a gcc-focused POV is caused by improper usage of
cpp-concats in rtai.c, which gccs < 2.96 do not catch. For me, rtai.c
compiles with SuSE-gcc-2.95.3 but doesn't do with gcc > 2.95.

AFAIK, under RH you probably need to use a different gcc (Isn't RH's
so-called kgcc is a gcc-2.95.x or even older?)

BTW: With the patch below rtai.c compiles with gcc-3.0.1:

--- arch/i386/rtai.c.orig	Tue Sep  4 10:01:06 2001
+++ arch/i386/rtai.c	Tue Sep  4 10:06:20 2001
@@ -230,7 +230,7 @@
         jz 1f; addl $4,%esp; iret; 1: ret")
 
 #define TRAP_FNAME(y) TRAP_##y(void)
-#define TRAP_NAME(y) TRAP_FNAME(##y)
+#define TRAP_NAME(y) TRAP_##y(void)
 
 #define BUILD_TRAP(vec) static void TRAP_NAME(vec) \
 { \

Ralf





More information about the users mailing list