config: Enable Debuginfod RPM sig checking and eu-stacktrace in spec

Message ID 20241024093411.460194-1-mark@klomp.org
State Committed
Headers
Series config: Enable Debuginfod RPM sig checking and eu-stacktrace in spec |

Commit Message

Mark Wielaard Oct. 24, 2024, 9:34 a.m. UTC
  For testing that the eu-stacktrace and debuginfod ima verification
code builds correctly explicitly add --enable-stacktrace and
--enable-debuginfod-ima-verification to configure.

	 * config/elfutils.spec.in (enable_stacktrace): New global,
         depends on arch.
	 (BuildRequires): Add sysprof-capture-devel.
	 (configure): Add --enable-stacktrace and
	 --enable-debuginfod-ima-verification.
	 (files): Add eu-stacktrace.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 config/elfutils.spec.in | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
  

Comments

Aaron Merey Oct. 24, 2024, 2:23 p.m. UTC | #1
On Thu, Oct 24, 2024 at 5:34 AM Mark Wielaard <mark@klomp.org> wrote:
>
> For testing that the eu-stacktrace and debuginfod ima verification
> code builds correctly explicitly add --enable-stacktrace and
> --enable-debuginfod-ima-verification to configure.
>
>          * config/elfutils.spec.in (enable_stacktrace): New global,
>          depends on arch.
>          (BuildRequires): Add sysprof-capture-devel.
>          (configure): Add --enable-stacktrace and
>          --enable-debuginfod-ima-verification.
>          (files): Add eu-stacktrace.
>
> Signed-off-by: Mark Wielaard <mark@klomp.org>
> ---
>  config/elfutils.spec.in | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in
> index e63a3c1083ef..96934514818d 100644
> --- a/config/elfutils.spec.in
> +++ b/config/elfutils.spec.in
> @@ -7,6 +7,13 @@ License: GPLv3+ and (GPLv2+ or LGPLv3+) and GFDL
>  Source: ftp://sourceware.org/pub/elfutils/%{version}/elfutils-%{version}.tar.bz2
>  Summary: A collection of utilities and DSOs to handle ELF files and DWARF data
>
> +# eu-stacktrace currently only supports x86_64
> +%ifarch x86_64
> +%global enable_stacktrace 1
> +%else
> +%global enable_stacktrace 0
> +%endif
> +
>  Requires: elfutils-libelf = %{version}-%{release}
>  Requires: elfutils-libs = %{version}-%{release}
>  # Can be a Recommends if rpm supports that
> @@ -53,6 +60,11 @@ BuildRequires: ima-evm-utils-devel
>  BuildRequires: openssl-devel
>  BuildRequires: rpm-sign
>
> +# For eu-stacktrace
> +%if %{enable_stacktrace}
> +BuildRequires: sysprof-capture-devel
> +%endif
> +
>  %define _gnu %{nil}
>  %define _programprefix eu-
>
> @@ -197,7 +209,13 @@ such servers to download those files on demand.
>  %setup -q
>
>  %build
> -%configure --program-prefix=%{_programprefix} --enable-debuginfod --enable-debuginfod-urls
> +%configure --program-prefix=%{_programprefix} \
> +           --enable-debuginfod \
> +           --enable-debuginfod-urls=https://debuginfod.elfutils.org/ \
> +%if %{enable_stacktrace}
> +           --enable-stacktrace \
> +%endif
> +           --enable-debuginfod-ima-verification
>  make -s %{?_smp_mflags}
>
>  %install
> @@ -259,6 +277,9 @@ fi
>  %{_bindir}/eu-size
>  %{_bindir}/eu-srcfiles
>  %{_bindir}/eu-stack
> +%if %{enable_stacktrace}
> +%{_bindir}/eu-stacktrace
> +%endif
>  %{_bindir}/eu-strings
>  %{_bindir}/eu-strip
>  %{_bindir}/eu-unstrip
> --
> 2.47.0
>

LGTM.

Thanks,
Aaron
  
Mark Wielaard Oct. 24, 2024, 4:42 p.m. UTC | #2
Hi Aaron,

On Thu, 2024-10-24 at 10:23 -0400, Aaron Merey wrote:
> On Thu, Oct 24, 2024 at 5:34 AM Mark Wielaard <mark@klomp.org> wrote:
> > 
> > For testing that the eu-stacktrace and debuginfod ima verification
> > code builds correctly explicitly add --enable-stacktrace and
> > --enable-debuginfod-ima-verification to configure.
> > 
> >          * config/elfutils.spec.in (enable_stacktrace): New global,
> >          depends on arch.
> >          (BuildRequires): Add sysprof-capture-devel.
> >          (configure): Add --enable-stacktrace and
> >          --enable-debuginfod-ima-verification.
> >          (files): Add eu-stacktrace.
> 
> LGTM.

Thanks, pushed.
I also updated the try builder to make sure it builds the rpm with
these new settings.
https://sourceware.org/cgit/builder/commit/?id=b94f4171fcbc4a055047daeeb640d2b58bae20bd

Cheers,

Mark
  

Patch

diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in
index e63a3c1083ef..96934514818d 100644
--- a/config/elfutils.spec.in
+++ b/config/elfutils.spec.in
@@ -7,6 +7,13 @@  License: GPLv3+ and (GPLv2+ or LGPLv3+) and GFDL
 Source: ftp://sourceware.org/pub/elfutils/%{version}/elfutils-%{version}.tar.bz2
 Summary: A collection of utilities and DSOs to handle ELF files and DWARF data
 
+# eu-stacktrace currently only supports x86_64
+%ifarch x86_64
+%global enable_stacktrace 1
+%else
+%global enable_stacktrace 0
+%endif
+
 Requires: elfutils-libelf = %{version}-%{release}
 Requires: elfutils-libs = %{version}-%{release}
 # Can be a Recommends if rpm supports that
@@ -53,6 +60,11 @@  BuildRequires: ima-evm-utils-devel
 BuildRequires: openssl-devel
 BuildRequires: rpm-sign
 
+# For eu-stacktrace
+%if %{enable_stacktrace}
+BuildRequires: sysprof-capture-devel
+%endif
+
 %define _gnu %{nil}
 %define _programprefix eu-
 
@@ -197,7 +209,13 @@  such servers to download those files on demand.
 %setup -q
 
 %build
-%configure --program-prefix=%{_programprefix} --enable-debuginfod --enable-debuginfod-urls
+%configure --program-prefix=%{_programprefix} \
+           --enable-debuginfod \
+           --enable-debuginfod-urls=https://debuginfod.elfutils.org/ \
+%if %{enable_stacktrace}
+           --enable-stacktrace \
+%endif
+           --enable-debuginfod-ima-verification
 make -s %{?_smp_mflags}
 
 %install
@@ -259,6 +277,9 @@  fi
 %{_bindir}/eu-size
 %{_bindir}/eu-srcfiles
 %{_bindir}/eu-stack
+%if %{enable_stacktrace}
+%{_bindir}/eu-stacktrace
+%endif
 %{_bindir}/eu-strings
 %{_bindir}/eu-strip
 %{_bindir}/eu-unstrip