mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 03:03:27 +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. */
|
/* For the memory allocator. */
|
||||||
_heap_start = _ebss;
|
_heap_start = _ebss;
|
||||||
_heap_end = ORIGIN(RAM) + LENGTH(RAM);
|
_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())
|
global := llvm.AddGlobal(c.mod, llvmType, g.LinkName())
|
||||||
g.llvmGlobal = global
|
g.llvmGlobal = global
|
||||||
if !strings.HasPrefix(g.LinkName(), "_extern_") {
|
if !g.IsExtern() {
|
||||||
global.SetLinkage(llvm.InternalLinkage)
|
global.SetLinkage(llvm.InternalLinkage)
|
||||||
initializer, err := getZeroValue(llvmType)
|
initializer, err := getZeroValue(llvmType)
|
||||||
if err != nil {
|
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 {
|
func (c *Compiler) parseGlobalInitializer(g *Global) error {
|
||||||
|
if g.IsExtern() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
llvmValue, err := c.getInterpretedValue(g.initializer)
|
llvmValue, err := c.getInterpretedValue(g.initializer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user