Skip to content

Commit bdea8c5

Browse files
Merge pull request ceph#61067 from MaxKellermann/librados_static
librados: disable symbol versions when building statically
2 parents 9c12e2d + 81ef8d5 commit bdea8c5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/librados/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ if(ENABLE_SHARED)
2929
set_property(TARGET librados APPEND_STRING PROPERTY
3030
LINK_FLAGS " -static-libstdc++ -static-libgcc")
3131
endif()
32+
target_compile_definitions(librados PRIVATE -DLIBRADOS_SHARED=1)
3233
endif()
3334
target_link_libraries(librados PRIVATE
3435
librados_impl osdc ceph-common cls_lock_client

src/librados/librados_c.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#define tracepoint(...)
4545
#endif
4646

47-
#if defined(HAVE_ASM_SYMVER) || defined(HAVE_ATTR_SYMVER)
47+
#if defined(LIBRADOS_SHARED) && (defined(HAVE_ASM_SYMVER) || defined(HAVE_ATTR_SYMVER))
4848
// prefer __attribute__() over global asm(".symver"). because the latter
4949
// is not parsed by the compiler and is partitioned away by GCC if
5050
// lto-partitions is enabled, in other words, these asm() statements

0 commit comments

Comments
 (0)