Skip to content

Commit ddf7210

Browse files
committed
Moved CORE_LIB to the last position of the defined linked objects.
The linking order was changed from: $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) $(OTHER_LIBS) to: $(LOCAL_OBJS) $(OTHER_OBJS) $(OTHER_LIBS) $(CORE_LIB) This makes more sense, as OTHER_OBJS would rather depend on CORE_LIB, than the other way around. Apart from libc and libm, CORE_LIB should conceptually _always_ be the last lib in the link list, as it is the core (base of everything). BTW, this was implemented correctly for the 'sam' architecture.
1 parent 22ca636 commit ddf7210

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Arduino.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ ifeq ($(findstring sam, $(strip $(ARCHITECTURE))), sam)
15551555
$(CC) $(LINKER_SCRIPTS) -Wl,-Map=$(OBJDIR)/$(TARGET).map -o $@ $(LOCAL_OBJS) $(OTHER_OBJS) $(OTHER_LIBS) $(LDFLAGS) $(CORE_LIB) -Wl,--end-group
15561556
# otherwise traditional
15571557
else
1558-
$(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) $(OTHER_LIBS) -lc -lm $(LINKER_SCRIPTS)
1558+
$(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(OTHER_OBJS) $(OTHER_LIBS) $(CORE_LIB) -lc -lm $(LINKER_SCRIPTS)
15591559
endif
15601560

15611561
$(CORE_LIB): $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)

0 commit comments

Comments
 (0)