build: patch packages supports cgo
This commit is contained in:
@@ -587,6 +587,13 @@ func buildPkg(ctx *context, aPkg *aPackage, verbose bool) (cgoLdflags []string,
|
||||
check(err)
|
||||
aPkg.LPkg = ret
|
||||
cgoLdflags, err = buildCgo(ctx, aPkg, aPkg.Package.Syntax, externs, verbose)
|
||||
if aPkg.AltPkg != nil {
|
||||
altLdflags, e := buildCgo(ctx, aPkg, aPkg.AltPkg.Syntax, externs, verbose)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
cgoLdflags = append(cgoLdflags, altLdflags...)
|
||||
}
|
||||
if ctx.output {
|
||||
pkg.ExportFile += ".ll"
|
||||
os.WriteFile(pkg.ExportFile, []byte(ret.String()), 0644)
|
||||
|
||||
@@ -16,11 +16,13 @@
|
||||
|
||||
package runtime
|
||||
|
||||
// llgo:skipall
|
||||
import (
|
||||
_ "unsafe"
|
||||
)
|
||||
|
||||
// llgo:skipall
|
||||
type _runtime struct{}
|
||||
|
||||
// GOROOT returns the root of the Go tree. It uses the
|
||||
// GOROOT environment variable, if set at process start,
|
||||
// or else the root used during the Go build.
|
||||
|
||||
Reference in New Issue
Block a user