From ebbd0023f93c6e96160274aeb56e07b6fa329b3b Mon Sep 17 00:00:00 2001 From: Randall Meyer Date: Fri, 19 Nov 2021 15:38:31 -0800 Subject: [PATCH] Partial of revert "Cleanup generated LDFLAGS for jemalloc (#8285)" This reverts commit 9b3cde501d9f72d250a34f6d4742c816e1e7797b. Restoring --add-needed, but keeping the corrected path --- build/jemalloc.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/jemalloc.m4 b/build/jemalloc.m4 index 8306a83b765..22eccd75df1 100644 --- a/build/jemalloc.m4 +++ b/build/jemalloc.m4 @@ -54,7 +54,8 @@ if test "$has_jemalloc" != "no"; then jemalloc_has_libs=0 if test "$jemalloc_base_dir" != "/usr"; then TS_ADDTO(CPPFLAGS, [-I${jemalloc_include}]) - TS_ADDTO(LDFLAGS, [-L${jemalloc_ldflags} -Wl,-rpath,${jemalloc_ldflags}]) + TS_ADDTO(LDFLAGS, [-L${jemalloc_ldflags}]) + TS_ADDTO(LDFLAGS, [-Wl,--add-needed -L${jemalloc_ldflags} -Wl,-rpath,${jemalloc_ldflags} -Wl,--no-as-needed]) TS_ADDTO_RPATH(${jemalloc_ldflags}) fi # On Darwin, jemalloc symbols are prefixed with je_. Search for that first, then fall back