Trouble compiling kernel with gcc-2.7.2

Trouble compiling kernel with gcc-2.7.2

Post by Omi » Mon, 19 Feb 1996 04:00:00



Hello,

I have had a lot of trouble compiling the kernel lately. It all started
when I thought I should upgrade from gcc 2.6.3 to 2.7.2 as 2.7.2 had
some bug fixes related to STL that I needed. At the time I was running
1.2.13 on SLackware 2.3 something. So I upgraded to gcc 2.7.2, compiled
all theree stages successfully. I also installed libg++ 2.7.1. To test
the compiler I thougth I'd try compiling the kernel. But within seconds
of starting to make zImage I got errors similar to the messages below.
In an attempt to fix this I reinstalled Linux from scratch (yes I backed
up the important stuff and reformatted the partition) with SLackware
3.0, reinstalled gcc 2.7.2 and libg++ 2.7.1 and tried compiling again.
This time I was trying to compile the linuxelf-1.2.13 sources. But I got
the error messges below. Can anyone shed some light on this?

(ustaad) 3:01pm /usr/src/linuxelf-1.2.13 make zImage
gcc -D__KERNEL__ -I/usr/src/linuxelf-1.2.13/include -Wall
-Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -m486  -c -o
init/main.o init/main.c
/usr/src/linuxelf-1.2.13/include/asm/io.h: In function `copro_timeout':
/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
/usr/src/linuxelf-1.2.13/include/asm/io.h: In function `check_fpu':
/usr/src/linuxelf-1.2.13/include/asm/io.h:78: inconsistent operand
constraints in an `asm'
/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
/usr/src/linuxelf-1.2.13/include/asm/io.h:78: inconsistent operand
constraints in an `asm'
/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
constraints in an `asm'
make: *** [init/main.o] Error 1

 
 
 

Trouble compiling kernel with gcc-2.7.2

Post by Theofilu Andre » Sun, 25 Feb 1996 04:00:00




Quote:>Hello,

>I have had a lot of trouble compiling the kernel lately. It all started
>when I thought I should upgrade from gcc 2.6.3 to 2.7.2 as 2.7.2 had
>some bug fixes related to STL that I needed. At the time I was running
>1.2.13 on SLackware 2.3 something. So I upgraded to gcc 2.7.2, compiled
>all theree stages successfully. I also installed libg++ 2.7.1. To test
>the compiler I thougth I'd try compiling the kernel. But within seconds
>of starting to make zImage I got errors similar to the messages below.
[stuff deleted]
>the error messges below. Can anyone shed some light on this?

>(ustaad) 3:01pm /usr/src/linuxelf-1.2.13 make zImage
>gcc -D__KERNEL__ -I/usr/src/linuxelf-1.2.13/include -Wall
>-Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -m486  -c -o
>init/main.o init/main.c
>/usr/src/linuxelf-1.2.13/include/asm/io.h: In function `copro_timeout':
>/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
>constraints in an `asm'
>/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
>constraints in an `asm'
>/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
>constraints in an `asm'
>/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
>constraints in an `asm'
>/usr/src/linuxelf-1.2.13/include/asm/io.h: In function `check_fpu':
>/usr/src/linuxelf-1.2.13/include/asm/io.h:78: inconsistent operand
>constraints in an `asm'
>/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
>constraints in an `asm'
>/usr/src/linuxelf-1.2.13/include/asm/io.h:78: inconsistent operand
>constraints in an `asm'
>/usr/src/linuxelf-1.2.13/include/asm/io.h:82: inconsistent operand
>constraints in an `asm'
>make: *** [init/main.o] Error 1

What can I say? I did the same and got exactly the same errors. It
seems, that the new compiler does not understand the inline assembler
code in that file any more or needs different code.
However, with newer kernels (1.3.57 and above) it works again.

All you can do is using an older version of gcc. If you have 2.6.3
or 2.7.0 you can give the option -V2.7.0 or -V2.6.3 to the command
line of your compiler. This at least worked for me.

If you've installed Slakware 3.0 and after that installed gcc v2.7.2,
the version 2.7.0 is still availlable. Just give the option mentioned
above and all should work again.

To insert these option look for the file
/usr/src/linux/arch/i386/Makefile. Somewhere at the beginning of this
file there is a line starting with

   CFLAGS = ...

Add the above option to this line.

Hope that helps.
--
Theofilu Andreas

               -------------------------------------------------
                           Enjoy the science of Linux!
                       Genie?e die Wissenschaft von Linux!
               -------------------------------------------------