gc: drop support for 'precise' globals

Precise globals require a whole program optimization pass that is hard
to support when building packages separately. This patch removes support
for these globals by converting the last use (Linux) to use
linker-defined symbols instead.

For details, see: https://github.com/tinygo-org/tinygo/issues/2870
This commit is contained in:
Ayke van Laethem
2022-05-30 13:47:09 +02:00
committed by Ron Evans
parent 5c488e3145
commit 2d61972475
9 changed files with 39 additions and 244 deletions
+1 -2
View File
@@ -189,8 +189,7 @@ func Optimize(mod llvm.Module, config *compileopts.Config, optLevel, sizeLevel i
builder.Populate(modPasses)
modPasses.Run(mod)
hasGCPass := AddGlobalsBitmap(mod)
hasGCPass = MakeGCStackSlots(mod) || hasGCPass
hasGCPass := MakeGCStackSlots(mod)
if hasGCPass {
if err := llvm.VerifyModule(mod, llvm.PrintMessageAction); err != nil {
return []error{errors.New("GC pass caused a verification failure")}