Permalink
Browse files

Took another couple of changes from @peplin's PR #256 for chipKIT

  • Loading branch information...
1 parent da5f42b commit 28210c85a92d3f38efc98581621735605dec1ad1 @sej7278 sej7278 committed Jul 9, 2015
Showing with 11 additions and 5 deletions.
  1. +1 −1 Arduino.mk
  2. +10 −4 chipKIT.mk
View
@@ -1407,7 +1407,7 @@ pre-build:
$(call runscript_if_exists,$(PRE_BUILD_HOOK))
$(TARGET_ELF): $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS)
- $(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) -lc -lm
+ $(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) -lc -lm $(LINKER_SCRIPTS)
$(CORE_LIB): $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)
$(AR) rcs $@ $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)
View
@@ -81,7 +81,11 @@ ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(ALTERNATE_CORE)
ARDUINO_PREFERENCES_PATH = $(MPIDE_PREFERENCES_PATH)
ARDUINO_DIR = $(MPIDE_DIR)
-CORE_AS_SRCS = $(ARDUINO_CORE_PATH)/vector_table.S
+CORE_AS_SRCS = $(ARDUINO_CORE_PATH)/vector_table.S \
+ $(ARDUINO_CORE_PATH)/cpp-startup.S \
+ $(ARDUINO_CORE_PATH)/crti.S \
+ $(ARDUINO_CORE_PATH)/crtn.S \
+ $(ARDUINO_CORE_PATH)/pic32_software_reset.S
ARDUINO_VERSION = 23
@@ -107,9 +111,11 @@ LDSCRIPT = $(call PARSE_BOARD,$(BOARD_TAG),ldscript)
LDSCRIPT_FILE = $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
MCU_FLAG_NAME=mprocessor
-LDFLAGS += -T $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
-LDFLAGS += -T $(ARDUINO_CORE_PATH)/chipKIT-application-COMMON.ld
-CPPFLAGS += -mno-smart-io -fno-short-double
+LDFLAGS += -mdebugger -mno-peripheral-libs -nostartfiles -Wl,--gc-sections
+LINKER_SCRIPTS += -T $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
+LINKER_SCRIPTS += -T $(ARDUINO_CORE_PATH)/chipKIT-application-COMMON.ld
+CPPFLAGS += -mno-smart-io -fno-short-double -fframe-base-loclist \
+ -g3 -Wcast-align -D_BOARD_MEGA_
CFLAGS_STD =
include $(ARDMK_DIR)/Arduino.mk

0 comments on commit 28210c8

Please sign in to comment.