From 4d2447d764447d55498b19132c45a2e0160b0aac Mon Sep 17 00:00:00 2001 From: Player Dagostino Date: Thu, 11 Aug 2011 02:12:28 +0200 Subject: [PATCH] Enable the DSO workaround on linux only AND in standalone. --- indra/llimage/llimagej2c.cpp | 4 ++-- indra/llplugin/CMakeLists.txt | 4 ++-- indra/llplugin/llplugininstance.cpp | 6 +++--- indra/newview/llappviewerlinux_api_dbus.cpp | 8 ++++++++ indra/plugins/webkit/linux_volume_catcher.cpp | 8 ++++++++ 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index ab36850ab..597346446 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -28,7 +28,7 @@ * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ -#if LL_LINUX +#if LL_LINUX && defined(LL_STANDALONE) #include #include #endif @@ -90,7 +90,7 @@ void LLImageJ2C::openDSO() j2cimpl_dso_memory_pool.create(); //attempt to load the shared library -#if LL_LINUX +#if LL_LINUX && defined(LL_STANDALONE) void *dso_handle = dlopen(dso_path.c_str(), RTLD_NOW | RTLD_GLOBAL); rv = (!dso_handle)?APR_EDSOOPEN:apr_os_dso_handle_put(&j2cimpl_dso_handle, dso_handle, j2cimpl_dso_memory_pool()); diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 58f565935..231b10bfa 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -65,9 +65,9 @@ endif (NOT WORD_SIZE EQUAL 32) list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) -if(LINUX) +if(LINUX AND STANDALONE) target_link_libraries (llplugin rt dl) -endif(LINUX) +endif(LINUX AND STANDALONE) add_dependencies(llplugin prepare) diff --git a/indra/llplugin/llplugininstance.cpp b/indra/llplugin/llplugininstance.cpp index 7f53d8074..86b855f4c 100644 --- a/indra/llplugin/llplugininstance.cpp +++ b/indra/llplugin/llplugininstance.cpp @@ -32,7 +32,7 @@ * * @endcond */ -#if LL_LINUX +#if LL_LINUX && defined(LL_STANDALONE) #include #include #endif @@ -87,7 +87,7 @@ int LLPluginInstance::load(std::string &plugin_file) { pluginInitFunction init_function = NULL; -#if LL_LINUX +#if LL_LINUX && defined(LL_STANDALONE) void *dso_handle = dlopen(plugin_file.c_str(), RTLD_NOW | RTLD_GLOBAL); int result = (!dso_handle)?APR_EDSOOPEN:apr_os_dso_handle_put(&mDSOHandle, dso_handle, AIAPRRootPool::get()()); @@ -101,7 +101,7 @@ int LLPluginInstance::load(std::string &plugin_file) char buf[1024]; apr_dso_error(mDSOHandle, buf, sizeof(buf)); -#if LL_LINUX +#if LL_LINUX && defined(LL_STANDALONE) LL_WARNS("Plugin") << "plugin load " << plugin_file << " failed with error " << result << " , additional info string: " << buf << LL_ENDL; #else LL_WARNS("Plugin") << "apr_dso_load of " << plugin_file << " failed with error " << result << " , additional info string: " << buf << LL_ENDL; diff --git a/indra/newview/llappviewerlinux_api_dbus.cpp b/indra/newview/llappviewerlinux_api_dbus.cpp index 217372962..b475eeedb 100644 --- a/indra/newview/llappviewerlinux_api_dbus.cpp +++ b/indra/newview/llappviewerlinux_api_dbus.cpp @@ -32,8 +32,10 @@ #if LL_DBUS_ENABLED +#ifdef LL_STANDALONE #include #include +#endif #include "linden_common.h" @@ -74,11 +76,17 @@ bool grab_dbus_syms(std::string dbus_dso_name) //attempt to load the shared library apr_pool_create(&sSymDBUSDSOMemoryPool, NULL); +#ifdef LL_STANDALONE void *dso_handle = dlopen(dbus_dso_name.c_str(), RTLD_NOW | RTLD_GLOBAL); rv = (!dso_handle)?APR_EDSOOPEN:apr_os_dso_handle_put(&sSymDBUSDSOHandle, dso_handle, sSymDBUSDSOMemoryPool); if ( APR_SUCCESS == rv ) +#else + if ( APR_SUCCESS == (rv = apr_dso_load(&sSymDBUSDSOHandle, + dbus_dso_name.c_str(), + sSymDBUSDSOMemoryPool) )) +#endif { INFOMSG("Found DSO: %s", dbus_dso_name.c_str()); diff --git a/indra/plugins/webkit/linux_volume_catcher.cpp b/indra/plugins/webkit/linux_volume_catcher.cpp index 98b6a0ec9..56cc642be 100644 --- a/indra/plugins/webkit/linux_volume_catcher.cpp +++ b/indra/plugins/webkit/linux_volume_catcher.cpp @@ -52,8 +52,10 @@ extern "C" { #include "aiaprpool.h" #include "apr_dso.h" +#ifdef LL_STANDALONE #include #include +#endif } //////////////////////////////////////////////////// @@ -89,10 +91,16 @@ bool grab_pa_syms(std::string pulse_dso_name) //attempt to load the shared library sSymPADSOMemoryPool.create(); +#ifdef LL_STANDALONE void *dso_handle = dlopen(pulse_dso_name.c_str(), RTLD_NOW | RTLD_GLOBAL); rv = (!dso_handle)?APR_EDSOOPEN:apr_os_dso_handle_put(&sSymPADSOHandle, dso_handle, sSymPADSOMemoryPool()); if ( APR_SUCCESS == rv ) +#else + if ( APR_SUCCESS == (rv = apr_dso_load(&sSymPADSOHandle, + pulse_dso_name.c_str(), + sSymPADSOMemoryPool()) )) +#endif { INFOMSG("Found DSO: %s", pulse_dso_name.c_str());