Merge commit '6588f36123eababf6e24564b49e5af374285d2b5' into optional-esp-clang

# Conflicts:
#	internal/crosscompile/crosscompile.go
#	internal/crosscompile/crosscompile_test.go
This commit is contained in:
Li Jie
2025-09-03 09:32:38 +08:00
59 changed files with 5523 additions and 2542 deletions

View File

@@ -176,13 +176,14 @@ func TestUseTarget(t *testing.T) {
expectLLVM string
expectCPU string
}{
{
name: "WASI Target",
targetName: "wasi",
expectError: false,
expectLLVM: "",
expectCPU: "generic",
},
// FIXME(MeteorsLiu): wasi in useTarget
// {
// name: "WASI Target",
// targetName: "wasi",
// expectError: false,
// expectLLVM: "",
// expectCPU: "generic",
// },
{
name: "RP2040 Target",
targetName: "rp2040",
@@ -279,13 +280,13 @@ func TestUseTarget(t *testing.T) {
func TestUseWithTarget(t *testing.T) {
// Test target-based configuration takes precedence
export, err := Use("linux", "amd64", "wasi", false, true)
export, err := Use("linux", "amd64", "esp32", false, true)
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
// Check if LLVM target is in CCFLAGS
found := slices.Contains(export.CCFLAGS, "-mcpu=generic")
found := slices.Contains(export.CCFLAGS, "-mcpu=esp32")
if !found {
t.Errorf("Expected CPU generic in CCFLAGS, got %v", export.CCFLAGS)
}