builder: add -mcpu flag while building libraries

This flag is important for the Xtensa backend because by default a more
powerful backend (ESP32) is assumed. Therefore, compiling for the
ESP8266 won't work by default and needs the -mcpu flag.
This commit is contained in:
Ayke van Laethem
2021-02-10 23:37:07 +01:00
committed by Ron Evans
parent 74fe213b15
commit 8a54615a09
2 changed files with 13 additions and 5 deletions
+2 -2
View File
@@ -171,7 +171,7 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(Buil
// Add compiler-rt dependency if needed. Usually this is a simple load from
// a cache.
if config.Target.RTLib == "compiler-rt" {
path, job, err := CompilerRT.load(config.Triple(), dir)
path, job, err := CompilerRT.load(config.Triple(), config.CPU(), dir)
if err != nil {
return err
}
@@ -187,7 +187,7 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(Buil
// Add libc dependency if needed.
if config.Target.Libc == "picolibc" {
path, job, err := Picolibc.load(config.Triple(), dir)
path, job, err := Picolibc.load(config.Triple(), config.CPU(), dir)
if err != nil {
return err
}