This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] [NFC] Support multi-arch and multi-OS building and testing
ClosedPublic

Authored by george.karpenkov on May 23 2018, 3:38 PM.

Diff Detail

Event Timeline

vitalybuka added inline comments.May 25 2018, 1:18 PM
test/fuzzer/lit.site.cfg.in
10

Why can't you use config.target_flags instead of config.target_cflags?

george.karpenkov marked an inline comment as done.
george.karpenkov added inline comments.
test/fuzzer/lit.site.cfg.in
10

Yep, that actually makes more sense.

vitalybuka accepted this revision.Jun 13 2018, 6:05 PM
This revision is now accepted and ready to land.Jun 13 2018, 6:05 PM
george.karpenkov marked an inline comment as done.Jun 13 2018, 6:06 PM

@vitalybuka Thanks!

This revision was automatically updated to reflect the committed changes.
Lekensteyn added inline comments.
compiler-rt/trunk/cmake/config-ix.cmake
195 ↗(On Diff #151420)

This breaks the Android builder: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/11681

-- LLVM host triple: aarch64-unknown-linux-gnu
-- LLVM default target triple: aarch64-unknown-linux-gnu
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Linker detection: GNU ld
-- Targeting ARM
-- Targeting AArch64
-- Compiler-RT supported architectures: aarch64
-- Builtin supported architectures: aarch64
CMake Error at projects/compiler-rt/cmake/config-ix.cmake:139 (message):
  Unsupported architecture: x86_64
Call Stack (most recent call first):
  projects/compiler-rt/cmake/Modules/CompilerRTCompile.cmake:47 (get_target_flags_for_arch)
  projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:362 (sanitizer_test_compile)
  projects/compiler-rt/lib/fuzzer/tests/CMakeLists.txt:53 (generate_compiler_rt_tests)

Previously, when -DLLVM_TARGETS_TO_BUILD="ARM;AArch64", then DLLVM_TARGETS_TO_BUILD='"'"'ARM;AArch64 would end up with an empty list. As a result, COMPILER_RT_HAS_FUZZER is FALSE and the fuzzer subdirectory is not added.

With this change, the fuzzer directory will be added, but its test suite configuration assumes that the host target (x86_64) is always available:

# libFuzzer unit tests are only run on the host machine.
set(arch "x86_64")

Could you have a look at this?