Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gcc13 for openSUSE:Factory checked 
in at 2023-01-19 16:43:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gcc13 (Old)
 and      /work/SRC/openSUSE:Factory/.gcc13.new.32243 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gcc13"

Thu Jan 19 16:43:49 2023 rev:3 rq:1058888 version:13.0.1+git5199

Changes:
--------
--- /work/SRC/openSUSE:Factory/gcc13/gcc13.changes      2022-12-22 
16:21:53.593621886 +0100
+++ /work/SRC/openSUSE:Factory/.gcc13.new.32243/gcc13.changes   2023-01-19 
16:43:53.433670994 +0100
@@ -1,0 +2,33 @@
+Tue Jan 17 09:30:14 UTC 2023 - Richard Biener <[email protected]>
+
+- Configure external timezone database provided by the timezone
+  package.  Make libstdc++6 recommend timezone to get a fully
+  working std::chrono.  Install timezone when running the testsuite.
+- Remove dependence on doxygen and graphviz when building the
+  testsuite.  Those were used to build the libstdc++ API html
+  documentation but we stopped shipping that when Java support
+  was removed and nobody noticed.  Purge traces of the built
+  libstdc++6-gccN-doc package.
+- Package libhwasan_preinit.o on x86_64.
+
+-------------------------------------------------------------------
+Mon Jan 16 11:59:43 UTC 2023 - Richard Biener <[email protected]>
+
+- Update to GCC trunk head (r13-5199-g2f81164255bf0d)
+  * pulls changes up to the start of Stage 4
+- Change version numbering to match the commit count from
+  the git gcc-descr alias
+- Add gcc13-pr107678.patch to fix unwinding on aarch64 with
+  pointer signing.  [bsc#1206684]
+
+-------------------------------------------------------------------
+Tue Dec 27 11:13:16 UTC 2022 - Ludwig Nussel <[email protected]>
+
+- Don't rely on %usrmerged, set it based on standard %suse_version
+
+-------------------------------------------------------------------
+Thu Dec 22 08:31:14 UTC 2022 - Matwey Kornilov <[email protected]>
+
+- Enable PRU flavour for gcc13
+
+-------------------------------------------------------------------

Old:
----
  gcc-13.0.0+git197351.tar.xz

New:
----
  cross-pru-gcc13-bootstrap.spec
  cross-pru-gcc13.spec
  gcc-13.0.1+git5199.tar.xz
  gcc13-pr107678.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cross-aarch64-gcc13-bootstrap.spec ++++++
--- /var/tmp/diff_new_pack.KXwZSc/_old  2023-01-19 16:43:55.229680347 +0100
+++ /var/tmp/diff_new_pack.KXwZSc/_new  2023-01-19 16:43:55.233680367 +0100
@@ -1,7 +1,7 @@
 #
 # spec file
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -101,7 +101,7 @@
 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
 
 URL:            https://gcc.gnu.org/
-Version:        13.0.0+git197351
+Version:        13.0.1+git5199
 Release:        0
 %define gcc_dir_version %(echo %version |  sed 's/+.*//' | cut -d '.' -f 1)
 %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' 
| sed 's/+/-/')
@@ -127,6 +127,7 @@
 Patch18:        gcc10-amdgcn-llvm-as.patch
 Patch19:        gcc11-gdwarf-4-default.patch
 Patch20:        gcc11-amdgcn-disable-hot-cold-partitioning.patch
+Patch21:        gcc13-pr107678.patch
 # A set of patches from the RH srpm
 Patch51:        gcc41-ppc32-retaddr.patch
 # Some patches taken from Debian
@@ -328,6 +329,7 @@
 %if %{suse_version} < 1550
 %patch19 -p1
 %endif
+%patch21 -p0
 %patch51
 %patch60 -p1
 %patch61
@@ -470,6 +472,7 @@
        $ENABLE_CHECKING \
        --disable-werror \
        --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
+       --with-libstdcxx-zoneinfo=%{_datadir}/zoneinfo \
        --enable-ssp \
        --disable-libssp \
 %if 0%{!?build_libvtv:1}

cross-aarch64-gcc13.spec: same change
cross-amdgcn-gcc13.spec: same change
cross-arm-gcc13.spec: same change
cross-arm-none-gcc13-bootstrap.spec: same change
cross-arm-none-gcc13.spec: same change
cross-avr-gcc13-bootstrap.spec: same change
cross-avr-gcc13.spec: same change
cross-epiphany-gcc13-bootstrap.spec: same change
cross-epiphany-gcc13.spec: same change
cross-hppa-gcc13-bootstrap.spec: same change
cross-hppa-gcc13.spec: same change
cross-m68k-gcc13.spec: same change
cross-mips-gcc13.spec: same change
cross-nvptx-gcc13.spec: same change
cross-ppc64-gcc13.spec: same change
cross-ppc64le-gcc13.spec: same change
++++++ cross-pru-gcc13-bootstrap.spec ++++++
++++ 993 lines (skipped)

cross-pru-gcc13.spec: same change
++++++ cross-riscv64-elf-gcc13-bootstrap.spec ++++++
--- /var/tmp/diff_new_pack.KXwZSc/_old  2023-01-19 16:43:55.725682929 +0100
+++ /var/tmp/diff_new_pack.KXwZSc/_new  2023-01-19 16:43:55.737682991 +0100
@@ -1,7 +1,7 @@
 #
 # spec file
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -102,7 +102,7 @@
 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
 
 URL:            https://gcc.gnu.org/
-Version:        13.0.0+git197351
+Version:        13.0.1+git5199
 Release:        0
 %define gcc_dir_version %(echo %version |  sed 's/+.*//' | cut -d '.' -f 1)
 %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' 
| sed 's/+/-/')
@@ -128,6 +128,7 @@
 Patch18:        gcc10-amdgcn-llvm-as.patch
 Patch19:        gcc11-gdwarf-4-default.patch
 Patch20:        gcc11-amdgcn-disable-hot-cold-partitioning.patch
+Patch21:        gcc13-pr107678.patch
 # A set of patches from the RH srpm
 Patch51:        gcc41-ppc32-retaddr.patch
 # Some patches taken from Debian
@@ -329,6 +330,7 @@
 %if %{suse_version} < 1550
 %patch19 -p1
 %endif
+%patch21 -p0
 %patch51
 %patch60 -p1
 %patch61
@@ -471,6 +473,7 @@
        $ENABLE_CHECKING \
        --disable-werror \
        --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
+       --with-libstdcxx-zoneinfo=%{_datadir}/zoneinfo \
        --enable-ssp \
        --disable-libssp \
 %if 0%{!?build_libvtv:1}

cross-riscv64-elf-gcc13.spec: same change
cross-riscv64-gcc13-bootstrap.spec: same change
cross-riscv64-gcc13.spec: same change
cross-rx-gcc13-bootstrap.spec: same change
cross-rx-gcc13.spec: same change
cross-s390x-gcc13.spec: same change
cross-sparc-gcc13.spec: same change
cross-sparc64-gcc13.spec: same change
cross-x86_64-gcc13.spec: same change
++++++ gcc13-testresults.spec ++++++
--- /var/tmp/diff_new_pack.KXwZSc/_old  2023-01-19 16:43:56.513687032 +0100
+++ /var/tmp/diff_new_pack.KXwZSc/_new  2023-01-19 16:43:56.517687053 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package gcc13-testresults
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -37,7 +37,7 @@
 
 # nospeccleaner
 
-%if !0%{?usrmerged}
+%if 0%{?suse_version} < 1550
 %define _slibdir  /%{_lib}
 %define slibdir   /lib
 %define slibdir64 /lib64
@@ -45,6 +45,7 @@
 %define _slibdir  %{_libdir}
 %define slibdir   %{_prefix}/lib
 %define slibdir64 %{_prefix}/lib64
+%define usrmerged 1
 %endif
 
 # Ada currently fails to build on a few platforms, enable it only
@@ -207,7 +208,7 @@
 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
 
 URL:            https://gcc.gnu.org/
-Version:        13.0.0+git197351
+Version:        13.0.1+git5199
 Release:        0
 %define gcc_dir_version %(echo %version |  sed 's/+.*//' | cut -d '.' -f 1)
 %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' 
| sed 's/+/-/')
@@ -271,11 +272,6 @@
 %define hostsuffix -4.8
 BuildRequires:  gcc48-c++
 %endif
-%if 0%{?building_testsuite:1}
-# For building the libstdc++ API reference
-BuildRequires:  doxygen
-BuildRequires:  graphviz
-%endif
 %ifarch ia64
 BuildRequires:  libunwind-devel
 %endif
@@ -283,6 +279,7 @@
 BuildRequires:  dejagnu
 BuildRequires:  expect
 BuildRequires:  gdb
+BuildRequires:  timezone
 %if %{build_go}
 BuildRequires:  netcfg
 BuildRequires:  procps
@@ -388,6 +385,7 @@
 Patch18:        gcc10-amdgcn-llvm-as.patch
 Patch19:        gcc11-gdwarf-4-default.patch
 Patch20:        gcc11-amdgcn-disable-hot-cold-partitioning.patch
+Patch21:        gcc13-pr107678.patch
 # A set of patches from the RH srpm
 Patch51:        gcc41-ppc32-retaddr.patch
 # Some patches taken from Debian
@@ -526,6 +524,7 @@
 %if %{suse_version} < 1550
 %patch19 -p1
 %endif
+%patch21 -p0
 %patch51
 %patch60 -p1
 %patch61
@@ -668,6 +667,7 @@
        $ENABLE_CHECKING \
        --disable-werror \
        --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
+       --with-libstdcxx-zoneinfo=%{_datadir}/zoneinfo \
        --enable-ssp \
        --disable-libssp \
 %if 0%{!?build_libvtv:1}

++++++ gcc13.spec ++++++
--- /var/tmp/diff_new_pack.KXwZSc/_old  2023-01-19 16:43:56.569687323 +0100
+++ /var/tmp/diff_new_pack.KXwZSc/_new  2023-01-19 16:43:56.589687428 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package gcc13
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,7 @@
 #
 
 
-%if !0%{?usrmerged}
+%if 0%{?suse_version} < 1550
 %define _slibdir  /%{_lib}
 %define slibdir   /lib
 %define slibdir64 /lib64
@@ -24,6 +24,7 @@
 %define _slibdir  %{_libdir}
 %define slibdir   %{_prefix}/lib
 %define slibdir64 %{_prefix}/lib64
+%define usrmerged 1
 %endif
 
 # Ada currently fails to build on a few platforms, enable it only
@@ -186,7 +187,7 @@
 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
 
 URL:            https://gcc.gnu.org/
-Version:        13.0.0+git197351
+Version:        13.0.1+git5199
 Release:        0
 %define gcc_dir_version %(echo %version |  sed 's/+.*//' | cut -d '.' -f 1)
 %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' 
| sed 's/+/-/')
@@ -250,11 +251,6 @@
 %define hostsuffix -4.8
 BuildRequires:  gcc48-c++
 %endif
-%if 0%{?building_testsuite:1}
-# For building the libstdc++ API reference
-BuildRequires:  doxygen
-BuildRequires:  graphviz
-%endif
 %ifarch ia64
 BuildRequires:  libunwind-devel
 %endif
@@ -262,6 +258,7 @@
 BuildRequires:  dejagnu
 BuildRequires:  expect
 BuildRequires:  gdb
+BuildRequires:  timezone
 %if %{build_go}
 BuildRequires:  netcfg
 BuildRequires:  procps
@@ -367,6 +364,7 @@
 Patch18:        gcc10-amdgcn-llvm-as.patch
 Patch19:        gcc11-gdwarf-4-default.patch
 Patch20:        gcc11-amdgcn-disable-hot-cold-partitioning.patch
+Patch21:        gcc13-pr107678.patch
 # A set of patches from the RH srpm
 Patch51:        gcc41-ppc32-retaddr.patch
 # Some patches taken from Debian
@@ -760,6 +758,10 @@
 %if %{suse_version} < 1500
 Recommends:     libstdc++%{libstdcxx_sover}-pp = %{version}-%{release}
 %endif
+# The std::chrono timezone database is provided by timezone
+# (/usr/share/zoneinfo/tzdata.zi), without that the tzdb is empty and
+# will only provide UTC
+Recommends:     timezone
 
 %description -n libstdc++%{libstdcxx_sover}%{libstdcxx_suffix}
 The standard C++ library, needed for dynamically linked C++ programs.
@@ -782,6 +784,10 @@
 %if %{suse_version} < 1500
 Recommends:     libstdc++%{libstdcxx_sover}-pp-32bit = %{version}-%{release}
 %endif
+# The std::chrono timezone database is provided by timezone
+# (/usr/share/zoneinfo/tzdata.zi), without that the tzdb is empty and
+# will only provide UTC
+Recommends:     timezone
 
 %description -n libstdc++%{libstdcxx_sover}%{libstdcxx_suffix}-32bit
 The standard C++ library, needed for dynamically linked C++ programs.
@@ -804,6 +810,10 @@
 %if %{suse_version} < 1500
 Recommends:     libstdc++%{libstdcxx_sover}-pp-64bit = %{version}-%{release}
 %endif
+# The std::chrono timezone database is provided by timezone
+# (/usr/share/zoneinfo/tzdata.zi), without that the tzdb is empty and
+# will only provide UTC
+Recommends:     timezone
 
 %description -n libstdc++%{libstdcxx_sover}%{libstdcxx_suffix}-64bit
 The standard C++ library, needed for dynamically linked C++ programs.
@@ -1633,17 +1643,6 @@
 
 %postun -n libvtv%{libvtv_sover}%{libvtv_suffix}-64bit -p /sbin/ldconfig
 
-%package -n libstdc++%{libstdcxx_sover}%{libdevel_suffix}-doc
-Summary:        Documentation for the GNU C++ standard library
-License:        GPL-3.0-or-later
-Group:          Documentation/HTML
-%if 0%{?suse_version} >= 1120
-BuildArch:      noarch
-%endif
-
-%description -n libstdc++%{libstdcxx_sover}%{libdevel_suffix}-doc
-Extensive HTML documentation for the GNU C++ standard library.
-
 %package go
 Summary:        GNU Go Compiler
 License:        GPL-3.0-or-later
@@ -2026,6 +2025,7 @@
 %if %{suse_version} < 1550
 %patch19 -p1
 %endif
+%patch21 -p0
 %patch51
 %patch60 -p1
 %patch61
@@ -2168,6 +2168,7 @@
        $ENABLE_CHECKING \
        --disable-werror \
        --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
+       --with-libstdcxx-zoneinfo=%{_datadir}/zoneinfo \
        --enable-ssp \
        --disable-libssp \
 %if 0%{!?build_libvtv:1}
@@ -3074,6 +3075,9 @@
 %ifarch %hwasan_arch
 %versmainlib libhwasan.so
 %versmainlib libhwasan.a
+%ifarch x86_64
+%versmainlib libhwasan_preinit.o
+%endif
 %endif
 %ifarch %asan_arch %ubsan_arch %tsan_arch %lsan_arch %hwasan_arch
 %versmainlib libsanitizer.spec

++++++ _multibuild ++++++
--- /var/tmp/diff_new_pack.KXwZSc/_old  2023-01-19 16:43:56.857688823 +0100
+++ /var/tmp/diff_new_pack.KXwZSc/_new  2023-01-19 16:43:56.873688906 +0100
@@ -21,6 +21,8 @@
 <flavor>cross-arm-none-gcc13</flavor>
 <flavor>cross-epiphany-gcc13-bootstrap</flavor>
 <flavor>cross-epiphany-gcc13</flavor>
+<flavor>cross-pru-gcc13-bootstrap</flavor>
+<flavor>cross-pru-gcc13</flavor>
 <flavor>cross-riscv64-elf-gcc13-bootstrap</flavor>
 <flavor>cross-riscv64-elf-gcc13</flavor>
 <flavor>cross-rx-gcc13-bootstrap</flavor>

++++++ change_spec ++++++
--- /var/tmp/diff_new_pack.KXwZSc/_old  2023-01-19 16:43:56.937689240 +0100
+++ /var/tmp/diff_new_pack.KXwZSc/_new  2023-01-19 16:43:56.949689302 +0100
@@ -115,6 +115,7 @@
 add_cross cross-hppa-gcc$base_ver hppa hppa-suse-linux %define gcc_icecream 1
 add_newlib_cross cross-arm-none-gcc$base_ver arm-none arm-none-eabi
 add_newlib_cross cross-epiphany-gcc$base_ver epiphany epiphany-elf
+add_newlib_cross cross-pru-gcc$base_ver pru pru
 #add_newlib_cross cross-nds32le-gcc$base_ver nds32le nds32le-elf
 add_newlib_cross cross-riscv64-elf-gcc$base_ver riscv64 riscv64-elf
 #add_newlib_cross cross-rl78-gcc$base_ver rl78 rl78-elf

++++++ gcc-13.0.0+git197351.tar.xz -> gcc-13.0.1+git5199.tar.xz ++++++
/work/SRC/openSUSE:Factory/gcc13/gcc-13.0.0+git197351.tar.xz 
/work/SRC/openSUSE:Factory/.gcc13.new.32243/gcc-13.0.1+git5199.tar.xz differ: 
char 15, line 1

++++++ gcc.spec.in ++++++
--- /var/tmp/diff_new_pack.KXwZSc/_old  2023-01-19 16:43:57.065689907 +0100
+++ /var/tmp/diff_new_pack.KXwZSc/_new  2023-01-19 16:43:57.065689907 +0100
@@ -17,7 +17,7 @@
 
 # nospeccleaner
 
-%if !0%{?usrmerged}
+%if 0%{?suse_version} < 1550
 %define _slibdir  /%{_lib}
 %define slibdir   /lib
 %define slibdir64 /lib64
@@ -25,6 +25,7 @@
 %define _slibdir  %{_libdir}
 %define slibdir   %{_prefix}/lib
 %define slibdir64 %{_prefix}/lib64
+%define usrmerged 1
 %endif
 
 # Ada currently fails to build on a few platforms, enable it only
@@ -190,7 +191,7 @@
 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
 
 URL:          https://gcc.gnu.org/
-Version: 13.0.0+git197351
+Version: 13.0.1+git5199
 Release:      1
 %define gcc_dir_version %(echo %version |  sed 's/+.*//' | cut -d '.' -f 1)
 %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' 
| sed 's/+/-/')
@@ -255,11 +256,6 @@
 %define hostsuffix -4.8
 BuildRequires: gcc48-c++
 %endif
-%if 0%{?building_testsuite:1}
-# For building the libstdc++ API reference
-BuildRequires: doxygen
-BuildRequires: graphviz
-%endif
 %ifarch ia64
 BuildRequires: libunwind-devel
 %endif
@@ -267,6 +263,7 @@
 BuildRequires: dejagnu
 BuildRequires: expect
 BuildRequires: gdb
+BuildRequires: timezone
 %if %{build_go}
 BuildRequires: procps
 BuildRequires: netcfg
@@ -372,6 +369,7 @@
 Patch18:       gcc10-amdgcn-llvm-as.patch
 Patch19:       gcc11-gdwarf-4-default.patch
 Patch20:       gcc11-amdgcn-disable-hot-cold-partitioning.patch
+Patch21:       gcc13-pr107678.patch
 # A set of patches from the RH srpm
 Patch51:       gcc41-ppc32-retaddr.patch
 # Some patches taken from Debian
@@ -605,6 +603,10 @@
 %if %{suse_version} < 1500
 Recommends: libstdc++%{libstdcxx_sover}-pp@variant@ = %{version}-%{release}
 %endif
+# The std::chrono timezone database is provided by timezone
+# (/usr/share/zoneinfo/tzdata.zi), without that the tzdb is empty and
+# will only provide UTC
+Recommends: timezone
 
 %description -n libstdc++%{libstdcxx_sover}%{libstdcxx_suffix}@variant@
 The standard C++ library, needed for dynamically linked C++ programs.
@@ -948,17 +950,6 @@
 %postun -n libvtv%{libvtv_sover}%{libvtv_suffix}@variant@ -p /sbin/ldconfig
 # PACKAGE-END
 
-%package -n libstdc++%{libstdcxx_sover}%{libdevel_suffix}-doc
-Summary:      Documentation for the GNU C++ standard library
-License:        GPL-3.0-or-later
-Group:        Documentation/HTML
-%if 0%{?suse_version} >= 1120
-BuildArch:    noarch
-%endif
-
-%description -n libstdc++%{libstdcxx_sover}%{libdevel_suffix}-doc
-Extensive HTML documentation for the GNU C++ standard library.
-
 # PACKAGE-BEGIN
 %package go@variant@
 Summary:      GNU Go Compiler
@@ -1213,6 +1204,7 @@
 %if %{suse_version} < 1550
 %patch19 -p1
 %endif
+%patch21 -p0
 %patch51
 %patch60 -p1
 %patch61
@@ -1355,6 +1347,7 @@
        $ENABLE_CHECKING \
        --disable-werror \
        --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
+       --with-libstdcxx-zoneinfo=%{_datadir}/zoneinfo \
        --enable-ssp \
        --disable-libssp \
 %if 0%{!?build_libvtv:1}
@@ -2269,6 +2262,9 @@
 %ifarch %hwasan_arch
 %versmainlib libhwasan.so
 %versmainlib libhwasan.a
+%ifarch x86_64
+%versmainlib libhwasan_preinit.o
+%endif
 %endif
 %ifarch %asan_arch %ubsan_arch %tsan_arch %lsan_arch %hwasan_arch
 %versmainlib libsanitizer.spec

++++++ gcc13-pr107678.patch ++++++
A recent change only initializes the regs.how[] during Dwarf unwinding
which resulted in an uninitialized offset used in return address signing
and random failures during unwinding.  The fix is to encode the return
address signing state in REG_UNSAVED and REG_UNDEFINED.

2023-01-10  Wilco Dijkstra  <[email protected]>

        PR target/107678
        * unwind-dw2.c (RA_SIGNED_BIT): Remove.
        * unwind-dw2-execute_cfa.h: Use REG_UNSAVED/UNDEFINED
        to encode return address signing state.
        * config/aarch64/aarch64-unwind.h (aarch64_demangle_return_addr)
        Check current return address signing state.
        (aarch64_frob_update_contex): Remove.

--- libgcc/config/aarch64/aarch64-unwind.h
+++ libgcc/config/aarch64/aarch64-unwind.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
 
 #define MD_DEMANGLE_RETURN_ADDR(context, fs, addr) \
   aarch64_demangle_return_addr (context, fs, addr)
-#define MD_FROB_UPDATE_CONTEXT(context, fs) \
-  aarch64_frob_update_context (context, fs)
 
 static inline int
 aarch64_cie_signed_with_b_key (struct _Unwind_Context *context)
@@ -55,42 +53,27 @@ aarch64_cie_signed_with_b_key (struct _Unwind_Context 
*context)
 
 static inline void *
 aarch64_demangle_return_addr (struct _Unwind_Context *context,
-                             _Unwind_FrameState *fs ATTRIBUTE_UNUSED,
+                             _Unwind_FrameState *fs,
                              _Unwind_Word addr_word)
 {
   void *addr = (void *)addr_word;
-  if (context->flags & RA_SIGNED_BIT)
+  const int reg = DWARF_REGNUM_AARCH64_RA_STATE;
+
+  if (fs->regs.how[reg] == REG_UNSAVED)
+    return addr;
+
+  /* Return-address signing state is toggled by DW_CFA_GNU_window_save (where
+     REG_UNDEFINED means enabled), or set by a DW_CFA_expression.  */
+  if (fs->regs.how[reg] == REG_UNDEFINED
+      || (_Unwind_GetGR (context, reg) & 0x1) != 0)
     {
       _Unwind_Word salt = (_Unwind_Word) context->cfa;
       if (aarch64_cie_signed_with_b_key (context) != 0)
        return __builtin_aarch64_autib1716 (addr, salt);
       return __builtin_aarch64_autia1716 (addr, salt);
     }
-  else
-    return addr;
-}
-
-/* Do AArch64 private initialization on CONTEXT based on frame info FS.  Mark
-   CONTEXT as return address signed if bit 0 of DWARF_REGNUM_AARCH64_RA_STATE 
is
-   set.  */
-
-static inline void
-aarch64_frob_update_context (struct _Unwind_Context *context,
-                            _Unwind_FrameState *fs)
-{
-  const int reg = DWARF_REGNUM_AARCH64_RA_STATE;
-  int ra_signed;
-  if (fs->regs.how[reg] == REG_UNSAVED)
-    ra_signed = fs->regs.reg[reg].loc.offset & 0x1;
-  else
-    ra_signed = _Unwind_GetGR (context, reg) & 0x1;
-  if (ra_signed)
-    /* The flag is used for re-authenticating EH handler's address.  */
-    context->flags |= RA_SIGNED_BIT;
-  else
-    context->flags &= ~RA_SIGNED_BIT;
 
-  return;
+  return addr;
 }
 
 #endif /* defined AARCH64_UNWIND_H && defined __ILP32__ */
--- libgcc/unwind-dw2.c
+++ libgcc/unwind-dw2.c
@@ -137,9 +137,6 @@ struct _Unwind_Context
 #define SIGNAL_FRAME_BIT ((~(_Unwind_Word) 0 >> 1) + 1)
   /* Context which has version/args_size/by_value fields.  */
 #define EXTENDED_CONTEXT_BIT ((~(_Unwind_Word) 0 >> 2) + 1)
-  /* Bit reserved on AArch64, return address has been signed with A or B
-     key.  */
-#define RA_SIGNED_BIT ((~(_Unwind_Word) 0 >> 3) + 1)
   _Unwind_Word flags;
   /* 0 for now, can be increased when further fields are added to
      struct _Unwind_Context.  */
--- libgcc/unwind-dw2-execute_cfa.h     2023-01-02 17:53:56.003021412 +0100
+++ libgcc/unwind-dw2-execute_cfa.h     2023-01-12 19:52:05.456327742 +0100
@@ -278,10 +278,15 @@
        case DW_CFA_GNU_window_save:
 #if defined (__aarch64__) && !defined (__ILP32__)
          /* This CFA is multiplexed with Sparc.  On AArch64 it's used to toggle
-            return address signing status.  */
+            return address signing status.  The REG_UNDEFINED/UNSAVED states
+            mean RA signing is enabled/disabled.  */
          reg = DWARF_REGNUM_AARCH64_RA_STATE;
-         gcc_assert (fs->regs.how[reg] == REG_UNSAVED);
-         fs->regs.reg[reg].loc.offset ^= 1;
+         gcc_assert (fs->regs.how[reg] == REG_UNSAVED
+                     || fs->regs.how[reg] == REG_UNDEFINED);
+         if (fs->regs.how[reg] == REG_UNSAVED)
+           fs->regs.how[reg] = REG_UNDEFINED;
+         else
+           fs->regs.how[reg] = REG_UNSAVED;
 #else
          /* ??? Hardcoded for SPARC register window configuration.  */
          if (__LIBGCC_DWARF_FRAME_REGISTERS__ >= 32)

Reply via email to