Skip to content

Commit

Permalink
Try to get 0.9.1 good to go
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Feb 4, 2024
1 parent 3cf036e commit 132bf9f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 18 deletions.
14 changes: 7 additions & 7 deletions recipes/libdwarf/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sources:
# "0.9.1":
# url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.9.1.tar.gz"
# sha256: "6da3f46a9f92b4e284c97c733851879d9b91b16642bede90c7614860a946824e"
"0.9.1":
url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.9.1.tar.gz"
sha256: "6da3f46a9f92b4e284c97c733851879d9b91b16642bede90c7614860a946824e"
"0.9.0":
url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.9.0.tar.gz"
sha256: "6d4c0ee8a869e68dfeb15c99b869cafca7a5f715ecfc699cbf4fd30729b33226"
Expand All @@ -18,10 +18,10 @@ sources:
url: "https://www.prevanders.net/libdwarf-20191104.tar.gz"
sha256: "45f50a966314421b7dab525859853616df6c9680f0ccf2f44b030c505236eaba"
patches:
# "0.9.1":
# - patch_file: "patches/0.9.1-0001-fixes.patch"
# patch_description: "fix DW_API definition and cmake"
# patch_type: "portability"
"0.9.1":
- patch_file: "patches/0.9.1-0001-fixes.patch"
patch_description: "fix DW_API definition and cmake"
patch_type: "portability"
"0.9.0":
- patch_file: "patches/0.9.0-0001-fixes.patch"
patch_description: "fix DW_API definition and cmake"
Expand Down
46 changes: 37 additions & 9 deletions recipes/libdwarf/all/patches/0.9.1-0001-fixes.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 70839abd..bac973c3 100644
index 70839abd..04b0f86f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -198,6 +198,12 @@ if (ENABLE_DECOMPRESSION)
@@ -196,6 +196,12 @@ if (ENABLE_DECOMPRESSION)
set(HAVE_ZSTD TRUE)
set(HAVE_ZSTD_H 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()
endif ()

+if(TARGET zstd::libzstd_shared)
+ add_library(ZSTD::ZSTD ALIAS zstd::libzstd_shared)
+else()
+ add_library(ZSTD::ZSTD ALIAS zstd::libzstd_static)
+endif()
+
message(STATUS "CMAKE_SIZEOF_VOID_P ... " ${CMAKE_SIZEOF_VOID_P} )

# DW_FWALLXX are gnu C++ options.
diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt
index 7500c9f4..6024d246 100644
index 7500c9f4..2cb66e72 100644
--- a/src/lib/libdwarf/CMakeLists.txt
+++ b/src/lib/libdwarf/CMakeLists.txt
@@ -105,7 +105,7 @@ target_include_directories(dwarf PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
if(ZLIB_FOUND AND ZSTD_FOUND)
- target_link_libraries(dwarf PRIVATE ZLIB::ZLIB ZSTD::ZSTD )
+ target_link_libraries(dwarf PRIVATE ZLIB::ZLIB ${ZSTD_LIB} )
endif()
set_target_properties(dwarf PROPERTIES PUBLIC_HEADER "libdwarf.h;dwarf.h")

@@ -116,7 +116,7 @@ install(TARGETS dwarf
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
Expand All @@ -34,6 +45,7 @@ index 7500c9f4..6024d246 100644
install(FILES cmake/libdwarf-config.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libdwarf")
-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")

diff --git a/src/lib/libdwarf/libdwarf.h b/src/lib/libdwarf/libdwarf.h
index 380d2ef7..8c62ee7e 100644
--- a/src/lib/libdwarf/libdwarf.h
Expand All @@ -47,3 +59,19 @@ index 380d2ef7..8c62ee7e 100644
# 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
4 changes: 2 additions & 2 deletions recipes/libdwarf/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
versions:
# "0.9.1":
# folder: all
"0.9.1":
folder: all
"0.9.0":
folder: all
"0.8.0":
Expand Down

0 comments on commit 132bf9f

Please sign in to comment.