Skip to content

Commit

Permalink
add a fallback that loads the mdapi library with an explicit soversion (
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbaug authored Nov 21, 2024
1 parent 8de5d56 commit c80a191
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cliloader/printmetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ static void* OpenLibrary()
{
void* ret = dlopen(cMDLibFileName, RTLD_LAZY | RTLD_LOCAL);
#if !defined(__APPLE__)
if (ret == NULL)
{
// try adding an explicit soversion
std::string check(cMDLibFileName); check += ".1";
ret = dlopen(check.c_str(), RTLD_LAZY | RTLD_LOCAL);
}
if (ret == NULL)
{
// old alternate name, may eventually be removed
Expand Down
6 changes: 6 additions & 0 deletions intercept/mdapi/MetricsDiscoveryHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ static void* OpenLibrary( const std::string& metricsLibraryName )
ret = dlopen(cMDLibFileName, RTLD_LAZY | RTLD_LOCAL);
}
#if !defined(__APPLE__)
if (ret == NULL)
{
// try adding an explicit soversion
std::string check(cMDLibFileName); check += ".1";
ret = dlopen(check.c_str(), RTLD_LAZY | RTLD_LOCAL);
}
if( ret == NULL )
{
// old alternate name, may eventually be removed
Expand Down

0 comments on commit c80a191

Please sign in to comment.