Re: PGCC and the kernel

Frank Heldt (Frank.Heldt@mahr.de)
Tue, 29 Jul 1997 09:53:35 +0200


John Twilley wrote:

Hello John,

> I'm using the newest version of PGCC I can find. Here's the version
> string:
> gcc driver version 2.7.2p snapshot 970522 executing gcc version 2.7.2p
The latest version is pgcc snapshot 970721
(ftp://ftp.goof.com/pub/pcg/Linux),
but 970522 is OK too ;-)

> I'd like to know if there are any tweaks I should make to kernel
> makefiles other than changing '-O2' to '-O6 -frisc'.
>
> Also, the kernel compiles fine except for arch/i386/lib/checksum.c,
> where it fails with this error:
>
> gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wno-sign-compare
> -Wstrict-prototypes -O5 -frisc -fomit-frame-pointer -D__SMP__ -pipe
> -fno-strength-reduce -mpentium -malign-loops=2 -malign-jumps=2
> -malign-functions=2 -DCPU=586 -D__SMP__ -c -o checksum.o checksum.c
> {standard input}: Assembler messages:
> {standard input}:509: Fatal error: Symbol end_of_body already defined.
>
> It compiles fine with -O2. I'm going to try all the different
> optimizations between -O2 and -O6 just to see what's breaking, and
> report it to the PGCC crew. Has anyone else noticed this?

Here's what I did:

1. change CFLAGS in toplevel Makefile to simply -O6
-fno-inline-functions
(-frisc and -fomit-frame-pointer are included in this O-Level !)
The -fno-inline-functions is a workaround for the "checksum.c" -
Problem, there is no decrease in performance, because the Kernel uses
mostly explizit inline Statements B-)

2. in arch/i386/Makefile change CFLAGS to -mpentium -DCPU586 and
remove -fno-strength-reduce (pgcc has this bug fixed). The
alignment options are not necessary, the pgcc uses the best
(zero) alignment per default.

3. The compiler generates a lot of warnings about signed/unsigned
comparison, if you don't like this, add -Wno-sign-compare after
-Wall to the CFLAGS.

I have no problems with the pgcc and Linux since I used them together,
the System runs stable. One interesting thing would be the performance
increase (if there is one), maybe you could run some benchmarks
(eg lmbench), i haven't done this so far (sorry).

Hope this helps

Bye
Frank

PS: Thanks to the pgcc and linux guys, I (and my K6) love both ;-)

-- 
* Frank Heldt
* mailto:Frank.Heldt@mahr.de   ===> Linux for IQ's higher than 95 <===
* +49 0551/7073-511