Skip to content

Conversation

@bneradt
Copy link
Contributor

@bneradt bneradt commented Jan 10, 2023

This addresses the following link error that Debian based builds were experiences with the make check target:

root@4a3eeaf3152e:/var/tmp/trafficserver/mgmt/rpc# make V=1 test_jsonrpcserver
/bin/bash ../../libtool  --tag=CXX   --mode=link ccache c++ -std=c++17 -g -pipe -Wall -Wextra -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-format-truncation -Wno-cast-function-type -Wno-stringop-overflow -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing -Wno-invalid-offsetof -Wno-noexcept-type -Wsuggest-override -mcx16  -rdynamic -Wl,--as-needed  -o test_jsonrpcserver server/unit_tests/test_jsonrpcserver-unit_test_main.o test_jsonrpcserver-IPCSocketClient.o server/unit_tests/test_jsonrpcserver-test_rpcserver.o libjsonrpc_protocol.la libjsonrpc_server.la ../../src/tscpp/util/libtscpputil.la ../../src/records/librecords_p.a ../../src/tscore/libtscore.la ../../iocore/eventsystem/libinkevent.a ../../src/records/librecords_p.a ../../iocore/eventsystem/libinkevent.a ../../src/tscore/libtscore.la ../../mgmt/libmgmt_p.la ../../proxy/shared/libUglyLogStubs.a -lyamlcpp -lhwloc  -lpthread -ldl
libtool: link: ccache c++ -std=c++17 -g -pipe -Wall -Wextra -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-format-truncation -Wno-cast-function-type -Wno-stringop-overflow -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing -Wno-invalid-offsetof -Wno-noexcept-type -Wsuggest-override -mcx16 -rdynamic -Wl,--as-needed -o .libs/test_jsonrpcserver server/unit_tests/test_jsonrpcserver-unit_test_main.o test_jsonrpcserver-IPCSocketClient.o server/unit_tests/test_jsonrpcserver-test_rpcserver.o  ./.libs/libjsonrpc_protocol.a ./.libs/libjsonrpc_server.a ../../src/tscpp/util/.libs/libtscpputil.so ../../src/records/librecords_p.a ../../iocore/eventsystem/libinkevent.a ../../src/tscore/.libs/libtscore.so ../../mgmt/.libs/libmgmt_p.a ../../proxy/shared/libUglyLogStubs.a /var/tmp/trafficserver/lib/yamlcpp/.libs/libyamlcpp.a -lhwloc -lpthread -ldl -Wl,-rpath -Wl,/var/tmp/ts_build/lib
/usr/bin/ld: ../../iocore/eventsystem/libinkevent.a(EventSystem.o): undefined reference to symbol '_ZN2ts13svtoi_convertE'
/usr/bin/ld: ../../src/tscpp/util/.libs/libtscpputil.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:1216: test_jsonrpcserver] Error 1

Note that libinkevent.a has a dependency upon ts::svtoi_convert. This is provided by libtscpputil.la, so it must come later in the library order when provided to the linker.

This addresses the following link error that Debian based builds were
experiences with the `make check` target:

root@4a3eeaf3152e:/var/tmp/trafficserver/mgmt/rpc# make V=1 test_jsonrpcserver
/bin/bash ../../libtool  --tag=CXX   --mode=link ccache c++ -std=c++17 -g -pipe -Wall -Wextra -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-format-truncation -Wno-cast-function-type -Wno-stringop-overflow -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing -Wno-invalid-offsetof -Wno-noexcept-type -Wsuggest-override -mcx16  -rdynamic -Wl,--as-needed  -o test_jsonrpcserver server/unit_tests/test_jsonrpcserver-unit_test_main.o test_jsonrpcserver-IPCSocketClient.o server/unit_tests/test_jsonrpcserver-test_rpcserver.o libjsonrpc_protocol.la libjsonrpc_server.la ../../src/tscpp/util/libtscpputil.la ../../src/records/librecords_p.a ../../src/tscore/libtscore.la ../../iocore/eventsystem/libinkevent.a ../../src/records/librecords_p.a ../../iocore/eventsystem/libinkevent.a ../../src/tscore/libtscore.la ../../mgmt/libmgmt_p.la ../../proxy/shared/libUglyLogStubs.a -lyamlcpp -lhwloc  -lpthread -ldl
libtool: link: ccache c++ -std=c++17 -g -pipe -Wall -Wextra -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-format-truncation -Wno-cast-function-type -Wno-stringop-overflow -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing -Wno-invalid-offsetof -Wno-noexcept-type -Wsuggest-override -mcx16 -rdynamic -Wl,--as-needed -o .libs/test_jsonrpcserver server/unit_tests/test_jsonrpcserver-unit_test_main.o test_jsonrpcserver-IPCSocketClient.o server/unit_tests/test_jsonrpcserver-test_rpcserver.o  ./.libs/libjsonrpc_protocol.a ./.libs/libjsonrpc_server.a ../../src/tscpp/util/.libs/libtscpputil.so ../../src/records/librecords_p.a ../../iocore/eventsystem/libinkevent.a ../../src/tscore/.libs/libtscore.so ../../mgmt/.libs/libmgmt_p.a ../../proxy/shared/libUglyLogStubs.a /var/tmp/trafficserver/lib/yamlcpp/.libs/libyamlcpp.a -lhwloc -lpthread -ldl -Wl,-rpath -Wl,/var/tmp/ts_build/lib
/usr/bin/ld: ../../iocore/eventsystem/libinkevent.a(EventSystem.o): undefined reference to symbol '_ZN2ts13svtoi_convertE'
/usr/bin/ld: ../../src/tscpp/util/.libs/libtscpputil.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:1216: test_jsonrpcserver] Error 1

Note that libinkevent.a has a dependency upon ts::svtoi_convert. This is
provided by libtscpputil.la, so it must come later in the library order
when provided to the linker.
@bneradt bneradt added the Build work related to build configuration or environment label Jan 10, 2023
@bneradt bneradt added this to the 10-Dev milestone Jan 10, 2023
@bneradt bneradt self-assigned this Jan 10, 2023
Copy link
Member

@ezelkow1 ezelkow1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm as long as it builds on everything

@bneradt bneradt merged commit 343f1e5 into apache:10-Dev Jan 10, 2023
@bneradt bneradt deleted the fix_test_jsonrpcserver_debian_link_error branch January 10, 2023 21:01
@zwoop zwoop modified the milestones: 10-Dev, 10.0.0 Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build work related to build configuration or environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants