forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
io_opentracing_cpp.patch
59 lines (56 loc) · 2.07 KB
/
io_opentracing_cpp.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff --git a/mocktracer/BUILD b/mocktracer/BUILD
index 3b22bab..d425e2e 100644
--- a/mocktracer/BUILD
+++ b/mocktracer/BUILD
@@ -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"
diff --git a/src/dynamic_load_unix.cpp b/src/dynamic_load_unix.cpp
index 17e08fd..7e8ac02 100644
--- a/src/dynamic_load_unix.cpp
+++ b/src/dynamic_load_unix.cpp
@@ -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
+ );
if (handle == nullptr) {
error_message = dlerror();
return make_unexpected(dynamic_load_failure_error);
# commit 3a6f049c123a1906c7381e824292c18fd8698293
# Author: Christian Neumüller <[email protected]>
# Date: Wed Feb 27 01:48:17 2019 +0100
#
# Fix MSVC compiler flags. (#104)
#
# * All debug specific flags would be replaced by release specific on MSVC.
# * The OPENTRACING_STATIC flag would be missing from OpenTracingConfig.cmake when linking against OpenTracing::opentracing-static
#
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1721fb3..3873b3a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,7 +52,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE} -D_SCL_SECURE_NO_WARNINGS")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS")
endif()
# ==============================================================================