Files
RetroArch/samples/tasks/patch_stream/Makefile
T
LibretroAdmin 0466e44485 samples/tasks/patch_stream: build at -O1, and one scratch buffer
The test ran under ASan + UBSan at -O0, the slowest step of
samples-tasks. -O1, as the other samples build, keeps every check and
runs faster; and the 2 MiB buffer each of the 20000 trials built its
patches in is allocated once, as each comparison reads its own
exact-size copy of the patch, where an overread is caught.

Measured on two CPUs: 138 s before, 103 s after, the same report.
2026-10-24 09:21:09 +02:00

37 lines
895 B
Makefile

include ../../sample_objdir.mk
TARGET := patch_stream_test
SOURCES := patch_stream_test.c ../../../tasks/patch_stream.c \
../../../libretro-common/encodings/encoding_vcdiff.c \
../../../libretro-common/encodings/encoding_crc32.c \
../../../libretro-common/features/features_cpu.c \
../../../libretro-common/compat/compat_strl.c
OBJS := $(call sample_objs,$(SOURCES:.c=.o))
CFLAGS += -Wall -pedantic -std=gnu99 -g1 -O1 -DHAVE_XDELTA -I../../../libretro-common/include
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
all: $(TARGET)
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
$(SAMPLE_OBJDIR)/%.o: $$(call sample_src,$$*).c
@mkdir -p $(@D)
$(CC) -c -o $@ $< $(CFLAGS)
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
clean:
rm -rf $(SAMPLE_OBJDIR)
rm -f $(TARGET) $(OBJS)
.PHONY: clean