From 820bb6a04b4653480294dae5fdd13cf78bdf7279 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Tue, 19 Jan 2021 22:13:59 +0000 Subject: [PATCH] make.probe: probe_optimize: remove -O2 Solaris Studio 12.5 cc seems to produce incorrect code at -O2 (a.k.a. -xO2) optimisation level; integer variables initialise at random values, and the behaviour of the shell is so incorrect it can't even run the test scripts. It does not support -Os so that is skipped for that compiler. At -O it works fine. src/cmd/INIT/make.probe: - By default, only try -Os and -O optimisation flags. --- src/cmd/INIT/make.probe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/INIT/make.probe b/src/cmd/INIT/make.probe index d6f4b1838..c1b931748 100644 --- a/src/cmd/INIT/make.probe +++ b/src/cmd/INIT/make.probe @@ -34,7 +34,7 @@ probe_lib_all_undef="-all -notall -all -none -Bwhole-archive -Bno-whole-archive probe_lib_multiple="-Wl,-zmuldefs" probe_libdir="shlib lib" probe_nmflags="'' -p -B" -probe_optimize="-Os -O2 -O" +probe_optimize="-Os -O" probe_pic="-Kpic -KPIC -fpic -fPIC -pic -PIC +z +Z" probe_no_protect="'-fno-stack-protector -fno-stack-protector-all' -GS-" probe_readonly="-R -Krodata -xMerge -Wa,-r"