@@ -6,7 +6,7 @@ TOP := $(cur_dir)
66# RUSTFLAGS that are likely to be tweaked by developers. For example,
77# while we enable debug logs by default here, some might want to strip them
88# for minimal code size / consumed cycles.
9- CUSTOM_RUSTFLAGS := --cfg debug_assertions
9+ CUSTOM_RUSTFLAGS := -C debug-assertions
1010# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
1111# one would want to keep the default values here.
1212FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS )
@@ -19,6 +19,7 @@ MODE := release
1919# we use a bash script with somes heuristics to find clang in current system.
2020CLANG := $(shell $(TOP ) /scripts/find_clang)
2121AR := $(subst clang,llvm-ar,$(CLANG ) )
22+ OBJCOPY := $(subst clang,llvm-objcopy,$(CLANG ) )
2223# When this is set to some value, the generated binaries will be copied over
2324BUILD_DIR :=
2425# Generated binaries to copy. By convention, a Rust crate's directory name will
4142 for binary in $( BINARIES) ; do \
4243 echo " Copying binary $$ binary to build directory" ; \
4344 cp $(TOP ) /target/riscv64imac-unknown-none-elf/$(MODE ) /$$ binary $(TOP ) /$(BUILD_DIR ) ; \
45+ cp $(TOP ) /$(BUILD_DIR ) /$$ binary $(TOP ) /$(BUILD_DIR ) /$$ binary.debug; \
46+ $(OBJCOPY ) --strip-debug --strip-all $(TOP ) /$(BUILD_DIR ) /$$ binary; \
4447 done \
4548 fi
4649
0 commit comments