diff --git a/cmake b/cmake index d1c44af3a6..6ebf7598f4 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit d1c44af3a6cc89f3f277a7585f8f87f1d98782eb +Subproject commit 6ebf7598f4932cecf0926705f815cb5634be21b9 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 10fb300f33..a823b60cea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -387,6 +387,10 @@ else () target_link_libraries(bro ${bro_SUBDIRS} ${brodeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) endif () +if ( NOT "${bro_LINKER_FLAGS}" STREQUAL "" ) + set_target_properties(bro PROPERTIES LINK_FLAGS "${bro_LINKER_FLAGS}") +endif () + install(TARGETS bro DESTINATION bin) set(BRO_EXE bro diff --git a/src/plugin/Manager.cc b/src/plugin/Manager.cc index 0ee8c1043b..efe7e0aea3 100644 --- a/src/plugin/Manager.cc +++ b/src/plugin/Manager.cc @@ -17,8 +17,8 @@ using namespace plugin; Plugin* Manager::current_plugin = 0; -string Manager::current_dir; -string Manager::current_sopath; +const char* Manager::current_dir = 0; +const char* Manager::current_sopath = 0; Manager::Manager() { @@ -199,7 +199,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_ const char* path = gl.gl_pathv[i]; current_plugin = 0; - current_dir = dir; + current_dir = dir.c_str(); current_sopath = path; void* hdl = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); @@ -226,8 +226,8 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_ reporter->FatalError("inconsistent plugin name: %s vs %s", current_plugin->Name().c_str(), name.c_str()); - current_dir.clear(); - current_sopath.clear(); + current_dir = 0; + current_sopath = 0; current_plugin = 0; DBG_LOG(DBG_PLUGINS, " Loaded %s", path); @@ -294,9 +294,9 @@ void Manager::RegisterPlugin(Plugin *plugin) { Manager::ActivePluginsInternal()->push_back(plugin); - if ( current_dir.size() && current_sopath.size() ) + if ( current_dir && current_sopath ) // A dynamic plugin, record its location. - plugin->SetPluginLocation(current_dir.c_str(), current_sopath.c_str()); + plugin->SetPluginLocation(current_dir, current_sopath); // Sort plugins by name to make sure we have a deterministic order. ActivePluginsInternal()->sort(plugin_cmp); diff --git a/src/plugin/Manager.h b/src/plugin/Manager.h index a4fc746789..bb6b9b5ad8 100644 --- a/src/plugin/Manager.h +++ b/src/plugin/Manager.h @@ -321,8 +321,8 @@ private: // Helpers providing access to current state during dlopen(). static Plugin* current_plugin; - static string current_dir; - static string current_sopath; + static const char* current_dir; + static const char* current_sopath; // Returns a modifiable list of all plugins, both static and dynamic. // This is a static method so that plugins can register themselves