feat(crosscompile): add ESP Clang multi-platform support

- Add ESP Clang download and extraction for cross-compilation
- Support multiple platforms: darwin/amd64, darwin/arm64, linux/amd64, linux/arm64, windows/amd64
- Integrate ESP Clang with target-based configuration system
- Add ClangRoot and ClangBinPath fields to Export struct
- Support .tar.xz extraction for ESP Clang packages
- Prioritize LLGoROOT clang installation over cached downloads
- Update build system to use custom clang for embedded platforms

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Li Jie
2025-08-04 15:18:15 +08:00
parent 3ac881b191
commit deea8754ae
4 changed files with 145 additions and 17 deletions

View File

@@ -76,7 +76,7 @@ func TestUseCrossCompileSDK(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
export, err := Use(tc.goos, tc.goarch, false)
export, err := use(tc.goos, tc.goarch, false)
if err != nil {
t.Fatalf("Unexpected error: %v", err)
@@ -255,7 +255,7 @@ func TestUseTarget(t *testing.T) {
func TestUseWithTarget(t *testing.T) {
// Test target-based configuration takes precedence
export, err := UseWithTarget("linux", "amd64", false, "wasi")
export, err := Use("linux", "amd64", false, "wasi")
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
@@ -267,7 +267,7 @@ func TestUseWithTarget(t *testing.T) {
}
// Test fallback to goos/goarch when no target specified
export, err = UseWithTarget(runtime.GOOS, runtime.GOARCH, false, "")
export, err = Use(runtime.GOOS, runtime.GOARCH, false, "")
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}