diff --git a/Server/core/CDynamicLibrary.cpp b/Server/core/CDynamicLibrary.cpp index bc17633fa92..82df629de4f 100644 --- a/Server/core/CDynamicLibrary.cpp +++ b/Server/core/CDynamicLibrary.cpp @@ -86,7 +86,7 @@ bool CDynamicLibrary::Load ( const char* szFilename ) LocalFree ( lpMsgBuf ); } #else - m_hModule = dlopen ( szFilename, RTLD_NOW | RTLD_DEEPBIND ); + m_hModule = dlopen ( szFilename, RTLD_NOW ); // Output error if needed if ( !m_hModule ) diff --git a/Server/core/premake5.lua b/Server/core/premake5.lua index e71e304c6cc..50285c58bda 100644 --- a/Server/core/premake5.lua +++ b/Server/core/premake5.lua @@ -47,6 +47,6 @@ project "Core" links { "ncursesw", "breakpad", "rt" } buildoptions { "-pthread" } linkoptions { "-pthread" } - + filter "platforms:x64" targetdir(buildpath("server/x64")) diff --git a/Server/launcher/CDynamicLibrary.cpp b/Server/launcher/CDynamicLibrary.cpp index 1b7a2fec34c..43f5b901b68 100644 --- a/Server/launcher/CDynamicLibrary.cpp +++ b/Server/launcher/CDynamicLibrary.cpp @@ -39,7 +39,7 @@ bool CDynamicLibrary::Load ( const char* szFilename ) #ifdef WIN32 m_hModule = LoadLibrary ( szFilename ); #else - m_hModule = dlopen ( szFilename, RTLD_NOW | RTLD_DEEPBIND ); + m_hModule = dlopen ( szFilename, RTLD_NOW ); // Output error if needed if ( !m_hModule ) diff --git a/Server/launcher/premake5.lua b/Server/launcher/premake5.lua index b896690e283..b8f8bf70ab3 100644 --- a/Server/launcher/premake5.lua +++ b/Server/launcher/premake5.lua @@ -28,8 +28,8 @@ project "Launcher" filter "system:linux" links { "dl" } - buildoptions { "-pthread" } - linkoptions { "-pthread" } + buildoptions { "-pthread", "-fvisibility=default" } + linkoptions { "-pthread", "-rdynamic" } filter {"system:linux", "platforms:x86"} targetname "mta-server" diff --git a/Server/mods/deathmatch/logic/CDynamicLibrary.cpp b/Server/mods/deathmatch/logic/CDynamicLibrary.cpp index 911f7149c94..7576f079549 100644 --- a/Server/mods/deathmatch/logic/CDynamicLibrary.cpp +++ b/Server/mods/deathmatch/logic/CDynamicLibrary.cpp @@ -46,7 +46,7 @@ bool CDynamicLibrary::Load ( const char* szFilename ) } #else - m_hModule = dlopen ( szFilename, RTLD_NOW | RTLD_DEEPBIND ); + m_hModule = dlopen ( szFilename, RTLD_NOW ); // Output error if needed if ( !m_hModule ) diff --git a/Server/mods/deathmatch/logic/lua/CLuaModule.cpp b/Server/mods/deathmatch/logic/lua/CLuaModule.cpp index ab7a2ee6f35..da6d128761a 100644 --- a/Server/mods/deathmatch/logic/lua/CLuaModule.cpp +++ b/Server/mods/deathmatch/logic/lua/CLuaModule.cpp @@ -79,7 +79,7 @@ int CLuaModule::_LoadModule ( void ) strError = SString( "%d", GetLastError() ); SetCurrentDirectory( strSavedCurrentDirectory ); #else - m_hModule = dlopen ( m_szFileName, RTLD_NOW | RTLD_DEEPBIND ); + m_hModule = dlopen ( m_szFileName, RTLD_NOW ); if ( m_hModule == NULL ) strError = dlerror(); #endif diff --git a/Shared/publicsdk/Common.h b/Shared/publicsdk/Common.h index d7b964bcb99..e1114897b3c 100644 --- a/Shared/publicsdk/Common.h +++ b/Shared/publicsdk/Common.h @@ -26,7 +26,7 @@ extern "C" #ifdef WIN32 #define MTAEXPORT extern "C" __declspec(dllexport) #else - #define MTAEXPORT extern "C" + #define MTAEXPORT extern "C" __attribute__ ((visibility ("default"))) #endif #include diff --git a/Shared/sdk/Common.h b/Shared/sdk/Common.h index dd2cbc99cf6..a21b839c610 100644 --- a/Shared/sdk/Common.h +++ b/Shared/sdk/Common.h @@ -79,7 +79,7 @@ struct ElementID #ifdef WIN32 #define _DECLSPEC_EX extern "C" _declspec(dllexport) #else -#define _DECLSPEC_EX extern "C" +#define _DECLSPEC_EX extern "C" __attribute__ ((visibility ("default"))) #endif // Maximum number of players that can be packed in a single lightweight puresync packet diff --git a/premake5.lua b/premake5.lua index 942c9a86181..85fed4c94a2 100644 --- a/premake5.lua +++ b/premake5.lua @@ -100,6 +100,7 @@ workspace "MTASA" filter "system:linux" vectorextensions "SSE2" + buildoptions { "-fvisibility=hidden" } -- Only build the client on Windows if os.target() == "windows" then diff --git a/utils/docker-entrypoint.sh b/utils/docker-entrypoint.sh index 7e3f2b4f815..d67c41917b4 100644 --- a/utils/docker-entrypoint.sh +++ b/utils/docker-entrypoint.sh @@ -9,7 +9,7 @@ fi # 32-bits if [ ! -d /compat/x86 ] && [[ $BUILD_BITS = "32" ]]; then - apt-get install -y libmysqlclient-dev:i386 + apt-get update && apt-get install -y libmysqlclient-dev:i386 mkdir -p /compat/x86 objcopy --redefine-syms=/compat/glibc_version_x86.redef /usr/lib/gcc/x86_64-linux-gnu/5/32/libstdc++.a /compat/x86/libstdc++.a objcopy --redefine-syms=/compat/glibc_version_x86.redef /usr/lib/i386-linux-gnu/libmysqlclient.a /compat/x86/libmysqlclient.a