fix: symbol not found when building in baremental environment
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
//go:build baremental
|
||||
|
||||
package unix
|
||||
|
||||
import (
|
||||
_ "unsafe"
|
||||
)
|
||||
|
||||
func Fcntl(fd int, cmd int, arg int) (int, error) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
func fcntl(fd int, cmd int, arg int) (int, error) {
|
||||
return 0, nil
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
//go:build !baremental
|
||||
|
||||
package unix
|
||||
|
||||
import (
|
||||
|
||||
5
runtime/internal/lib/runtime/maxprocs_baremental.go
Normal file
5
runtime/internal/lib/runtime/maxprocs_baremental.go
Normal file
@@ -0,0 +1,5 @@
|
||||
//go:build baremental
|
||||
|
||||
package runtime
|
||||
|
||||
func c_maxprocs() int32 { return 1 }
|
||||
11
runtime/internal/lib/runtime/maxprocs_default.go
Normal file
11
runtime/internal/lib/runtime/maxprocs_default.go
Normal file
@@ -0,0 +1,11 @@
|
||||
//go:build !baremental
|
||||
|
||||
package runtime
|
||||
|
||||
const (
|
||||
LLGoPackage = "link"
|
||||
LLGoFiles = "_wrap/runtime.c"
|
||||
)
|
||||
|
||||
//go:linkname c_maxprocs C.llgo_maxprocs
|
||||
func c_maxprocs() int32
|
||||
@@ -26,11 +26,6 @@ import (
|
||||
// llgo:skipall
|
||||
type _runtime struct{}
|
||||
|
||||
const (
|
||||
LLGoPackage = "link"
|
||||
LLGoFiles = "_wrap/runtime.c"
|
||||
)
|
||||
|
||||
var defaultGOROOT string // set by cmd/link
|
||||
|
||||
func GOROOT() string {
|
||||
@@ -43,9 +38,6 @@ func Version() string {
|
||||
return buildVersion
|
||||
}
|
||||
|
||||
//go:linkname c_maxprocs C.llgo_maxprocs
|
||||
func c_maxprocs() int32
|
||||
|
||||
func GOMAXPROCS(n int) int {
|
||||
return int(c_maxprocs())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user