Revision fa136cb5417a554c2b7c85001235e2aace214732 authored by Steven Johnson on 29 August 2023, 16:21:59 UTC, committed by GitHub on 29 August 2023, 16:21:59 UTC
* Fix CMake test for generator_aot_multitarget

* Ensure that multitarget AOT builds have consistent random numbers

If a Generator uses random_float() (or the int or uint versions), and is used in a multitarget build, we weren't resetting the counters for random generation between each subtarget... meaning that each subtarget would get a different random sequence, leading to some ery hard-to-debug test failures when running on different hardware variants. This PR ensures that the relevant counters are all reset before each subtarget is generated, so that each should see the same sequence of random number generation.

* Update CMakeLists.txt

* Update multitarget_aottest.cpp

* Combine float/uint counters
1 parent fe9f0b7
Raw File
toolchain.linux-x64-fuzzer.cmake
# Toolchain for compiling with ASAN enabled on a Linux-x86-64 host.
# This is done as a "crosscompile" because we must use our LLVM version
# of clang for *all* compilation (rather than using it just for bitcode
# and letting the host compiler, eg gcc, handle everything else); fuzzer
# essentially requires everything to be compiled with matching versions
# of the same compiler.
#
# Note: requires LLVM to be built with -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind"
#
# Note: only tested with LLVM/Clang 16 as of this comment. Earlier versions
# may likely work but are not tested.

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR i686)

set(CMAKE_C_COMPILER ${LLVM_ROOT}/bin/clang)
set(CMAKE_CXX_COMPILER ${LLVM_ROOT}/bin/clang++)
set(CMAKE_LINKER ${LLVM_ROOT}/bin/ld.lld)

set(CMAKE_C_FLAGS_INIT "-fsanitize=fuzzer-no-link")
set(CMAKE_CXX_FLAGS_INIT "-fsanitize=fuzzer-no-link")

set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=${CMAKE_LINKER}")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=${CMAKE_LINKER}")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=${CMAKE_LINKER}")

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/env)

# Sanitizer builds intermittently fail when using CCache for reasons that aren't
# clear; default to turning it off
set(Halide_CCACHE_BUILD OFF)
back to top