Skip to content

Commit

Permalink
libdwarf: add version 0.11.1 (#26101)
Browse files Browse the repository at this point in the history
* libdwarf: add version 0.11.1

* Fix patches
  • Loading branch information
jeremy-rifkin authored Dec 9, 2024
1 parent e2ab219 commit 0a29941
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recipes/libdwarf/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.11.1":
url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.11.1.tar.gz"
sha256: "dfd24db87c354b3ba6fa72d29a481014f81768fea15ddcde96a8a938b1557c17"
"0.11.0":
url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.11.0.tar.gz"
sha256: "5135af38dc202206538a3dcdc90675aa8b320e132156849c6855dea5ea0c0729"
Expand All @@ -24,6 +27,10 @@ sources:
url: "https://www.prevanders.net/libdwarf-0.5.0.tar.xz"
sha256: "11fa822c60317fa00e1a01a2ac9e8388f6693e8662ab72d352c5f50c7e0112a9"
patches:
"0.11.1":
- patch_file: "patches/0.11.1-0001-fixes.patch"
patch_description: "fix DW_API definition and cmake"
patch_type: "portability"
"0.11.0":
- patch_file: "patches/0.10.1-0001-fixes.patch"
patch_description: "fix DW_API definition and cmake"
Expand Down
65 changes: 65 additions & 0 deletions recipes/libdwarf/all/patches/0.11.1-0001-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f219f078..d8a78136 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -228,6 +228,12 @@ if (ENABLE_DECOMPRESSION)
set(HAVE_ZSTD_H TRUE)
set(BUILT_WITH_ZLIB_AND_ZSTD TRUE)
endif()
+ find_package(zstd CONFIG REQUIRED)
+ if(TARGET zstd::libzstd_shared)
+ set(ZSTD_LIB zstd::libzstd_shared)
+ else()
+ set(ZSTD_LIB zstd::libzstd_static)
+ endif()
message(STATUS "Found libzstd : ${zstd_FOUND}")
message(STATUS "Found zlib : ${ZLIB_FOUND}")
message(STATUS "Build with zlib and zstd: ${BUILT_WITH_ZLIB_AND_ZSTD}")
diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt
index 02787555..862c97b8 100644
--- a/src/lib/libdwarf/CMakeLists.txt
+++ b/src/lib/libdwarf/CMakeLists.txt
@@ -117,7 +117,7 @@ install(TARGETS dwarf
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)

-configure_file(libdwarf.pc.in libdwarf.pc @ONLY)
+# configure_file(libdwarf.pc.in libdwarf.pc @ONLY)

# The install has to be here, not in
# another CMakeLists.txt to make install work properly
@@ -140,5 +140,5 @@ export(
NAMESPACE libdwarf::
FILE "${PROJECT_BINARY_DIR}/libdwarf-targets.cmake"
)
-install(FILES "${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+#install(FILES "${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(FILES "${PROJECT_SOURCE_DIR}/cmake/Findzstd.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libdwarf")
index 380d2ef7..8c62ee7e 100644
--- a/src/lib/libdwarf/libdwarf.h
+++ b/src/lib/libdwarf/libdwarf.h
@@ -51,7 +51,7 @@
#endif /* DW_API */

#ifndef LIBDWARF_STATIC
-# if defined(_WIN32) || defined(__CYGWIN__)
+# if defined(LIBDWARF_SHARED) && (defined(_WIN32) || defined(__CYGWIN__))
# ifdef LIBDWARF_BUILD
# define DW_API __declspec(dllexport)
# else /* !LIBDWARF_BUILD */
diff --git a/src/lib/libdwarf/libdwarf_private.h b/src/lib/libdwarf/libdwarf_private.h
index b37ae994..7fa89256 100644
--- a/src/lib/libdwarf/libdwarf_private.h
+++ b/src/lib/libdwarf/libdwarf_private.h
@@ -26,11 +26,7 @@
#ifdef _MSC_VER /* Macro to select VS compiler */
#include <windows.h>
typedef SSIZE_T ssize_t;
-#ifdef _WIN64
-typedef long long off_t;
-#else
typedef long off_t;
-#endif
#endif /* _MSC_VER */

#ifndef TRUE
2 changes: 2 additions & 0 deletions recipes/libdwarf/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.11.1":
folder: all
"0.11.0":
folder: all
"0.10.1":
Expand Down

0 comments on commit 0a29941

Please sign in to comment.