Skip to content

Commit

Permalink
clients/Makefile.am: do not LDADD libnutclient.la to libnutclientstub…
Browse files Browse the repository at this point in the history
….la, we use them both in ultimate test program linking

This reverts commit c5b34c7
"tests/Makefile.am: do not LDADD libnutclient.la where we (also) use libnutclientstub.la":
(on Linux) without the "extra" link we get
	  CXXLD    cppunittest
	/usr/bin/ld: cppunittest-nutclienttest.o: undefined reference to symbol '_ZTIN3nut12NutExceptionE'
	/usr/bin/ld: /home/runner/work/nut/nut/clients/.libs/libnutclient.so.2: error adding symbols: DSO missing from command line
	clang: error: linker command failed with exit code 1 (use -v to see invocation)

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jan 2, 2025
1 parent 8bb23fd commit bfb4154
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clients/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ if HAVE_CXX11
# libnutclientstub version information and build
libnutclientstub_la_SOURCES = nutclientmem.h nutclientmem.cpp
libnutclientstub_la_LDFLAGS = -version-info 1:1:0
libnutclientstub_la_LIBADD = libnutclient.la
#libnutclientstub_la_LIBADD = libnutclient.la
if HAVE_WINDOWS
# Many versions of MingW seem to fail to build non-static DLL without this
libnutclientstub_la_LDFLAGS += -no-undefined
Expand Down
6 changes: 3 additions & 3 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ check-local: $(check_PROGRAMS)
RES=0; for P in $? ; do $(VALGRIND) ./$$P || { RES=$$? ; echo "FAILED: $(VALGRIND) ./$$P" >&2; }; done; exit $$RES
endif WITH_VALGRIND

# NOTE: libnutclientstub includes libnutclient and adds nutclientmem
cppunittest_CXXFLAGS = $(AM_CXXFLAGS) $(CPPUNIT_CFLAGS) $(CPPUNIT_CXXFLAGS) $(CPPUNIT_NUT_CXXFLAGS) $(CXXFLAGS)
###cppunittest_CXXFLAGS += -I$(top_srcdir)/include -DTOP_SRCDIR="\"$(top_srcdir)\""
cppunittest_LDFLAGS = $(CPPUNIT_LDFLAGS) $(CPPUNIT_LIBS)
cppunittest_LDADD = $(top_builddir)/clients/libnutclientstub.la
cppunittest_LDADD = $(top_builddir)/clients/libnutclient.la
cppunittest_LDADD += $(top_builddir)/clients/libnutclientstub.la
cppunittest_SOURCES = $(CPPUNITTESTSRC) $(CPPUNITTESTERSRC)

# Currently nutconf and related codebase causes woes for static analysis
Expand All @@ -166,7 +166,7 @@ endif WITH_NUTCONF

cppnit_CXXFLAGS = $(AM_CXXFLAGS) $(CPPUNIT_CFLAGS) $(CPPUNIT_CXXFLAGS) $(CPPUNIT_NUT_CXXFLAGS) $(CXXFLAGS)
cppnit_LDFLAGS = $(CPPUNIT_LDFLAGS) $(CPPUNIT_LIBS)
cppnit_LDADD = $(top_builddir)/clients/libnutclientstub.la
cppnit_LDADD = $(top_builddir)/clients/libnutclient.la $(top_builddir)/clients/libnutclientstub.la
cppnit_SOURCES = $(CPPCLIENTTESTSRC) $(CPPUNITTESTERSRC)

# Make sure out-of-dir C++ dependencies exist (especially when dev-building
Expand Down

0 comments on commit bfb4154

Please sign in to comment.