Skip to content

Conversation

@llvmbot
Copy link
Member

@llvmbot llvmbot commented Feb 3, 2025

Backport cb2598d

Requested by: @brad0

@llvmbot llvmbot added this to the LLVM 20.X Release milestone Feb 3, 2025
@llvmbot
Copy link
Member Author

llvmbot commented Feb 3, 2025

@tblah What do you think about merging this PR to the release branch?

@llvmbot llvmbot requested a review from tblah February 3, 2025 15:10
@llvmbot llvmbot added flang:runtime flang Flang issues not falling into any other category labels Feb 3, 2025
@llvmbot
Copy link
Member Author

llvmbot commented Feb 3, 2025

@llvm/pr-subscribers-flang-runtime

Author: None (llvmbot)

Changes

Backport cb2598d

Requested by: @brad0


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

1 Files Affected:

  • (modified) flang/runtime/CMakeLists.txt (+7-2)
diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt
index fbfaae9a8806486..bf27a121e4d174c 100644
--- a/flang/runtime/CMakeLists.txt
+++ b/flang/runtime/CMakeLists.txt
@@ -59,10 +59,15 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
     )
 endif()
 
+set(linked_libraries FortranDecimal)
+
 # function checks
 find_package(Backtrace)
 set(HAVE_BACKTRACE ${Backtrace_FOUND})
 set(BACKTRACE_HEADER ${Backtrace_HEADER})
+if(HAVE_BACKTRACE)
+  list(APPEND linked_libraries ${Backtrace_LIBRARY})
+endif()
 
 include(CheckCXXSymbolExists)
 include(CheckCXXSourceCompiles)
@@ -271,7 +276,7 @@ if (NOT DEFINED MSVC)
   add_flang_library(FortranRuntime
     ${sources}
     LINK_LIBS
-    FortranDecimal
+    ${linked_libraries}
 
     INSTALL_WITH_TOOLCHAIN
   )
@@ -279,7 +284,7 @@ else()
   add_flang_library(FortranRuntime
     ${sources}
     LINK_LIBS
-    FortranDecimal
+    ${linked_libraries}
   )
   set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
   add_flang_library(FortranRuntime.static ${sources}

)

Fixes building the backtrace support on FreeBSD/NetBSD/OpenBSD/DragonFly and musl
libc with libexecinfo.

(cherry picked from commit cb2598d)
@tstellar tstellar merged commit 8fe8a86 into llvm:release/20.x Feb 5, 2025
4 of 6 checks passed
@github-actions
Copy link

github-actions bot commented Feb 5, 2025

@brad0 (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:runtime flang Flang issues not falling into any other category

Projects

Development

Successfully merging this pull request may close these issues.

4 participants