forked from rpms/elfutils
		
	0.192 Enable eu-stacktrace on x86_64
Add elfutils-0.192-enable-eu-stacktrace.patch Add elfutils-0.192-stacktrace-lto.patch Resolves: RHEL-64046
This commit is contained in:
		
							parent
							
								
									347352d8dc
								
							
						
					
					
						commit
						c4c0436113
					
				
							
								
								
									
										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 | Name: elfutils | ||||||
| Version: 0.192 | Version: 0.192 | ||||||
| %global baserelease 1 | %global baserelease 2 | ||||||
| Release: %{baserelease}%{?dist} | Release: %{baserelease}%{?dist} | ||||||
| URL: http://elfutils.org/ | URL: http://elfutils.org/ | ||||||
| %global source_url ftp://sourceware.org/pub/elfutils/%{version}/ | %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. | # Needed for isa specific Provides and Requires. | ||||||
| %global depsuffix %{?_isa}%{!?_isa:-%{_arch}} | %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-libelf%{depsuffix} = %{version}-%{release} | ||||||
| Requires: elfutils-libs%{depsuffix} = %{version}-%{release} | Requires: elfutils-libs%{depsuffix} = %{version}-%{release} | ||||||
| Requires: elfutils-debuginfod-client%{depsuffix} = %{version}-%{release} | Requires: elfutils-debuginfod-client%{depsuffix} = %{version}-%{release} | ||||||
| @ -53,6 +60,11 @@ BuildRequires: curl | |||||||
| # For run-debuginfod-response-headers.sh test case | # For run-debuginfod-response-headers.sh test case | ||||||
| BuildRequires: socat | BuildRequires: socat | ||||||
| 
 | 
 | ||||||
|  | # For eu-stacktrace | ||||||
|  | %if %{enable_stacktrace} | ||||||
|  | BuildRequires: sysprof-capture-devel | ||||||
|  | %endif | ||||||
|  | 
 | ||||||
| BuildRequires: automake | BuildRequires: automake | ||||||
| BuildRequires: autoconf | BuildRequires: autoconf | ||||||
| BuildRequires: gettext-devel | BuildRequires: gettext-devel | ||||||
| @ -80,6 +92,9 @@ Patch1: elfutils-0.186-fdo-swap.patch | |||||||
| # Include libeu.a objects in libelf.a for static linking. | # Include libeu.a objects in libelf.a for static linking. | ||||||
| Patch2: elfutils-0.192-libelf-static.patch | Patch2: elfutils-0.192-libelf-static.patch | ||||||
| 
 | 
 | ||||||
|  | # Fix eu-stacktrace LTO build error. | ||||||
|  | Patch3: elfutils-0.192-stacktrace-lto.patch | ||||||
|  | 
 | ||||||
| %description | %description | ||||||
| Elfutils is a collection of utilities, including stack (to show | Elfutils is a collection of utilities, including stack (to show | ||||||
| backtraces), nm (for listing symbols from object files), size | backtraces), nm (for listing symbols from object files), size | ||||||
| @ -305,11 +320,14 @@ trap 'cat config.log' EXIT | |||||||
| # dist_debuginfod_url is defined in macros.dist. Fedora and CentOS have | # dist_debuginfod_url is defined in macros.dist. Fedora and CentOS have | ||||||
| # URLs pointing to their respective servers.  RHEL and Amazon Linux do | # URLs pointing to their respective servers.  RHEL and Amazon Linux do | ||||||
| # not configure a default server. | # not configure a default server. | ||||||
|  | %configure CFLAGS="$RPM_OPT_FLAGS" \ | ||||||
| %if "%{?dist_debuginfod_url}" | %if "%{?dist_debuginfod_url}" | ||||||
| %configure CFLAGS="$RPM_OPT_FLAGS" --enable-debuginfod-urls=%{dist_debuginfod_url} | 	--enable-debuginfod-urls=%{dist_debuginfod_url} \ | ||||||
| %else |  | ||||||
| %configure CFLAGS="$RPM_OPT_FLAGS" |  | ||||||
| %endif | %endif | ||||||
|  | %if %{enable_stacktrace} | ||||||
|  | 	--enable-stacktrace \ | ||||||
|  | %endif | ||||||
|  | 	--enable-debuginfod | ||||||
| trap '' EXIT | trap '' EXIT | ||||||
| %make_build | %make_build | ||||||
| 
 | 
 | ||||||
| @ -385,6 +403,9 @@ fi | |||||||
| %{_bindir}/eu-size | %{_bindir}/eu-size | ||||||
| %{_bindir}/eu-srcfiles | %{_bindir}/eu-srcfiles | ||||||
| %{_bindir}/eu-stack | %{_bindir}/eu-stack | ||||||
|  | %if %{enable_stacktrace} | ||||||
|  | %{_bindir}/eu-stacktrace | ||||||
|  | %endif | ||||||
| %{_bindir}/eu-strings | %{_bindir}/eu-strings | ||||||
| %{_bindir}/eu-strip | %{_bindir}/eu-strip | ||||||
| %{_bindir}/eu-unstrip | %{_bindir}/eu-unstrip | ||||||
| @ -492,6 +513,10 @@ exit 0 | |||||||
| %systemd_postun_with_restart debuginfod.service | %systemd_postun_with_restart debuginfod.service | ||||||
| 
 | 
 | ||||||
| %changelog | %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 | * Wed Oct 23 2024 Aaron Merey <amerey@redhat.com> - 0.192-1 | ||||||
| - Upgrade to upstream elfutils 0.192 | - Upgrade to upstream elfutils 0.192 | ||||||
| - Drop upstreamed patches | - Drop upstreamed patches | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user