build: show cgo compile errors

This commit is contained in:
Li Jie
2025-01-15 14:04:38 +08:00
parent 38cb89a946
commit 28b3ec322c
2 changed files with 22 additions and 9 deletions

View File

@@ -591,7 +591,7 @@ func buildPkg(ctx *context, aPkg *aPackage, verbose bool) (cgoLdflags []string,
if aPkg.AltPkg != nil {
altLdflags, e := buildCgo(ctx, aPkg, aPkg.AltPkg.Syntax, externs, verbose)
if e != nil {
return nil, e
return nil, fmt.Errorf("build cgo of %v failed: %v", pkgPath, e)
}
cgoLdflags = append(cgoLdflags, altLdflags...)
}