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

    <tr>
        <th>Summary</th>
        <td>
            libunwind: cmake build doesn't define it will use assembler files
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          0-wiz-0
      </td>
    </tr>
</table>

<pre>
    Building libunwind as a separate package for the pkgsrc software distribution, I noticed that (at least on NetBSD) the assembler files were not compiled at all.

`libunwind/src/CMakeLists.txt` has workarounds for macOS, mingw, and AIX where the assembler sources are defined to be 'C' source code. I guess this is working around the same issue, but I'm not sure.

Anyway, I filed a bug with CMake, but a CMake developer said [this was caused by libunwind not enabling assembler support](https://gitlab.kitware.com/cmake/cmake/-/issues/24308#note_1300126).
I tested the proposed fix, and it works for me.

Please add
```
enable_language(ASM)
```
at the top of libunwind/src/CMakeLists.txt, and find out if the following workaround:
```
# See add_asm_sources() in compiler-rt for explanation of this workaround.
# CMake doesn't work correctly with assembly on AIX. Workaround by compiling
# as C files as well.
if((APPLE AND CMAKE_VERSION VERSION_LESS 3.19) OR
   (MINGW AND CMAKE_VERSION VERSION_LESS 3.17) OR
   (${CMAKE_SYSTEM_NAME} MATCHES "AIX"))
 set_source_files_properties(${LIBUNWIND_ASM_SOURCES} PROPERTIES LANGUAGE C)
endif()
```
is really needed.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVd2OozgTfRrnphQEJglwkQvyNx_6OulWM7MzexUZKIi3HYxsM0z26Vc2dHpa3dKuFMUgUVXnnDpVZlrzpkVck-WGLHcz1puLVGt_PvC_5_6skNVtvem5qHjbgOBF3w68rYBpYKCxY4oZhI6VL6xBqKUCc0HoXhqtStCyNgNTCBXXRvGiN1y2hG4hg1YaXmIF5sIMEBozAwKZNiBbOKHZ5DtCE5eLaY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