Skip to content

mingw-w64: Add compiling and running capability for mingw

Christopher Degawa requested to merge github/fork/1480c1/mingw into master

it will compile fine with gcc and clang from mingw-w64.

clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-w64-windows-gnu
Thread model: posix

gcc.exe (Rev1, Built by MSYS2 project) 8.3.0

However, only the clang produced version will actually properly run and produce a propper video. When trying to debug the gcc produced version, I get

(gdb)
Thread 22 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 27456.0x61d8]
0x000000006c00adae in get_top_vector (above=0xd8d8fd10 '\177' <repeats 128 times>, "`sÖ")
    at D:/msys64/home/cddeg/SVT-AV1/Source/Lib/Common/ASM_AVX2/EbIntraPrediction_Intrinsic_AVX2.c:10593
10593     return _mm256_inserti128_si256(_mm256_castsi128_si256(t0), t1, 1);
(gdb) bt
#0  0x000000006c00adae in get_top_vector (above=0xd8d8fd10 '\177' <repeats 128 times>, "`sÖ")
    at D:/msys64/home/cddeg/SVT-AV1/Source/Lib/Common/ASM_AVX2/EbIntraPrediction_Intrinsic_AVX2.c:10593
#1  0x000000006c00edf4 in aom_paeth_predictor_64x64_avx2 (
    dst=0x95d6df00 "\201\201\201\201\201\201\201\201\201", '\200' <repeats 24 times>, '\177' <repeats 31 times>, "\201\201\201\201\201\201\201\201\201", '\200' <repeats 24 times>, '\177' <repeats 31 times>, "\201\201\201\201\201\201\201\201\201", '\200' <repeats 24 times>, '\177' <repeats 31 times>, "\201\201\201\201\201\201\201\201"..., stride=64,
    above=0xd8d8fd10 '\177' <repeats 128 times>, "`sÖ", left=0xd8d8fc70 '\201' <repeats 128 times>)
    at D:/msys64/home/cddeg/SVT-AV1/Source/Lib/Common/ASM_AVX2/EbIntraPrediction_Intrinsic_AVX2.c:10826
#2  0x000000006bc97342 in intra_prediction_open_loop (p_angle=0, ois_intra_mode=12 '\f', src_origin_x=0,
    src_origin_y=0, tx_size=TX_64X64, above_row=0xd8d8fd10 '\177' <repeats 128 times>, "`sÖ",
    left_col=0xd8d8fc70 '\201' <repeats 128 times>, context_ptr=0x95d69530)
    at D:/msys64/home/cddeg/SVT-AV1/Source/Lib/Common/Codec/EbIntraPrediction.c:10367
#3  0x000000006bcc8ac1 in open_loop_intra_search_sb (picture_control_set_ptr=0x500780a0, sb_index=0,
    context_ptr=0x95d69530, input_ptr=0x86514aa0, asm_type=ASM_AVX2)
    at D:/msys64/home/cddeg/SVT-AV1/Source/Lib/Common/Codec/EbMotionEstimation.c:8728
#4  0x000000006bcca36b in MotionEstimationKernel (input_ptr=0x95d69530)
    at D:/msys64/home/cddeg/SVT-AV1/Source/Lib/Common/Codec/EbMotionEstimationProcess.c:602
#5  0x00007ffb70ba81f4 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#6  0x00007ffb70d4a251 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#7  0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

(lldb) Process 15424 crashed
* thread #31, stop reason = Exception 0xc0000005 encountered at address 0x6c00adae
    frame #0: 0x000000006c00adae libSvtAv1Enc.dll`get_top_vector(above=<unavailable>) at EbIntraPrediction_Intrinsic_AVX2.c:10593
   10590          const __m128i zero = _mm_setzero_si128();
   10591          const __m128i t0 = _mm_unpacklo_epi8(x, zero);
   10592          const __m128i t1 = _mm_unpackhi_epi8(x, zero);
-> 10593          return _mm256_inserti128_si256(_mm256_castsi128_si256(t0), t1, 1);
   10594        }
   10595
   10596        void aom_paeth_predictor_16x8_avx2(uint8_t *dst, ptrdiff_t stride,
bt
* thread #31, stop reason = Exception 0xc0000005 encountered at address 0x6c00adae
  * frame #0: 0x000000006c00adae libSvtAv1Enc.dll`get_top_vector(above=<unavailable>) at EbIntraPrediction_Intrinsic_AVX2.c:10593
    frame #1: 0x000000006c00edf4 libSvtAv1Enc.dll`aom_paeth_predictor_64x64_avx2(dst=<unavailable>, stride=<unavailable>, above=<unavailable>, left=<unavailable>) at EbIntraPrediction_Intrinsic_AVX2.c:10826
    frame #2: 0x000000006bc97342 libSvtAv1Enc.dll`intra_prediction_open_loop(p_angle=<unavailable>, ois_intra_mode=<unavailable>, src_origin_x=<unavailable>, src_origin_y=<unavailable>, tx_size=<unavailable>, above_row=<unavailable>, left_col=<unavailable>, context_ptr=<unavailable>) at EbIntraPrediction.c:10367
    frame #3: 0x000000006bcc8ac1 libSvtAv1Enc.dll`open_loop_intra_search_sb(picture_control_set_ptr=<unavailable>, sb_index=<unavailable>, context_ptr=<unavailable>, input_ptr=<unavailable>, asm_type=<unavailable>) at EbMotionEstimation.c:8728
    frame #4: 0x000000006bcca36b libSvtAv1Enc.dll`MotionEstimationKernel(input_ptr=<unavailable>) at EbMotionEstimationProcess.c:602
    frame #5: 0x00007ffb70ba81f4 kernel32.dll`BaseThreadInitThunk + 20
    frame #6: 0x00007ffb70d4a251 ntdll.dll`RtlUserThreadStart + 33

I'm not exactly sure why only clang works fine and not gcc.

Merge request reports