From 274038486b4acacf4165d90b40292e595359694c Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Wed, 20 Mar 2024 20:39:30 -0400 Subject: [PATCH] ensure dllexport/public visibility of all aliases we generate --- src/libc_override_gcc_and_weak.h | 2 +- src/libc_override_glibc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libc_override_gcc_and_weak.h b/src/libc_override_gcc_and_weak.h index 65abeb7..c25b6a3 100644 --- a/src/libc_override_gcc_and_weak.h +++ b/src/libc_override_gcc_and_weak.h @@ -55,7 +55,7 @@ # error libc_override_gcc_and_weak.h is for gcc distributions only. #endif -#define ALIAS(tc_fn) __attribute__ ((alias (#tc_fn), used)) +#define ALIAS(tc_fn) __attribute__ ((alias (#tc_fn), used)) PERFTOOLS_DLL_DECL void* operator new(size_t size) CPP_BADALLOC ALIAS(tc_new); void operator delete(void* p) CPP_NOTHROW ALIAS(tc_delete); diff --git a/src/libc_override_glibc.h b/src/libc_override_glibc.h index 3269213..4e14037 100644 --- a/src/libc_override_glibc.h +++ b/src/libc_override_glibc.h @@ -70,7 +70,7 @@ // do it inside the gcc #ifdef, since redhat uses gcc. // TODO(csilvers): only do this if we detect we're an old enough glibc? -#define ALIAS(tc_fn) __attribute__ ((alias (#tc_fn))) +#define ALIAS(tc_fn) __attribute__ ((alias (#tc_fn))) PERFTOOLS_DLL_DECL extern "C" { void* __libc_malloc(size_t size) ALIAS(tc_malloc); void __libc_free(void* ptr) ALIAS(tc_free);