Skip to content

Commit c7c53b7

Browse files
committed
cmake: add -rdynamic flag to fix "undefined symbol" issue starting from ubuntu 26.04
This would happen when loading plugin .so. This was likely the default before, or it is needed now because of more aggresive linking optimizations. Either way, according to the docs, it should be used when dealing with exactly this use-case.
1 parent 85009a8 commit c7c53b7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ option(PACKAGE_BUILDER_DEB "Enable DEB package builder (make deb)" OFF)
6565

6666
## -----------------------------------------------------------------------------
6767
# Hard coded definitions
68-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -std=gnu11")
68+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -std=gnu11 -rdynamic")
6969
set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
7070
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Wall -Wextra -pedantic")
71-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -std=gnu++11")
71+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -std=gnu++11 -rdynamic")
7272
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
7373
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -pedantic")
7474

0 commit comments

Comments
 (0)