This is an automated email from the ASF dual-hosted git repository.

cmcfarlen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a86eea6b2 Move DbgCtl.cc from tscore to tsapicore (#10585)
4a86eea6b2 is described below

commit 4a86eea6b23e682a27dc626dc7ff4bafc7c24dc2
Author: Chris McFarlen <ch...@mcfarlen.us>
AuthorDate: Fri Oct 13 16:53:22 2023 -0500

    Move DbgCtl.cc from tscore to tsapicore (#10585)
    
    * Move DbgCtl.cc from tscore to tsapicore
    
    * actually move DbgCtl.cc
    
    * appease gnu ld
    
    * set PIC on tsapicore
    
    * update autotools
    
    * fix library order
    
    ---------
    
    Co-authored-by: Chris McFarlen <cmcfar...@apple.com>
---
 iocore/hostdb/Makefile.am     |  2 +-
 iocore/net/Makefile.am        |  2 ++
 mgmt/rpc/CMakeLists.txt       |  3 +++
 mgmt/rpc/Makefile.am          |  2 ++
 proxy/hdrs/CMakeLists.txt     |  3 ++-
 proxy/hdrs/Makefile.am        |  3 +++
 proxy/http2/Makefile.am       |  2 ++
 proxy/logging/Makefile.am     |  2 ++
 src/api/CMakeLists.txt        |  2 ++
 src/{tscore => api}/DbgCtl.cc |  0
 src/api/Makefile.am           |  1 +
 src/tscore/CMakeLists.txt     |  2 +-
 src/tscore/Makefile.am        | 11 +++++------
 13 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/iocore/hostdb/Makefile.am b/iocore/hostdb/Makefile.am
index 24cd5d2cd4..d2847bca92 100644
--- a/iocore/hostdb/Makefile.am
+++ b/iocore/hostdb/Makefile.am
@@ -66,8 +66,8 @@ test_CPP_FLAGS = \
 test_LD_ADD = \
        $(top_builddir)/iocore/eventsystem/libinkevent.a \
        $(top_builddir)/src/records/librecords_p.a \
-       $(top_builddir)/src/tscore/libtscore.a \
        $(top_builddir)/src/api/libtsapicore.a \
+       $(top_builddir)/src/tscore/libtscore.a \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        @SWOC_LIBS@ @HWLOC_LIBS@ @YAMLCPP_LIBS@ @OPENSSL_LIBS@ @LIBPCRE@ 
@LIBCAP@
 
diff --git a/iocore/net/Makefile.am b/iocore/net/Makefile.am
index cfa445cb63..504732eed5 100644
--- a/iocore/net/Makefile.am
+++ b/iocore/net/Makefile.am
@@ -53,6 +53,7 @@ test_certlookup_SOURCES = \
 test_certlookup_LDADD = \
        $(top_builddir)/iocore/eventsystem/libinkevent.a \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        $(top_builddir)/proxy/ParentSelectionStrategy.o \
        @YAMLCPP_LIBS@ \
@@ -86,6 +87,7 @@ test_UDPNet_LDADD = \
        $(top_builddir)/src/records/librecords_p.a \
        $(top_builddir)/proxy/hdrs/libhdrs.a \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/proxy/ParentSelectionStrategy.o \
diff --git a/mgmt/rpc/CMakeLists.txt b/mgmt/rpc/CMakeLists.txt
index 45c2d2fc5d..3d4266b277 100644
--- a/mgmt/rpc/CMakeLists.txt
+++ b/mgmt/rpc/CMakeLists.txt
@@ -39,6 +39,8 @@ set_target_properties(jsonrpc_protocol PROPERTIES 
POSITION_INDEPENDENT_CODE TRUE
 target_link_libraries(jsonrpc_protocol
     PUBLIC
         ts::tscore
+    PRIVATE
+        ts::tsapicore
 )
 
 add_library(jsonrpc_server STATIC
@@ -78,6 +80,7 @@ if(BUILD_TESTING)
     jsonrpc/unit_tests/test_basic_protocol.cc
   )
   target_link_libraries(test_jsonrpc
+    ts::tsapicore
     catch2::catch2
     ts::jsonrpc_protocol
     libswoc
diff --git a/mgmt/rpc/Makefile.am b/mgmt/rpc/Makefile.am
index f6cd65082c..d2014a6032 100644
--- a/mgmt/rpc/Makefile.am
+++ b/mgmt/rpc/Makefile.am
@@ -65,6 +65,7 @@ test_jsonrpc_LDADD = \
        libjsonrpc_protocol.la \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/iocore/eventsystem/libinkevent.a \
        $(top_builddir)/src/records/librecords_p.a \
        $(top_builddir)/src/tscore/libtscore.a \
@@ -105,6 +106,7 @@ test_jsonrpcserver_LDADD = \
        libjsonrpc_protocol.la \
        libjsonrpc_server.la \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/iocore/eventsystem/libinkevent.a \
        $(top_builddir)/src/records/librecords_p.a \
        $(top_builddir)/src/api/libtsapicore.a \
diff --git a/proxy/hdrs/CMakeLists.txt b/proxy/hdrs/CMakeLists.txt
index d5b092cc6f..4ace93dfac 100644
--- a/proxy/hdrs/CMakeLists.txt
+++ b/proxy/hdrs/CMakeLists.txt
@@ -45,6 +45,7 @@ target_link_libraries(hdrs
         ts::tscore
     PRIVATE
         ts::inkevent
+        ts::tsapicore
 )
 
 if(BUILD_TESTING)
@@ -68,6 +69,6 @@ if(BUILD_TESTING)
     unit_tests/test_XPACK.cc
   )
   target_include_directories(test_proxy_hdrs_xpack PRIVATE 
${CMAKE_CURRENT_SOURCE_DIR})
-  target_link_libraries(test_proxy_hdrs_xpack PRIVATE ts::tscore libswoc 
catch2::catch2)
+  target_link_libraries(test_proxy_hdrs_xpack PRIVATE ts::tscore ts::tsapicore 
libswoc catch2::catch2)
   add_test(NAME test_proxy_hdrs_xpack COMMAND test_proxy_hdrs_xpack)
 endif()
diff --git a/proxy/hdrs/Makefile.am b/proxy/hdrs/Makefile.am
index a1343e9826..670317c1b2 100644
--- a/proxy/hdrs/Makefile.am
+++ b/proxy/hdrs/Makefile.am
@@ -91,6 +91,7 @@ test_proxy_hdrs_LDADD = \
        $(top_builddir)/iocore/eventsystem/libinkevent.a \
        $(top_builddir)/src/records/librecords_p.a \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        $(top_builddir)/src/api/libtsapicore.a \
        @SWOC_LIBS@ @YAMLCPP_LIBS@ @HWLOC_LIBS@ @LIBPCRE@ @OPENSSL_LIBS@ 
@LIBCAP@
@@ -107,6 +108,7 @@ test_hdr_heap_LDADD = \
        $(top_builddir)/iocore/eventsystem/libinkevent.a \
        $(top_builddir)/src/records/librecords_p.a \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        $(top_builddir)/src/api/libtsapicore.a \
        @SWOC_LIBS@ @HWLOC_LIBS@ \
@@ -118,6 +120,7 @@ test_XPACK_CPPFLAGS = \
 
 test_XPACK_LDADD = \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        @SWOC_LIBS@ @LIBPCRE@ @LIBCAP@
 
diff --git a/proxy/http2/Makefile.am b/proxy/http2/Makefile.am
index 9db5940e6d..e32a17b965 100644
--- a/proxy/http2/Makefile.am
+++ b/proxy/http2/Makefile.am
@@ -97,6 +97,7 @@ test_libhttp2_SOURCES = \
 
 test_Http2DependencyTree_LDADD = \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        @SWOC_LIBS@
 
@@ -110,6 +111,7 @@ test_Http2DependencyTree_SOURCES = \
 test_Http2FrequencyCounter_LDADD = \
        $(top_builddir)/iocore/eventsystem/libinkevent.a \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        @SWOC_LIBS@ \
        @LIBPCRE@ \
diff --git a/proxy/logging/Makefile.am b/proxy/logging/Makefile.am
index 1b16731729..c42add2d47 100644
--- a/proxy/logging/Makefile.am
+++ b/proxy/logging/Makefile.am
@@ -82,6 +82,7 @@ test_LogUtils_SOURCES = \
 test_LogUtils_LDADD = \
        $(top_builddir)/iocore/eventsystem/libinkevent.a \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        @SWOC_LIBS@ @HWLOC_LIBS@ @YAMLCPP_LIBS@ @LIBPCRE@ @LIBCAP@
 
@@ -98,6 +99,7 @@ test_RolledLogDeleter_SOURCES = \
 test_RolledLogDeleter_LDADD = \
        $(top_builddir)/iocore/eventsystem/libinkevent.a \
        $(top_builddir)/src/tscore/libtscore.a \
+       $(top_builddir)/src/api/libtsapicore.a \
        $(top_builddir)/src/tscpp/util/libtscpputil.la \
        @SWOC_LIBS@ @HWLOC_LIBS@ @YAMLCPP_LIBS@ @LIBPCRE@ @LIBCAP@
 
diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt
index 0b081ed929..0fd1cd32d6 100644
--- a/src/api/CMakeLists.txt
+++ b/src/api/CMakeLists.txt
@@ -31,9 +31,11 @@ add_library(tsapicore STATIC
   InkVConnInternal.cc
   FetchSM.cc
   LifecycleAPIHooks.cc
+  DbgCtl.cc
 )
 add_library(ts::tsapicore ALIAS tsapicore)
 target_link_libraries(tsapicore PRIVATE ts::tscore)
+set_target_properties(tsapicore PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
 
 include_directories(
   ${IOCORE_INCLUDE_DIRS}
diff --git a/src/tscore/DbgCtl.cc b/src/api/DbgCtl.cc
similarity index 100%
rename from src/tscore/DbgCtl.cc
rename to src/api/DbgCtl.cc
diff --git a/src/api/Makefile.am b/src/api/Makefile.am
index 778919466b..6e150687ef 100644
--- a/src/api/Makefile.am
+++ b/src/api/Makefile.am
@@ -70,6 +70,7 @@ libtsapicore_a_SOURCES = \
        ConfigUpdateCbTable.cc \
        InkContInternal.cc \
        InkVConnInternal.cc \
+       DbgCtl.cc \
        FetchSM.cc \
        LifecycleAPIHooks.cc
 
diff --git a/src/tscore/CMakeLists.txt b/src/tscore/CMakeLists.txt
index 63dba24821..6be2921cb1 100644
--- a/src/tscore/CMakeLists.txt
+++ b/src/tscore/CMakeLists.txt
@@ -38,7 +38,6 @@ add_library(tscore
         ConsistentHash.cc
         ContFlags.cc
         CryptoHash.cc
-        DbgCtl.cc
         Diags.cc
         Encoding.cc
         Errata.cc
@@ -173,6 +172,7 @@ if(BUILD_TESTING)
             PRIVATE
                 libswoc
                 ts::tscore
+                ts::tsapicore
                 yaml-cpp::yaml-cpp
                 resolv
                 ts::tscpputil
diff --git a/src/tscore/Makefile.am b/src/tscore/Makefile.am
index d7493c0c8f..e5e2269b39 100644
--- a/src/tscore/Makefile.am
+++ b/src/tscore/Makefile.am
@@ -49,7 +49,6 @@ libtscore_a_SOURCES = \
        ConsistentHash.cc \
        ContFlags.cc \
        CryptoHash.cc \
-       DbgCtl.cc \
        Diags.cc \
        Encoding.cc \
        Errata.cc \
@@ -131,16 +130,16 @@ ParseRulesCType: CompileParseRules
        LSAN_OPTIONS='detect_leaks=0' ./CompileParseRules
 
 test_atomic_SOURCES = test_atomic.cc
-test_atomic_LDADD = libtscore.a $(top_builddir)/src/tscpp/util/libtscpputil.la 
@SWOC_LIBS@ @LIBPCRE@ @LIBCAP@
+test_atomic_LDADD = libtscore.a $(top_builddir)/src/api/libtsapicore.a 
$(top_builddir)/src/tscpp/util/libtscpputil.la @SWOC_LIBS@ @LIBPCRE@ @LIBCAP@
 
 test_freelist_SOURCES = test_freelist.cc
-test_freelist_LDADD = libtscore.a 
$(top_builddir)/src/tscpp/util/libtscpputil.la @SWOC_LIBS@ @LIBPCRE@ @LIBCAP@
+test_freelist_LDADD = libtscore.a  $(top_builddir)/src/api/libtsapicore.a 
$(top_builddir)/src/tscpp/util/libtscpputil.la @SWOC_LIBS@ @LIBPCRE@ @LIBCAP@
 
 test_geometry_SOURCES = test_geometry.cc
-test_geometry_LDADD = libtscore.a 
$(top_builddir)/src/tscpp/util/libtscpputil.la @SWOC_LIBS@ @LIBPCRE@ -lstdc++
+test_geometry_LDADD = libtscore.a  $(top_builddir)/src/api/libtsapicore.a 
$(top_builddir)/src/tscpp/util/libtscpputil.la @SWOC_LIBS@ @LIBPCRE@ -lstdc++
 
 test_X509HostnameValidator_CPPFLAGS = $(AM_CPPFLAGS) 
-I$(abs_top_srcdir)/lib/catch2
-test_X509HostnameValidator_LDADD = libtscore.a 
$(top_builddir)/src/tscpp/util/libtscpputil.la \
+test_X509HostnameValidator_LDADD = libtscore.a  
$(top_builddir)/src/api/libtsapicore.a 
$(top_builddir)/src/tscpp/util/libtscpputil.la \
        @SWOC_LIBS@ @LIBPCRE@ @OPENSSL_LIBS@ @LIBCAP@
 test_X509HostnameValidator_SOURCES = unit_tests/test_X509HostnameValidator.cc
 
@@ -148,7 +147,7 @@ test_tscore_CPPFLAGS = $(AM_CPPFLAGS)\
        -I$(abs_top_srcdir)/lib/catch2
 
 test_tscore_CXXFLAGS = -Wno-array-bounds $(AM_CXXFLAGS)
-test_tscore_LDADD = libtscore.a $(top_builddir)/src/tscpp/util/libtscpputil.la 
\
+test_tscore_LDADD = libtscore.a  $(top_builddir)/src/api/libtsapicore.a 
$(top_builddir)/src/tscpp/util/libtscpputil.la \
        @SWOC_LIBS@ @OPENSSL_LIBS@ @LIBPCRE@ @LIBCAP@
 test_tscore_SOURCES = \
        unit_tests/unit_test_main.cc \

Reply via email to