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

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


The following commit(s) were added to refs/heads/master by this push:
     new e02a7e51 Optimize relocation processing when loading liblog4cxx.so 
(#341)
e02a7e51 is described below

commit e02a7e51c3ee2176ad329702391ede21f4527e6b
Author: Stephen Webb <[email protected]>
AuthorDate: Fri Feb 2 12:34:42 2024 +1100

    Optimize relocation processing when loading liblog4cxx.so (#341)
---
 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..bc3f7cb3 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(UNIX AND NOT APPLE)
+        # 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