inline asm errors when compiling linux-1.2.13 with gcc-2.7.1

inline asm errors when compiling linux-1.2.13 with gcc-2.7.1

Post by J.J. van der Heijde » Thu, 23 Nov 1995 04:00:00



Hello,

I've run into problems compiling the linux-1.2.13 kernel, which
always worked fine for me. I suspect the problem is not the
kernel, but gcc. I recently upgraded my gcc to version 2.7.1
(homebuilt from GNU sources, linux-aout configuration). When I
try to build the kernel, I get:

ZOO-station:/usr/src/linux# make zlilo
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall
-Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -m486  -c -o
init/main.o init/main.c
/usr/src/linux/include/asm/io.h: In function `copro_timeout':
/usr/src/linux/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
/usr/src/linux/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
/usr/src/linux/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
/usr/src/linux/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
/usr/src/linux/include/asm/io.h: In function `check_fpu':
/usr/src/linux/include/asm/io.h:78: inconsistent operand
constraints in an `asm'
/usr/src/linux/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
/usr/src/linux/include/asm/io.h:78: inconsistent operand
constraints in an `asm'
/usr/src/linux/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
make: *** [init/main.o] Error 1
ZOO-station:/usr/src/linux#

So, did gcc-2.7.1 chenge the syntax for inline asm?
Does anybody have the same problems, or know how to fix this?

The offending part from linux/include/asm/io.h:

73: #define __OUTS(s) \
74: extern inline void outs##s(unsigned short port, const void *
addr, unsigned long count) \
75: { __asm__ __volatile__ ("cld ; rep ; outs" #s \
76: : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1"
(count)); }
77:
78: __IN(b,"b","0" (0))
79: __IN(w,"w","0" (0))
80: __IN(l,"")
81:
82: __OUT(b,"b",char)
83: __OUT(w,"w",short)
84: __OUT(l,,int)
85:
86: __INS(b)
87: __INS(w)
88: __INS(l)
89:
90: __OUTS(b)
91: __OUTS(w)
92: __OUTS(l)

BTW: The ftape module, which also never gave me troubles, gives
about the
same errors.

Happy hacking,
          JanJaap

 
 
 

1. Gcc-2.7.2 won't compile linux-1.2.13

In my attempt to move to ELF, I acquired linux-1.2.13 (I've been
running 1.2.6 fine for months) and gcc-2.7.2 (I've been using 2.6.3
fine for months, too).  I compiled linux-1.2.13 with gcc-2.6.3
and have been running on it fine for a day (it's what's running
now).  Then I installed gcc-2.7.2.  It installed in
/usr/local/lib/gcc-lib/i586-unknown-linuxaout (2.6.3 was installed
in /usr/local/lib/gcc-lib/i586-unknown-linux).  I compiled a
program I had compiled and installed last week (a POP3 daemon)
and ran 'file' on the result.  File said the following:
'popper.linux: Linux/i386 not stripped' (I didn't try to run
the daemon).  Then I tried to compile linux-1.2.13 with
gcc-2.7.2 after doing 'make mrproper;make config;make dep;make clean',
and got the following:

% make zImage
gcc -b i586-unknown-linuxaout -D__KERNEL__
   -I/usr4/src/linux-1.2.13/linux/include -Wall -Wstrict-prototypes
   -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -m486
   -c -o init/main.o init/main.c
/usr4/src/linux-1.2.13/linux/include/asm/io.h: In function
  `copro_timeout':
/usr4/src/linux-1.2.13/linux/include/asm/io.h:82: inconsistent
  operand constraints in an `asm'
/usr4/src/linux-1.2.13/linux/include/asm/io.h:82: inconsistent
  operand constraints in an `asm'
/usr4/src/linux-1.2.13/linux/include/asm/io.h:82: inconsistent
  operand constraints in an `asm'
/usr4/src/linux-1.2.13/linux/include/asm/io.h:82: inconsistent
  operand constraints in an `asm'
/usr4/src/linux-1.2.13/linux/include/asm/io.h: In function `check_fpu':
/usr4/src/linux-1.2.13/linux/include/asm/io.h:78: inconsistent
  operand constraints in an `asm'
/usr4/src/linux-1.2.13/linux/include/asm/io.h:82: inconsistent
  operand constraints in an `asm'
/usr4/src/linux-1.2.13/linux/include/asm/io.h:78: inconsistent
  operand constraints in an `asm'
/usr4/src/linux-1.2.13/linux/include/asm/io.h:82: inconsistent
  operand constraints in an `asm'
make: *** [init/main.o] Error 1

Notice I tried '-b i586-unknown-linuxaout' as suggested by the ELF
installation documentation.  I also tried '-fno-strength-reduce'
as suggested by http://www.sjc.ox.ac.uk/users/barlow/linux-gcc.html.
Neither changed anything.  Putting '-b i486-linuxaout' produced the
error that cpp and cc1 couldn't be found.  I also changed
'LD     =ld' to 'LD     =ld -m i386linux' in the kernel make file
(as suggested by the ELF upgrade doc), but to no avail.

Does anyone have any ideas on how to fix this.  I seem to remember
something I read saying that going to ELF meant rewriting assembly
code.  Is this related to that?  Pointers to any helpful
documents would be greatly appreciated.

Bob Crosson

2. help me! fdisk murdered my HD

3. Kernel-1.2.13 compiled!! with GCC-2.7.0

4. Viola to solaris 2.5 x86 (gcc)?

5. HELP: error compiling L1.2.13 / gcc 2.7.2

6. Could someone please recommend a good textbook for learning Linux?

7. kernel1.2.13 compilation error (asm)

8. Primary DNS Server

9. Problem with GCC V2.7.2 compiling kernel V1.2.13

10. pcsp-patch-1.2.13 with gcc-2.7.2 possible?

11. compiling kernel1.2.13 linker-error

12. NCSA on linux-1.2.13/ELF: SIGSEGV, 500 Server Error