Created
November 25, 2019 00:36
-
-
Save osak/b9de42042bc953f24d45b170af20c579 to your computer and use it in GitHub Desktop.
Build datadog-agent on NetBSD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/pkg/collector/python/aggregator.go b/pkg/collector/python/aggregator.go | |
index 6e2070d62..7ef65df5c 100644 | |
--- a/pkg/collector/python/aggregator.go | |
+++ b/pkg/collector/python/aggregator.go | |
@@ -16,7 +16,7 @@ import ( | |
/* | |
#include <datadog_agent_rtloader.h> | |
-#cgo !windows LDFLAGS: -ldatadog-agent-rtloader -ldl | |
+#cgo !windows LDFLAGS: -ldatadog-agent-rtloader | |
#cgo windows LDFLAGS: -ldatadog-agent-rtloader -lstdc++ -static | |
*/ | |
import "C" | |
diff --git a/pkg/collector/python/containers.go b/pkg/collector/python/containers.go | |
index c6f65ba3a..b344214f6 100644 | |
--- a/pkg/collector/python/containers.go | |
+++ b/pkg/collector/python/containers.go | |
@@ -15,7 +15,7 @@ import ( | |
/* | |
#include <datadog_agent_rtloader.h> | |
-#cgo !windows LDFLAGS: -ldatadog-agent-rtloader -ldl | |
+#cgo !windows LDFLAGS: -ldatadog-agent-rtloader | |
#cgo windows LDFLAGS: -ldatadog-agent-rtloader -lstdc++ -static | |
*/ | |
import "C" | |
diff --git a/pkg/collector/python/datadog_agent.go b/pkg/collector/python/datadog_agent.go | |
index 09f68108a..c743a1c92 100644 | |
--- a/pkg/collector/python/datadog_agent.go | |
+++ b/pkg/collector/python/datadog_agent.go | |
@@ -23,7 +23,7 @@ import ( | |
) | |
/* | |
-#cgo !windows LDFLAGS: -ldatadog-agent-rtloader -ldl | |
+#cgo !windows LDFLAGS: -ldatadog-agent-rtloader | |
#cgo windows LDFLAGS: -ldatadog-agent-rtloader -lstdc++ -static | |
#include "datadog_agent_rtloader.h" | |
diff --git a/pkg/collector/python/init.go b/pkg/collector/python/init.go | |
index 70d96faea..1ec511f92 100644 | |
--- a/pkg/collector/python/init.go | |
+++ b/pkg/collector/python/init.go | |
@@ -27,7 +27,7 @@ import ( | |
) | |
/* | |
-#cgo !windows LDFLAGS: -ldatadog-agent-rtloader -ldl | |
+#cgo !windows LDFLAGS: -ldatadog-agent-rtloader | |
#cgo windows LDFLAGS: -ldatadog-agent-rtloader -lstdc++ -static | |
#include "datadog_agent_rtloader.h" | |
diff --git a/pkg/collector/python/init_nix.go b/pkg/collector/python/init_nix.go | |
index 88c073474..b87bd7b04 100644 | |
--- a/pkg/collector/python/init_nix.go | |
+++ b/pkg/collector/python/init_nix.go | |
@@ -15,7 +15,7 @@ import ( | |
) | |
/* | |
-#cgo !windows LDFLAGS: -ldatadog-agent-rtloader -ldl | |
+#cgo !windows LDFLAGS: -ldatadog-agent-rtloader | |
#include <datadog_agent_rtloader.h> | |
*/ | |
diff --git a/pkg/collector/python/kubeutil.go b/pkg/collector/python/kubeutil.go | |
index 683586427..bd71333ec 100644 | |
--- a/pkg/collector/python/kubeutil.go | |
+++ b/pkg/collector/python/kubeutil.go | |
@@ -19,7 +19,7 @@ import ( | |
/* | |
#include <datadog_agent_rtloader.h> | |
-#cgo !windows LDFLAGS: -ldatadog-agent-rtloader -ldl | |
+#cgo !windows LDFLAGS: -ldatadog-agent-rtloader | |
#cgo windows LDFLAGS: -ldatadog-agent-rtloader -lstdc++ -static | |
*/ | |
import "C" | |
diff --git a/pkg/collector/python/memory.go b/pkg/collector/python/memory.go | |
index d249ddd67..c7a40c23e 100644 | |
--- a/pkg/collector/python/memory.go | |
+++ b/pkg/collector/python/memory.go | |
@@ -21,7 +21,7 @@ import ( | |
) | |
/* | |
-#cgo !windows LDFLAGS: -ldatadog-agent-rtloader -ldl | |
+#cgo !windows LDFLAGS: -ldatadog-agent-rtloader | |
#cgo windows LDFLAGS: -ldatadog-agent-rtloader -lstdc++ -static | |
#include "datadog_agent_rtloader.h" | |
diff --git a/pkg/collector/python/no_kubeutil.go b/pkg/collector/python/no_kubeutil.go | |
index c27a6c281..861755457 100644 | |
--- a/pkg/collector/python/no_kubeutil.go | |
+++ b/pkg/collector/python/no_kubeutil.go | |
@@ -9,7 +9,7 @@ package python | |
/* | |
#include <datadog_agent_rtloader.h> | |
-#cgo !windows LDFLAGS: -ldatadog-agent-rtloader -ldl | |
+#cgo !windows LDFLAGS: -ldatadog-agent-rtloader | |
#cgo windows LDFLAGS: -ldatadog-agent-rtloader -lstdc++ -static | |
*/ | |
import "C" | |
diff --git a/pkg/collector/python/tagger.go b/pkg/collector/python/tagger.go | |
index 5075de7e2..09ee985e0 100644 | |
--- a/pkg/collector/python/tagger.go | |
+++ b/pkg/collector/python/tagger.go | |
@@ -16,7 +16,7 @@ import ( | |
) | |
/* | |
-#cgo !windows LDFLAGS: -ldatadog-agent-rtloader -ldl | |
+#cgo !windows LDFLAGS: -ldatadog-agent-rtloader | |
#cgo windows LDFLAGS: -ldatadog-agent-rtloader -lstdc++ -static | |
#include "datadog_agent_rtloader.h" | |
diff --git a/pkg/collector/python/util.go b/pkg/collector/python/util.go | |
index 0f4405efc..23788b21e 100644 | |
--- a/pkg/collector/python/util.go | |
+++ b/pkg/collector/python/util.go | |
@@ -9,7 +9,7 @@ package python | |
/* | |
#include <datadog_agent_rtloader.h> | |
-#cgo !windows LDFLAGS: -ldatadog-agent-rtloader -ldl | |
+#cgo !windows LDFLAGS: -ldatadog-agent-rtloader | |
#cgo windows LDFLAGS: -ldatadog-agent-rtloader -lstdc++ -static | |
*/ | |
import "C" | |
diff --git a/rtloader/common/rtloader_mem.h b/rtloader/common/rtloader_mem.h | |
index 16f4ecfb7..11fce8050 100644 | |
--- a/rtloader/common/rtloader_mem.h | |
+++ b/rtloader/common/rtloader_mem.h | |
@@ -70,6 +70,9 @@ void _free(void *ptr); | |
# elif __APPLE__ | |
# define __THROW | |
# endif | |
+#ifndef __THROW | |
+#define __THROW | |
+#endif | |
char *strdupe(const char *s1) __THROW; | |
#else | |
diff --git a/rtloader/rtloader/rtloader.cpp b/rtloader/rtloader/rtloader.cpp | |
index fd0d395f4..5634e7cb9 100644 | |
--- a/rtloader/rtloader/rtloader.cpp | |
+++ b/rtloader/rtloader/rtloader.cpp | |
@@ -51,9 +51,11 @@ void signalHandler(int sig, siginfo_t *, void *) | |
void *buffer[STACKTRACE_SIZE]; | |
char **symbols; | |
- size_t nptrs = backtrace(buffer, STACKTRACE_SIZE); | |
+ // size_t nptrs = backtrace(buffer, STACKTRACE_SIZE); | |
+ size_t nptrs = 0; | |
std::cerr << "HANDLER CAUGHT signal Error: signal " << sig << std::endl; | |
- symbols = backtrace_symbols(buffer, nptrs); | |
+ // symbols = backtrace_symbols(buffer, nptrs); | |
+ symbols = NULL; | |
if (symbols == NULL) { | |
std::cerr << "Error getting backtrace symbols" << std::endl; | |
} else { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment