Skip to content

Commit

Permalink
Fix the order in which libraries are linked when building tests. (#580)
Browse files Browse the repository at this point in the history
Previously we had the order of {core libs} {sys libs} {app libs}
This had a problem when an app lib was relying on something from a sys library; for example an
app lib using MDNS that is provided by the syslib avahi-client.

Now the order is {app libs} {core libs} {syslibs}.
  • Loading branch information
balazsracz authored Oct 9, 2021
1 parent 1a1b9f8 commit 5b6fcb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion etc/core_test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $(LIBDIR)/timestamp: $(BUILDDIRS)

$(info test deps $(TESTOBJSEXTRA) $(LIBDIR)/timestamp )
$(TESTBINS): %.test$(EXTENTION) : %.test.o $(TESTOBJSEXTRA) $(LIBDIR)/timestamp lib/timestamp $(TESTLIBDEPS) $(TESTEXTRADEPS) | $(BUILDDIRS)
$(LD) -o $@ $(LDFLAGS) -los $< $(TESTOBJSEXTRA) $(STARTGROUP) $(LINKCORELIBS) $(ENDGROUP) $(SYSLIBRARIES)
$(LD) -o $@ $(LDFLAGS) -los $< $(TESTOBJSEXTRA) $(LIBS) $(STARTGROUP) $(LINKCORELIBS) $(ENDGROUP) $(SYSLIBRARIES)

-include $(TESTOBJS:.test.o=.dtest)
-include $(TESTOBJSEXTRA:.o=.d)
Expand Down
3 changes: 1 addition & 2 deletions etc/prog.mk
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,8 @@ SRCDIR=$(abspath ../../)
#old code from prog.mk
#$(TEST_EXTRA_OBJS) $(OBJEXTRA) $(LDFLAGS) $(LIBS) $(SYSLIBRARIES)
#new code in core_test.mk
#$(LDFLAGS) -los $< $(TESTOBJSEXTRA) $(LINKCORELIBS) $(SYSLIBRARIES)
#$(LDFLAGS) -los $< $(TESTOBJSEXTRA) $(LIBS) $(LINKCORELIBS) $(SYSLIBRARIES)
#TESTOBJSEXTRA += $(TEST_EXTRA_OBJS)
SYSLIBRARIES += $(LIBS)
TESTEXTRADEPS += lib/timestamp
include $(OPENMRNPATH)/etc/core_test.mk

Expand Down

0 comments on commit 5b6fcb9

Please sign in to comment.