diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/elfutils | |
Diffstat (limited to 'vcpkg/ports/elfutils')
| -rw-r--r-- | vcpkg/ports/elfutils/disable-werror.diff | 20 | ||||
| -rw-r--r-- | vcpkg/ports/elfutils/link-libs.diff | 102 | ||||
| -rw-r--r-- | vcpkg/ports/elfutils/portfile.cmake | 96 | ||||
| -rw-r--r-- | vcpkg/ports/elfutils/rpath-link.diff | 26 | ||||
| -rw-r--r-- | vcpkg/ports/elfutils/static-tools.diff | 12 | ||||
| -rw-r--r-- | vcpkg/ports/elfutils/vcpkg.json | 40 |
6 files changed, 296 insertions, 0 deletions
diff --git a/vcpkg/ports/elfutils/disable-werror.diff b/vcpkg/ports/elfutils/disable-werror.diff new file mode 100644 index 0000000..be6a77f --- /dev/null +++ b/vcpkg/ports/elfutils/disable-werror.diff @@ -0,0 +1,20 @@ +diff --git a/config/eu.am b/config/eu.am +index e6c241f..4136e7c 100644 +--- a/config/eu.am ++++ b/config/eu.am +@@ -99,7 +99,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ + $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ + $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ + $(USE_AFTER_FREE3_WARNING) \ +- $(if $($(*F)_no_Werror),,-Werror) \ + $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ + $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \ +@@ -109,7 +108,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \ + $(TRAMPOLINES_WARNING) \ + $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ + $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ +- $(if $($(*F)_no_Werror),,-Werror) \ + $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ + $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \ diff --git a/vcpkg/ports/elfutils/link-libs.diff b/vcpkg/ports/elfutils/link-libs.diff new file mode 100644 index 0000000..7023345 --- /dev/null +++ b/vcpkg/ports/elfutils/link-libs.diff @@ -0,0 +1,102 @@ +diff --git a/config/libdw.pc.in b/config/libdw.pc.in +index 2e83a43..bdfc808 100644 +--- a/config/libdw.pc.in ++++ b/config/libdw.pc.in +@@ -18,5 +18,4 @@ Requires: libelf = @VERSION@ + # We support various compressed ELF images, but don't export any of the + # data structures or functions. zlib (gz) is always required, bzip2 (bz2) + # lzma (xz) and zstd () are optional. But bzip2 doesn't have a pkg-config file. +-Requires.private: zlib @LIBLZMA@ @LIBZSTD@ +-Libs.private: @BZ2_LIB@ ++Requires.private: zlib @LIBLZMA@ @LIBZSTD@ bzip2 +diff --git a/configure.ac b/configure.ac +index f191488..fe617ac 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -429,6 +429,8 @@ AM_CONDITIONAL(TESTS_RPATH, test "$tests_use_rpath" = yes) + dnl zlib is mandatory. + save_LIBS="$LIBS" + LIBS= ++PKG_PROG_PKG_CONFIG ++PKG_CHECK_MODULES([ZLIB], [zlib], [LIBS="$ZLIB_LIBS $LIBS"], AC_MSG_ERROR([zlib not found])) + eu_ZIPLIB(zlib,ZLIB,z,gzdirect,gzip) + AS_IF([test "x$with_zlib" = xno], [AC_MSG_ERROR([zlib not found but is required])]) + LIBS="$save_LIBS" +@@ -437,18 +439,21 @@ dnl Test for bzlib and xz/lzma/zstd, gives BZLIB/LZMALIB/ZSTD .am + dnl conditional and config.h USE_BZLIB/USE_LZMALIB/USE_ZSTD #define. + save_LIBS="$LIBS" + LIBS= ++PKG_CHECK_MODULES([BZLIB], [bzip2], [LIBS="$BZLIB_LIBS $LIBS"], AC_MSG_ERROR([bzip2 not found])) + eu_ZIPLIB(bzlib,BZLIB,bz2,BZ2_bzdopen,bzip2) + # We need this since bzip2 doesn't have a pkgconfig file. + BZ2_LIB="$LIBS" + AC_SUBST([BZ2_LIB]) + save_LIBS="$LIBS" + LIBS= ++PKG_CHECK_MODULES([LZMA], [liblzma], [LIBS="$LZMA_LIBS $LIBS"], AC_MSG_ERROR([liblzma not found])) + eu_ZIPLIB(lzma,LZMA,lzma,lzma_auto_decoder,[LZMA (xz)]) + lzma_LIBS="$LIBS" + LIBS="$lzma_LIBS $save_LIBS" + AS_IF([test "x$with_lzma" = xyes], [LIBLZMA="liblzma"], [LIBLZMA=""]) + AC_SUBST([lzma_LIBS]) + AC_SUBST([LIBLZMA]) ++PKG_CHECK_MODULES([ZSTD], [libzstd], [LIBS="$ZSTDLIBS $LIBS"], AC_MSG_ERROR([libzstd not found])) + eu_ZIPLIB(zstd,ZSTD,zstd,ZSTD_decompress,[ZSTD (zst)]) + AS_IF([test "x$with_zstd" = xyes], [LIBZSTD="libzstd"], [LIBLZSTD=""]) + AC_SUBST([LIBZSTD]) +diff --git a/debuginfod/Makefile.am b/debuginfod/Makefile.am +index 0a129fa..b90ed23 100644 +--- a/debuginfod/Makefile.am ++++ b/debuginfod/Makefile.am +@@ -42,8 +42,8 @@ program_transform_name = s,x,x, + + if BUILD_STATIC + libasm = ../libasm/libasm.a +-libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread +-libelf = ../libelf/libelf.a -lz ++libdw = ../libdw/libdw.a $(ZLIB_LIBS) $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread ++libelf = ../libelf/libelf.a $(ZLIB_LIBS) $(zip_LIBS) + if DUMMY_LIBDEBUGINFOD + libdebuginfod = ./libdebuginfod.a + else +diff --git a/libdw/Makefile.am b/libdw/Makefile.am +index 5363c02..045cde5 100644 +--- a/libdw/Makefile.am ++++ b/libdw/Makefile.am +@@ -110,7 +110,7 @@ libdw_so_LIBS = ../libebl/libebl_pic.a ../backends/libebl_backends_pic.a \ + ../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \ + ../libdwfl/libdwfl_pic.a ../libdwfl_stacktrace/libdwfl_stacktrace_pic.a + libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so +-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LIBS) $(obstack_LIBS) $(zip_LIBS) -pthread ++libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl $(ZLIB_LIBS) $(argp_LDADD) $(fts_LIBS) $(obstack_LIBS) $(zip_LIBS) -pthread + libdw.so: $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS) + $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ + -Wl,--soname,$@.$(VERSION),--enable-new-dtags \ +diff --git a/libelf/Makefile.am b/libelf/Makefile.am +index 3402863..30a331e 100644 +--- a/libelf/Makefile.am ++++ b/libelf/Makefile.am +@@ -106,7 +106,7 @@ libelf_pic_a_SOURCES = + am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os) + + libelf_so_DEPS = ../lib/libeu.a +-libelf_so_LDLIBS = $(libelf_so_DEPS) -lz $(zstd_LIBS) ++libelf_so_LDLIBS = $(libelf_so_DEPS) $(ZLIB_LIBS) $(zstd_LIBS) + if USE_LOCKS + libelf_so_LDLIBS += -lpthread + endif +diff --git a/src/Makefile.am b/src/Makefile.am +index 6bdf2df..2fd5b42 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -54,8 +54,8 @@ CLEANFILES = $(bin_SCRIPTS) $(EXTRA_libar_a_DEPENDENCIES) + + if BUILD_STATIC + libasm = ../libasm/libasm.a +-libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread +-libelf = ../libelf/libelf.a -lz $(zstd_LIBS) ++libdw = ../libdw/libdw.a $(ZLIB_LIBS) $(zip_LIBS) $(libelf) -ldl -lpthread ++libelf = ../libelf/libelf.a $(ZLIB_LIBS) $(zstd_LIBS) + if LIBDEBUGINFOD + libdebuginfod = ../debuginfod/libdebuginfod.a -lpthread $(libcurl_LIBS) $(crypto_LIBS) $(jsonc_LIBS) + else diff --git a/vcpkg/ports/elfutils/portfile.cmake b/vcpkg/ports/elfutils/portfile.cmake new file mode 100644 index 0000000..bcf2d77 --- /dev/null +++ b/vcpkg/ports/elfutils/portfile.cmake @@ -0,0 +1,96 @@ +vcpkg_download_distfile(ARCHIVE
+ URLS "https://sourceware.org/pub/elfutils/${VERSION}/elfutils-${VERSION}.tar.bz2"
+ "https://www.mirrorservice.org/sites/sourceware.org/pub/elfutils/${VERSION}/elfutils-${VERSION}.tar.bz2"
+ FILENAME "elfutils-${VERSION}.tar.bz2"
+ SHA512 557e328e3de0d2a69d09c15a9333f705f3233584e2c6a7d3ce855d06a12dc129e69168d6be64082803630397bd64e1660a8b5324d4f162d17922e10ddb367d76
+)
+
+vcpkg_extract_source_archive(SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ PATCHES
+ disable-werror.diff
+ link-libs.diff
+ rpath-link.diff
+ static-tools.diff
+)
+
+vcpkg_find_acquire_program(FLEX)
+get_filename_component(FLEX_DIR "${FLEX}" DIRECTORY )
+vcpkg_add_to_path(PREPEND "${FLEX_DIR}")
+vcpkg_find_acquire_program(BISON)
+get_filename_component(BISON_DIR "${BISON}" DIRECTORY )
+vcpkg_add_to_path(PREPEND "${BISON_DIR}")
+
+set(options "")
+
+if("libdebuginfod" IN_LIST FEATURES)
+ list(APPEND options "--enable-libdebuginfod=yes")
+else()
+ list(APPEND options "--enable-libdebuginfod=no")
+endif()
+
+if("nls" IN_LIST FEATURES)
+ vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gettext/bin")
+else()
+ set(ENV{AUTOPOINT} true) # the program
+ list(APPEND options "--enable-nls=no")
+endif()
+
+vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTOCONFIG
+ OPTIONS
+ ${options}
+ --enable-debuginfod=no
+ --with-bzlib
+ --with-lzma
+ --with-zlib
+ --with-zstd
+)
+
+vcpkg_install_make()
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/etc"
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/etc/debuginfod"
+ "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug"
+)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ set(wrong_suffix "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}")
+else()
+ set(wrong_suffix "${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}")
+endif()
+file(GLOB wrong_libs
+ "${CURRENT_PACKAGES_DIR}/lib/*${wrong_suffix}"
+ "${CURRENT_PACKAGES_DIR}/lib/*${wrong_suffix}.*"
+ "${CURRENT_PACKAGES_DIR}/debug/lib/*${wrong_suffix}"
+ "${CURRENT_PACKAGES_DIR}/debug/lib/*${wrong_suffix}.*"
+)
+file(REMOVE ${wrong_libs})
+
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/eu-make-debug-archive" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../..")
+if("libdebuginfod" IN_LIST FEATURES)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/etc/profile.d/debuginfod.sh" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../..")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/etc/profile.d/debuginfod.csh" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../..")
+endif()
+
+vcpkg_install_copyright(
+ COMMENT [[
+The libraries are subject to LGPL-3.0-or-later OR GPL-2.0-or-later (cf. COPYING-LGPLV3, COPYING-GPLV2).
+The tools are subject to GPL-3.0-or-later (cf. COPYING).
+For additional terms, see the following source files:
+- doc/readelf.1 (GFDL-NIV-1.3)
+- lib/stdatomic-fbsd.h (BSD-2-Clause)
+- libcpu/i386_parse.* (GPL-3+ with Bison exception)
+- libelf/dl-hash.h (LGPL-2.1+)
+- libelf/elf.h (LGPL-2.1+)
+]]
+ FILE_LIST
+ "${SOURCE_PATH}/COPYING-LGPLV3"
+ "${SOURCE_PATH}/COPYING"
+ "${SOURCE_PATH}/COPYING-GPLV2"
+)
diff --git a/vcpkg/ports/elfutils/rpath-link.diff b/vcpkg/ports/elfutils/rpath-link.diff new file mode 100644 index 0000000..9db4533 --- /dev/null +++ b/vcpkg/ports/elfutils/rpath-link.diff @@ -0,0 +1,26 @@ +diff --git a/debuginfod/Makefile.am b/debuginfod/Makefile.am +index db27b2a..b90ed23 100644 +--- a/debuginfod/Makefile.am ++++ b/debuginfod/Makefile.am +@@ -58,7 +58,7 @@ endif + libebl = ../libebl/libebl.a + libeu = ../lib/libeu.a + +-AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw:. ++AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw:.:$(libdir) + + bin_PROGRAMS = + if DEBUGINFOD +diff --git a/src/Makefile.am b/src/Makefile.am +index 8e35512..33f7f4b 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -26,7 +26,7 @@ AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ + -I$(srcdir)/../libdwfl -I$(srcdir)/../libdwfl_stacktrace \ + -I$(srcdir)/../libasm -I../debuginfod + +-AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw $(STACK_USAGE_NO_ERROR) ++AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw:$(libdir) $(STACK_USAGE_NO_ERROR) + + bin_PROGRAMS = readelf nm size strip elflint findtextrel addr2line \ + elfcmp objdump ranlib strings ar unstrip stack elfcompress \ diff --git a/vcpkg/ports/elfutils/static-tools.diff b/vcpkg/ports/elfutils/static-tools.diff new file mode 100644 index 0000000..35ea05f --- /dev/null +++ b/vcpkg/ports/elfutils/static-tools.diff @@ -0,0 +1,12 @@ +diff --git a/configure.ac b/configure.ac +index bbe8673..7bb1b0e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -415,6 +415,7 @@ AS_HELP_STRING([--enable-install-elfh],[install elf.h in include dir]), + AM_CONDITIONAL(INSTALL_ELFH, test "$install_elfh" = yes) + + AM_CONDITIONAL(BUILD_STATIC, [dnl ++test "$enable_static" = yes || + test "$use_gprof" = yes -o "$use_gcov" = yes]) + + AC_ARG_ENABLE([tests-rpath], diff --git a/vcpkg/ports/elfutils/vcpkg.json b/vcpkg/ports/elfutils/vcpkg.json new file mode 100644 index 0000000..c640617 --- /dev/null +++ b/vcpkg/ports/elfutils/vcpkg.json @@ -0,0 +1,40 @@ +{ + "name": "elfutils", + "version": "0.193", + "description": "elfutils is a collection of utilities and libraries to read, create and modify ELF binary files, find and handle DWARF debug data, symbols, thread state and stacktraces for processes and core files on GNU/Linux.", + "homepage": "https://sourceware.org/elfutils/", + "license": null, + "supports": "linux", + "dependencies": [ + "bzip2", + "liblzma", + "zlib", + "zstd" + ], + "features": { + "libdebuginfod": { + "description": "Build the debuginfod library.", + "dependencies": [ + { + "name": "curl", + "default-features": false + }, + "json-c" + ] + }, + "nls": { + "description": "Enable native language support", + "dependencies": [ + { + "name": "gettext", + "host": true, + "default-features": false, + "features": [ + "tools" + ] + }, + "gettext-libintl" + ] + } + } +} |