mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 18:47:47 +00:00
Fix external globals
This broke the allocator on ARM, and with that the blinky example.
This commit is contained in:
@@ -80,4 +80,3 @@ __bss_end__ = _ebss;
|
||||
/* For the memory allocator. */
|
||||
_heap_start = _ebss;
|
||||
_heap_end = ORIGIN(RAM) + LENGTH(RAM);
|
||||
runtime.heapptr = _heap_start; /* necessary? */
|
||||
|
||||
+4
-1
@@ -252,7 +252,7 @@ func (c *Compiler) Parse(mainPath string, buildTags []string) error {
|
||||
}
|
||||
global := llvm.AddGlobal(c.mod, llvmType, g.LinkName())
|
||||
g.llvmGlobal = global
|
||||
if !strings.HasPrefix(g.LinkName(), "_extern_") {
|
||||
if !g.IsExtern() {
|
||||
global.SetLinkage(llvm.InternalLinkage)
|
||||
initializer, err := getZeroValue(llvmType)
|
||||
if err != nil {
|
||||
@@ -745,6 +745,9 @@ func (c *Compiler) initMapNewBucket(mapType *types.Map) (llvm.Value, uint64, uin
|
||||
}
|
||||
|
||||
func (c *Compiler) parseGlobalInitializer(g *Global) error {
|
||||
if g.IsExtern() {
|
||||
return nil
|
||||
}
|
||||
llvmValue, err := c.getInterpretedValue(g.initializer)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user