Skip to content

Commit

Permalink
Use external debuginfo tooling
Browse files Browse the repository at this point in the history
There's been an increasing interest in the wider community to use
the debuginfo tooling outside rpm context, and deep ELF format
internals are not rpm's core business anyhow, the reasons for it
being here are entirely historical. So without further ado, remove
the debuginfo tooling from rpm and rely on the external debugedit
project from now on.

Update INSTALL to document the new dependency, and add conditionals
to relevant debuginfo build tests. The lower-level debugedit and
sepdebugcrcfix tools are tested in the external project, no need
to duplicate that here.
  • Loading branch information
pmatilai committed Jun 21, 2021
1 parent ce48167 commit 04b0805
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 6,008 deletions.
4 changes: 4 additions & 0 deletions INSTALL
Expand Up @@ -5,6 +5,10 @@ The popt library for option parsing, must be version 1.13 or later.
It is available from
http://ftp.rpm.org/popt/

The debugedit >= 0.3 tools for producing debuginfo sub-packages.
It is available from
https://sourceware.org/debugedit/

Lua >= 5.2 library + development environment.
Note that only the library is needed at runtime, RPM never calls external
Lua interpreter for anything. Lua is available from
Expand Down
19 changes: 0 additions & 19 deletions Makefile.am
Expand Up @@ -159,29 +159,10 @@ rpm2archive_LDADD += @WITH_POPT_LIB@ @WITH_ARCHIVE_LIB@


if LIBELF
if LIBDWARF
if LIBDW
rpmconfig_SCRIPTS += scripts/find-debuginfo.sh

rpmlibexec_PROGRAMS += debugedit
debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
debugedit_LDADD = rpmio/librpmio.la
debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
if HAVE_LIBDW_STRTAB
debugedit_LDADD += @WITH_LIBDW_LIB@
else
debugedit_LDADD += @WITH_LIBDW_LIB@ -lebl
endif # HAVE_LIBDW_STRTAB
endif # LIBDW
endif # LIBDWARF
rpmlibexec_PROGRAMS += elfdeps
elfdeps_SOURCES = tools/elfdeps.c
elfdeps_LDADD = rpmio/librpmio.la
elfdeps_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@

rpmlibexec_PROGRAMS += sepdebugcrcfix
sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c
sepdebugcrcfix_LDADD = @WITH_LIBELF_LIB@
endif #LIBELF

rpmlibexec_PROGRAMS += rpmdeps
Expand Down
11 changes: 1 addition & 10 deletions configure.ac
Expand Up @@ -105,6 +105,7 @@ AC_PATH_PROG(__ZSTD, zstd, /usr/bin/zstd, $MYPATH)
AC_PATH_PROG(__LD, ld, /usr/bin/ld, $MYPATH)
AC_PATH_PROG(__OBJDUMP, objdump, /usr/bin/objdump, $MYPATH)
AC_PATH_PROG(__STRIP, strip, /usr/bin/strip, $MYPATH)
AC_PATH_PROG(__FIND_DEBUGINFO, find-debuginfo, /usr/bin/find-debuginfo, $MYPATH)

AC_PATH_PROG(__GIT, git, /usr/bin/git, $MYPATH)
AC_PATH_PROG(__HG, hg, /usr/bin/hg, $MYPATH)
Expand Down Expand Up @@ -259,11 +260,6 @@ AC_CHECK_HEADERS([gelf.h], [
AC_SUBST(WITH_LIBELF_LIB)
AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes])

AC_CHECK_HEADERS([dwarf.h], [
WITH_LIBDWARF=yes
])
AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes])

#=================
# Select crypto library
AC_ARG_WITH(crypto,
Expand Down Expand Up @@ -444,7 +440,6 @@ AM_CONDITIONAL(WITH_ARCHIVE,[test "$with_archive" = yes])
#=================
# Check for elfutils libdw library with dwelf_elf_gnu_build_id.
WITH_LIBDW_LIB=
HAVE_LIBDW_STRTAB=
AS_IF([test "$WITH_LIBELF" = yes],[
AC_CHECK_HEADERS([elfutils/libdwelf.h],[
# dwelf_elf_gnu_build_id was introduced in elfutils 0.159
Expand All @@ -453,9 +448,6 @@ AS_IF([test "$WITH_LIBELF" = yes],[
[Define to 1 if you have elfutils libdw library])
WITH_LIBDW_LIB="-ldw"
WITH_LIBDW=yes
# If possible we also want the strtab functions from elfutils 0.167.
# But we can fall back on the (unsupported) ebl alternatives if not.
AC_CHECK_LIB(dw, dwelf_strtab_init, [HAVE_LIBDW_STRTAB=yes])
# whether libdw supports compressed ELF objects
AC_CHECK_LIB(dw, dwelf_elf_begin, [
AC_DEFINE(HAVE_DWELF_ELF_BEGIN, 1, [Have dwelf_elf_begin?])
Expand All @@ -465,7 +457,6 @@ AS_IF([test "$WITH_LIBELF" = yes],[
])
AC_SUBST(WITH_LIBDW_LIB)
AM_CONDITIONAL(LIBDW,[test "$WITH_LIBDW" = yes])
AM_CONDITIONAL(HAVE_LIBDW_STRTAB,[test "$HAVE_LIBDW_STRTAB" = yes])

#=================
# Process --enable-ndb
Expand Down
2 changes: 1 addition & 1 deletion macros.in
Expand Up @@ -68,7 +68,7 @@
%__objdump @__OBJDUMP@
%__strip @__STRIP@

%__find_debuginfo %{_rpmconfigdir}/find-debuginfo.sh
%__find_debuginfo @__FIND_DEBUGINFO@

#==============================================================================
# Conditional build stuff.
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.am
Expand Up @@ -12,7 +12,7 @@ EXTRA_DIST = \
brp-remove-la-files \
check-files check-prereqs \
check-buildroot check-rpaths check-rpaths-worker \
find-debuginfo.sh find-lang.sh \
find-lang.sh \
perl.prov perl.req \
rpmdb_dump rpmdb_load \
rpm.daily rpm.log rpm.supp rpm2cpio.sh \
Expand Down

0 comments on commit 04b0805

Please sign in to comment.