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

swebb2066 pushed a commit to branch reduce_dynamic_linking_overhead
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git

commit 2ad0693aff8834bb3e4efb5a0b41820878b3006e
Author: Stephen Webb <[email protected]>
AuthorDate: Thu Feb 1 14:05:45 2024 +1100

    Optimize relocation processing when loading liblog4cxx.so
---
 src/main/cpp/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/cpp/CMakeLists.txt b/src/main/cpp/CMakeLists.txt
index 616de883..e19a619e 100644
--- a/src/main/cpp/CMakeLists.txt
+++ b/src/main/cpp/CMakeLists.txt
@@ -22,6 +22,10 @@ option(LOG4CXX_ABI_CHECK "Check for ABI changes" OFF)
 add_library(log4cxx)
 if(BUILD_SHARED_LIBS)
     target_compile_definitions(log4cxx PRIVATE LOG4CXX)
+    if(NOT WIN32)
+        # Make defined symbols non-preemptible, which can optimize relocation 
processing
+        target_link_options(log4cxx PRIVATE "LINKER:-Bsymbolic")
+    endif()
 else()
     target_compile_definitions(log4cxx PUBLIC LOG4CXX_STATIC)
 endif()

Reply via email to