symbolizer-path
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Sat, 4 May 2024 05:30:47 +0000 (07:30 +0200)
committerGianfranco Costamagna <locutusofborg@debian.org>
Sat, 4 May 2024 05:30:47 +0000 (07:30 +0200)
===================================================================

Gbp-Pq: Name symbolizer-path.diff

compiler-rt/lib/sanitizer_common/CMakeLists.txt
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp

index 59ab17317f93e7a565a72dd8d13bb21721f1d25d..c38d484be7775512b272f0e6f5ef9eaccbad41f9 100644 (file)
@@ -209,6 +209,7 @@ set(SANITIZER_IMPL_HEADERS
   )
 
 include_directories(..)
+include_directories(${LLVM_INCLUDE_DIR})
 
 set(SANITIZER_COMMON_DEFINITIONS
   HAVE_RPC_XDR_H=${HAVE_RPC_XDR_H})
index 1a5e38faea88747c35894299673515076ccbc5b1..8a9596b5f9d0c533a72b24a944fb18ce794c1338 100644 (file)
 #  include "sanitizer_symbolizer_libbacktrace.h"
 #  include "sanitizer_symbolizer_mac.h"
 
+#include "llvm/Config/llvm-config.h" // for LLVM_VERSION_MAJOR
+
+#define TOSTR2(X) #X
+#define TOSTR(X) TOSTR2(X)
+
 // C++ demangling function, as required by Itanium C++ ABI. This is weak,
 // because we do not require a C++ ABI library to be linked to a program
 // using sanitizers; if it's not present, we'll just use the mangled name.
@@ -451,7 +456,7 @@ static SymbolizerTool *ChooseExternalSymbolizer(LowLevelAllocator *allocator) {
     return new(*allocator) AtosSymbolizer(found_path, allocator);
   }
 #endif  // SANITIZER_APPLE
-  if (const char *found_path = FindPathToBinary("llvm-symbolizer")) {
+  if (const char *found_path = "/usr/bin/llvm-symbolizer-" TOSTR(LLVM_VERSION_MAJOR)) {
     VReport(2, "Using llvm-symbolizer found at: %s\n", found_path);
     return new(*allocator) LLVMSymbolizer(found_path, allocator);
   }