avr: use compiler-rt

This commit is contained in:
Ayke van Laethem
2020-04-14 17:55:07 +02:00
parent 43d7f48de4
commit ce0abac5a3
10 changed files with 60 additions and 18 deletions
+8 -2
View File
@@ -16,8 +16,10 @@ var genericBuiltins = []string{
"addvsi3.c",
"addvti3.c",
"apple_versioning.c",
"ashlsi3.c",
"ashldi3.c",
"ashlti3.c",
"ashrsi3.c",
"ashrdi3.c",
"ashrti3.c",
"bswapdi2.c",
@@ -72,7 +74,9 @@ var genericBuiltins = []string{
"floatunsisf.c",
"floatuntidf.c",
"floatuntisf.c",
//"int_util.c",
"fp_mode.c",
"int_util.c",
"lshrsi3.c",
"lshrdi3.c",
"lshrti3.c",
"moddi3.c",
@@ -86,6 +90,7 @@ var genericBuiltins = []string{
"muloti4.c",
"mulsc3.c",
"mulsf3.c",
"mulsi3.c",
"multi3.c",
"multf3.c",
"mulvdi3.c",
@@ -108,6 +113,7 @@ var genericBuiltins = []string{
"powidf2.c",
"powisf2.c",
"powitf2.c",
"powixf2.c",
"subdf3.c",
"subsf3.c",
"subvdi3.c",
@@ -159,7 +165,7 @@ var aeabiBuiltins = []string{
var CompilerRT = Library{
name: "compiler-rt",
cflags: func() []string { return []string{"-Werror", "-Wall", "-std=c11", "-nostdlibinc"} },
sourceDir: "lib/compiler-rt/lib/builtins",
sourceDir: "llvm-project.master/compiler-rt/lib/builtins",
sources: func(target string) []string {
builtins := append([]string{}, genericBuiltins...) // copy genericBuiltins
if strings.HasPrefix(target, "arm") || strings.HasPrefix(target, "thumb") {
+3
View File
@@ -74,6 +74,9 @@ func (l *Library) Load(target string) (path string, err error) {
if strings.HasPrefix(target, "riscv32-") {
args = append(args, "-march=rv32imac", "-mabi=ilp32", "-fforce-enable-int128")
}
if strings.HasPrefix(target, "avr-") {
args = append(args, "-mdouble=64", "-mmcu=atmega1284p")
}
// Compile all sources.
var objs []string