all: improve compiler-rt compilation
A few changes to make sure compiler-rt is correctly compiled (and doesn't include host headers, for example). This improves support for AVR, but it still doesn't work. Compiler-rt itself doesn't really work for AVR either.
Этот коммит содержится в:
родитель
73709922b2
коммит
1bbdab41d2
3 изменённых файлов: 9 добавлений и 2 удалений
|
@ -161,7 +161,7 @@ func loadBuiltins(target string) (path string, err error) {
|
||||||
objpath := filepath.Join(dir, name+".o")
|
objpath := filepath.Join(dir, name+".o")
|
||||||
objs = append(objs, objpath)
|
objs = append(objs, objpath)
|
||||||
srcpath := filepath.Join(builtinsDir, name+".c")
|
srcpath := filepath.Join(builtinsDir, name+".c")
|
||||||
cmd := exec.Command(commands["clang"], "-c", "-Oz", "-g", "-Werror", "-Wall", "-std=c11", "--target="+target, "-o", objpath, srcpath)
|
cmd := exec.Command(commands["clang"], "-c", "-Oz", "-g", "-Werror", "-Wall", "-std=c11", "-fshort-enums", "-nostdlibinc", "--target="+target, "-o", objpath, srcpath)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
cmd.Dir = dir
|
cmd.Dir = dir
|
||||||
|
|
|
@ -53,3 +53,11 @@ func abort() {
|
||||||
func align(ptr uintptr) uintptr {
|
func align(ptr uintptr) uintptr {
|
||||||
return (ptr + 3) &^ 3
|
return (ptr + 3) &^ 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Implement memset for compiler-rt.
|
||||||
|
//go:export memset
|
||||||
|
func memset(ptr unsafe.Pointer, c byte, size uintptr) {
|
||||||
|
for i := uintptr(0); i < size; i++ {
|
||||||
|
*(*byte)(unsafe.Pointer(uintptr(ptr) + i)) = c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
"-Wl,--gc-sections",
|
"-Wl,--gc-sections",
|
||||||
"-fno-exceptions", "-fno-unwind-tables",
|
"-fno-exceptions", "-fno-unwind-tables",
|
||||||
"-ffunction-sections", "-fdata-sections",
|
"-ffunction-sections", "-fdata-sections",
|
||||||
"-fno-short-enums",
|
|
||||||
"-Os",
|
"-Os",
|
||||||
"-DNRF51",
|
"-DNRF51",
|
||||||
"-Ilib/CMSIS/CMSIS/Include",
|
"-Ilib/CMSIS/CMSIS/Include",
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче