Mail Archives: pgcc/1998/08/29/19:23:12
My experience with building the 2.1.x Linux kernel with PGCC v1.03 has been
that the -O3 switch is OK, but that any greater optimization results in
that kernel hanging during boot-up. I recently tracked down the exact
compiler switch that is causing the problem.
I used the description on http://goof.com/pcg/pgcc-faq.html#SEC04 as a
guide to which -Ox switches enable which optimizations. Starting with -O3,
at which no problems are seen, I did successive builds of kernel 2.1.117
each with an additional compiler switch, then attempted to boot with that
kernel. I used only switches described as 'safe'. Naturally, I first
removed the standard '-m486' switch from the kernel's makefile.
The kernel works fine when built with these -O4 switches:
-O3
--schedule-insns2
--swap-for-agi
--risc
--interleave-stack-non-stack
--schedule-stack-reg-insns
Adding the '--risc-const' switch breaks the kernel. It always boots to the
point where it mounts the swap partition, then it just freezes up. I
removed that switch from the makefile and continued the successive kernel
builds. Eventually, the optimizations I had enabled looked like this:
-O3
--schedule-insns2
--swap-for-agi
--risc
--interleave-stack-non-stack
--schedule-stack-reg-insns
--runtime-lift-stores
--all-mem-givs
--do-offload
--risc-mem-dest
Using this list of optimizations, the 2.1.117 kernel builds, boots and runs
great. Adding back in the '--risc-const' switch again caused the kernel to
freeze up at boot time.
(BTW, use of these last 4 switches seemed to make no difference in the
kernel size at all, so it might be that those otimization never actually
generated any code changes.)
About my system: RedHat v5.1 with PGCC v1.03a installed. PGCC was
installed via the '586 packages found on the Foyers' Web site
(www.foyer.se/downloads/pgcc_rpms.html). I also installed the library RPMs
from that same page. My version of binutils is 2.9.1.0.10. My machine is
a Pentium with 32MB of RAM.
So... what is the story on '--risc-const'? It is listed on the PGCC Web
page as 'safe', but my experience is that it is not safe at all on the
2.1.x Linux kernel.
Thank you.
***** Steve Snyder *****
- Raw text -