github.com/aykevl/tinygo@v0.5.0/linker-external.go (about)

     1  // +build !byollvm
     2  
     3  package main
     4  
     5  // This file provides a Link() function that always runs an external command. It
     6  // is provided for when tinygo is built without linking to liblld.
     7  
     8  import (
     9  	"os"
    10  	"os/exec"
    11  )
    12  
    13  // Link invokes a linker with the given name and arguments.
    14  //
    15  // This version always runs the linker as an external command.
    16  func Link(linker string, flags ...string) error {
    17  	cmd := exec.Command(linker, flags...)
    18  	cmd.Stdout = os.Stdout
    19  	cmd.Stderr = os.Stderr
    20  	return cmd.Run()
    21  }