1 # To build these benchmarks, build the target "ScudoBenchmarks.$ARCH", where
2 # $ARCH is the name of the target architecture. For example,
3 # ScudoBenchmarks.x86_64 for 64-bit x86. The benchmark executable is then
4 # available under projects/compiler-rt/lib/scudo/standalone/benchmarks/ in the
9 set(SCUDO_BENCHMARK_CFLAGS -I${COMPILER_RT_SOURCE_DIR}/lib/scudo/standalone)
11 list(APPEND SCUDO_BENCHMARK_CFLAGS -fno-emulated-tls)
13 string(REPLACE ";" " " SCUDO_BENCHMARK_CFLAGS " ${SCUDO_BENCHMARK_CFLAGS}")
15 foreach(arch ${SCUDO_STANDALONE_SUPPORTED_ARCH})
16 add_benchmark(ScudoBenchmarks.${arch}
18 $<TARGET_OBJECTS:RTScudoStandalone.${arch}>)
19 set_property(TARGET ScudoBenchmarks.${arch} APPEND_STRING PROPERTY
20 COMPILE_FLAGS "${SCUDO_BENCHMARK_CFLAGS}")
22 if (COMPILER_RT_HAS_GWP_ASAN)
24 ScudoBenchmarksWithGwpAsan.${arch} malloc_benchmark.cpp
25 $<TARGET_OBJECTS:RTScudoStandalone.${arch}>
26 $<TARGET_OBJECTS:RTGwpAsan.${arch}>
27 $<TARGET_OBJECTS:RTGwpAsanBacktraceLibc.${arch}>
28 $<TARGET_OBJECTS:RTGwpAsanSegvHandler.${arch}>)
30 TARGET ScudoBenchmarksWithGwpAsan.${arch} APPEND_STRING PROPERTY
31 COMPILE_FLAGS "${SCUDO_BENCHMARK_CFLAGS} -DGWP_ASAN_HOOKS")