mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 11:13:27 +00:00
builtins: add GENERIC_TF_SOURCES
This addes GENERIC_TF_SOURCES, which contains long double floating point builtins (80 bit, 128 bit, etc). This is needed for full printf support.
This commit is contained in:
committed by
Ron Evans
parent
841abb0903
commit
55f7d21ff5
+38
-4
@@ -3,8 +3,8 @@ package builder
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
|
||||||
|
|
||||||
|
"github.com/tinygo-org/tinygo/compileopts"
|
||||||
"github.com/tinygo-org/tinygo/goenv"
|
"github.com/tinygo-org/tinygo/goenv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -132,6 +132,38 @@ var genericBuiltins = []string{
|
|||||||
"umodti3.c",
|
"umodti3.c",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// These are the GENERIC_TF_SOURCES as of LLVM 18.
|
||||||
|
// They are not needed on all platforms (32-bit platforms usually don't need
|
||||||
|
// these) but they seem to compile fine so it's easier to include them.
|
||||||
|
var genericBuiltins128 = []string{
|
||||||
|
"addtf3.c",
|
||||||
|
"comparetf2.c",
|
||||||
|
"divtc3.c",
|
||||||
|
"divtf3.c",
|
||||||
|
"extenddftf2.c",
|
||||||
|
"extendhftf2.c",
|
||||||
|
"extendsftf2.c",
|
||||||
|
"fixtfdi.c",
|
||||||
|
"fixtfsi.c",
|
||||||
|
"fixtfti.c",
|
||||||
|
"fixunstfdi.c",
|
||||||
|
"fixunstfsi.c",
|
||||||
|
"fixunstfti.c",
|
||||||
|
"floatditf.c",
|
||||||
|
"floatsitf.c",
|
||||||
|
"floattitf.c",
|
||||||
|
"floatunditf.c",
|
||||||
|
"floatunsitf.c",
|
||||||
|
"floatuntitf.c",
|
||||||
|
"multc3.c",
|
||||||
|
"multf3.c",
|
||||||
|
"powitf2.c",
|
||||||
|
"subtf3.c",
|
||||||
|
"trunctfdf2.c",
|
||||||
|
"trunctfhf2.c",
|
||||||
|
"trunctfsf2.c",
|
||||||
|
}
|
||||||
|
|
||||||
var aeabiBuiltins = []string{
|
var aeabiBuiltins = []string{
|
||||||
"arm/aeabi_cdcmp.S",
|
"arm/aeabi_cdcmp.S",
|
||||||
"arm/aeabi_cdcmpeq_check_nan.c",
|
"arm/aeabi_cdcmpeq_check_nan.c",
|
||||||
@@ -190,11 +222,13 @@ var libCompilerRT = Library{
|
|||||||
},
|
},
|
||||||
librarySources: func(target string) ([]string, error) {
|
librarySources: func(target string) ([]string, error) {
|
||||||
builtins := append([]string{}, genericBuiltins...) // copy genericBuiltins
|
builtins := append([]string{}, genericBuiltins...) // copy genericBuiltins
|
||||||
if strings.HasPrefix(target, "arm") || strings.HasPrefix(target, "thumb") {
|
switch compileopts.CanonicalArchName(target) {
|
||||||
|
case "arm":
|
||||||
builtins = append(builtins, aeabiBuiltins...)
|
builtins = append(builtins, aeabiBuiltins...)
|
||||||
}
|
case "avr":
|
||||||
if strings.HasPrefix(target, "avr") {
|
|
||||||
builtins = append(builtins, avrBuiltins...)
|
builtins = append(builtins, avrBuiltins...)
|
||||||
|
case "x86_64", "aarch64", "riscv64": // any 64-bit arch
|
||||||
|
builtins = append(builtins, genericBuiltins128...)
|
||||||
}
|
}
|
||||||
return builtins, nil
|
return builtins, nil
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user