fix: symbol not found when building in baremental environment

This commit is contained in:
Haolan
2025-09-05 16:27:38 +08:00
parent 6588f36123
commit 2d1120bf69
15 changed files with 143 additions and 34 deletions

View File

@@ -21,7 +21,7 @@ import (
)
const (
LLGoPackage = "decl"
LLGoPackage = "link"
)
type (

View File

@@ -1,4 +1,4 @@
//go:build !wasm
//go:build !wasm && !baremental
package debug

View File

@@ -0,0 +1,40 @@
//go:build baremental
package debug
import (
"unsafe"
c "github.com/goplus/llgo/runtime/internal/clite"
)
type Info struct {
Fname *c.Char
Fbase c.Pointer
Sname *c.Char
Saddr c.Pointer
}
func Address() unsafe.Pointer {
panic("not implemented")
}
func Addrinfo(addr unsafe.Pointer, info *Info) c.Int {
panic("not implemented")
}
type Frame struct {
PC uintptr
Offset uintptr
SP unsafe.Pointer
Name string
}
func StackTrace(skip int, fn func(fr *Frame) bool) {
panic("not implemented")
}
func PrintStack(skip int) {
panic("not implemented")
}

View File

@@ -1,3 +1,5 @@
//go:build wasm
package debug
import (

View File

@@ -1,4 +1,4 @@
//go:build linux
//go:build linux && !baremental
package debug

View File

@@ -0,0 +1,29 @@
//go:build baremental
/*
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package c
import _ "unsafe"
//go:linkname Stdin stdin
var Stdin FilePtr
//go:linkname Stdout stdout
var Stdout FilePtr
var Stderr FilePtr = Fopen(Str("/dev/stderr"), Str("w"))

View File

@@ -1,5 +1,4 @@
//go:build !darwin
// +build !darwin
//go:build !darwin && !baremental
/*
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.