Skip to content

Fix linker warning for C++ tests #2744

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

Open
wants to merge 9 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...

@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
…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]>
@AppVeyorBot
Copy link

@jimklimov jimklimov marked this pull request as ready for review April 25, 2025 08:23
@jimklimov
Copy link
Member Author

Resyncing with main NUT code base after v2.8.3 release.

@AppVeyorBot
Copy link

…in test programs, have it include libnutclient.la [networkupstools#2744]

Signed-off-by: Jim Klimov <[email protected]>
…en/before libnutclientstub.la is [networkupstools#2744]"

This reverts commit f7b76b5123199f2bd5c90216325c5e3a09f335c4:
added dependency seems to be treated as an empty recipe which
blocks the actual build.
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.

2 participants