File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,24 @@ fn main() {
37
37
. define ( "ENABLE_MODULE_SCHNORRSIG" , Some ( "1" ) )
38
38
. define ( "ENABLE_MODULE_EXTRAKEYS" , Some ( "1" ) ) ;
39
39
40
+ if env:: var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap ( ) == "riscv32" {
41
+ base_config. compiler ( "/usr/local/opt/llvm/bin/clang" )
42
+ . flag ( "--sysroot=/opt/riscv/riscv32-unknown-elf" ) // https://github.com/riscv-collab/riscv-gnu-toolchain has been built and stored in /opt/riscv
43
+ . flag ( "--gcc-toolchain=/opt/riscv" ) // https://github.com/riscv-collab/riscv-gnu-toolchain has been built and stored in /opt/riscv
44
+ . no_default_flags ( true )
45
+ . flag ( "-O3" )
46
+ . flag ( "--target=riscv32-unknown-none-elf" )
47
+ . flag ( "-mabi=ilp32" )
48
+ . flag ( "-mcmodel=medany" )
49
+ . flag ( "-Os" )
50
+ . flag ( "-fdata-sections" )
51
+ . flag ( "-ffunction-sections" )
52
+ . flag ( "-dead_strip" )
53
+ . flag ( "-flto" )
54
+ . flag ( "-march=rv32im" )
55
+ . target ( "riscv32-unknown-none-elf" ) ;
56
+ }
57
+
40
58
if cfg ! ( feature = "lowmemory" ) {
41
59
base_config. define ( "ECMULT_WINDOW_SIZE" , Some ( "4" ) ) ; // A low-enough value to consume negligible memory
42
60
base_config. define ( "ECMULT_GEN_PREC_BITS" , Some ( "2" ) ) ;
@@ -68,4 +86,3 @@ fn main() {
68
86
base_config. compile ( "libsecp256k1.a" ) ;
69
87
}
70
88
}
71
-
You can’t perform that action at this time.
0 commit comments