@@ -247,10 +247,9 @@ func MuslArchitecture(triple string) string {
247
247
return CanonicalArchName (triple )
248
248
}
249
249
250
- // LibcPath returns the path to the libc directory. The libc path will be either
251
- // a precompiled libc shipped with a TinyGo build, or a libc path in the cache
252
- // directory (which might not yet be built).
253
- func (c * Config ) LibcPath (name string ) (path string , precompiled bool ) {
250
+ // LibcPath returns the path to the libc directory. The libc path will be a libc
251
+ // path in the cache directory (which might not yet be built).
252
+ func (c * Config ) LibcPath (name string ) string {
254
253
archname := c .Triple ()
255
254
if c .CPU () != "" {
256
255
archname += "-" + c .CPU ()
@@ -266,17 +265,9 @@ func (c *Config) LibcPath(name string) (path string, precompiled bool) {
266
265
archname += "-" + c .Target .Libc
267
266
}
268
267
269
- // Try to load a precompiled library.
270
- precompiledDir := filepath .Join (goenv .Get ("TINYGOROOT" ), "pkg" , archname , name )
271
- if _ , err := os .Stat (precompiledDir ); err == nil {
272
- // Found a precompiled library for this OS/architecture. Return the path
273
- // directly.
274
- return precompiledDir , true
275
- }
276
-
277
268
// No precompiled library found. Determine the path name that will be used
278
269
// in the build cache.
279
- return filepath .Join (goenv .Get ("GOCACHE" ), name + "-" + archname ), false
270
+ return filepath .Join (goenv .Get ("GOCACHE" ), name + "-" + archname )
280
271
}
281
272
282
273
// DefaultBinaryExtension returns the default extension for binaries, such as
@@ -360,7 +351,7 @@ func (c *Config) LibcCFlags() []string {
360
351
case "picolibc" :
361
352
root := goenv .Get ("TINYGOROOT" )
362
353
picolibcDir := filepath .Join (root , "lib" , "picolibc" , "newlib" , "libc" )
363
- path , _ := c .LibcPath ("picolibc" )
354
+ path := c .LibcPath ("picolibc" )
364
355
return []string {
365
356
"-nostdlibinc" ,
366
357
"-isystem" , filepath .Join (path , "include" ),
@@ -370,7 +361,7 @@ func (c *Config) LibcCFlags() []string {
370
361
}
371
362
case "musl" :
372
363
root := goenv .Get ("TINYGOROOT" )
373
- path , _ := c .LibcPath ("musl" )
364
+ path := c .LibcPath ("musl" )
374
365
arch := MuslArchitecture (c .Triple ())
375
366
return []string {
376
367
"-nostdlibinc" ,
@@ -390,7 +381,7 @@ func (c *Config) LibcCFlags() []string {
390
381
return nil
391
382
case "mingw-w64" :
392
383
root := goenv .Get ("TINYGOROOT" )
393
- path , _ := c .LibcPath ("mingw-w64" )
384
+ path := c .LibcPath ("mingw-w64" )
394
385
return []string {
395
386
"-nostdlibinc" ,
396
387
"-isystem" , filepath .Join (path , "include" ),
0 commit comments