From d5e11fa19b6b4ef53f2c5106c1c1c6d8e50358b3 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Tue, 14 Jan 2020 13:41:10 +0100 Subject: [PATCH] compiler: do not emit debug info for extern globals This results in a link error in the following commit (undefined reference to runtime.trackedGlobalsBitmap from .debug_info). Solution: don't emit debug info for declared but not defined symbols. --- compiler/symbol.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/symbol.go b/compiler/symbol.go index c5a4183f..ae853f18 100644 --- a/compiler/symbol.go +++ b/compiler/symbol.go @@ -82,7 +82,7 @@ func (c *Compiler) getGlobal(g *ssa.Global) llvm.Value { } } - if c.Debug() { + if c.Debug() && !info.extern { // Add debug info. // TODO: this should be done for every global in the program, not just // the ones that are referenced from some code.