From 9cce68023ac45621af360af41b9c3b170b1b630f Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Wed, 9 Dec 2020 10:17:11 +0100 Subject: [PATCH] Export all symbols from the main executable for the antibot Add `-rdynamic` if supported by the linker. Not all symbols being exported broke our builds recently, the antibot library used `mem_comp` from the main binary but it wasn't exported, leading to the following runtime error: ``` ./DDRace64-Server_sql: symbol lookup error: /home/teeworlds/servers/libantibot.so: undefined symbol: mem_comp ``` --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9780283e3..a1dd0e20f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2552,6 +2552,8 @@ endmacro() source_group_tree(src) if(ANTIBOT) + # Allow the antibot library to use functions from the server binary. + add_c_compiler_flag_if_supported(OUR_FLAGS_LINK -rdynamic) set_own_rpath(${TARGET_SERVER}) endif()