File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
lib/zstd-1.5.7/build/cmake/lib Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,23 @@ if (ZSTD_BUILD_SHARED)
137137endif ()
138138if (ZSTD_BUILD_STATIC)
139139 add_library (libzstd_static STATIC ${Sources} ${Headers} )
140+ #
141+ # Fluent Bit links libzstd statically while also loading libsystemd at
142+ # runtime. On platforms such as RHEL10, libsystemd itself links against
143+ # the system's shared libzstd. When our binary exports the bundled zstd
144+ # symbols with default visibility the dynamic linker may resolve
145+ # libsystemd's zstd calls to the bundled implementation instead of the
146+ # system one. The ABI between the two releases is not compatible which
147+ # ultimately leads to crashes when libsystemd frees its own ZSTD
148+ # structures via our symbols.
149+ #
150+ # Hide all symbols from the static archive so that the bundled library
151+ # cannot interpose the system copy used by libsystemd (or any other
152+ # consumer). This mirrors how we build the static archive on other
153+ # platforms and keeps the symbols internal to fluent-bit.
154+ set_target_properties (libzstd_static PROPERTIES
155+ C_VISIBILITY_PRESET hidden
156+ VISIBILITY_INLINES_HIDDEN YES )
140157 target_include_directories (libzstd_static INTERFACE $<BUILD_INTERFACE:${PUBLIC_INCLUDE_DIRS} >)
141158 list (APPEND library_targets libzstd_static)
142159 if (ZSTD_MULTITHREAD_SUPPORT)
You can’t perform that action at this time.
0 commit comments