Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linker warning for C++ tests #2744

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jimklimov
Copy link
Member

Avoid linker warning with some C++ test programs, e.g.:

              CXXLD    cppnit
            ld: warning: file /export/home/abuild/nut/obj/nut-2.8.2.1775.28/_build/sub/clients/.libs/libnutclient.so:
              linked to ../clients/.libs/libnutclient.so: attempted multiple inclusion of file

NOTE: Two fixes are attempted here, but they misfire differently on different platforms/toolkits.
Maybe the current status-quo is the least-worst situation...

…ibnutclientstub.la

Avoid linker warning:
	  CXXLD    cppnit
	ld: warning: file /export/home/abuild/nut/obj/nut-2.8.2.1775.28/_build/sub/clients/.libs/libnutclient.so:
	  linked to ../clients/.libs/libnutclient.so: attempted multiple inclusion of file

Signed-off-by: Jim Klimov <[email protected]>
….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]>
@jimklimov jimklimov added C++ CI Entries related to continuous integration infrastructure (historically also recipes like Makefiles) impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) labels Jan 2, 2025
@jimklimov jimklimov added this to the NUT 2.9 milestone Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ CI Entries related to continuous integration infrastructure (historically also recipes like Makefiles) impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant