rust-fuzz / libfuzzer

Rust bindings and utilities for LLVM’s libFuzzer
Apache License 2.0
215 stars 46 forks source link

Build fails on Windows since 0.4.8: `error C2039: 'clamp': is not a member of 'std'` #126

Open SimonSapin opened 4 days ago

SimonSapin commented 4 days ago

CI for the apollo-rs project started failing on Windows since libfuzzer-sys 0.4.8 was released. The most relevant part of the output seems to be:

  libfuzzer\FuzzerLoop.cpp(802): error C2039: 'clamp': is not a member of 'std'
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\mutex(30): note: see declaration of 'std'
  libfuzzer\FuzzerLoop.cpp(802): error C3861: 'clamp': identifier not found

Full output from Cargo:

``` The following warnings were emitted during compilation: warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: ToolExecError: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-W4" "-std=c++17" "-fno-omit-frame-pointer" "-w" "-FoC:\\Users\\circleci\\project\\target\\debug\\build\\libfuzzer-sys-9af3eb7cac4d51af\\out\\dea49a5d26799b40-FuzzerLoop.o" "-c" "libfuzzer\\FuzzerLoop.cpp" with args cl.exe did not execute successfully (status code exit code: 2).cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' warning: libfuzzer-sys@0.4.8: cl : Command line warning D9025 : overriding '/W4' with '/w' error: failed to run custom build command for `libfuzzer-sys v0.4.8` Caused by: process didn't exit successfully: `C:\Users\circleci\project\target\debug\build\libfuzzer-sys-45fee8a1ef926e81\build-script-build` (exit code: 1) --- stdout cargo:rerun-if-env-changed=CUSTOM_LIBFUZZER_PATH cargo:rerun-if-changed=libfuzzer\FuzzerCrossOver.cpp cargo:rerun-if-changed=libfuzzer\FuzzerDataFlowTrace.cpp cargo:rerun-if-changed=libfuzzer\FuzzerDriver.cpp cargo:rerun-if-changed=libfuzzer\FuzzerExtFunctionsDlsym.cpp cargo:rerun-if-changed=libfuzzer\FuzzerExtFunctionsWeak.cpp cargo:rerun-if-changed=libfuzzer\FuzzerExtFunctionsWindows.cpp cargo:rerun-if-changed=libfuzzer\FuzzerExtraCounters.cpp cargo:rerun-if-changed=libfuzzer\FuzzerExtraCountersDarwin.cpp cargo:rerun-if-changed=libfuzzer\FuzzerExtraCountersWindows.cpp cargo:rerun-if-changed=libfuzzer\FuzzerFork.cpp cargo:rerun-if-changed=libfuzzer\FuzzerInterceptors.cpp cargo:rerun-if-changed=libfuzzer\FuzzerIO.cpp cargo:rerun-if-changed=libfuzzer\FuzzerIOPosix.cpp cargo:rerun-if-changed=libfuzzer\FuzzerIOWindows.cpp cargo:rerun-if-changed=libfuzzer\FuzzerLoop.cpp cargo:rerun-if-changed=libfuzzer\FuzzerMain.cpp cargo:rerun-if-changed=libfuzzer\FuzzerMerge.cpp cargo:rerun-if-changed=libfuzzer\FuzzerMutate.cpp cargo:rerun-if-changed=libfuzzer\FuzzerSHA1.cpp cargo:rerun-if-changed=libfuzzer\FuzzerTracePC.cpp cargo:rerun-if-changed=libfuzzer\FuzzerUtil.cpp cargo:rerun-if-changed=libfuzzer\FuzzerUtilDarwin.cpp cargo:rerun-if-changed=libfuzzer\FuzzerUtilFuchsia.cpp cargo:rerun-if-changed=libfuzzer\FuzzerUtilLinux.cpp cargo:rerun-if-changed=libfuzzer\FuzzerUtilPosix.cpp cargo:rerun-if-changed=libfuzzer\FuzzerUtilWindows.cpp OUT_DIR = Some(C:\Users\circleci\project\target\debug\build\libfuzzer-sys-9af3eb7cac4d51af\out) OPT_LEVEL = Some(0) TARGET = Some(x86_64-pc-windows-msvc) cargo:rerun-if-env-changed=VCINSTALLDIR VCINSTALLDIR = None cargo:rerun-if-env-changed=VSTEL_MSBuildProjectFullPath VSTEL_MSBuildProjectFullPath = None cargo:rerun-if-env-changed=VSCMD_ARG_VCVARS_SPECTRE VSCMD_ARG_VCVARS_SPECTRE = None cargo:rerun-if-env-changed=WindowsSdkDir WindowsSdkDir = None cargo:rerun-if-env-changed=WindowsSDKVersion WindowsSDKVersion = None cargo:rerun-if-env-changed=LIB LIB = None PATH = Some(C:\Users\circleci\project\target\debug\deps;C:\Users\circleci\project\target\debug;C:\Users\circleci\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib;C:\Program Files (x86)\Windows Application Driver;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin;C:\Program Files (x86)\Microsoft Visual Studio\Installer\;C:\tools\ruby26;C:\tools\ruby26\bin;C:\ProgramData\nvm;C:\miniconda3\miniconda3\condabin;C:\tools\miniconda3;C:\tools\miniconda3\Library\mingw-w64\bin;C:\tools\miniconda3\Library\usr\bin;C:\tools\miniconda3\Library\bin;C:\tools\miniconda3\Scripts;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metadata_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\PowerShell\7\;C:\Program Files\Google\Compute Engine\sysprep;C:\Program Files\Docker;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git LFS;C:\Program Files\Amazon\AWSCLI\bin\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files (x86)\vim\vim80;C:\Program Files\Go\bin;C:\Program Files\OpenJDK\jdk-12.0.2\bin;C:\Program Files\nodejs;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\IncrediBuild;C:\Users\circleci\.cargo\bin;C:\Users\circleci\AppData\Local\Microsoft\WindowsApps;) cargo:rerun-if-env-changed=INCLUDE INCLUDE = None HOST = Some(x86_64-pc-windows-msvc) cargo:rerun-if-env-changed=CXX_x86_64-pc-windows-msvc CXX_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CXX_x86_64_pc_windows_msvc CXX_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CXX HOST_CXX = None cargo:rerun-if-env-changed=CXX CXX = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some(cmpxchg16b,fxsr,sse,sse2,sse3) DEBUG = Some(true) cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-msvc CXXFLAGS_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_msvc CXXFLAGS_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CXXFLAGS HOST_CXXFLAGS = None cargo:rerun-if-env-changed=CXXFLAGS CXXFLAGS = None cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT FuzzerExtFunctionsWeak.cpp FuzzerCrossOver.cpp FuzzerDriver.cpp FuzzerExtFunctionsDlsym.cpp FuzzerDataFlowTrace.cpp cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' FuzzerExtFunctionsWindows.cpp cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' FuzzerExtraCounters.cpp FuzzerExtraCountersDarwin.cpp cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' FuzzerExtraCountersWindows.cpp FuzzerFork.cpp FuzzerInterceptors.cpp cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' FuzzerIO.cpp FuzzerIOPosix.cpp FuzzerIOWindows.cpp cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' FuzzerLoop.cpp FuzzerMain.cpp cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' FuzzerMerge.cpp cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\istream(517): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\istream(511): note: while compiling class template member function 'std::basic_istream> &std::basic_istream>::read(_Elem *,std::streamsize)' with [ _Elem=char ] libfuzzer\FuzzerIO.cpp(57): note: see reference to function template instantiation 'std::basic_istream> &std::basic_istream>::read(_Elem *,std::streamsize)' being compiled with [ _Elem=char ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\istream(697): note: see reference to class template instantiation 'std::basic_istream>' being compiled FuzzerMutate.cpp C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(743): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Users\circleci\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libfuzzer-sys-0.4.8\libfuzzer\FuzzerCommand.h(144): note: see reference to function template instantiation 'std::basic_ostream> &std::operator <<>(std::basic_ostream> &,const char *)' being compiled cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(743): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Users\circleci\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libfuzzer-sys-0.4.8\libfuzzer\FuzzerCommand.h(144): note: see reference to function template instantiation 'std::basic_ostream> &std::operator <<>(std::basic_ostream> &,const char *)' being compiled libfuzzer\FuzzerLoop.cpp(802): error C2039: 'clamp': is not a member of 'std' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\mutex(30): note: see declaration of 'std' libfuzzer\FuzzerLoop.cpp(802): error C3861: 'clamp': identifier not found C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(743): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Users\circleci\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libfuzzer-sys-0.4.8\libfuzzer\FuzzerCommand.h(144): note: see reference to function template instantiation 'std::basic_ostream> &std::operator <<>(std::basic_ostream> &,const char *)' being compiled exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 2 FuzzerSHA1.cpp C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(743): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Users\circleci\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libfuzzer-sys-0.4.8\libfuzzer\FuzzerCommand.h(144): note: see reference to function template instantiation 'std::basic_ostream> &std::operator <<>(std::basic_ostream> &,const char *)' being compiled C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(374): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(367): note: while compiling class template member function 'std::basic_ostream> &std::basic_ostream>::operator <<(unsigned __int64)' libfuzzer\FuzzerMerge.cpp(265): note: see reference to function template instantiation 'std::basic_ostream> &std::basic_ostream>::operator <<(unsigned __int64)' being compiled C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(640): note: see reference to class template instantiation 'std::basic_ostream>' being compiled cargo:warning=ToolExecError: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-W4" "-std=c++17" "-fno-omit-frame-pointer" "-w" "-FoC:\\Users\\circleci\\project\\target\\debug\\build\\libfuzzer-sys-9af3eb7cac4d51af\\out\\dea49a5d26799b40-FuzzerLoop.o" "-c" "libfuzzer\\FuzzerLoop.cpp" with args cl.exe did not execute successfully (status code exit code: 2).cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(743): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Users\circleci\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libfuzzer-sys-0.4.8\libfuzzer\FuzzerCommand.h(144): note: see reference to function template instantiation 'std::basic_ostream> &std::operator <<>(std::basic_ostream> &,const char *)' being compiled C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(301): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(294): note: while compiling class template member function 'std::basic_ostream> &std::basic_ostream>::operator <<(unsigned int)' libfuzzer\FuzzerSHA1.cpp(214): note: see reference to function template instantiation 'std::basic_ostream> &std::basic_ostream>::operator <<(unsigned int)' being compiled C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(640): note: see reference to class template instantiation 'std::basic_ostream>' being compiled C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(775): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(734): note: see reference to function template instantiation 'std::basic_string,std::allocator> *std::vector>::_Emplace_reallocate(std::basic_string,std::allocator> *const ,const _Ty &)' being compiled with [ _Ty=std::string ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(734): note: see reference to function template instantiation 'std::basic_string,std::allocator> *std::vector>::_Emplace_reallocate(std::basic_string,std::allocator> *const ,const _Ty &)' being compiled with [ _Ty=std::string ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(743): note: see reference to function template instantiation 'void std::vector>::emplace_back(const _Ty &)' being compiled with [ _Ty=std::string ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(742): note: while compiling class template member function 'void std::vector>::push_back(const _Ty &)' with [ _Ty=std::string ] libfuzzer\FuzzerIOWindows.cpp(149): note: see reference to function template instantiation 'void std::vector>::push_back(const _Ty &)' being compiled with [ _Ty=std::string ] libfuzzer\FuzzerIOWindows.cpp(146): note: see reference to class template instantiation 'std::vector>' being compiled FuzzerTracePC.cpp cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' FuzzerUtilDarwin.cpp FuzzerUtil.cpp cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' FuzzerUtilFuchsia.cpp FuzzerUtilLinux.cpp cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' FuzzerUtilPosix.cpp FuzzerUtilWindows.cpp cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cargo:warning=cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' cargo:warning=cl : Command line warning D9025 : overriding '/W4' with '/w' cl : Command line warning D9002 : ignoring unknown option '-std=c++17' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(743): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Users\circleci\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libfuzzer-sys-0.4.8\libfuzzer\FuzzerCommand.h(144): note: see reference to function template instantiation 'std::basic_ostream> &std::operator <<>(std::basic_ostream> &,const char *)' being compiled C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(743): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Users\circleci\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libfuzzer-sys-0.4.8\libfuzzer\FuzzerCommand.h(144): note: see reference to function template instantiation 'std::basic_ostream> &std::operator <<>(std::basic_ostream> &,const char *)' being compiled C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(743): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Users\circleci\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libfuzzer-sys-0.4.8\libfuzzer\FuzzerCommand.h(144): note: see reference to function template instantiation 'std::basic_ostream> &std::operator <<>(std::basic_ostream> &,const char *)' being compiled exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 --- stderr error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-W4" "-std=c++17" "-fno-omit-frame-pointer" "-w" "-FoC:\\Users\\circleci\\project\\target\\debug\\build\\libfuzzer-sys-9af3eb7cac4d51af\\out\\dea49a5d26799b40-FuzzerLoop.o" "-c" "libfuzzer\\FuzzerLoop.cpp" with args cl.exe did not execute successfully (status code exit code: 2). ```
nagisa commented 4 days ago

Hm, the gcc-style flags being passed along to cl.exe seem very suspect.

https://github.com/rust-fuzz/libfuzzer/blob/main/build.rs#L34 is wrong and a likely cause. Should be using the Build::std instead. Build::force_frame_pointer for -fno-omit-frame-pointer. And Build::warnings(false) for -w would get rid of the other flags too.

I don't have msvc around to test, though.