From cf28e0356782fab54f51e4a394e30642c7371bc5 Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Tue, 27 Jun 2023 01:20:01 -0400 Subject: [PATCH] correctly order weakening step to avoid race Previously we allowed test programs to be linked at the same time as weakening is performed, rewriting the .a archives. So lets be more explicit. We weaken after all-am (which "runs" everything including libraries and programs), but before all target. --- Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1d5858c..8284c0f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1390,10 +1390,11 @@ endif WITH_HEAP_PROFILER_OR_CHECKER # Do the weakening on some exported libtcmalloc symbols. -install-exec-local: all-local -all-local: $(LIBS_TO_WEAKEN) +run-weaken: all-am for la in $(LIBS_TO_WEAKEN); do lib=".libs/`basename $$la .la`.a"; [ ! -f "$$lib" ] || $(WEAKEN) "$$lib"; done +install-exec-local: run-weaken +all: run-weaken # This should always include $(TESTS), but may also include other # binaries that you compile but don't want automatically installed.