Skip to content

Commit

Permalink
Cleaned up arguments passed to the assembler
Browse files Browse the repository at this point in the history
Removes need for -Wno-unused-command-line-argument
  • Loading branch information
apaillier-ledger committed Oct 17, 2024
1 parent 67320f0 commit 316e78d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions Makefile.defines
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions Makefile.rules_generic
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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),)
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Makefile.standard_app
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 316e78d

Please sign in to comment.