@@ -306,7 +306,9 @@ func buildAllPkgs(ctx *context, initial []*packages.Package, verbose bool) (pkgs
306
306
}
307
307
linkParts := concatPkgLinkFiles (ctx , pkg , verbose )
308
308
allParts := append (linkParts , cgoLdflags ... )
309
- allParts = append (allParts , pkg .ExportFile )
309
+ if pkg .ExportFile != "" {
310
+ allParts = append (allParts , pkg .ExportFile )
311
+ }
310
312
aPkg .LinkArgs = allParts
311
313
} else {
312
314
// panic("todo")
@@ -358,7 +360,9 @@ func buildAllPkgs(ctx *context, initial []*packages.Package, verbose bool) (pkgs
358
360
if err != nil {
359
361
panic (err )
360
362
}
361
- aPkg .LinkArgs = append (cgoLdflags , pkg .ExportFile )
363
+ if pkg .ExportFile != "" {
364
+ aPkg .LinkArgs = append (cgoLdflags , pkg .ExportFile )
365
+ }
362
366
aPkg .LinkArgs = append (aPkg .LinkArgs , concatPkgLinkFiles (ctx , pkg , verbose )... )
363
367
if aPkg .AltPkg != nil {
364
368
aPkg .LinkArgs = append (aPkg .LinkArgs , concatPkgLinkFiles (ctx , aPkg .AltPkg .Package , verbose )... )
@@ -612,14 +616,16 @@ func buildPkg(ctx *context, aPkg *aPackage, verbose bool) (cgoLdflags []string,
612
616
}
613
617
cgoLdflags = append (cgoLdflags , altLdflags ... )
614
618
}
615
- pkg .ExportFile += ".ll"
616
- os .WriteFile (pkg .ExportFile , []byte (ret .String ()), 0644 )
617
- if debugBuild || verbose {
618
- fmt .Fprintf (os .Stderr , "==> Export %s: %s\n " , aPkg .PkgPath , pkg .ExportFile )
619
- }
620
- if IsCheckEnable () {
621
- if err , msg := llcCheck (ctx .env , pkg .ExportFile ); err != nil {
622
- fmt .Fprintf (os .Stderr , "==> lcc %v: %v\n %v\n " , pkg .PkgPath , pkg .ExportFile , msg )
619
+ if pkg .ExportFile != "" {
620
+ pkg .ExportFile += ".ll"
621
+ os .WriteFile (pkg .ExportFile , []byte (ret .String ()), 0644 )
622
+ if debugBuild || verbose {
623
+ fmt .Fprintf (os .Stderr , "==> Export %s: %s\n " , aPkg .PkgPath , pkg .ExportFile )
624
+ }
625
+ if IsCheckEnable () {
626
+ if err , msg := llcCheck (ctx .env , pkg .ExportFile ); err != nil {
627
+ fmt .Fprintf (os .Stderr , "==> lcc %v: %v\n %v\n " , pkg .PkgPath , pkg .ExportFile , msg )
628
+ }
623
629
}
624
630
}
625
631
return
0 commit comments