build(test): link ezoption_parser_unit-t / mysql_resolution_unit-t with WASAN

obj/tap.o is compiled with $(OPT), which includes $(WASAN) =
-fsanitize=address when WITHASAN=1. Every other unit test binary goes
through the pattern rule on line 333 which re-applies $(OPT) on the link
line, pulling in libasan. The two explicit rules for
ezoption_parser_unit-t and mysql_resolution_unit-t were written without
$(OPT) on the link step (they avoid linking libproxysql.a since they are
standalone header-only tests), but they also dropped $(WASAN) — so the
linker sees ASAN-instrumented tap.o and nothing to resolve
__asan_report_*, __asan_init, __asan_handle_no_return, etc. against:

  /usr/bin/ld: obj/tap.o: undefined reference to `__asan_report_load8'
  ... (hundreds more) ...
  collect2: error: ld returned 1 exit status
  make[1]: *** [Makefile:321: ezoption_parser_unit-t] Error 1

Put $(WASAN) back on both link commands. CI-unit-tests-asan-coverage has
been red on every branch (including v3.0 itself) since at least
2026-04-12 because of this.
fix/pgsql-active-tx-on-broken-conn
Rene Cannao 4 weeks ago
parent c2200e472d
commit 8da7a71a44

@ -320,12 +320,12 @@ $(ODIR)/tap_noise_stubs.o: | $(ODIR)
ezoption_parser_unit-t: ezoption_parser_unit-t.cpp $(ODIR)/tap.o $(ODIR)/tap_noise_stubs.o
$(CXX) $< $(ODIR)/tap.o $(ODIR)/tap_noise_stubs.o \
-I$(TAP_IDIR) -I$(PROXYSQL_PATH)/include \
$(STDCPP) -O0 -ggdb $(WGCOV) $(LWGCOV) -lpthread -o $@
$(STDCPP) -O0 -ggdb $(WGCOV) $(LWGCOV) $(WASAN) -lpthread -o $@
mysql_resolution_unit-t: mysql_resolution_unit-t.cpp $(ODIR)/tap.o $(ODIR)/tap_noise_stubs.o
$(CXX) $< $(ODIR)/tap.o $(ODIR)/tap_noise_stubs.o \
-I$(TAP_IDIR) -I$(PROXYSQL_PATH)/include \
$(STDCPP) -O0 -ggdb $(WGCOV) $(LWGCOV) -lpthread -o $@
$(STDCPP) -O0 -ggdb $(WGCOV) $(LWGCOV) $(WASAN) -lpthread -o $@
# Pattern rule: all unit tests use the same compile + link flags.
# Each test binary is built from its .cpp source, linked against

Loading…
Cancel
Save