<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/69454>69454</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            fatal error when building the OpenBLAS ThunderX2 dynamic kernel for Windows on ARM
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          hmartinez82
      </td>
    </tr>
</table>

<pre>
    I gave it another try on building OpenBLAS with DYNAMIC_ARCH=ON (see https://github.com/msys2/MINGW-packages/blob/b07f75117ed0cfe6e1f000de7caaffb433cb8c80/mingw-w64-openblas/PKGBUILD#L72) for Windows on ARM after patching Clang with https://github.com/llvm/llvm-project/pull/67894
Is it possible that I also have to add another patch for supporting the whole fix or this something new related only to ThunderX2?

Clang is still crashing. 
```
[9616/15543] Building C object kernel/CMakeFiles/kernel_THUNDERX2T99.dir/CMakeFiles/dcopy_k_THUNDERX2T99.c.obj
FAILED: kernel/CMakeFiles/kernel_THUNDERX2T99.dir/CMakeFiles/dcopy_k_THUNDERX2T99.c.obj
C:\msys64\clangarm64\bin\clang.exe -IC:/M_P/mingw-w64-openblas/src/OpenBLAS-0.3.24/lapack-netlib/LAPACKE/include -IC:/M_P/mingw-w64-openblas/src/OpenBLAS-0.3.24 -IC:/M_P/mingw-w64-openblas/src/build-CLANGARM64-32/kernel_config/THUNDERX2T99 -Wno-unused-function -Wno-unused-variable  -DHAVE_C11 -DMS_ABI -fopenmp=libomp -DUSE_OPENMP -Wall -DF_INTERFACE_GFORT -DDYNAMIC_ARCH -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=64 -DMAX_PARALLEL_NUMBER=1 -DNO_AFFINITY -DVERSION="\"0.3.24\"" -DBUILD_SINGLE -DBUILD_DOUBLE -DBUILD_COMPLEX -DBUILD_COMPLEX16 -O3 -DNDEBUG -DBUILD_KERNEL -DTABLE_NAME=gotoblas_THUNDERX2T99  -DTS=_THUNDERX2T99 -MD -MT kernel/CMakeFiles/kernel_THUNDERX2T99.dir/CMakeFiles/dcopy_k_THUNDERX2T99.c.obj -MF kernel\CMakeFiles\kernel_THUNDERX2T99.dir\CMakeFiles\dcopy_k_THUNDERX2T99.c.obj.d -o kernel/CMakeFiles/kernel_THUNDERX2T99.dir/CMakeFiles/dcopy_k_THUNDERX2T99.c.obj -c C:/M_P/mingw-w64-openblas/src/build-CLANGARM64-32/kernel/CMakeFiles/dcopy_k_THUNDERX2T99.c
fatal error: error in backend: Failed to evaluate function length in SEH unwind info
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: C:\\msys64\\clangarm64\\bin\\clang.exe -IC:/M_P/mingw-w64-openblas/src/OpenBLAS-0.3.24/lapack-netlib/LAPACKE/include -IC:/M_P/mingw-w64-openblas/src/OpenBLAS-0.3.24 -IC:/M_P/mingw-w64-openblas/src/build-CLANGARM64-32/kernel_config/THUNDERX2T99 -Wno-unused-function -Wno-unused-variable -DHAVE_C11 -DMS_ABI -fopenmp=libomp -DUSE_OPENMP -Wall -DF_INTERFACE_GFORT -DDYNAMIC_ARCH -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=64 -DMAX_PARALLEL_NUMBER=1 -DNO_AFFINITY -DVERSION=\"0.3.24\" -DBUILD_SINGLE -DBUILD_DOUBLE -DBUILD_COMPLEX -DBUILD_COMPLEX16 -O3 -DNDEBUG -DBUILD_KERNEL -DTABLE_NAME=gotoblas_THUNDERX2T99 -DTS=_THUNDERX2T99 -MD -MT kernel/CMakeFiles/kernel_THUNDERX2T99.dir/CMakeFiles/dcopy_k_THUNDERX2T99.c.obj -MF kernel\\CMakeFiles\\kernel_THUNDERX2T99.dir\\CMakeFiles\\dcopy_k_THUNDERX2T99.c.obj.d -o kernel/CMakeFiles/kernel_THUNDERX2T99.dir/CMakeFiles/dcopy_k_THUNDERX2T99.c.obj -c C:/M_P/mingw-w64-openblas/src/build-CLANGARM64-32/kernel/CMakeFiles/dcopy_k_THUNDERX2T99.c
1. <eof> parser at end of file
2.      Code generation
3. Running pass 'Function Pass Manager' on module 'C:/M_P/mingw-w64-openblas/src/build-CLANGARM64-32/kernel/CMakeFiles/dcopy_k_THUNDERX2T99.c'.
4. Running pass 'AArch64 Assembly Printer' on function '@dcopy_k_THUNDERX2T99'
Exception Code: 0xE0000046
 #0 0x00007fff9ff06334 (C:\Windows\System32\KERNELBASE.dll+0x76334)
 #1 0x00007ffef8f85ad0 llvm::CrashRecoveryContext::HandleExit(int) (C:\msys64\clangarm64\bin\libLLVM-17.dll+0x85ad0)
 #2 0x00007ffef9029ff4 llvm::sys::Process::Exit(int, bool) (C:\msys64\clangarm64\bin\libLLVM-17.dll+0x129ff4)
 #3 0x00007ff7519b6fe8 llvm::InitializeAllAsmPrinters() (C:\msys64\clangarm64\bin\clang.exe+0x6fe8)
 #4 0x00007ffef8f9323c llvm::report_fatal_error(llvm::Twine const&, bool) (C:\msys64\clangarm64\bin\libLLVM-17.dll+0x9323c)
 #5 0x00007ffef8f9311c llvm::report_fatal_error(char const*, bool) (C:\msys64\clangarm64\bin\libLLVM-17.dll+0x9311c)
 #6 0x00007ffefa5e8f4c llvm::Win64EH::ARM64UnwindEmitter::Emit(llvm::MCStreamer&) const (C:\msys64\clangarm64\bin\libLLVM-17.dll+0x16e8f4c)
 #7 0x00007ffefa5de8d4 llvm::MCStreamer::emitWinCFIEndProc(llvm::SMLoc) (C:\msys64\clangarm64\bin\libLLVM-17.dll+0x16de8d4)
 #8 0x00007ffef9938478 llvm::WinException::endFuncletImpl() (C:\msys64\clangarm64\bin\libLLVM-17.dll+0xa38478)
 #9 0x00007ffef99380a8 llvm::WinException::endFunction(llvm::MachineFunction const*) (C:\msys64\clangarm64\bin\libLLVM-17.dll+0xa380a8)
#10 0x00007ffef98d848c llvm::AsmPrinter::emitFunctionBody() (C:\msys64\clangarm64\bin\libLLVM-17.dll+0x9d848c)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 17.0.2
Target: aarch64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/msys64/clangarm64/bin
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: C:/msys64/tmp/dcopy_k_THUNDERX2T99-ce9e97.c
clang: note: diagnostic msg: C:/msys64/tmp/dcopy_k_THUNDERX2T99-ce9e97.sh
clang: note: diagnostic msg:

********************
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
 Aborting...
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWVtv2zjT_jXMzUCGRMmyfZELWYfEWJ9gO033yqAkyuZWIg2SymF__QdSjg_Ztttu22_x4n0DIRZPw4fDmWc4FFGK7Tilt6g_Rv3khrR6L-TtviFSM07_HOKbXJSvtxPYkScKTAPhQu-pBC1fQXDIW1aXjO9gcaB8PI3W8Mz0HpLf59FsEm-jVXyP_GQxB4SHilLYa31QyI8QzhDOdkzv27xXiAbhrFGvCiOczSbzu0fnQIpPZEcVwllei9z8uINq0Pe8AS3doqIh9SrXdUs6KAipqjzw_SIfFkPXiGJ89-w8h4EjDpTnNTFilr_djR8m0wRhfzrACI-gEhIeGS_FszJriVYzIJWmEg5EF3uzqrgmfNct6SvI6_rp7cc5SPEHLTTC2aGta4SzcDAcBchNkBtNlNHgQSjF8pqC3hMNEyC1ErA36tUCSFmeVGxRWJCqPRyE2ZEd6D2F572oKVTsBYQEvWcKlGiotog5fQZJa6JpCYLXr0boZt_yksqPGPlZh6T7363ODNesrqGQRBkZPTh2Ct3j0xX741HohQhnXr8f-KifwPht92MQuVk2fKKSU7PseEY-0YzVdge72u3m_mGepKuPeDMa9Uom33crC3F43X667lf0RP5HhyCLJtM0QX70a6eJzS73Y2OPYYD6cWHURGRjCznjb1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