aboutsummaryrefslogtreecommitdiff
path: root/Arduino.mk
diff options
context:
space:
mode:
authorSimon John <817564+sej7278@users.noreply.github.com>2020-10-20 09:15:05 +0100
committerGitHub <noreply@github.com>2020-10-20 09:15:05 +0100
commitd664c9b6b22bdd1fc921a54a16ffc68048b51fd1 (patch)
treed2f84b477f8a86e20431d52f6f6657aef78932d8 /Arduino.mk
parente39a026014e1bd77cd82dd9d9e01d7807c59c9b9 (diff)
parent37e757599abb3658d604a84bc6603997ebec5200 (diff)
Merge pull request #645 from kpfleming/use-cxx-for-linking-on-samd
Use C++ compiler when linking for SAMD-based boards
Diffstat (limited to 'Arduino.mk')
-rw-r--r--Arduino.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/Arduino.mk b/Arduino.mk
index 08af529..2d34ef0 100644
--- a/Arduino.mk
+++ b/Arduino.mk
@@ -1685,9 +1685,9 @@ pre-build:
# copied from arduino with start-group, end-group
$(TARGET_ELF): $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS)
-# sam devices need start and end group
+# sam devices need start and end group, and must be linked using C++ compiler
ifeq ($(findstring sam, $(strip $(ARCHITECTURE))), sam)
- $(CC) $(LINKER_SCRIPTS) -Wl,-Map=$(OBJDIR)/$(TARGET).map -o $@ $(LOCAL_OBJS) $(OTHER_OBJS) $(OTHER_LIBS) $(LDFLAGS) $(CORE_LIB) -Wl,--end-group
+ $(CXX) $(LINKER_SCRIPTS) -Wl,-Map=$(OBJDIR)/$(TARGET).map -o $@ $(LOCAL_OBJS) $(OTHER_OBJS) $(OTHER_LIBS) $(LDFLAGS) $(CORE_LIB) -Wl,--end-group
# otherwise traditional
else
$(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(OTHER_OBJS) $(OTHER_LIBS) $(CORE_LIB) -lc -lm $(LINKER_SCRIPTS)