<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - CMake LANGUAGE property misused for .S assembler sources"
   href="https://bugs.llvm.org/show_bug.cgi?id=48234">48234</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CMake LANGUAGE property misused for .S assembler sources
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Build scripts
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>cmake
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>brad.king@kitware.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>CMake's "LANGUAGE" source file property is documented to mean that the source
file is *written* in the specified language.  However, several places in LLVM
are using "LANGUAGE C" to mean "use the C compiler":

*
<a href="https://github.com/llvm/llvm-project/blob/release/11.x/compiler-rt/cmake/Modules/AddCompilerRT.cmake#L110-L119">https://github.com/llvm/llvm-project/blob/release/11.x/compiler-rt/cmake/Modules/AddCompilerRT.cmake#L110-L119</a>

*
<a href="https://github.com/llvm/llvm-project/blob/release/11.x/libunwind/src/CMakeLists.txt#L32-L34">https://github.com/llvm/llvm-project/blob/release/11.x/libunwind/src/CMakeLists.txt#L32-L34</a>

*
<a href="https://github.com/llvm/llvm-project/blob/release/11.x/openmp/runtime/src/CMakeLists.txt#L119-L122">https://github.com/llvm/llvm-project/blob/release/11.x/openmp/runtime/src/CMakeLists.txt#L119-L122</a>

This usage is incorrect.

CMake 3.19.0 adds "-x c" when compiling source files with "LANGUAGE C" in order
to support C sources with non-standard extensions.  That was reported to CMake
as breaking LLVM:

* <a href="https://gitlab.kitware.com/cmake/cmake/-/issues/21469">https://gitlab.kitware.com/cmake/cmake/-/issues/21469</a>

CMake 3.19.1 will probably revert the change to restore compatibility, but a
policy will be added to make the change again in a compatible way.  The OLD
behavior of such a policy will be deprecated by definition, so LLVM needs to be
updated to stop doing this.

There is a comment in libunwind about the reason for "LANGUAGE C" being to work
around CMake not honoring OSX_ARCHITECTURES for assembly sources.  This has
been fixed in CMake 3.19.0:

* <a href="https://gitlab.kitware.com/cmake/cmake/-/issues/20771">https://gitlab.kitware.com/cmake/cmake/-/issues/20771</a>
* <a href="https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5152">https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5152</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>