diff --git a/_demo/go/gobuild/demo.go b/_demo/go/gobuild/demo.go index 70cb4700..04adfadb 100644 --- a/_demo/go/gobuild/demo.go +++ b/_demo/go/gobuild/demo.go @@ -1,5 +1,3 @@ -//go:build go1.23 - package main import ( diff --git a/runtime/internal/lib/go/build/build.go b/runtime/internal/lib/go/build/build.go index dc778edb..dff10b62 100644 --- a/runtime/internal/lib/go/build/build.go +++ b/runtime/internal/lib/go/build/build.go @@ -15,8 +15,6 @@ import ( "strconv" "strings" _ "unsafe" - - "github.com/goplus/llgo/runtime/internal/lib/internal/buildcfg" ) // Type aliases to reference standard library types @@ -63,7 +61,7 @@ func parseGoVersion() int { return minor } } - return 24 + panic("parseGoVersion: cannot parse go version from runtime.Version(): " + runtime.Version()) } // defaultContext returns the default Context for builds. @@ -95,7 +93,7 @@ func defaultContext() Context { env := os.Getenv("CGO_ENABLED") if env == "" { - env = buildcfg.DefaultCGO_ENABLED + env = defaultCGO_ENABLED } switch env { case "1": diff --git a/runtime/internal/lib/go/build/zcgo.go b/runtime/internal/lib/go/build/zcgo.go new file mode 100644 index 00000000..34645a73 --- /dev/null +++ b/runtime/internal/lib/go/build/zcgo.go @@ -0,0 +1,7 @@ +// Copyright 2024 The GoPlus Authors (goplus.org). All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package build + +const defaultCGO_ENABLED = "1" diff --git a/runtime/internal/lib/internal/buildcfg/buildcfg.go b/runtime/internal/lib/internal/buildcfg/buildcfg.go deleted file mode 100644 index 88d78b00..00000000 --- a/runtime/internal/lib/internal/buildcfg/buildcfg.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2024 The GoPlus Authors (goplus.org). All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package buildcfg - -// llgo:skipall -type _buildcfg struct{} - -// DefaultCGO_ENABLED is the default value for CGO_ENABLED -// when the environment variable is not set. -const DefaultCGO_ENABLED = "1" diff --git a/runtime/internal/lib/runtime/symtab.go b/runtime/internal/lib/runtime/symtab.go index 04d236eb..a583611f 100644 --- a/runtime/internal/lib/runtime/symtab.go +++ b/runtime/internal/lib/runtime/symtab.go @@ -140,6 +140,10 @@ type Func struct { opaque struct{} // unexported field to disallow conversions } +func (f *Func) Name() string { + panic("todo") +} + // moduledata records information about the layout of the executable // image. It is written by the linker. Any changes here must be // matched changes to the code in cmd/link/internal/ld/symtab.go:symtab.