@@ -6,7 +6,7 @@ TOP := $(cur_dir)
6
6
# RUSTFLAGS that are likely to be tweaked by developers. For example,
7
7
# while we enable debug logs by default here, some might want to strip them
8
8
# for minimal code size / consumed cycles.
9
- CUSTOM_RUSTFLAGS := --cfg debug_assertions
9
+ CUSTOM_RUSTFLAGS := -C debug-assertions
10
10
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
11
11
# one would want to keep the default values here.
12
12
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS )
@@ -19,6 +19,7 @@ MODE := release
19
19
# we use a bash script with somes heuristics to find clang in current system.
20
20
CLANG := $(shell $(TOP ) /scripts/find_clang)
21
21
AR := $(subst clang,llvm-ar,$(CLANG ) )
22
+ OBJCOPY := $(subst clang,llvm-objcopy,$(CLANG ) )
22
23
# When this is set to some value, the generated binaries will be copied over
23
24
BUILD_DIR :=
24
25
# Generated binaries to copy. By convention, a Rust crate's directory name will
41
42
for binary in $( BINARIES) ; do \
42
43
echo " Copying binary $$ binary to build directory" ; \
43
44
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; \
44
47
done \
45
48
fi
46
49
0 commit comments