google / oss-fuzz

OSS-Fuzz - continuous fuzzing for open source software.
https://google.github.io/oss-fuzz
Apache License 2.0
10.32k stars 2.2k forks source link

[FuzzIntrospector] FI fails to build for Qemu #12516

Open Navidem opened 1 day ago

Navidem commented 1 day ago

Qemu fails to build locally when I try this: python infra/helper.py build_fuzzers --sanitizer=introspector qemu

Looks like meson fails testing the compiler with the additional FI added flags. The error says:

Running compile:
Working directory:  /src/qemu/build-oss-fuzz/meson-private/tmpu34y99wp
Code:

      #ifdef __apple_build_version__
      # if __clang_major__ < 12 || (__clang_major__ == 12 && __clang_minor__ < 0)
      #  error You need at least XCode Clang v12.0 to compile QEMU
      # endif
      #else
      # if __clang_major__ < 10 || (__clang_major__ == 10 && __clang_minor__ < 0)
      #  error You need at least Clang v10.0 to compile QEMU
      # endif
      #endif
-----------
Command line: `clang -m64 /src/qemu/build-oss-fuzz/meson-private/tmpu34y99wp/testfile.c -o /src/qemu/build-oss-fuzz/meson-private/tmpu34y99wp/output.obj -c -O1 -fno-omit-frame-pointer -gline-tables-only -Wno-error=enum-constexpr-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=deprecated-declarations -Wno-error=implicit-function-declaration -Wno-error=implicit-int -O0 -flto -fno-inline-functions -fuse-ld=gold -Wno-unused-command-line-argument -fsanitize=fuzzer-no-link -g -Wno-error=unused-command-line-argument -O1 -fno-omit-frame-pointer -gline-tables-only -Wno-error=enum-constexpr-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=deprecated-declarations -Wno-error=implicit-function-declaration -Wno-error=implicit-int -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -O0 -flto -fno-inline-functions -fuse-ld=gold -Wno-unused-command-line-argument -fsanitize=fuzzer-no-link -g -Wno-error=unused-command-line-argument -U __OPTIMIZE__ -D_FILE_OFFSET_BITS=64 -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -std=gnu11` -> 1
stderr:
clang: error: argument unused during compilation: '-fuse-ld=gold' [-Werror,-Wunused-command-line-argument]
clang: error: argument unused during compilation: '-fuse-ld=gold' [-Werror,-Wunused-command-line-argument]
-----------

../meson.build:289:4: ERROR: Problem encountered: You either need GCC v7.4 or Clang v10.0 (or XCode Clang v12.0) to compile QEMU
evverx commented 1 day ago

I think it's related to https://github.com/google/oss-fuzz/issues/12167. It should be possible to get it to work by tweaking various flags OSS-Fuzz passes and adding *_LD flags: https://github.com/google/oss-fuzz/pull/12081