diff -up oneTBB-2020.2/src/tbbmalloc/proxy.cpp.orig oneTBB-2020.2/src/tbbmalloc/proxy.cpp --- oneTBB-2020.2/src/tbbmalloc/proxy.cpp.orig 2020-03-31 06:40:13.752296189 -0600 +++ oneTBB-2020.2/src/tbbmalloc/proxy.cpp 2020-03-31 06:42:52.611900760 -0600 @@ -146,15 +146,7 @@ static inline void initPageSize() 1) detection that the proxy library is loaded 2) check that dlsym("malloc") found something different from our replacement malloc */ -// Starting from GCC 9, the -Wmissing-attributes warning was extended for alias below -#if __GNUC__ == 9 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wmissing-attributes" -#endif -extern "C" void *__TBB_malloc_proxy(size_t) __attribute__ ((alias ("malloc"))); -#if __GNUC__ == 9 - #pragma GCC diagnostic pop -#endif +extern "C" void *__TBB_malloc_proxy(size_t) __attribute__ ((alias ("malloc"), copy (malloc))); static void *orig_msize; @@ -296,25 +288,17 @@ struct mallinfo mallinfo() __THROW size_t dlmalloc_usable_size(const void *ptr) __attribute__ ((alias ("malloc_usable_size"))); #else // __ANDROID__ // C11 function, supported starting GLIBC 2.16 -void *aligned_alloc(size_t alignment, size_t size) __attribute__ ((alias ("memalign"))); +void *aligned_alloc(size_t alignment, size_t size) __attribute__ ((alias ("memalign"), copy (memalign))); // Those non-standard functions are exported by GLIBC, and might be used // in conjunction with standard malloc/free, so we must ovberload them. // Bionic doesn't have them. Not removing from the linker scripts, // as absent entry points are ignored by the linker. -// Starting from GCC 9, the -Wmissing-attributes warning was extended for aliases below -#if __GNUC__ == 9 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wmissing-attributes" -#endif -void *__libc_malloc(size_t size) __attribute__ ((alias ("malloc"))); -void *__libc_calloc(size_t num, size_t size) __attribute__ ((alias ("calloc"))); -void *__libc_memalign(size_t alignment, size_t size) __attribute__ ((alias ("memalign"))); -void *__libc_pvalloc(size_t size) __attribute__ ((alias ("pvalloc"))); -void *__libc_valloc(size_t size) __attribute__ ((alias ("valloc"))); -#if __GNUC__ == 9 - #pragma GCC diagnostic pop -#endif +void *__libc_malloc(size_t size) __attribute__ ((alias ("malloc"), copy (malloc))); +void *__libc_calloc(size_t num, size_t size) __attribute__ ((alias ("calloc"), copy (calloc))); +void *__libc_memalign(size_t alignment, size_t size) __attribute__ ((alias ("memalign"), copy (memalign))); +void *__libc_pvalloc(size_t size) __attribute__ ((alias ("pvalloc"), copy (pvalloc))); +void *__libc_valloc(size_t size) __attribute__ ((alias ("valloc"), copy (valloc))); // call original __libc_* to support naive replacement of free via __libc_free etc void __libc_free(void *ptr) Diff finished. Tue Mar 31 06:43:27 2020