Skip to content

Commit 9fc86d3

Browse files
committed
Use -g in compilation
1 parent 190ebba commit 9fc86d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
TARGET := riscv64-unknown-linux-gnu-
22
CC := $(TARGET)gcc
33
LD := $(TARGET)gcc
4+
OBJCOPY := $(TARGET)objcopy
45

56
PARAMS = sphincs-shake-128f
67
THASH = simple
78

8-
CFLAGS := -fPIC -O3 -fno-builtin-printf -fno-builtin-memcmp -nostdinc -nostartfiles -fvisibility=hidden -fdata-sections -ffunction-sections -nostdlib -Wno-nonnull-compare -DCKB_VM -DCKB_DECLARATION_ONLY
9+
CFLAGS := -fPIC -O3 -fno-builtin-printf -fno-builtin-memcmp -nostdinc -nostartfiles -fvisibility=hidden -fdata-sections -ffunction-sections -nostdlib -Wno-nonnull-compare -DCKB_VM -DCKB_DECLARATION_ONLY -g
910
LDFLAGS := -fdata-sections -ffunction-sections
1011

1112
# Using a new version of gcc will have a warning of ckb-c-stdlib
@@ -66,7 +67,7 @@ ifneq (,$(findstring sha2,$(PARAMS)))
6667
HEADERS += $(SPHINCS_PLUS_DIR)sha2.h
6768
endif
6869

69-
# CFLAGS := $(CFLAGS) -g -DCKB_C_STDLIB_PRINTF
70+
# CFLAGS := $(CFLAGS) -DCKB_C_STDLIB_PRINTF
7071

7172
# docker pull nervos/ckb-riscv-gnu-toolchain:gnu-jammy-20230214
7273
BUILDER_DOCKER := nervos/ckb-riscv-gnu-toolchain@sha256:7601a814be2595ad471288fefc176356b31101837a514ddb0fc93b11c1cf5135
@@ -82,6 +83,8 @@ build/convert_asm: c/ref/fips202_asm.S
8283
build/sphincsplus_lock: c/ckb-sphincsplus-lock.c $(SOURCES) $(HEADERS)
8384
mkdir -p build
8485
$(CC) $(CFLAGS) -o $@ $(SOURCES) $<
86+
cp $@ $@.debug
87+
$(OBJCOPY) --strip-debug --strip-all $@
8588

8689
clean:
8790
rm -rf build/sphincsplus_lock

0 commit comments

Comments
 (0)