From 8125a65622b5915c808db3c659794667e758730f Mon Sep 17 00:00:00 2001 From: cnlohr Date: Thu, 5 Dec 2024 00:51:27 -0800 Subject: [PATCH] Make the linker make the map file instead of it being a separate step becuase it tells you which libraries are actually being linked that way. --- ch32v003fun/ch32v003fun.mk | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ch32v003fun/ch32v003fun.mk b/ch32v003fun/ch32v003fun.mk index b4d0732a..44ce572b 100644 --- a/ch32v003fun/ch32v003fun.mk +++ b/ch32v003fun/ch32v003fun.mk @@ -1,15 +1,15 @@ # Default prefix for Windows ifeq ($(OS),Windows_NT) - PREFIX?=riscv64-unknown-elf + PREFIX?=riscv64-unknown-elf # Check if riscv64-linux-gnu-gcc exists else ifneq ($(shell which riscv64-linux-gnu-gcc),) - PREFIX?=riscv64-linux-gnu + PREFIX?=riscv64-linux-gnu # Check if riscv64-unknown-elf-gcc exists else ifneq ($(shell which riscv64-unknown-elf-gcc),) - PREFIX?=riscv64-unknown-elf + PREFIX?=riscv64-unknown-elf # Default prefix else - PREFIX?=riscv64-elf + PREFIX?=riscv64-elf endif # Fedora places newlib in a different location @@ -34,7 +34,7 @@ ifeq ($(DEBUG),1) endif CFLAGS?=-g -Os -flto -ffunction-sections -fdata-sections -fmessage-length=0 -msmall-data-limit=8 -LDFLAGS+=-Wl,--print-memory-usage +LDFLAGS+=-Wl,--print-memory-usage -Wl,-Map=$(TARGET).map ifeq ($(TARGET_MCU),CH32V003) CFLAGS_ARCH+=-march=rv32ec -mabi=ilp32e -DCH32V003=1 @@ -189,7 +189,6 @@ FILES_TO_COMPILE:=$(SYSTEM_C) $(TARGET).$(TARGET_EXT) $(ADDITIONAL_C_FILES) $(TARGET).bin : $(TARGET).elf $(PREFIX)-objdump -S $^ > $(TARGET).lst - $(PREFIX)-objdump -t $^ > $(TARGET).map $(PREFIX)-objcopy -O binary $< $(TARGET).bin $(PREFIX)-objcopy -O ihex $< $(TARGET).hex