--- a/src/track/heaptrack_inject.cpp
+++ b/src/track/heaptrack_inject.cpp
@@ -26,6 +26,15 @@
  * @brief Experimental support for symbol overloading after runtime injection.
  */
 
+#ifndef __WORDSIZE
+#include <limits.h>
+#if ULONG_MAX == 0xffffffffffffffff
+#define __WORDSIZE 64
+#elif ULONG_MAX == 0xffffffff
+#define __WORDSIZE 32
+#endif
+#endif
+
 #ifndef ELF_R_SYM
 #if __WORDSIZE == 64
 #define ELF_R_SYM(i) ELF64_R_SYM(i)

--- a/src/track/libheaptrack.cpp
+++ b/src/track/libheaptrack.cpp
@@ -80,7 +80,7 @@ chrono::milliseconds elapsedTime()
     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
 }
 
-__pid_t gettid()
+pid_t gettid()
 {
 #ifdef __linux__
     return syscall(SYS_gettid);

--- a/tests/manual/dlopen.cpp
+++ b/tests/manual/dlopen.cpp
@@ -9,6 +9,9 @@ __attribute__((weak)) extern void allocFromLib(bool leak);
 
 int main()
 {
+#ifndef RTLD_DEEPBIND
+    printf("SKIP (RTLD_DEEPBIND undefined)\n");
+#else
     fprintf(stderr, "malloc address: %p\n", dlsym(RTLD_NEXT, "malloc"));
     fprintf(stderr, "free address: %p\n", dlsym(RTLD_NEXT, "free"));
 
@@ -27,6 +30,7 @@ int main()
 
     fprintf(stderr, "malloc address: %p\n", dlsym(RTLD_NEXT, "malloc"));
     fprintf(stderr, "free address: %p\n", dlsym(RTLD_NEXT, "free"));
+#endif
 
     return 0;
 }
