Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libdwarf: add version 0.9.0 #21817

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.9.0":
url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.9.0.tar.gz"
sha256: "6d4c0ee8a869e68dfeb15c99b869cafca7a5f715ecfc699cbf4fd30729b33226"
"0.8.0":
url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.8.0.tar.gz"
sha256: "8ef0dbfb0816b02aac97b87426689ebaa4efb8ec2ca2c759ea34c5e4678dff3f"
Expand All @@ -12,6 +15,10 @@ sources:
url: "https://www.prevanders.net/libdwarf-20191104.tar.gz"
sha256: "45f50a966314421b7dab525859853616df6c9680f0ccf2f44b030c505236eaba"
patches:
"0.9.0":
- patch_file: "patches/0.9.0-0001-fixes.patch"
patch_description: "fix DW_API definition and cmake"
patch_type: "portability"
"0.8.0":
- patch_file: "patches/0.8.0-0001-fixes.patch"
patch_description: "fix DW_API definition and cmake"
Expand Down
4 changes: 3 additions & 1 deletion recipes/libdwarf/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, rename
from conan.tools.build import cross_building
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.scm import Version
import os

required_conan_version = ">=1.53.0"
Expand All @@ -13,7 +14,6 @@ class LibdwarfConan(ConanFile):
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://www.prevanders.net/dwarf.html"
topics = ("debug", "dwarf", "dwarf2", "elf")

package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
Expand Down Expand Up @@ -50,6 +50,8 @@ def requirements(self):
if self.options.with_dwarfgen or self.version == "20191104":
self.requires("libelf/0.8.13")
self.requires("zlib/[>=1.2.11 <2]")
if self.version != "20191104" and Version(self.version) >= "0.9.0":
self.requires("zstd/1.5.5")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down
66 changes: 66 additions & 0 deletions recipes/libdwarf/all/patches/0.9.0-0001-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
diff --git a/src/bin/dwarfdump/CMakeLists.txt b/src/bin/dwarfdump/CMakeLists.txt
index 6d2c328..bc10581 100644
--- a/src/bin/dwarfdump/CMakeLists.txt
+++ b/src/bin/dwarfdump/CMakeLists.txt
@@ -68,7 +68,7 @@ target_compile_options(dwarfdump PRIVATE ${DW_FWALL})

target_link_libraries(dwarfdump PRIVATE dwarf)

-if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+if(0)
set(SUFFIX 64)
endif()
set(LIBDIR lib${SUFFIX})
diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt
index 4ad5c4f..22143c0 100644
--- a/src/lib/libdwarf/CMakeLists.txt
+++ b/src/lib/libdwarf/CMakeLists.txt
@@ -108,10 +108,14 @@ 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 )
+ if (TARGET zstd::libzstd_shared)
+ target_link_libraries(dwarf PRIVATE ZLIB::ZLIB zstd::libzstd_shared)
+ else()
+ target_link_libraries(dwarf PRIVATE ZLIB::ZLIB zstd::libzstd_static)
+ endif()
endif()

-set(SUFFIX $<$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>:64>)
+#set(SUFFIX $<$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>:64>)
set(LIBDIR lib${SUFFIX})
set(BINDIR bin${SUFFIX})

@@ -120,7 +124,7 @@ install(TARGETS dwarf
LIBRARY DESTINATION ${LIBDIR}
ARCHIVE DESTINATION ${LIBDIR})

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

# The install has to be here, not in
# another CMakeLists.txt to make install work properly
@@ -145,6 +149,6 @@ install(
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.h
DESTINATION include/libdwarf)
-install( FILES ${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc
- DESTINATION lib/pkgconfig
-)
+#install( FILES ${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc
+# DESTINATION lib/pkgconfig
+#)
diff --git a/src/lib/libdwarf/libdwarf.h b/src/lib/libdwarf/libdwarf.h
index ed3d1d0..91f2fd8 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 */
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.9.0":
folder: all
"0.8.0":
folder: all
"0.7.0":
Expand Down