2025-10-15 14:54:29 +00:00
|
|
|
// 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 provides alternative implementations for go/build.
|
2025-10-16 13:09:32 +00:00
|
|
|
// We override build.Default.Compiler in an init function.
|
2025-10-15 14:54:29 +00:00
|
|
|
|
|
|
|
|
package build
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"go/build"
|
|
|
|
|
)
|
|
|
|
|
|
2025-10-16 13:09:32 +00:00
|
|
|
func init() {
|
|
|
|
|
// LLGO PATCH: Override build.Default.Compiler to be "gc" instead of "llgo"
|
|
|
|
|
// This prevents "unknown compiler" errors when user code uses go/build package
|
|
|
|
|
// Even though runtime.Compiler = "llgo", we set build.Default.Compiler = "gc"
|
2025-10-16 13:28:54 +00:00
|
|
|
build.Default.Compiler = "gc"
|
2025-10-15 14:54:29 +00:00
|
|
|
}
|