[llvm-bugs] [Bug 48234] New: CMake LANGUAGE property misused for .S assembler sources

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 19 12:54:46 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48234

            Bug ID: 48234
           Summary: CMake LANGUAGE property misused for .S assembler
                    sources
           Product: Build scripts
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: brad.king at kitware.com
                CC: llvm-bugs at lists.llvm.org

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":

*
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/libunwind/src/CMakeLists.txt#L32-L34

*
https://github.com/llvm/llvm-project/blob/release/11.x/openmp/runtime/src/CMakeLists.txt#L119-L122

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:

* https://gitlab.kitware.com/cmake/cmake/-/issues/21469

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:

* https://gitlab.kitware.com/cmake/cmake/-/issues/20771
* https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5152

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201119/a5ad6a19/attachment.html>


More information about the llvm-bugs mailing list