rust-lang / libz-sys

Rust crate package to link to a system libz (zlib)
Apache License 2.0
110 stars 73 forks source link

libz-ng-sys-1.1.12\src\zlib-ng\arch\x86\chunkset_avx2.c(79): fatal error C1001: Internal compiler error. #160

Closed rscarson closed 9 months ago

rscarson commented 9 months ago

Getting fatal error C1001: Internal compiler error. trying to build libz-ng-sys-1.1.12 in Windows 10 with cmake version 3.27.6

Full compiler output:

error: failed to run custom build command for `libz-ng-sys v1.1.12`

Caused by:
  process didn't exit successfully: `C:\Users\username\Repositories\js_playground\target\debug\build\libz-ng-sys-846323099f255c0b\build-script-build_zng` (exit code: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_x86_64-pc-windows-msvc = None
  CMAKE_TOOLCHAIN_FILE_x86_64_pc_windows_msvc = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-pc-windows-msvc = None
  CMAKE_GENERATOR_x86_64_pc_windows_msvc = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-pc-windows-msvc = None
  CMAKE_PREFIX_PATH_x86_64_pc_windows_msvc = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-pc-windows-msvc = None
  CMAKE_x86_64_pc_windows_msvc = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "C:\\Users\\username\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\libz-ng-sys-1.1.12\\src/zlib-ng" "-G" "Visual Studio 17 2022" "-Thost=x64" "-Ax64" "-DBUILD_SHARED_LIBS=OFF" "-DZLIB_COMPAT=OFF" "-DZLIB_ENABLE_TESTS=OFF" "-DWITH_GZFILEOP=ON" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\username\\Repositories\\js_playground\\target\\debug\\build\\libz-ng-sys-f3a4cecc015c50fc\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Debug"
  -- Using CMake version 3.27.6
  -- ZLIB_HEADER_VERSION: 1.2.13
  -- ZLIBNG_HEADER_VERSION: 2.1.3
  -- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19044.
  -- The C compiler identification is MSVC 19.31.30919.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.31.30919/bin/Hostx64/x64/cl.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Arch detected: 'x86_64'
  -- Basearch of 'x86_64' has been detected as: 'x86'
  -- Looking for sys/auxv.h
  -- Looking for sys/auxv.h - not found
  -- Looking for sys/sdt.h
  -- Looking for sys/sdt.h - not found
  -- Looking for unistd.h
  -- Looking for unistd.h - not found
  -- Looking for sys/types.h
  -- Looking for sys/types.h - found
  -- Looking for stdint.h
  -- Looking for stdint.h - found
  -- Looking for stddef.h
  -- Looking for stddef.h - found
  -- Check size of off64_t
  -- Check size of off64_t - failed
  -- Check size of _off64_t
  -- Check size of _off64_t - failed
  -- Check size of __off64_t
  -- Check size of __off64_t - failed
  -- Looking for fseeko
  -- Looking for fseeko - not found
  -- Looking for strerror
  -- Looking for strerror - found
  -- Looking for posix_memalign
  -- Looking for posix_memalign - not found
  -- Looking for aligned_alloc
  -- Looking for aligned_alloc - not found
  -- Performing Test HAVE_NO_INTERPOSITION
  -- Performing Test HAVE_NO_INTERPOSITION - Failed
  -- Performing Test HAVE_ATTRIBUTE_VISIBILITY_HIDDEN
  -- Performing Test HAVE_ATTRIBUTE_VISIBILITY_HIDDEN - Failed
  -- Performing Test HAVE_ATTRIBUTE_VISIBILITY_INTERNAL
  -- Performing Test HAVE_ATTRIBUTE_VISIBILITY_INTERNAL - Failed
  -- Performing Test HAVE_ATTRIBUTE_ALIGNED
  -- Performing Test HAVE_ATTRIBUTE_ALIGNED - Failed
  -- Performing Test HAVE_THREAD_LOCAL
  -- Performing Test HAVE_THREAD_LOCAL - Failed
  -- Performing Test HAVE_BUILTIN_CTZ
  -- Performing Test HAVE_BUILTIN_CTZ - Failed
  -- Performing Test HAVE_BUILTIN_CTZLL
  -- Performing Test HAVE_BUILTIN_CTZLL - Failed
  -- Performing Test HAVE_PTRDIFF_T
  -- Performing Test HAVE_PTRDIFF_T - Success
  -- Performing Test HAVE_AVX2_INTRIN
  -- Performing Test HAVE_AVX2_INTRIN - Success
  -- Performing Test HAVE_AVX512_INTRIN
  -- Performing Test HAVE_AVX512_INTRIN - Success
  -- Performing Test HAVE_MASK_INTRIN
  -- Performing Test HAVE_MASK_INTRIN - Success
  -- Performing Test HAVE_AVX512VNNI_INTRIN
  -- Performing Test HAVE_AVX512VNNI_INTRIN - Success
  -- Performing Test HAVE_SSE42CRC_INLINE_ASM
  -- Performing Test HAVE_SSE42CRC_INLINE_ASM - Failed
  -- Performing Test HAVE_SSE42CRC_INTRIN
  -- Performing Test HAVE_SSE42CRC_INTRIN - Success
  -- Performing Test HAVE_SSE2_INTRIN
  -- Performing Test HAVE_SSE2_INTRIN - Success
  -- Performing Test HAVE_SSSE3_INTRIN
  -- Performing Test HAVE_SSSE3_INTRIN - Success
  -- Performing Test HAVE_PCLMULQDQ_INTRIN
  -- Performing Test HAVE_PCLMULQDQ_INTRIN - Success
  -- Performing Test HAVE_VPCLMULQDQ_INTRIN
  -- Performing Test HAVE_VPCLMULQDQ_INTRIN - Success
  -- Performing Test HAVE_XSAVE_INTRIN
  -- Performing Test HAVE_XSAVE_INTRIN - Success
  -- Architecture-specific source files: arch/x86/x86_features.c;arch/x86/slide_hash_avx2.c;arch/x86/chunkset_avx2.c;arch/x86/compare256_avx2.c;arch/x86/adler32_avx2.c;arch/x86/adler32_avx512.c;arch/x86/adler32_avx512_vnni.c;arch/x86/adler32_sse42.c;arch/x86/insert_string_sse42.c;arch/x86/chunkset_sse2.c;arch/x86/compare256_sse2.c;arch/x86/slide_hash_sse2.c;arch/x86/adler32_ssse3.c;arch/x86/chunkset_ssse3.c;arch/x86/crc32_pclmulqdq.c;arch/x86/crc32_vpclmulqdq.c
  -- The following features have been enabled:

   * CMAKE_BUILD_TYPE, Build type: Debug (selected)
   * AVX2_SLIDEHASH, Support AVX2 optimized slide_hash, using "/arch:AVX2"
   * AVX2_CHUNKSET, Support AVX2 optimized chunkset, using "/arch:AVX2"
   * AVX2_COMPARE256, Support AVX2 optimized compare256, using "/arch:AVX2"
   * AVX2_ADLER32, Support AVX2-accelerated adler32, using "/arch:AVX2"
   * AVX512_ADLER32, Support AVX512-accelerated adler32, using "/arch:AVX512"
   * AVX512VNNI_ADLER32, Support AVX512VNNI adler32, using "/arch:AVX512"
   * SSE42_CRC, Support SSE4.2 optimized CRC hash generation, using ""
   * SSSE3_ADLER32, Support SSSE3-accelerated adler32, using ""
   * PCLMUL_CRC, Support CRC hash generation using PCLMULQDQ, using "  "
   * VPCLMUL_CRC, Support CRC hash generation using VPCLMULQDQ, using " /arch:AVX512"
   * XSAVE, Support XSAVE intrinsics using ""
   * WITH_GZFILEOP, Compile with support for gzFile related functions
   * ZLIBNG_ENABLE_TESTS, Test zlib-ng specific API
   * WITH_SANITIZER, Enable sanitizer support
   * WITH_GTEST, Build gtest_zlib
   * WITH_OPTIM, Build with optimisation
   * WITH_NEW_STRATEGIES, Use new strategies
   * WITH_AVX2, Build with AVX2
   * WITH_AVX512, Build with AVX512
   * WITH_AVX512VNNI, Build with AVX512 VNNI
   * WITH_SSE2, Build with SSE2
   * WITH_SSSE3, Build with SSSE3
   * WITH_SSE42, Build with SSE42
   * WITH_PCLMULQDQ, Build with PCLMULQDQ
   * WITH_VPCLMULQDQ, Build with VPCLMULQDQ

  -- The following features have been disabled:

   * ZLIB_SYMBOL_PREFIX, Publicly exported symbols DO NOT have a custom prefix
   * ZLIB_COMPAT, Compile with zlib compatible API
   * ZLIB_ENABLE_TESTS, Build test binaries
   * WITH_FUZZERS, Build test/fuzz
   * WITH_BENCHMARKS, Build test/benchmarks
   * WITH_BENCHMARK_APPS, Build application benchmarks
   * WITH_NATIVE_INSTRUCTIONS, Instruct the compiler to use the full instruction set on this host (gcc/clang -march=native)
   * WITH_MAINTAINER_WARNINGS, Build with project maintainer warnings
   * WITH_CODE_COVERAGE, Enable code coverage reporting
   * WITH_INFLATE_STRICT, Build with strict inflate distance checking
   * WITH_INFLATE_ALLOW_INVALID_DIST, Build with zero fill for inflate invalid distances
   * INSTALL_UTILS, Copy minigzip and minideflate during install

  -- Configuring done (67.7s)
  -- Generating done (0.1s)
  -- Build files have been written to: C:/Users/username/Repositories/js_playground/target/debug/build/libz-ng-sys-f3a4cecc015c50fc/out/build
  running: "cmake" "--build" "." "--target" "install" "--config" "Debug" "--parallel" "8"
  Microsoft (R) Build Engine version 17.1.0-preview-21601-01+01e6196d5 for .NET Framework
  Copyright (C) Microsoft Corporation. All rights reserved.

    1>Checking Build System
    Building Custom Rule C:/Users/username/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libz-ng-sys-1.1.12/src/zlib-ng/CMakeLists.txt
    adler32.c
    adler32_fold.c
    chunkset.c
    compare256.c
    compress.c
    cpu_features.c
    crc32_braid.c
    crc32_braid_comb.c
    crc32_fold.c
    deflate.c
    deflate_fast.c
    deflate_huff.c
    deflate_medium.c
    deflate_quick.c
    deflate_rle.c
    deflate_slow.c
    deflate_stored.c
    functable.c
    infback.c
    inflate.c
    Generating Code...
    Compiling...
    inftrees.c
    insert_string.c
    insert_string_roll.c
    slide_hash.c
    trees.c
    uncompr.c
    zutil.c
    x86_features.c
    adler32_sse42.c
    insert_string_sse42.c
    chunkset_sse2.c
    compare256_sse2.c
    slide_hash_sse2.c
    adler32_ssse3.c
    chunkset_ssse3.c
    crc32_pclmulqdq.c
    gzlib.c
    gzread.c
    gzwrite.c
    Generating Code...
    slide_hash_avx2.c
    chunkset_avx2.c
    compare256_avx2.c
    adler32_avx2.c
    Generating Code...
  C:\Users\username\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libz-ng-sys-1.1.12\src\zlib-ng\arch\x86\chunkset_avx2.c(79): fatal error C1001: Internal compiler error. [C:\Users\username\Repositories\js_playground\target\debug\build\libz-ng-sys-f3a4cecc015c50fc\out\build\zlib.vcxproj]
    (compiler file 'd:\a01\_work\5\s\src\vctools\Compiler\Utc\src\p2\main.c', line 220)
     To work around this problem, try simplifying or changing the program near the locations listed above.
    If possible please provide a repro here: https://developercommunity.visualstudio.com
    Please choose the Technical Support command on the Visual C++
     Help menu, or open the Technical Support help file for more information

  --- stderr
  CMake Warning:
    Manually-specified variables were not used by the project:

      CMAKE_ASM_FLAGS
      CMAKE_ASM_FLAGS_DEBUG
      CMAKE_CXX_FLAGS
      CMAKE_CXX_FLAGS_DEBUG

  thread 'main' panicked at '
  command did not execute successfully, got: exit code: 1

  build script failed, must exit now', C:\Users\username\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.50\src\lib.rs:1098:5
Byron commented 9 months ago

Thank you!

Since the error occur while compiling zlib-ng\arch\x86\chunkset_avx2.c using a C compiler, I recommend to post this information to the zlib-ng project instead.

Closing as out of scope. However, please feel free to reopen if this can and should be fixed here for reasons that weren't obvious.