From ae5b297d592d55e9d8fb4e06f9c66e00684e87e9 Mon Sep 17 00:00:00 2001 From: Jaden Weiss Date: Sat, 11 Jul 2020 14:32:38 -0400 Subject: [PATCH] builder: remove optimization level 0 Currently, turning optimizations off causes compile failures. We rely on the optimizer removing some dead symbols. Avoid providing an option that does not work right now. In the future once everything has been fixed we can re-enable this. --- builder/build.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/builder/build.go b/builder/build.go index cf8086c1..da9a6c98 100644 --- a/builder/build.go +++ b/builder/build.go @@ -76,8 +76,15 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(stri // exactly. errs = nil switch config.Options.Opt { - case "none", "0": - errs = transform.Optimize(mod, config, 0, 0, 0) // -O0 + /* + Currently, turning optimizations off causes compile failures. + We rely on the optimizer removing some dead symbols. + Avoid providing an option that does not work right now. + In the future once everything has been fixed we can re-enable this. + + case "none", "0": + errs = transform.Optimize(mod, config, 0, 0, 0) // -O0 + */ case "1": errs = transform.Optimize(mod, config, 1, 0, 0) // -O1 case "2":