$(CXX) $(BEES_CXXFLAGS) -I../src -M -MF $@ -MT bench-bees-plan.o $<
-include bench-bees-plan.dep
-bench-bees-plan: bench-bees-plan.o test-bees-plan-lib.o ../makeflags Makefile ../lib/libcrucible.a
- $(CXX) $(BEES_CXXFLAGS) $(SECTION_FLAGS) $(BEES_LDFLAGS) -Wl,--gc-sections -o $@ bench-bees-plan.o test-bees-plan-lib.o $(LIBS)
+# Links test-bees-util-lib.o for the same BEESCOUNT symbols test-bees-plan needs
+# (bench-bees-plan.o pulls the same instrumented test-bees-plan-lib.o).
+bench-bees-plan: bench-bees-plan.o test-bees-plan-lib.o test-bees-util-lib.o ../makeflags Makefile ../lib/libcrucible.a
+ $(CXX) $(BEES_CXXFLAGS) $(SECTION_FLAGS) $(BEES_LDFLAGS) -Wl,--gc-sections -o $@ bench-bees-plan.o test-bees-plan-lib.o test-bees-util-lib.o $(LIBS)
$(REPL_TESTS): %: %.o $(REPL_OBJS) ../makeflags Makefile ../lib/libcrucible.a
$(CXX) $(BEES_CXXFLAGS) $(BEES_LDFLAGS) -o $@ $< $(REPL_OBJS) $(LIBS)
// it exists to reproduce the CPU/memory scaling of the search on large,
// heavily-overlapping match pools locally, without looping through bigtest.
//
-// Build (from test/):
-// make test-bees-plan-lib.o
-// clang++ $(BEES_CXXFLAGS) -I../src -ffunction-sections -fdata-sections \
-// -Wl,--gc-sections -o bench-bees-plan \
-// bench-bees-plan.cc test-bees-plan-lib.o -L../lib -lcrucible -lpthread -latomic
-// (--gc-sections is required: test-bees-plan-lib.o is all of bees-plan.cc,
-// which contains functions this bench never calls — CostReport's operator<<
-// and BeesPlan::print (needing pretty(double) and BeesExtent::bytenr) and
-// BeesCandidateQueue::pick_best_candidate (needing BeesExtent::phys_size) —
-// that reference symbols this standalone link does not provide. The section
-// GC drops them because nothing reachable from main() calls them.)
+// Build (from test/): make bench-bees-plan
+// The Makefile links it against the function-sectioned test-bees-plan-lib.o and
+// test-bees-util-lib.o with --gc-sections, which drops the bees-plan.cc code this
+// bench never calls (CostReport's operator<<, BeesPlan::print, and
+// BeesCandidateQueue::pick_best_candidate — needing pretty(double) / BeesExtent
+// bytenr / phys_size) plus the unused rest of bees-util.cc, so the standalone
+// link resolves only what main() reaches.
//
-// Usage: ./bench-bees-plan [num_matches] [region_blocks] [max_match_blocks] \
+// Usage: ./bench-bees-plan [num_matches] [region_blocks] [max_match_blocks]
// [seed] [per-type-max] [total-max]
#include "bees-plan.h"