Skip to content

Commit 613bc1f

Browse files
committed
fix: expand RTT debugger compatibility
1 parent 3869f76 commit 613bc1f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compiler/symbol.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,13 @@ func (c *compilerContext) getGlobal(g *ssa.Global) llvm.Value {
702702
})
703703
llvmGlobal.AddMetadata(0, diglobal)
704704
}
705+
706+
if info.linkName == "machine.rttSerialInstance" {
707+
// Create the symbol alias and make sure neither gets optimized away.
708+
alias := llvm.AddAlias(c.mod, llvmType, 0, llvmGlobal, "_SEGGER_RTT")
709+
llvmutil.AppendToGlobal(c.mod, "llvm.used", alias)
710+
llvmutil.AppendToGlobal(c.mod, "llvm.used", llvmGlobal)
711+
}
705712
}
706713
return llvmGlobal
707714
}

0 commit comments

Comments
 (0)