Makefile: force -O0 when compiling with SANITIZE=leak

Cherry pick commit d3775de0 (Makefile: force -O0 when compiling with SANITIZE=leak, 2022-10-18), as otherwise the leak checker at GitHub Actions CI seems to fail with a false positive. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Oct 18, 2022 at 16:15 UTC 86fa96860b42d13dac3b1023817dfc177a91324c
1 file changed +1
Makefile
+1
@@ -1338,6 +1338,7 @@ BASIC_CFLAGS += -DSHA1DC_FORCE_ALIGNED_ACCESS
1338 endif
1339 ifneq ($(filter leak,$(SANITIZERS)),)
1340 BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS
1341 +BASIC_CFLAGS += -O0
1342 SANITIZE_LEAK = YesCompiledWithIt
1343 endif
1344 ifneq ($(filter address,$(SANITIZERS)),)