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.
This commit is contained in:
Pieter du Preez 2018-09-29 23:58:07 +02:00
parent 22ca63614d
commit ddf7210407

View file

@ -1555,7 +1555,7 @@ 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
# otherwise traditional
else
$(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) $(OTHER_LIBS) -lc -lm $(LINKER_SCRIPTS)
$(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(OTHER_OBJS) $(OTHER_LIBS) $(CORE_LIB) -lc -lm $(LINKER_SCRIPTS)
endif
$(CORE_LIB): $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)