Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-8464

Correctly source clang's libFuzzer library if compiling 'test/fuzz' in CMake

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage - Ra 2022-01-10

      Context:

      Currently the CMake build for 'test/fuzz' assumes that it if can correctly source the LLVM CMake Package, the clang fuzzer library is available under the systems library path (i.e. can link with '-fsanitize=fuzzer').

      This is incorrect/buggy behaviour. In some cases, CMake could source a LLVM Package, where the fuzzer library install is not under any default library system path. This hence leads to a compiler error, where the '-fsanitize=fuzzer' linker flag fails compilation (due to not being able to find libFuzzer).

      Definition of Done:

      There are two main approaches we could take. These either being:

      1. Correctly source the absolute location of the libFuzzer library and explicitly link the library file to the fuzzer test executable. We can source the full libFuzzer library path with 'llvm_map_components_to_libnames' (available under the CMake LLVM package). If the path cannot be sourced, skip compilation of the fuzzer.
      2. Test compile if the '-fsanitize=fuzzer' linker flag is available on the user's system. If not, skip compilation of the fuzzer.

      I'd strongly prefer we go with Option 1 and try to make that work (Option 2 limits the ability to compile test/fuzz  to specific system environment configurations)

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            alison.felizzi@mongodb.com Alison Felizzi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: