Skip to content

Commit

Permalink
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
Delphix Engineering committed Jan 2, 2025
2 parents 5049f1c + 7f70848 commit 6af475d
Show file tree
Hide file tree
Showing 88 changed files with 2,241 additions and 10,723 deletions.
5 changes: 1 addition & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@

ACLOCAL_AMFLAGS = -I m4

SUBDIRS = include src tests examples
if BUILD_PYTHON_EXT
SUBDIRS += python
endif
SUBDIRS = include src tests tools examples

dist_noinst_DATA = \
COPYING.GPLv2 \
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
next
----
* Remove legacy Python bindings. Use pykdumpfile instead.

0.5.5
-----
* Incompatible API changes:
- kdump_get_typed_attr(): parameters and type mismatch behaviour
- kdump_attr_ref_get(): result must be discarded
Expand All @@ -8,6 +12,7 @@ next
* Parse QEMU CPU state ELF notes.
* Use kernel page tables when initializing X86-64 Linux with PTI from
CR3 register value.
* Include the kdumpid utility.
* Fix direct mapping if LDT PTI remapping is used in Linux on X86-64.
* Minor cache improvements and a NULL-pointer dereference fix.
* Fix test suite for 32-bit architectures.
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ To compile this package, you'll need the following:
* [GCC](http://gcc.gnu.org/). The source uses a few construct specific
to GCC (such as variable attributes). Porting should be easy, though.

If you want to build kdumpid, you'll also need:

* [BFD](http://www.gnu.org/software/binutils/). Any version with
disassemblers for x86, ppc and s390 will do. This usually comes with
the distro packaged as binutils-devel or similar.

To create documentation files, you'll need:

* [Doxygen](http://www.doxygen.org/). Usually packaged as doxygen.
Expand Down Expand Up @@ -50,8 +56,7 @@ To generate the `configure` script, run
Python
------

This repository contains some manually written Python bindings. These are now
deprecated in favour of a fresh rewrite using CFFI. See
There are official Python bindings for `libkdumpfile`; see
[pykdumpfile](https://github.com/ptesarik/pykdumpfile).

Making Releases
Expand Down
15 changes: 11 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
dnl Package release versioning
m4_define([pkg_major_version], [0])
m4_define([pkg_minor_version], [5])
m4_define([pkg_micro_version], [4])
m4_define([pkg_micro_version], [5])
m4_define([pkg_version],
[pkg_major_version.pkg_minor_version.pkg_micro_version])

dnl FIXME: kdumpid has a different versioning scheme
m4_define([kdumpid_major_version], [1])
m4_define([kdumpid_minor_version], [7])

AC_INIT([libkdumpfile],[pkg_version],[[email protected]])

AC_CONFIG_SRCDIR([src/kdumpfile/diskdump.c])
Expand Down Expand Up @@ -101,8 +105,10 @@ AC_ARG_ENABLE(debug,
AS_IF([test "x$enable_debug" = xyes],
[AC_DEFINE(ENABLE_DEBUG, 1, Define to enable extra debugging features)])

dnl check for Python
kdump_PYTHON([2.7.0])
dnl check whether to build optional tools
AC_SUBST(KDUMPID_VER_MAJOR, kdumpid_major_version)
AC_SUBST(KDUMPID_VER_MINOR, kdumpid_minor_version)
KDUMP_TOOL_KDUMPID

AC_CONFIG_FILES([
Makefile
Expand All @@ -112,8 +118,9 @@ AC_CONFIG_FILES([
src/Makefile
src/addrxlat/Makefile
src/kdumpfile/Makefile
python/Makefile
tests/Makefile
tools/Makefile
tools/kdumpid/Makefile
libaddrxlat.pc
libkdumpfile.pc
include/libkdumpfile/kdumpfile.h
Expand Down
42 changes: 0 additions & 42 deletions m4/python.m4

This file was deleted.

100 changes: 100 additions & 0 deletions m4/tools.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# KDUMP_TRY_LINK(LIBRARIES)
# ---------------------------------------------------------
# Try to link the existing test source file with additional
# libraries.
# Set kdump_res to "yes" on success, else set it to "no".
# Standard error output is saved to conftest.linkerr.
AC_DEFUN([KDUMP_TRY_LINK],[dnl
kdump_save_LIBS="$LIBS"
kdump_save_ac_link="$ac_link"
LIBS="$1 $LIBS"
ac_link="$ac_link 2>conftest.linkerr"
AC_LINK_IFELSE([], kdump_res=yes, [kdump_res=no
$2])
LIBS="$kdump_save_LIBS"
ac_link="$kdump_save_ac_link"
])# KDUMP_TRY_LINK

AC_DEFUN([KDUMP_REPORT_LINKERR],[dnl
AS_ECHO("$as_me:$LINENO: all linker errors") >&AS_MESSAGE_LOG_FD
cat conftest.linkerr >&AS_MESSAGE_LOG_FD
])# KDUMP_REPORT_LINKERR

AC_DEFUN([KDUMP_TRY_LINK_UNDEF],[dnl
kdump_save_LDFLAGS="$LDFLAGS"
LDFLAGS="-z undefs $2 $LDFLAGS"
KDUMP_TRY_LINK($1, KDUMP_REPORT_LINKERR)
LDFLAGS="$kdump_save_LDFLAGS"
])# KDUMP_TRY_LINK_UNDEF

AC_DEFUN([KDUMP_DIS_ASM_CHECK_UNDEF],[dnl
AC_REQUIRE([AC_PROG_EGREP])dnl
AC_MSG_CHECKING([whether disassembler requires $1])
KDUMP_TRY_LINK($DIS_ASM_LIBS)
AS_ECHO("$as_me:$LINENO: matching linker errors") >&AS_MESSAGE_LOG_FD
AS_IF([$EGREP "@<:@^A-Za-z0-9_@:>@($2)" conftest.linkerr >&AS_MESSAGE_LOG_FD],
[AC_MSG_RESULT(yes)
DIS_ASM_LIBS="$DIS_ASM_LIBS $1"
KDUMP_TRY_LINK_UNDEF($DIS_ASM_LIBS)
AS_IF([test yes != "$kdump_res"],
[AC_MSG_FAILURE([Link fails with $1])])],
[AC_MSG_RESULT(no)])dnl
])# KDUMP_DIS_ASM_CHECK_UNDEF

AC_DEFUN([KDUMP_DIS_ASM_LIBS],[dnl determine disassembler libraries
DIS_ASM_LIBS=-lopcodes
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
[#include <dis-asm.h>],
[disassembler(bfd_arch_i386, FALSE, bfd_mach_x86_64, NULL);])])
dnl ignore undefined symbols from missing linker dependencies
AC_MSG_CHECKING([for disassembler in $DIS_ASM_LIBS])
KDUMP_TRY_LINK_UNDEF($DIS_ASM_LIBS, [-Wl,--require-defined=disassembler])
AC_MSG_RESULT($kdump_res)
AS_IF([test yes = "$kdump_res"], [dnl
KDUMP_DIS_ASM_CHECK_UNDEF(-lbfd, bfd_)
KDUMP_DIS_ASM_CHECK_UNDEF(-lsframe, sframe_)
KDUMP_DIS_ASM_CHECK_UNDEF(-liberty, htab_create|splay_tree_new)
KDUMP_DIS_ASM_CHECK_UNDEF(-lz, inflate)
KDUMP_DIS_ASM_CHECK_UNDEF(-lzstd, ZSTD_)
KDUMP_DIS_ASM_CHECK_UNDEF(-ldl, dlopen)
AS_IF([test yes != "$kdump_res"],
[KDUMP_REPORT_LINKERR]
[AC_MSG_FAILURE([Tried everything, still cannot link disassembler.])])
AC_SUBST(DIS_ASM_LIBS)
])dnl
])# KDUMP_DIS_ASM_LIBS

AC_DEFUN([KDUMP_DIS_ASM],[dnl determine disassembler options
AC_CHECK_HEADERS(dis-asm.h, [],
[AC_MSG_ERROR([Disassembler headers not found])])
AC_MSG_CHECKING([whether disassembler supports syntax highlighting])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <dis-asm.h>
void fn(struct disassemble_info *info, void *stream,
fprintf_ftype fprintf_func, fprintf_styled_ftype fprintf_styled_func)
{
init_disassemble_info(info, stream, fprintf_func, fprintf_styled_func);
}
])],
[dnl
AC_MSG_RESULT(yes)
AC_DEFINE(DIS_ASM_STYLED_PRINTF, [1],
[Define if init_disassemble_info() has a printf_styled_func parameter])],
[AC_MSG_RESULT(no)])
KDUMP_DIS_ASM_LIBS
])# KDUMP_DIS_ASM

AC_DEFUN([KDUMP_TOOL_KDUMPID],[dnl enable/disable kdumpid build
AC_ARG_ENABLE(kdumpid,
[AS_HELP_STRING(--disable-kdumpid,
[do not build kdumpid])],
[],
[enable_kdumpid=yes])
AS_IF([test no != "$enable_kdumpid"], [dnl
KDUMP_DIS_ASM
AS_IF([test yes != "$kdump_res"],
[AC_MSG_FAILURE(
[disassembler test failed (--disable-kdumpid to disable)])]
)])
AM_CONDITIONAL(BUILD_KDUMPID, [test yes = "$enable_kdumpid"])
])# KDUMP_TOOL_KDUMPID
9 changes: 0 additions & 9 deletions python/.gitignore

This file was deleted.

106 changes: 0 additions & 106 deletions python/Makefile.am

This file was deleted.

Loading

0 comments on commit 6af475d

Please sign in to comment.