[mips] revert r366664 - flip mips back from -O2 to -O

Now that I have -head fitting in 8MB of flash again, I can test
out freebsd-head on my home AP test setup.  Unfortunately,
the introduction of -O2 in r366664 causes the following infinite
loop shortly after boot:

------

MAP: No valid partition found at map/rootfs.uzip
Warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin/init
BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x4042c320 got a read fault (type 0x2) at 0x2e3a0
Trapframe Register Dump:
        zero: 0 at: 0   v0: 0   v1: 0
        a0: 0x1af34     a1: 0   a2: 0   a3: 0x7fffeff0
        t0: 0   t1: 0   t2: 0   t3: 0
        t4: 0   t5: 0   t6: 0   t7: 0
        t8: 0   t9: 0x152e8     s0: 0x7fffee84  s1: 0
        s2: 0   s3: 0   s4: 0   s5: 0
        s6: 0   s7: 0   k0: 0   k1: 0
        gp: 0x362c0     sp: 0x7fffedf0  s8: 0   ra: 0x40417df0
        sr: 0xf413      mullo: 0        mulhi: 0        badvaddr: 0x2e3a0
        cause: 0xffffffff80000008       pc: 0x4042c31c
Page table info for pc address 0x4042c320: pde = 0x80712000, pte = 0xa002065a
Dumping 4 words starting at pc address 0x4042c320:
8f9980e0 80820000 10400067 00809825
Page table info for bad address 0x2e3a0: pde = 0, pte = 0

------

I'm not yet sure why, but until I figure it out with the mips64/cheri
folk this should be reverted.

This should only use -O on GCC generated code for MIPS platforms.

Tested:

* QCA934x (mips74k) - WDR-3600/WDR-4300 APs

Differential Revision: https://reviews.freebsd.org/D28122
This commit is contained in:
Adrian Chadd 2021-01-12 13:13:20 -08:00
parent 986deea5b5
commit bd72252aac

View File

@ -166,7 +166,14 @@ CC ?= c89
CFLAGS ?= -O
.else
CC ?= cc
.if ${MACHINE_CPUARCH} == "mips" && ${COMPILER_TYPE} == "gcc"
# Note: there are currently issues generating code gcc-6.x targeting
# code for at least mips32. The system hits infinite page faults
# when starting /sbin/init if -O2 is used.
CFLAGS ?= -O -pipe
.else
CFLAGS ?= -O2 -pipe
.endif
.if defined(NO_STRICT_ALIASING)
CFLAGS += -fno-strict-aliasing
.endif