Skip to content

Commit 2122a68

Browse files
committed
fix: handle situations where linked binary does not link against a libc flavor
1 parent 4334932 commit 2122a68

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

autoinstrumentation/injector/src/injector.c

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
"-javaagent:" \
1313
"/otel-auto-instrumentation-injector/instrumentation/jvm/javaagent.jar"
1414

15+
// Provide a fallback weak symbol, in case the linked binary
16+
// does not actually link against a libc flavor.
17+
__attribute__((weak)) char **__environ = NULL;
18+
1519
extern char **__environ;
1620

1721
size_t __strlen(const char *s) {
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
global:
33
getenv;
4+
__environ;
45
local:
56
*;
67
};

0 commit comments

Comments
 (0)