llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libunwind

Author: Jon Chesterfield (JonChesterfield)

<details>
<summary>Changes</summary>

When a CMakeLists.txt is missing a 'project' statement you get the default 
supported languages of C and CXX. 
https://cmake.org/cmake/help/latest/command/project.html. The help says ASM 
should be listed last.

CMake doesn't raise an error about the .S files it has been told about when 
project is missing. It silently ignores them. In this case, the symptom is an 
undefined symbol *jumpto in the library.

Working theory for why this isn't more obviously broken everywhere is the 
'runtimes' CMakeLists.txt does contain a 'project' statement which lists ASM 
and/or by default linking shared libraries with undefined symbols succeeds.

The string immediately after project appears to be arbitrary, chosen 'Unwind' 
to match the capitalization of 'Runtimes'. 

For completeness, this also removes the following warning when building 
libunwind by itself:

&gt;CMake Warning (dev) in CMakeLists.txt:
&gt;  No project() command is present.  The top-level CMakeLists.txt file must
&gt;  contain a literal, direct call to the project() command.  Add a line of
&gt;  code such as
&gt;
&gt;    project(ProjectName)
&gt;
&gt;  near the top of the file, but after cmake_minimum_required().
&gt;
&gt;  CMake is pretending there is a "project(Project)" command on the first
&gt;  line.
&gt; This warning is for project developers.  Use -Wno-dev to suppress it.

This gives no hint that the consequence of ignoring this warning is cmake will 
ignore your assembly.

---
Full diff: https://github.com/llvm/llvm-project/pull/86351.diff


1 Files Affected:

- (modified) libunwind/CMakeLists.txt (+1) 


``````````diff
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 806d5a783ec39c..01d3b72b73e842 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -3,6 +3,7 @@
 
#===============================================================================
 
 cmake_minimum_required(VERSION 3.20.0)
+project(Unwind LANGUAGES C CXX ASM)
 
 set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/86351
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to