From 639b629037b78c8564cc6cca840d7ee299f37721 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 16 Oct 2024 14:46:44 +0200 Subject: [PATCH] Cleaned up arguments passed to the assembler Removes need for -Wno-unused-command-line-argument --- Makefile.defines | 6 ++---- Makefile.rules_generic | 14 +++++++------- Makefile.standard_app | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Makefile.defines b/Makefile.defines index e86c6703f..b600857b5 100644 --- a/Makefile.defines +++ b/Makefile.defines @@ -79,8 +79,6 @@ CFLAGS += -fropi CFLAGS += -fno-jump-tables # avoid jump tables for switch to avoid problems with invalid PIC access CFLAGS += -nostdlib -nodefaultlibs -AFLAGS += -fno-common - LDFLAGS += -fomit-frame-pointer LDFLAGS += -Wall LDFLAGS += -fno-common -ffunction-sections -fdata-sections -fwhole-program @@ -90,7 +88,7 @@ LDFLAGS += -Wl,--gc-sections -Wl,-Map,$(DBG_DIR)/app.map ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOS)) CFLAGS += --target=armv6m-none-eabi -mthumb CFLAGS += -mcpu=cortex-m0plus -mthumb -mtune=cortex-m0plus -AFLAGS += -mcpu=cortex-m0plus -mtune=cortex-m0plus -mthumb +AFLAGS += -mcpu=cortex-m0plus -mthumb LDFLAGS += -mcpu=cortex-m0plus -mthumb LDFLAGS += -nostartfiles --specs=nano.specs endif @@ -104,7 +102,7 @@ LDFLAGS += -mtune=cortex-m0plus -mlittle-endian -mcpu=cortex-m0plus LDFLAGS += -nostdlib -nodefaultlibs #-nostartfiles LDFLAGS += -mno-movt LDFLAGS += -L$(BOLOS_SDK)/arch/st33/lib/ -AFLAGS += -mcpu=cortex-m0plus -mtune=cortex-m0plus -mthumb +AFLAGS += -mcpu=cortex-m0plus -mthumb endif ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX TARGET_NANOS2)) diff --git a/Makefile.rules_generic b/Makefile.rules_generic index a3170dccd..bf4fded01 100644 --- a/Makefile.rules_generic +++ b/Makefile.rules_generic @@ -92,11 +92,11 @@ $(OBJ_DIR)/app/%.o: $(APP_DIR)/%.c $(BUILD_DEPENDENCIES) prepare $(OBJ_DIR)/app/%.o: $(APP_DIR)/%.s $(BUILD_DEPENDENCIES) prepare @echo "[AS] $@" - $(L)$(call as_cmdline,$(INCLUDES_PATH), $(DEFINES),$<,$@) + $(L)$(call as_cmdline,$(INCLUDES_PATH),$<,$@) $(OBJ_DIR)/app/%.o: $(APP_DIR)/%.S $(BUILD_DEPENDENCIES) prepare @echo "[AS] $@" - $(L)$(call as_cmdline,$(INCLUDES_PATH), $(DEFINES),$<,$@) + $(L)$(call as_cmdline,$(INCLUDES_PATH),$<,$@) # SDK files targets $(OBJ_DIR)/sdk/%.o: $(BOLOS_SDK)/%.c $(BUILD_DEPENDENCIES) prepare @@ -105,11 +105,11 @@ $(OBJ_DIR)/sdk/%.o: $(BOLOS_SDK)/%.c $(BUILD_DEPENDENCIES) prepare $(OBJ_DIR)/sdk/%.o: $(BOLOS_SDK)/%.s $(BUILD_DEPENDENCIES) prepare @echo "[AS] $@" - $(L)$(call as_cmdline,$(INCLUDES_PATH), $(DEFINES),$<,$@) + $(L)$(call as_cmdline,$(INCLUDES_PATH),$<,$@) $(OBJ_DIR)/sdk/%.o: $(BOLOS_SDK)/%.S $(BUILD_DEPENDENCIES) prepare @echo "[AS] $@" - $(L)$(call as_cmdline,$(INCLUDES_PATH), $(DEFINES),$<,$@) + $(L)$(call as_cmdline,$(INCLUDES_PATH),$<,$@) # Generic targets $(OBJ_DIR)/%.o: %.c $(BUILD_DEPENDENCIES) prepare @@ -118,11 +118,11 @@ $(OBJ_DIR)/%.o: %.c $(BUILD_DEPENDENCIES) prepare $(OBJ_DIR)/%.o: %.s $(BUILD_DEPENDENCIES) prepare @echo "[AS] $@" - $(L)$(call as_cmdline,$(INCLUDES_PATH), $(DEFINES),$<,$@) + $(L)$(call as_cmdline,$(INCLUDES_PATH),$<,$@) $(OBJ_DIR)/%.o: %.S $(BUILD_DEPENDENCIES) prepare @echo "[AS] $@" - $(L)$(call as_cmdline,$(INCLUDES_PATH), $(DEFINES),$<,$@) + $(L)$(call as_cmdline,$(INCLUDES_PATH),$<,$@) ifeq (,$(filter $(DEFINES),BOLOS_OS_UPGRADER_APP)) ifneq ($(SCRIPT_LD),) @@ -197,7 +197,7 @@ endif # dependency files are generated along the object file cc_cmdline = $(CC) -c $(CFLAGS) -MMD -MT $(4) -MF $(subst $(OBJ_DIR), $(DEP_DIR), $(addsuffix .d, $(basename $(4)))) $(addprefix -D,$(2)) $(addprefix -I,$(1)) -o $(4) $(3) -as_cmdline = $(AS) -c $(AFLAGS) $(addprefix -D,$(2)) $(addprefix -I,$(1)) -o $(4) $(3) +as_cmdline = $(AS) -c $(AFLAGS) $(addprefix -I,$(1)) -o $(3) $(2) ### END GCC COMPILER RULES diff --git a/Makefile.standard_app b/Makefile.standard_app index e2870cea6..95c02823a 100644 --- a/Makefile.standard_app +++ b/Makefile.standard_app @@ -221,7 +221,7 @@ CC := $(CLANGPATH)clang AS := $(CLANGPATH)clang LD := $(CLANGPATH)clang ifeq ($(AS),$(CLANGPATH)clang) - AFLAGS += --target=arm-arm-none-eabi -Wno-unused-command-line-argument + AFLAGS += --target=arm-arm-none-eabi endif LDLIBS += -lm -lgcc -lc