forked from rpms/elfutils
		
	0.192-2
Enable eu-stacktrace on x86_64 Add elfutils-0.192-stacktrace-lto.patch Resolves: RHEL-64067
This commit is contained in:
		
							parent
							
								
									e1311a3451
								
							
						
					
					
						commit
						c06d0b7bcf
					
				
							
								
								
									
										35
									
								
								elfutils-0.192-stacktrace-lto.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								elfutils-0.192-stacktrace-lto.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,35 @@ | ||||
| commit 43829fb8780ecbe9d17aaed22d3dfcb806cb5f45 | ||||
| Author: Mark Wielaard <mark@klomp.org> | ||||
| Date:   Thu Oct 24 10:44:25 2024 +0200 | ||||
| 
 | ||||
|     stacktrace: Init elf_fd in sysprof_init_dwfl | ||||
|      | ||||
|     When building with LTO gcc believes elf_fd can be used uninitialized: | ||||
|      | ||||
|     In function ‘sysprof_init_dwfl’, | ||||
|         inlined from ‘sysprof_unwind_cb’ at stacktrace.c:1235:16: | ||||
|     stacktrace.c:1087:7: error: ‘elf_fd’ may be used uninitialized [-Werror=maybe-uninitialized] | ||||
|      1087 |       close (elf_fd); | ||||
|           |       ^ | ||||
|      | ||||
|     This code won't be reached because if find_procfile doesn't initialize | ||||
|     elf_fd, it will return an error. But help the compiler by initializing | ||||
|     elf_fd to -1. | ||||
|      | ||||
|             * src/stacktrace.c (sysprof_init_dwfl): Init elf_fd to -1. | ||||
|      | ||||
|     Signed-off-by: Mark Wielaard <mark@klomp.org> | ||||
| 
 | ||||
| diff --git a/src/stacktrace.c b/src/stacktrace.c
 | ||||
| index 438cb1dd0d38..b912ca5de502 100644
 | ||||
| --- a/src/stacktrace.c
 | ||||
| +++ b/src/stacktrace.c
 | ||||
| @@ -1033,7 +1033,7 @@ sysprof_init_dwfl (struct sysprof_unwind_info *sui,
 | ||||
|      } | ||||
|   | ||||
|    Elf *elf = NULL; | ||||
| -  int elf_fd;
 | ||||
| +  int elf_fd = -1;
 | ||||
|    err = find_procfile (dwfl, &pid, &elf, &elf_fd); | ||||
|    if (err < 0) | ||||
|      { | ||||
| @ -4,7 +4,7 @@ | ||||
| 
 | ||||
| Name: elfutils | ||||
| Version: 0.192 | ||||
| %global baserelease 1 | ||||
| %global baserelease 2 | ||||
| Release: %{baserelease}%{?dist} | ||||
| URL: http://elfutils.org/ | ||||
| %global source_url ftp://sourceware.org/pub/elfutils/%{version}/ | ||||
| @ -16,6 +16,13 @@ Summary: A collection of utilities and DSOs to handle ELF files and DWARF data | ||||
| # Needed for isa specific Provides and Requires. | ||||
| %global depsuffix %{?_isa}%{!?_isa:-%{_arch}} | ||||
| 
 | ||||
| # eu-stacktrace currently only supports x86_64 | ||||
| %ifarch x86_64 | ||||
| %global enable_stacktrace 1 | ||||
| %else | ||||
| %global enable_stacktrace 0 | ||||
| %endif | ||||
| 
 | ||||
| Requires: elfutils-libelf%{depsuffix} = %{version}-%{release} | ||||
| Requires: elfutils-libs%{depsuffix} = %{version}-%{release} | ||||
| Requires: elfutils-debuginfod-client%{depsuffix} = %{version}-%{release} | ||||
| @ -53,6 +60,11 @@ BuildRequires: curl | ||||
| # For run-debuginfod-response-headers.sh test case | ||||
| BuildRequires: socat | ||||
| 
 | ||||
| # For eu-stacktrace | ||||
| %if %{enable_stacktrace} | ||||
| BuildRequires: sysprof-capture-devel | ||||
| %endif | ||||
| 
 | ||||
| BuildRequires: automake | ||||
| BuildRequires: autoconf | ||||
| BuildRequires: gettext-devel | ||||
| @ -77,6 +89,9 @@ BuildRequires: gettext-devel | ||||
| # Include libeu.a objects in libelf.a for static linking. | ||||
| Patch1: elfutils-0.192-libelf-static.patch | ||||
| 
 | ||||
| # Fix eu-stacktrace LTO build error. | ||||
| Patch2: elfutils-0.192-stacktrace-lto.patch | ||||
| 
 | ||||
| %description | ||||
| Elfutils is a collection of utilities, including stack (to show | ||||
| backtraces), nm (for listing symbols from object files), size | ||||
| @ -303,11 +318,14 @@ RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -Wformat" | ||||
| 
 | ||||
| trap 'cat config.log' EXIT | ||||
| 
 | ||||
| %configure CFLAGS="$RPM_OPT_FLAGS" \ | ||||
| %if 0%{?centos} >= 8 | ||||
| %configure CFLAGS="$RPM_OPT_FLAGS" --enable-debuginfod-urls=https://debuginfod.centos.org/ | ||||
| %else | ||||
| %configure CFLAGS="$RPM_OPT_FLAGS" | ||||
| 	--enable-debuginfod-urls=%{dist_debuginfod_url} \ | ||||
| %endif | ||||
| %if %{enable_stacktrace} | ||||
| 	--enable-stacktrace \ | ||||
| %endif | ||||
| 	--enable-debuginfod | ||||
| trap '' EXIT | ||||
| %make_build | ||||
| 
 | ||||
| @ -390,6 +408,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 | ||||
| @ -497,6 +518,10 @@ exit 0 | ||||
| %systemd_postun_with_restart debuginfod.service | ||||
| 
 | ||||
| %changelog | ||||
| * Thu Oct 24 2024 Aaron Merey <amerey@redhat.com> - 0.192-2 | ||||
| - Enable eu-stacktrace on x86_64 | ||||
| - Add elfutils-0.192-stacktrace-lto.patch | ||||
| 
 | ||||
| * Wed Oct 23 2024 Aaron Merey <amerey@redhat.com> - 0.192-1 | ||||
| - Upgrade to upstream elfutils 0.192 | ||||
| - Drop upstreamed patches | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user