brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · b4011e5 Raw
72 lines · plain
1if(NOT LLVM_LIBC_INCLUDE_SCUDO)2  return()3endif()4 5# We use a special library consisting of only the SCUDO allocator6# functions to link to the integration tests below. We could instead7# link to libllvmlibc.a directly, but since libllvmlibc.a contains8# functions which depend on the LLVM libc startup system, the integration9# test will have to link to the LLVM libc startup system. LLVM libc's startup10# system is not complete enough to allow this. It is also desireable to11# keep the dependencies as minimal as possible.12 13add_entrypoint_library(14  libc_for_scudo_integration_test15  DEPENDS16    libc.src.errno.errno17    libc.src.fcntl.open18    libc.src.sched.__sched_getcpucount19    libc.src.stdlib.aligned_alloc20    libc.src.stdlib.calloc21    libc.src.stdlib.free22    libc.src.stdlib.malloc23    libc.src.stdlib.realloc24    libc.src.sys.auxv.getauxval25    libc.src.sys.mman.mmap26    libc.src.sys.mman.munmap27    libc.src.sys.prctl.prctl28    libc.src.unistd.__llvm_libc_syscall29    libc.src.unistd.close30    libc.src.unistd.read31    libc.src.unistd.sysconf32    libc.src.unistd.write33)34 35add_executable(36  libc-scudo-integration-test37  integration_test.cpp38)39 40target_link_options(41  libc-scudo-integration-test42  PRIVATE43  -pthread44)45 46target_link_libraries(libc-scudo-integration-test47  PRIVATE48  libc_for_scudo_integration_test49)50 51add_executable(52  libc-gwp-asan-uaf-should-crash53  gwp_asan_should_crash.cpp54)55 56target_link_options(57  libc-gwp-asan-uaf-should-crash58  PRIVATE59  -pthread60)61 62target_link_libraries(libc-gwp-asan-uaf-should-crash63  PRIVATE64  libc_for_scudo_integration_test65)66 67add_custom_command(TARGET libc-scudo-integration-test68                   POST_BUILD69                   COMMAND $<TARGET_FILE:libc-scudo-integration-test>70                   COMMENT "Run the test after it is built."71                   VERBATIM)72