mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 14:33:41 +00:00
compiler: add //go:linkname support for globals
We previously used our own //go:extern but //go:linkname is probably the better choice since it's used in the math/bits package.
This commit is contained in:
Vendored
+6
@@ -2,6 +2,12 @@ package main
|
||||
|
||||
import _ "unsafe"
|
||||
|
||||
// Use the go:linkname mechanism to link this global to a different package.
|
||||
// This is used in math/bits.
|
||||
//
|
||||
//go:linkname linknamedGlobal runtime.testLinknamedGlobal
|
||||
var linknamedGlobal int
|
||||
|
||||
// Creates an external global with name extern_global.
|
||||
//
|
||||
//go:extern extern_global
|
||||
|
||||
Reference in New Issue
Block a user