compileopts: set 'purego' build tag by default

This is needed for various crypto libraries.
This commit is contained in:
Ayke van Laethem
2024-02-05 18:55:10 +01:00
committed by Ron Evans
parent ed55f56d85
commit 0952b1b984
2 changed files with 14 additions and 10 deletions
+6 -1
View File
@@ -74,7 +74,12 @@ func (c *Config) GOARM() string {
// BuildTags returns the complete list of build tags used during this build.
func (c *Config) BuildTags() []string {
tags := append(c.Target.BuildTags, []string{"tinygo", "math_big_pure_go", "gc." + c.GC(), "scheduler." + c.Scheduler(), "serial." + c.Serial()}...)
tags := append(c.Target.BuildTags, []string{
"tinygo", // that's the compiler
"purego", // to get various crypto packages to work
"math_big_pure_go", // to get math/big to work
"gc." + c.GC(), "scheduler." + c.Scheduler(), // used inside the runtime package
"serial." + c.Serial()}...) // used inside the machine package
for i := 1; i <= c.GoMinorVersion; i++ {
tags = append(tags, fmt.Sprintf("go1.%d", i))
}