mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 23:13:40 +00:00
riscv: add support for compiler-rt
This gets all the tests to compile and many of them to pass. There are some issues left, but those are probably unrelated to compiler-rt.
This commit is contained in:
committed by
Ron Evans
parent
c97b7221bd
commit
ad022ef23d
+5
-1
@@ -236,7 +236,11 @@ func CompileBuiltins(target string, callback func(path string) error) error {
|
|||||||
// Note: -fdebug-prefix-map is necessary to make the output archive
|
// Note: -fdebug-prefix-map is necessary to make the output archive
|
||||||
// reproducible. Otherwise the temporary directory is stored in the
|
// reproducible. Otherwise the temporary directory is stored in the
|
||||||
// archive itself, which varies each run.
|
// archive itself, which varies each run.
|
||||||
err := runCCompiler("clang", "-c", "-Oz", "-g", "-Werror", "-Wall", "-std=c11", "-fshort-enums", "-nostdlibinc", "-ffunction-sections", "-fdata-sections", "-Wno-macro-redefined", "--target="+target, "-fdebug-prefix-map="+dir+"="+remapDir, "-o", objpath, srcpath)
|
args := []string{"-c", "-Oz", "-g", "-Werror", "-Wall", "-std=c11", "-fshort-enums", "-nostdlibinc", "-ffunction-sections", "-fdata-sections", "-Wno-macro-redefined", "--target=" + target, "-fdebug-prefix-map=" + dir + "=" + remapDir}
|
||||||
|
if strings.HasPrefix(target, "riscv32-") {
|
||||||
|
args = append(args, "-march=rv32imac", "-mabi=ilp32", "-fforce-enable-int128")
|
||||||
|
}
|
||||||
|
err := runCCompiler("clang", append(args, "-o", objpath, srcpath)...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &commandError{"failed to build", srcpath, err}
|
return &commandError{"failed to build", srcpath, err}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"gc": "conservative",
|
"gc": "conservative",
|
||||||
"compiler": "clang",
|
"compiler": "clang",
|
||||||
"linker": "ld.lld",
|
"linker": "ld.lld",
|
||||||
|
"rtlib": "compiler-rt",
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=riscv32--none",
|
"--target=riscv32--none",
|
||||||
"-march=rv32imac",
|
"-march=rv32imac",
|
||||||
|
|||||||
Reference in New Issue
Block a user