Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SimonSapin opened this issue Nov 25, 2024 · 1 comment

Comments

@SimonSapin
Copy link

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: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: 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: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9025 : overriding '/W4' with '/w'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
warning: [email protected]: cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer'
warning: [email protected]: 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<char,std::char_traits<char>> &std::basic_istream<char,std::char_traits<char>>::read(_Elem *,std::streamsize)'
          with
          [
              _Elem=char
          ]
  libfuzzer\FuzzerIO.cpp(57): note: see reference to function template instantiation 'std::basic_istream<char,std::char_traits<char>> &std::basic_istream<char,std::char_traits<char>>::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<char,std::char_traits<char>>' 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<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,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<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,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<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,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<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,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<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(unsigned __int64)'
  libfuzzer\FuzzerMerge.cpp(265): note: see reference to function template instantiation 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::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<char,std::char_traits<char>>' 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<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,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<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(unsigned int)'
  libfuzzer\FuzzerSHA1.cpp(214): note: see reference to function template instantiation 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::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<char,std::char_traits<char>>' 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<char,std::char_traits<char>,std::allocator<char>> *std::vector<std::string,std::allocator<std::string>>::_Emplace_reallocate<const _Ty&>(std::basic_string<char,std::char_traits<char>,std::allocator<char>> *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<char,std::char_traits<char>,std::allocator<char>> *std::vector<std::string,std::allocator<std::string>>::_Emplace_reallocate<const _Ty&>(std::basic_string<char,std::char_traits<char>,std::allocator<char>> *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<std::string,std::allocator<std::string>>::emplace_back<const _Ty&>(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<std::string,std::allocator<std::string>>::push_back(const _Ty &)'
          with
          [
              _Ty=std::string
          ]
  libfuzzer\FuzzerIOWindows.cpp(149): note: see reference to function template instantiation 'void std::vector<std::string,std::allocator<std::string>>::push_back(const _Ty &)' being compiled
          with
          [
              _Ty=std::string
          ]
  libfuzzer\FuzzerIOWindows.cpp(146): note: see reference to class template instantiation 'std::vector<std::string,std::allocator<std::string>>' 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<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,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<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,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<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,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
Copy link
Member

nagisa commented Nov 25, 2024

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.

github-merge-queue bot pushed a commit to smithy-lang/smithy-rs that referenced this issue Nov 27, 2024
~If CI fails, commit the necessary fixes to this PR until all checks
pass.~

~If changes are required to
[crateNameToLastKnownWorkingVersions](https://github.com/smithy-lang/smithy-rs/blob/92916b5484cdfef9ff58540ebf5e845eeeccf860/aws/sdk/build.gradle.kts#L504),
revert the first commit in the PR, run `./gradlew
aws:sdk:cargoUpdateAllLockfiles`, and commit the updated lockfiles.~

This PR pins `libfuzzer-sys` to 0.4.7 due to
rust-fuzz/libfuzzer#126 while upgrading
dependencies.

---------

Co-authored-by: ysaito1001 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants