Compare commits

..

51 commits

Author SHA1 Message Date
Fedora Release Engineering
fcb5bb2fcd Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild 2026-01-16 03:55:06 +00:00
Michal Hlavinka
ed1cde7031 updated to 15.2.0 2025-09-18 14:17:18 +02:00
Fedora Release Engineering
1c738c8e54 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 17:14:01 +00:00
Michal Hlavinka
607d9ea5cd rebuild with refreshed newlib library 2025-05-21 12:12:46 +02:00
Michal Hlavinka
5e828f8327 updated to 15.1.0 2025-05-19 16:24:58 +02:00
Michal Hlavinka
fa08ac1d18 rebuild for new arm-none-eabi-newlib 2025-04-15 18:50:54 +02:00
Fedora Release Engineering
e71b9ddc2f Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 11:32:39 +00:00
Fedora Release Engineering
ffaf211d17 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-17 17:25:25 +00:00
Michal Hlavinka
8862551316 full build of gcc 14.1 2024-05-22 22:10:32 +02:00
Michal Hlavinka
5c07405b3c drop patch reference 2024-05-22 14:51:45 +02:00
Michal Hlavinka
b9ec8a7ae0 updated to 14.1.0, bootstrap build, do not use 2024-05-22 14:44:01 +02:00
Michal Hlavinka
a6ed123c6f drop i686 build as not all i686 requirements are available anymore 2024-03-19 09:32:20 +01:00
Michal Hlavinka
826de3aa0a rebuild with updated newlib 2024-03-19 07:33:15 +01:00
Fedora Release Engineering
e44d65896f Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-22 23:26:35 +00:00
Fedora Release Engineering
84ae221d4e Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 13:32:15 +00:00
Michal Hlavinka
7065269656 updated to 13.2.0 2023-08-29 22:11:35 +02:00
Michal Hlavinka
4ead877058 updated to 13.2.0 2023-08-29 19:33:58 +02:00
Fedora Release Engineering
40579f2fa4 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 13:44:33 +00:00
Michal Hlavinka
dead502867 updated to 13.1.0 2023-07-12 12:44:54 +02:00
Michal Hlavinka
b8de4de438 updated to 12.3.0 2023-05-24 12:33:41 +02:00
Michal Hlavinka
9d37d74fe0 update license tag format (SPDX migration) for https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_1 2023-05-10 12:35:21 +02:00
Michal Hlavinka
1a29941f93 use new patch macro format, with epel compatibility 2023-05-03 12:14:27 +02:00
Michal Hlavinka
5baf027193 rebuild for updated newlib package 2023-04-12 09:05:31 +02:00
Florian Weimer
ad49c5b047 Backport upstream patches for improved C99 compatibility
Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
2023-01-19 15:35:27 +01:00
Fedora Release Engineering
e240a5aabb Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-18 22:07:01 +00:00
Michal Hlavinka
52c2bf64d6 update spec variables too 2022-08-23 23:45:40 +02:00
Michal Hlavinka
8850112f1d updated to 12.2.0 2022-08-23 22:52:13 +02:00
Michal Hlavinka
04d10ee959 fix FTBFS (#2113112) 2022-08-02 17:38:17 +02:00
Michal Hlavinka
3b67f619c0 updated to 12.1.0 2022-07-27 12:52:35 +02:00
Fedora Release Engineering
8517f82d32 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-20 21:12:17 +00:00
Michal Hlavinka
034498d013 updated to 11.3.0 2022-06-02 12:32:51 +02:00
Michal Hlavinka
1577175b09 update source0 url 2022-06-01 11:12:43 +02:00
Fedora Release Engineering
2f625508b3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-19 21:36:28 +00:00
Michal Hlavinka
9082a10480 autoconf 2.69 is not available, do not call it 2021-10-27 09:00:59 +02:00
Fedora Release Engineering
7a5c52f64c - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 17:54:16 +00:00
Fedora Release Engineering
307c95c5b6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 12:58:01 +00:00
Michal Hlavinka
3e4361e640 regular build for 11.1.0 2021-05-04 22:01:02 +02:00
Michal Hlavinka
e2a4e0e781 Merge branch 'rawhide' of ssh://pkgs.fedoraproject.org/rpms/arm-none-eabi-gcc-cs into rawhide 2021-05-04 18:58:45 +02:00
Michal Hlavinka
1dc8e1460c bootstrap build for 11.1.0 2021-05-04 18:57:03 +02:00
Michal Hlavinka
916153573a add explicit requirement for autoconf 2.69 2021-04-11 15:22:27 +02:00
Jeff Law
be73f9bbfb - Packport fix for libbacktrace's handling of dwarf-5 2021-02-24 15:40:30 -07:00
Fedora Release Engineering
7507348fbd - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 00:25:46 +00:00
Tom Stellard
c59d9bfb7e Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2020-12-16 23:37:14 +00:00
Michal Hlavinka
cd0502bb71 regular build for 10.2.0 2020-11-04 20:42:08 +01:00
Michal Hlavinka
196d385c47 bootstrap build for gcc 10.2.0 2020-11-04 12:41:42 +01:00
Jeff Law
e44cd47f58 Disable LTO on s390x for now 2020-08-10 22:12:40 -06:00
Fedora Release Engineering
d238fce3c8 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-08-01 00:03:24 +00:00
Fedora Release Engineering
fa452d96fe - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 12:23:10 +00:00
Jeff Law
5ba50cd8ba Add autoconf to BuildRequires 2020-07-20 23:50:45 -06:00
Jeff Law
b3f684ecc2 Add missing .patch file 2020-07-20 23:44:25 -06:00
Jeff Law
eacfd6cbf9 Fix broken configure tests compromised by LTO 2020-07-20 23:33:07 -06:00
6 changed files with 125 additions and 267 deletions

11
.gitignore vendored
View file

@ -11,4 +11,13 @@
/gcc-7.4.0.tar.xz
/gcc-9.2.0.tar.xz
/gcc-10.2.0.tar.xz
/gcc-10.3.0.tar.xz
/gcc-11.1.0.tar.xz
/gcc-11.3.0.tar.xz
/gcc-12.1.0.tar.xz
/gcc-12.2.0.tar.xz
/gcc-12.3.0.tar.xz
/gcc-13.1.0.tar.xz
/gcc-13.2.0.tar.xz
/gcc-14.1.0.tar.xz
/gcc-15.1.0.tar.xz
/gcc-15.2.0.tar.xz

View file

@ -1,7 +1,7 @@
%global processor_arch arm
%global target %{processor_arch}-none-eabi
%global gcc_ver 10.3.0
%global gcc_short_ver 10.3
%global gcc_ver %{version}
%global gcc_short_ver 15.1
# we need newlib to compile complete gcc, but we need gcc to compile newlib,
# so compile minimal gcc first
@ -9,32 +9,17 @@
Name: %{target}-gcc-cs
Epoch: 1
Version: %{gcc_ver}
Release: 1%{?dist}
Version: 15.2.0
Release: 2%{?dist}
Summary: GNU GCC for cross-compilation for %{target} target
# Most of the sources are licensed under GPLv3+ with these exceptions:
# LGPLv2+ libquadmath/ libjava/libltdl/ gcc/testsuite/objc.dg/gnu-encoding/generate-random
# libgcc/soft-fp/ libffi/msvcc.sh
# LGPLv3+ gcc/prefix.c
# BSD libgo/go/regexp/testdata/testregex.cz zlib/example.c libffi/
# libjava/classpath/external/relaxngDatatype/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java
# GPLv2+ libitm/testsuite/libitm.c/memset-1.c libjava/
# Public Domain libjava/classpath/external/sax/org/xml/sax/ext/EntityResolver2.java
# libjava/classpath/external/sax/org/xml/sax/ext/DeclHandler.java
# BSL zlib/contrib/dotzlib/DotZLib/GZipStream.cs
License: GPLv2+ and GPLv3+ and LGPLv2+ and BSD
License: GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.0-or-later AND MIT AND BSD-2-Clause
URL: https://gcc.gnu.org/
Source0: gcc-%{gcc_ver}.tar.xz
Source0: http://ftp.gnu.org/gnu/gcc/gcc-%{version}/gcc-%{version}.tar.xz
Source1: README.fedora
Source2: bootstrapexplain
Patch0: gcc10.patch
Patch1: gcc-config.patch
Patch2: gcc11.patch
BuildRequires: autoconf
#BuildRequires: autoconf = 2.69
BuildRequires: gcc-c++
BuildRequires: %{target}-binutils >= 2.21, zlib-devel gmp-devel mpfr-devel libmpc-devel flex autogen
%if ! %{bootstrap}
@ -44,6 +29,12 @@ BuildRequires: make
Requires: %{target}-binutils >= 2.21
Provides: %{target}-gcc = %{gcc_ver}
%if 0%{?fedora} > 39
# as per https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
# ppl-devel is no longer available for 32bit, so we have to skip it too
ExcludeArch: %{ix86}
%endif
%description
This is a Cross Compiling version of GNU GCC, which can be used to
compile for the %{target} platform, instead of for the
@ -61,16 +52,8 @@ compile c++ code for the %{target} platform, instead of for the native
%prep
%setup -q -c
pushd gcc-%{gcc_ver}
#%patch0 -p2 -b .gcc10fix
%patch1 -p2 -b .gccconfig
%patch2 -p1 -b .gcc11fix
popd
pushd gcc-%{gcc_ver}/libiberty
autoconf -f
popd
pushd gcc-%{gcc_ver}/intl
autoconf -f
#autoconf -f
popd
pushd gcc-%{gcc_ver}
@ -110,8 +93,10 @@ mkdir -p gcc-%{target} gcc-nano-%{target}
#### normal version
pushd gcc-%{target}
CC="%{__cc} ${RPM_OPT_FLAGS} -fno-stack-protector" \
FILTERED_RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}" | sed 's/Werror=format-security/Wno-format-security/g')
export CFLAGS=$FILTERED_RPM_OPT_FLAGS
export CXXFLAGS=$FILTERED_RPM_OPT_FLAGS
CC="%{__cc} ${FILTERED_RPM_OPT_FLAGS} -fno-stack-protector" \
../gcc-%{gcc_ver}/configure --prefix=%{_prefix} --mandir=%{_mandir} \
--with-pkgversion="Fedora %{version}-%{release}" \
--with-bugurl="https://bugzilla.redhat.com/" \
@ -258,6 +243,7 @@ rm -rf $RPM_BUILD_ROOT/%{_datadir}/gcc-%{gcc_ver} ||:
%check
exit 0 # broken test, temporarily disable
%if %{bootstrap}
exit 0
%endif
@ -301,8 +287,101 @@ popd
%endif
%changelog
* Tue May 04 2021 Michal Hlavinka <mhlavink@redhat.com> - 1:10.3.0-1
- updated to 10.3.0
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1:15.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Thu Sep 18 2025 Michal Hlavinka <mhlavink@redhat.com> - 1:15.2.0-1
- updated to 15.2.0
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1:15.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Wed May 21 2025 Michal Hlavinka <mhlavink@redhat.com> - 1:15.1.0-2
- rebuild with refreshed newlib library
* Mon May 19 2025 Michal Hlavinka <mhlavink@redhat.com> - 1:15.1.0-1
- updated to 15.1.0
* Tue Apr 15 2025 Michal Hlavinka <mhlavink@redhat.com> - 1:14.1.0-4
- rebuild for new arm-none-eabi-newlib
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1:14.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:14.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Wed May 22 2024 Michal Hlavinka <mhlavink@redhat.com> - 1:14.1.0-1
- full build of gcc 14.1
* Wed May 22 2024 Michal Hlavinka <mhlavink@redhat.com> - 1:14.1.0-0
- updated to 14.1.0, bootstrap build, do not use
* Tue Mar 19 2024 Michal Hlavinka <mhlavink@redhat.com> - 1:13.2.0-5
- drop i686 build as not all i686 requirements are available anymore
* Tue Mar 19 2024 Michal Hlavinka <mhlavink@redhat.com> - 1:13.2.0-4
- rebuild with updated newlib
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:13.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:13.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Aug 29 2023 Michal Hlavinka <mhlavink@redhat.com> - 1:13.2.0-1
- updated to 13.2.0
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:13.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jul 12 2023 Michal Hlavinka <mhlavink@redhat.com> - 1:13.1.0-1
- updated to 13.1.0
* Wed May 24 2023 Michal Hlavinka <mhlavink@redhat.com> - 1:12.3.0-1
- updated to 12.3.0
* Wed May 10 2023 Michal Hlavinka <mhlavink@redhat.com> - 1:12.2.0-5
- update license tag format (SPDX migration) for https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_1
* Wed Apr 12 2023 Michal Hlavinka <mhlavink@redhat.com> - 1:12.2.0-4
- rebuild for updated newlib package
* Thu Jan 19 2023 Florian Weimer <fweimer@redhat.com> - 1:12.2.0-3
- Backport upstream patches for improved C99 compatibility
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:12.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Aug 23 2022 Michal Hlavinka <mhlavink@redhat.com> - 1:12.2.0-1
- updated to 12.2.0
* Tue Aug 02 2022 Michal Hlavinka <mhlavink@redhat.com> - 1:12.1.0-2
- fix FTBFS (#2113112)
* Wed Jul 27 2022 Michal Hlavinka <mhlavink@redhat.com> - 1:12.1.0-1
- updated to 12.1.0
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:11.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jun 01 2022 Michal Hlavinka <mhlavink@redhat.com> - 1:11.3.0-1
- updated to 11.3.0
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:11.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:11.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue May 04 2021 Michal Hlavinka <mhlavink@redhat.com> - 1:11.1.0-1
- regular build for 11.1.0
* Tue May 04 2021 Michal Hlavinka <mhlavink@redhat.com> - 1:11.1.0-0
- bootstrap build for 11.1.0
* Sun Apr 11 2021 Michal Hlavinka <mhlavink@redhat.com> - 1:10.2.0-5
- add explicit requirement for autoconf 2.69
* Wed Feb 24 2021 Jeff Law <law@redhat.com> - 1:10.2.0-4
- Packport fix for libbacktrace's handling of dwarf-5

View file

@ -1,44 +0,0 @@
diff -Nrup a/gcc-9.2.0/libiberty/aclocal.m4 b/libiberty/aclocal.m4
--- a/gcc-9.2.0/libiberty/aclocal.m4 2019-01-19 09:01:34.000000000 -0700
+++ b/gcc-9.2.0/libiberty/aclocal.m4 2020-01-09 22:00:27.183312982 -0700
@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then
fi
AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
-[AC_TRY_RUN([find_stack_direction ()
+[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction ()
{
static char *addr = 0;
auto char dummy;
diff --git a/config/intdiv0.m4 b/gcc-9.2.0/config/intdiv0.m4
index 55dddcf1..ba906efc 100644
--- a/gcc-9.2.0/config/intdiv0.m4
+++ b/gcc-9.2.0/config/intdiv0.m4
@@ -31,10 +31,10 @@ sigfpe_handler (sig) int sig;
exit (sig != SIGFPE);
}
-int x = 1;
-int y = 0;
-int z;
-int nan;
+volatile int x = 1;
+volatile int y = 0;
+volatile int z;
+volatile int nan;
int main ()
{
diff --git a/gcc-9.2.0/libiberty/configure.ac b/gcc-9.2.0/libiberty/configure.ac
index f1ce7601..fc20d228 100644
--- a/gcc-9.2.0/libiberty/configure.ac
+++ b/gcc-9.2.0/libiberty/configure.ac
@@ -661,7 +661,7 @@ if test -z "${setobjs}"; then
for v in $vars; do
AC_MSG_CHECKING([for $v])
AC_CACHE_VAL(libiberty_cv_var_$v,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[__attribute__ ((used)) int *p;]],[[extern int $v []; p = $v;]])],
[eval "libiberty_cv_var_$v=yes"],
[eval "libiberty_cv_var_$v=no"])])
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then

View file

@ -1,14 +0,0 @@
diff -Nrup a/gcc-9.2.0/libbacktrace/edtest.c b/gcc-9.2.0/libbacktrace/edtest.c
--- a/gcc-9.2.0/libbacktrace/edtest.c 2019-01-01 05:31:55.000000000 -0700
+++ b/gcc-9.2.0/libbacktrace/edtest.c 2019-10-31 14:26:22.808494361 -0600
@@ -43,8 +43,8 @@ POSSIBILITY OF SUCH DAMAGE. */
#include "testlib.h"
-static int test1 (void) __attribute__ ((noinline, unused));
-static int test1 (void) __attribute__ ((noinline, unused));
+static int test1 (void) __attribute__ ((noinline, noclone, unused));
+static int test1 (void) __attribute__ ((noinline, noclone, unused));
extern int f2 (int);
extern int f3 (int, int);

View file

@ -1,172 +0,0 @@
commit 325e70b47c6c321710c7b9c792b8fbee95cecd63
Author: Ian Lance Taylor <iant@golang.org>
Date: Mon Jan 18 14:38:10 2021 -0800
libbacktrace: use correct directory/filename for DWARF 5
PR debug/98716
* dwarf.c (read_v2_paths): Allocate zero entry for dirs and
filenames.
(read_line_program): Remove parameter u, change caller. Don't
subtract one from dirs and filenames index.
(read_function_entry): Don't subtract one from filenames index.
diff --git a/libbacktrace/dwarf.c b/libbacktrace/dwarf.c
index 3d0cbedf770..9097df6cc76 100644
--- a/libbacktrace/dwarf.c
+++ b/libbacktrace/dwarf.c
@@ -2344,19 +2344,20 @@ read_v2_paths (struct backtrace_state *state, struct unit *u,
++hdr->dirs_count;
}
- hdr->dirs = NULL;
- if (hdr->dirs_count != 0)
- {
- hdr->dirs = ((const char **)
- backtrace_alloc (state,
- hdr->dirs_count * sizeof (const char *),
- hdr_buf->error_callback,
- hdr_buf->data));
- if (hdr->dirs == NULL)
- return 0;
- }
+ /* The index of the first entry in the list of directories is 1. Index 0 is
+ used for the current directory of the compilation. To simplify index
+ handling, we set entry 0 to the compilation unit directory. */
+ ++hdr->dirs_count;
+ hdr->dirs = ((const char **)
+ backtrace_alloc (state,
+ hdr->dirs_count * sizeof (const char *),
+ hdr_buf->error_callback,
+ hdr_buf->data));
+ if (hdr->dirs == NULL)
+ return 0;
- i = 0;
+ hdr->dirs[0] = u->comp_dir;
+ i = 1;
while (*hdr_buf->buf != '\0')
{
if (hdr_buf->reported_underflow)
@@ -2383,6 +2384,10 @@ read_v2_paths (struct backtrace_state *state, struct unit *u,
++hdr->filenames_count;
}
+ /* The index of the first entry in the list of file names is 1. Index 0 is
+ used for the DW_AT_name of the compilation unit. To simplify index
+ handling, we set entry 0 to the compilation unit file name. */
+ ++hdr->filenames_count;
hdr->filenames = ((const char **)
backtrace_alloc (state,
hdr->filenames_count * sizeof (char *),
@@ -2390,7 +2395,8 @@ read_v2_paths (struct backtrace_state *state, struct unit *u,
hdr_buf->data));
if (hdr->filenames == NULL)
return 0;
- i = 0;
+ hdr->filenames[0] = u->filename;
+ i = 1;
while (*hdr_buf->buf != '\0')
{
const char *filename;
@@ -2404,7 +2410,7 @@ read_v2_paths (struct backtrace_state *state, struct unit *u,
return 0;
dir_index = read_uleb128 (hdr_buf);
if (IS_ABSOLUTE_PATH (filename)
- || (dir_index == 0 && u->comp_dir == NULL))
+ || (dir_index < hdr->dirs_count && hdr->dirs[dir_index] == NULL))
hdr->filenames[i] = filename;
else
{
@@ -2413,10 +2419,8 @@ read_v2_paths (struct backtrace_state *state, struct unit *u,
size_t filename_len;
char *s;
- if (dir_index == 0)
- dir = u->comp_dir;
- else if (dir_index - 1 < hdr->dirs_count)
- dir = hdr->dirs[dir_index - 1];
+ if (dir_index < hdr->dirs_count)
+ dir = hdr->dirs[dir_index];
else
{
dwarf_buf_error (hdr_buf,
@@ -2704,8 +2708,8 @@ read_line_header (struct backtrace_state *state, struct dwarf_data *ddata,
static int
read_line_program (struct backtrace_state *state, struct dwarf_data *ddata,
- struct unit *u, const struct line_header *hdr,
- struct dwarf_buf *line_buf, struct line_vector *vec)
+ const struct line_header *hdr, struct dwarf_buf *line_buf,
+ struct line_vector *vec)
{
uint64_t address;
unsigned int op_index;
@@ -2715,8 +2719,8 @@ read_line_program (struct backtrace_state *state, struct dwarf_data *ddata,
address = 0;
op_index = 0;
- if (hdr->filenames_count > 0)
- reset_filename = hdr->filenames[0];
+ if (hdr->filenames_count > 1)
+ reset_filename = hdr->filenames[1];
else
reset_filename = "";
filename = reset_filename;
@@ -2781,10 +2785,8 @@ read_line_program (struct backtrace_state *state, struct dwarf_data *ddata,
size_t f_len;
char *p;
- if (dir_index == 0 && hdr->version < 5)
- dir = u->comp_dir;
- else if (dir_index - 1 < hdr->dirs_count)
- dir = hdr->dirs[dir_index - 1];
+ if (dir_index < hdr->dirs_count)
+ dir = hdr->dirs[dir_index];
else
{
dwarf_buf_error (line_buf,
@@ -2851,14 +2853,14 @@ read_line_program (struct backtrace_state *state, struct dwarf_data *ddata,
filename = "";
else
{
- if (fileno - 1 >= hdr->filenames_count)
+ if (fileno >= hdr->filenames_count)
{
dwarf_buf_error (line_buf,
("invalid file number in "
"line number program"));
return 0;
}
- filename = hdr->filenames[fileno - 1];
+ filename = hdr->filenames[fileno];
}
}
break;
@@ -2948,7 +2950,7 @@ read_line_info (struct backtrace_state *state, struct dwarf_data *ddata,
if (!read_line_header (state, ddata, u, is_dwarf64, &line_buf, hdr))
goto fail;
- if (!read_line_program (state, ddata, u, hdr, &line_buf, &vec))
+ if (!read_line_program (state, ddata, hdr, &line_buf, &vec))
goto fail;
if (line_buf.reported_underflow)
@@ -3289,7 +3291,7 @@ read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata,
function->caller_filename = "";
else
{
- if (val.u.uint - 1 >= lhdr->filenames_count)
+ if (val.u.uint >= lhdr->filenames_count)
{
dwarf_buf_error (unit_buf,
("invalid file number in "
@@ -3297,7 +3299,7 @@ read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata,
return 0;
}
function->caller_filename =
- lhdr->filenames[val.u.uint - 1];
+ lhdr->filenames[val.u.uint];
}
}
break;

View file

@ -1 +1 @@
SHA512 (gcc-10.3.0.tar.xz) = 2b2dd7453d48a398c29eaebd1422b70341001b8c90a62aee51e83344e7fdd8a8e45f82a4a9165bd7edc76dada912c932f4b6632c5636760fec4c5d7e402b3f86
SHA512 (gcc-15.2.0.tar.xz) = 89047a2e07bd9da265b507b516ed3635adb17491c7f4f67cf090f0bd5b3fc7f2ee6e4cc4008beef7ca884b6b71dffe2bb652b21f01a702e17b468cca2d10b2de