Skip to content

Commit 4e0b02e

Browse files
committed
Try to fix split config
1 parent ee46093 commit 4e0b02e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ext/solib_bootstrap.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ struct dd_slice { const unsigned char *ptr; uintptr_t len; };
5959
// don't handle during our self-relocation.
6060
extern const struct dd_slice DD_TRAMPOLINE_BIN __attribute__((visibility("hidden")));
6161

62+
// Actually, the "split" build configuration requires that, when building
63+
// ddtrace.la (yes, .la is apparently stil a thing), we provide a definition for
64+
// the symbol, otherwise we get a linker error: "undefined reference to
65+
// `DD_TRAMPOLINE_BIN'" / "relocation R_X86_64_PC32 against undefined hidden
66+
// symbol `DD_TRAMPOLINE_BIN' can not be used when making a shared object". So
67+
// provide here a weak hidden definition in the hopes that the final linking
68+
// step will ignore it in favor of the non-weak version in the rust library
69+
// libddtrace_php.a.
70+
const struct dd_slice DD_TRAMPOLINE_BIN __attribute__((visibility("hidden"), weak)) = {0};
71+
6272
// ---- Structs {{{
6373

6474
struct loaded_lib {

libdatadog

0 commit comments

Comments
 (0)