Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Fix envoy build #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mocktracer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ cc_library(
deps = [
"//:opentracing",
],
alwayslink = 1,
)

cc_binary(
name = "libmocktracer_plugin.so",
linkshared = 1,
linkstatic = 1,
visibility = ["//visibility:public"],
deps = [
"//mocktracer:mocktracer"
Expand Down
8 changes: 7 additions & 1 deletion src/dynamic_load_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ DynamicallyLoadTracingLibrary(const char* shared_library,
std::string& error_message) noexcept try {
dlerror(); // Clear any existing error.

const auto handle = dlopen(shared_library, RTLD_NOW | RTLD_LOCAL);
const auto handle = dlopen(shared_library, RTLD_NOW | RTLD_LOCAL
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
| RTLD_NODELETE
#endif
#endif
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment with a reference to the original issue?

if (handle == nullptr) {
error_message = dlerror();
return make_unexpected(dynamic_load_failure_error);
Expand Down