openSUSE Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
February 2022
- 1 participants
- 2613 discussions
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-ZEO for openSUSE:Factory checked in at 2022-02-28 19:43:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ZEO (Old)
and /work/SRC/openSUSE:Factory/.python-ZEO.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ZEO"
Mon Feb 28 19:43:56 2022 rev:13 rq:958061 version:5.2.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ZEO/python-ZEO.changes 2021-09-25 00:36:40.031209097 +0200
+++ /work/SRC/openSUSE:Factory/.python-ZEO.new.1958/python-ZEO.changes 2022-02-28 19:44:28.109961516 +0100
@@ -1,0 +2,5 @@
+Mon Feb 28 14:09:54 UTC 2022 - Matej Cepl <mcepl(a)suse.com>
+
+- Set ZEO4_SERVER env. variable to skip expected failing tests.
+
+-------------------------------------------------------------------
Old:
----
python-ZEO-rpmlintrc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-ZEO.spec ++++++
--- /var/tmp/diff_new_pack.vPkjZy/_old 2022-02-28 19:44:28.753961758 +0100
+++ /var/tmp/diff_new_pack.vPkjZy/_new 2022-02-28 19:44:28.757961759 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-ZEO
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2013 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
@@ -26,7 +26,6 @@
License: ZPL-2.1
URL: https://github.com/zopefoundation/ZEO
Source: https://files.pythonhosted.org/packages/source/Z/ZEO/ZEO-%{version}.tar.gz
-Source99: %{name}-rpmlintrc
# https://github.com/zopefoundation/ZEO/issues/184
Patch0: python-ZEO-no-mock.patch
BuildRequires: %{python_module ZConfig}
@@ -77,7 +76,8 @@
%prep
%setup -q -n ZEO-%{version}
-%patch0 -p1
+%autopatch -p1
+
# delete backup files
find . -name "*~" -print -delete
# remove unwanted shebang
@@ -100,6 +100,7 @@
%check
pushd src
+export ZEO4_SERVER=1
%pyunittest -v ZEO/tests/test*.py
%post
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-marathon for openSUSE:Factory checked in at 2022-02-28 19:43:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-marathon (Old)
and /work/SRC/openSUSE:Factory/.python-marathon.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-marathon"
Mon Feb 28 19:43:54 2022 rev:7 rq:958056 version:0.13.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-marathon/python-marathon.changes 2020-09-16 19:41:46.238963304 +0200
+++ /work/SRC/openSUSE:Factory/.python-marathon.new.1958/python-marathon.changes 2022-02-28 19:44:27.269961202 +0100
@@ -1,0 +2,10 @@
+Mon Feb 28 11:36:47 UTC 2022 - pgajdos(a)suse.com
+
+- fix build, run tests
+- added patches
+ fix https://github.com/thefactory/marathon-python/issues/284
+ + python-marathon-no-2to3.patch
+ fix https://github.com/thefactory/marathon-python/commit/1850734b5b916d14554168…
+ + python-marathon-use-collections.abc.patch
+
+-------------------------------------------------------------------
New:
----
python-marathon-no-2to3.patch
python-marathon-use-collections.abc.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-marathon.spec ++++++
--- /var/tmp/diff_new_pack.WHYiYu/_old 2022-02-28 19:44:27.817961407 +0100
+++ /var/tmp/diff_new_pack.WHYiYu/_new 2022-02-28 19:44:27.829961411 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-marathon
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,7 +25,15 @@
License: MIT
Group: Development/Languages/Python
URL: https://github.com/thefactory/marathon-python
-Source: https://files.pythonhosted.org/packages/source/m/marathon/marathon-%{versio…
+Source: https://github.com/thefactory/marathon-python/archive/refs/tags/%{version}.…
+# https://github.com/thefactory/marathon-python/issues/284
+Patch0: python-marathon-no-2to3.patch
+# https://github.com/thefactory/marathon-python/commit/1850734b5b916d14554168…
+Patch1: python-marathon-use-collections.abc.patch
+BuildRequires: %{python_module pytest}
+BuildRequires: %{python_module requests-mock}
+BuildRequires: %{python_module requests-toolbelt}
+BuildRequires: %{python_module requests}
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
Requires: python-requests >= 2.4.0
@@ -37,7 +45,9 @@
Python interface to the Mesos Marathon REST API.
%prep
-%setup -q -n marathon-%{version}
+%setup -q -n marathon-python-%{version}
+%patch0 -p1
+%patch1 -p1
%build
%python_build
@@ -46,7 +56,7 @@
%python_install
%check
-# requires Docker and Marathon server installed there
+%pytest
%files %{python_files}
%license LICENSE
++++++ marathon-0.13.0.tar.gz ++++++
++++ 2920 lines of diff (skipped)
++++++ python-marathon-no-2to3.patch ++++++
Index: marathon-0.13.0/setup.py
===================================================================
--- marathon-0.13.0.orig/setup.py 2020-08-21 18:22:30.000000000 +0200
+++ marathon-0.13.0/setup.py 2022-02-28 12:20:53.654551958 +0100
@@ -2,10 +2,6 @@
import sys
from setuptools import setup
-extra = {}
-if sys.version_info >= (3,):
- extra['use_2to3'] = True
-
setup(
name='marathon',
version='0.13.0',
@@ -30,5 +26,4 @@ setup(
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
],
- **extra
)
++++++ python-marathon-use-collections.abc.patch ++++++
diff --git a/marathon/util.py b/marathon/util.py
index d9f5664..af2932e 100644
--- a/marathon/util.py
+++ b/marathon/util.py
@@ -1,4 +1,10 @@
-import collections
+# collections.abc new as of 3.3, and collections is deprecated. collections
+# will be unavailable in 3.9
+try:
+ import collections.abc as collections
+except ImportError:
+ import collections
+
import datetime
import logging
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package gcc7 for openSUSE:Factory checked in at 2022-02-28 19:43:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gcc7 (Old)
and /work/SRC/openSUSE:Factory/.gcc7.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gcc7"
Mon Feb 28 19:43:53 2022 rev:36 rq:958058 version:7.5.0+r278197
Changes:
--------
--- /work/SRC/openSUSE:Factory/gcc7/cross-aarch64-gcc7.changes 2021-09-27 20:09:29.118500242 +0200
+++ /work/SRC/openSUSE:Factory/.gcc7.new.1958/cross-aarch64-gcc7.changes 2022-02-28 19:44:22.669959479 +0100
@@ -1,0 +2,45 @@
+Mon Feb 28 07:21:45 UTC 2022 - Richard Biener <rguenther(a)suse.com>
+
+- Remove include-fixed/sys/rseq.h to fix build on openSUSE:Factory.
+- Avoid duplicate license in cross packages.
+
+-------------------------------------------------------------------
+Tue Oct 26 06:20:55 UTC 2021 - Richard Biener <rguenther(a)suse.com>
+
+- Adjust some ambiguous SPDX license specifications to prevent
+ spec-cleaner from messing up.
+
+-------------------------------------------------------------------
+Mon Oct 25 11:40:00 UTC 2021 - Lukas Lansky <lukas.lansky(a)suse.com>
+
+- Add gcc7-pr55917.patch to do not handle exceptions in std::thread
+ (jsc#CAR-1182)
+
+-------------------------------------------------------------------
+Wed Oct 20 16:52:20 UTC 2021 - Giuliano Belinassi <giuliano.belinassi(a)suse.com>
+
+- Add gcc7-pfe-0001-Backport-Add-entry-for-patchable_function_entry.patch,
+ gcc7-pfe-0002-Backport-Skip-fpatchable-function-entry-tests-for-nv.patch,
+ gcc7-pfe-0003-Backport-Error-out-on-nvptx-for-fpatchable-function-.patch,
+ gcc7-pfe-0004-Backport-Adapt-scan-assembler-times-for-alpha.patch,
+ gcc7-pfe-0005-Backport-patchable_function_entry-decl.c-Use-3-NOPs-.patch,
+ gcc7-pfe-0006-Backport-IBM-Z-Use-the-dedicated-NOP-instructions-fo.patch,
+ gcc7-pfe-0007-Backport-Add-regex-to-search-for-uppercase-NOP-instr.patch,
+ gcc7-pfe-0008-Backport-ICE-segmentation-fault-with-patchable_funct.patch,
+ gcc7-pfe-0009-Backport-patchable_function_entry-decl.c-Pass-mcpu-g.patch,
+ gcc7-pfe-0010-Backport-patchable_function_entry-decl.c-Do-not-run-.patch,
+ gcc7-pfe-0011-Backport-patchable_function_entry-decl.c-Add-fno-pie.patch,
+ gcc7-pfe-0012-Backport-PR-c-89946-ICE-in-assemble_start_function-a.patch,
+ gcc7-pfe-0013-Backport-targhooks.c-default_print_patchable_functio.patch,
+ gcc7-pfe-0014-Backport-Align-__patchable_function_entries-to-POINT.patch,
+ gcc7-pfe-0015-Backport-Fix-PR-93242-patchable-function-entry-broke.patch,
+ gcc7-pfe-0016-Backport-Fix-patchable-function-entry-on-arc.patch,
+ gcc7-pfe-0017-Backport-Add-patch_area_size-and-patch_area_entry-to.patch,
+ gcc7-pfe-0018-Backport-testsuite-Adjust-patchable_function-tests-f.patch,
+ gcc7-pfe-0019-Backport-Use-the-section-flag-o-for-__patchable_func.patch,
+ gcc7-pfe-0020-Backport-varasm-Fix-up-__patchable_function_entries-.patch,
+ gcc7-pfe-0021-Backport-rs6000-Avoid-fpatchable-function-entry-regr.patch,
+ and gcc7-pfe-0022-Fix-unwinding-issues-when-pfe-is-enabled.patch
+ to add -fpatchable-function-entry feature to gcc-7.
+
+-------------------------------------------------------------------
cross-arm-gcc7.changes: same change
cross-arm-none-gcc7-bootstrap.changes: same change
cross-arm-none-gcc7.changes: same change
cross-avr-gcc7-bootstrap.changes: same change
cross-avr-gcc7.changes: same change
cross-epiphany-gcc7-bootstrap.changes: same change
cross-epiphany-gcc7.changes: same change
cross-hppa-gcc7.changes: same change
cross-i386-gcc7.changes: same change
cross-m68k-gcc7.changes: same change
cross-mips-gcc7.changes: same change
cross-nvptx-gcc7.changes: same change
cross-ppc64-gcc7.changes: same change
cross-ppc64le-gcc7.changes: same change
cross-rx-gcc7-bootstrap.changes: same change
cross-rx-gcc7.changes: same change
cross-s390x-gcc7.changes: same change
cross-sparc-gcc7.changes: same change
cross-sparc64-gcc7.changes: same change
cross-x86_64-gcc7.changes: same change
gcc7-testresults.changes: same change
gcc7.changes: same change
New:
----
gcc7-pfe-0001-Backport-Add-entry-for-patchable_function_entry.patch
gcc7-pfe-0002-Backport-Skip-fpatchable-function-entry-tests-for-nv.patch
gcc7-pfe-0003-Backport-Error-out-on-nvptx-for-fpatchable-function-.patch
gcc7-pfe-0004-Backport-Adapt-scan-assembler-times-for-alpha.patch
gcc7-pfe-0005-Backport-patchable_function_entry-decl.c-Use-3-NOPs-.patch
gcc7-pfe-0006-Backport-IBM-Z-Use-the-dedicated-NOP-instructions-fo.patch
gcc7-pfe-0007-Backport-Add-regex-to-search-for-uppercase-NOP-instr.patch
gcc7-pfe-0008-Backport-ICE-segmentation-fault-with-patchable_funct.patch
gcc7-pfe-0009-Backport-patchable_function_entry-decl.c-Pass-mcpu-g.patch
gcc7-pfe-0010-Backport-patchable_function_entry-decl.c-Do-not-run-.patch
gcc7-pfe-0011-Backport-patchable_function_entry-decl.c-Add-fno-pie.patch
gcc7-pfe-0012-Backport-PR-c-89946-ICE-in-assemble_start_function-a.patch
gcc7-pfe-0013-Backport-targhooks.c-default_print_patchable_functio.patch
gcc7-pfe-0014-Backport-Align-__patchable_function_entries-to-POINT.patch
gcc7-pfe-0015-Backport-Fix-PR-93242-patchable-function-entry-broke.patch
gcc7-pfe-0016-Backport-Fix-patchable-function-entry-on-arc.patch
gcc7-pfe-0017-Backport-Add-patch_area_size-and-patch_area_entry-to.patch
gcc7-pfe-0018-Backport-testsuite-Adjust-patchable_function-tests-f.patch
gcc7-pfe-0019-Backport-Use-the-section-flag-o-for-__patchable_func.patch
gcc7-pfe-0020-Backport-varasm-Fix-up-__patchable_function_entries-.patch
gcc7-pfe-0021-Backport-rs6000-Avoid-fpatchable-function-entry-regr.patch
gcc7-pfe-0022-Fix-unwinding-issues-when-pfe-is-enabled.patch
gcc7-pr55917.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cross-aarch64-gcc7.spec ++++++
--- /var/tmp/diff_new_pack.O99qwZ/_old 2022-02-28 19:44:25.645960594 +0100
+++ /var/tmp/diff_new_pack.O99qwZ/_new 2022-02-28 19:44:25.653960596 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package cross-aarch64-gcc7
+# spec file
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -23,6 +23,7 @@
#
# spec file for package gcc (Version 4.0.1)
#
+# Copyright (c) 2005 SUSE Linux AG, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@@ -107,6 +108,7 @@
%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/+/-/')
%define binsuffix -7
+Group: Development/Languages/C and C++
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{version}.tar.xz
Source1: change_spec
@@ -140,6 +142,7 @@
Patch32: gcc7-pr81942.patch
Patch33: gcc7-sanitizer-cyclades.patch
Patch34: gcc7-ada-MINSTKSZ.patch
+Patch35: gcc7-pr55917.patch
# A set of patches from the RH srpm
Patch51: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
@@ -151,6 +154,28 @@
Patch102: gcc7-aarch64-sls-miti-1.patch
Patch103: gcc7-aarch64-sls-miti-2.patch
Patch104: gcc7-aarch64-sls-miti-3.patch
+Patch105: gcc7-pfe-0001-Backport-Add-entry-for-patchable_function_entry.patch
+Patch106: gcc7-pfe-0002-Backport-Skip-fpatchable-function-entry-tests-for-nv.patch
+Patch107: gcc7-pfe-0003-Backport-Error-out-on-nvptx-for-fpatchable-function-.patch
+Patch108: gcc7-pfe-0004-Backport-Adapt-scan-assembler-times-for-alpha.patch
+Patch109: gcc7-pfe-0005-Backport-patchable_function_entry-decl.c-Use-3-NOPs-.patch
+Patch110: gcc7-pfe-0006-Backport-IBM-Z-Use-the-dedicated-NOP-instructions-fo.patch
+Patch111: gcc7-pfe-0007-Backport-Add-regex-to-search-for-uppercase-NOP-instr.patch
+Patch112: gcc7-pfe-0008-Backport-ICE-segmentation-fault-with-patchable_funct.patch
+Patch113: gcc7-pfe-0009-Backport-patchable_function_entry-decl.c-Pass-mcpu-g.patch
+Patch114: gcc7-pfe-0010-Backport-patchable_function_entry-decl.c-Do-not-run-.patch
+Patch115: gcc7-pfe-0011-Backport-patchable_function_entry-decl.c-Add-fno-pie.patch
+Patch116: gcc7-pfe-0012-Backport-PR-c-89946-ICE-in-assemble_start_function-a.patch
+Patch117: gcc7-pfe-0013-Backport-targhooks.c-default_print_patchable_functio.patch
+Patch118: gcc7-pfe-0014-Backport-Align-__patchable_function_entries-to-POINT.patch
+Patch119: gcc7-pfe-0015-Backport-Fix-PR-93242-patchable-function-entry-broke.patch
+Patch120: gcc7-pfe-0016-Backport-Fix-patchable-function-entry-on-arc.patch
+Patch121: gcc7-pfe-0017-Backport-Add-patch_area_size-and-patch_area_entry-to.patch
+Patch122: gcc7-pfe-0018-Backport-testsuite-Adjust-patchable_function-tests-f.patch
+Patch123: gcc7-pfe-0019-Backport-Use-the-section-flag-o-for-__patchable_func.patch
+Patch124: gcc7-pfe-0020-Backport-varasm-Fix-up-__patchable_function_entries-.patch
+Patch125: gcc7-pfe-0021-Backport-rs6000-Avoid-fpatchable-function-entry-regr.patch
+Patch126: gcc7-pfe-0022-Fix-unwinding-issues-when-pfe-is-enabled.patch
# Define the canonical target and host architecture
# %%gcc_target_arch is supposed to be the full target triple
@@ -252,10 +277,9 @@
#!BuildIgnore: gcc-PIE
BuildRequires: update-alternatives
Requires(post): update-alternatives
-Requires(preun): update-alternatives
+Requires(preun):update-alternatives
Summary: The GNU Compiler Collection targeting %{cross_arch}
License: GPL-3.0-or-later
-Group: Development/Languages/C and C++
%description
The GNU Compiler Collection as a cross-compiler targeting %{cross_arch}.
@@ -306,6 +330,7 @@
%patch32 -p1
%patch33 -p1
%patch34 -p1
+%patch35 -p1
%patch51
%patch60
%patch61
@@ -315,6 +340,28 @@
%patch102 -p1
%patch103 -p1
%patch104 -p1
+%patch105 -p1
+%patch106 -p1
+%patch107 -p1
+%patch108 -p1
+%patch109 -p1
+%patch110 -p1
+%patch111 -p1
+%patch112 -p1
+%patch113 -p1
+%patch114 -p1
+%patch115 -p1
+%patch116 -p1
+%patch117 -p1
+%patch118 -p1
+%patch119 -p1
+%patch120 -p1
+%patch121 -p1
+%patch122 -p1
+%patch123 -p1
+%patch124 -p1
+%patch125 -p1
+%patch126 -p1
#test patching end
cross-arm-gcc7.spec: same change
cross-arm-none-gcc7-bootstrap.spec: same change
cross-arm-none-gcc7.spec: same change
cross-avr-gcc7-bootstrap.spec: same change
cross-avr-gcc7.spec: same change
cross-epiphany-gcc7-bootstrap.spec: same change
cross-epiphany-gcc7.spec: same change
cross-hppa-gcc7.spec: same change
cross-i386-gcc7.spec: same change
cross-m68k-gcc7.spec: same change
cross-mips-gcc7.spec: same change
cross-nvptx-gcc7.spec: same change
cross-ppc64-gcc7.spec: same change
cross-ppc64le-gcc7.spec: same change
cross-rx-gcc7-bootstrap.spec: same change
cross-rx-gcc7.spec: same change
cross-s390x-gcc7.spec: same change
cross-sparc-gcc7.spec: same change
cross-sparc64-gcc7.spec: same change
cross-x86_64-gcc7.spec: same change
++++++ gcc7-testresults.spec ++++++
--- /var/tmp/diff_new_pack.O99qwZ/_old 2022-02-28 19:44:26.441960892 +0100
+++ /var/tmp/diff_new_pack.O99qwZ/_new 2022-02-28 19:44:26.449960894 +0100
@@ -1,7 +1,7 @@
#
# spec file for package gcc7-testresults
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -21,6 +21,7 @@
#
# spec file for package gcc7
#
+# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -304,6 +305,7 @@
Suggests: gcc7-info gcc7-locale
%endif
+Group: Development/Languages/C and C++
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{version}.tar.xz
Source1: change_spec
@@ -337,6 +339,7 @@
Patch32: gcc7-pr81942.patch
Patch33: gcc7-sanitizer-cyclades.patch
Patch34: gcc7-ada-MINSTKSZ.patch
+Patch35: gcc7-pr55917.patch
# A set of patches from the RH srpm
Patch51: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
@@ -348,6 +351,28 @@
Patch102: gcc7-aarch64-sls-miti-1.patch
Patch103: gcc7-aarch64-sls-miti-2.patch
Patch104: gcc7-aarch64-sls-miti-3.patch
+Patch105: gcc7-pfe-0001-Backport-Add-entry-for-patchable_function_entry.patch
+Patch106: gcc7-pfe-0002-Backport-Skip-fpatchable-function-entry-tests-for-nv.patch
+Patch107: gcc7-pfe-0003-Backport-Error-out-on-nvptx-for-fpatchable-function-.patch
+Patch108: gcc7-pfe-0004-Backport-Adapt-scan-assembler-times-for-alpha.patch
+Patch109: gcc7-pfe-0005-Backport-patchable_function_entry-decl.c-Use-3-NOPs-.patch
+Patch110: gcc7-pfe-0006-Backport-IBM-Z-Use-the-dedicated-NOP-instructions-fo.patch
+Patch111: gcc7-pfe-0007-Backport-Add-regex-to-search-for-uppercase-NOP-instr.patch
+Patch112: gcc7-pfe-0008-Backport-ICE-segmentation-fault-with-patchable_funct.patch
+Patch113: gcc7-pfe-0009-Backport-patchable_function_entry-decl.c-Pass-mcpu-g.patch
+Patch114: gcc7-pfe-0010-Backport-patchable_function_entry-decl.c-Do-not-run-.patch
+Patch115: gcc7-pfe-0011-Backport-patchable_function_entry-decl.c-Add-fno-pie.patch
+Patch116: gcc7-pfe-0012-Backport-PR-c-89946-ICE-in-assemble_start_function-a.patch
+Patch117: gcc7-pfe-0013-Backport-targhooks.c-default_print_patchable_functio.patch
+Patch118: gcc7-pfe-0014-Backport-Align-__patchable_function_entries-to-POINT.patch
+Patch119: gcc7-pfe-0015-Backport-Fix-PR-93242-patchable-function-entry-broke.patch
+Patch120: gcc7-pfe-0016-Backport-Fix-patchable-function-entry-on-arc.patch
+Patch121: gcc7-pfe-0017-Backport-Add-patch_area_size-and-patch_area_entry-to.patch
+Patch122: gcc7-pfe-0018-Backport-testsuite-Adjust-patchable_function-tests-f.patch
+Patch123: gcc7-pfe-0019-Backport-Use-the-section-flag-o-for-__patchable_func.patch
+Patch124: gcc7-pfe-0020-Backport-varasm-Fix-up-__patchable_function_entries-.patch
+Patch125: gcc7-pfe-0021-Backport-rs6000-Avoid-fpatchable-function-entry-regr.patch
+Patch126: gcc7-pfe-0022-Fix-unwinding-issues-when-pfe-is-enabled.patch
Summary: Testsuite results
License: SUSE-Public-Domain
@@ -487,6 +512,7 @@
%patch32 -p1
%patch33 -p1
%patch34 -p1
+%patch35 -p1
%patch51
%patch60
%patch61
@@ -496,6 +522,28 @@
%patch102 -p1
%patch103 -p1
%patch104 -p1
+%patch105 -p1
+%patch106 -p1
+%patch107 -p1
+%patch108 -p1
+%patch109 -p1
+%patch110 -p1
+%patch111 -p1
+%patch112 -p1
+%patch113 -p1
+%patch114 -p1
+%patch115 -p1
+%patch116 -p1
+%patch117 -p1
+%patch118 -p1
+%patch119 -p1
+%patch120 -p1
+%patch121 -p1
+%patch122 -p1
+%patch123 -p1
+%patch124 -p1
+%patch125 -p1
+%patch126 -p1
#test patching end
++++++ gcc7.spec ++++++
++++ 742 lines (skipped)
++++ between /work/SRC/openSUSE:Factory/gcc7/gcc7.spec
++++ and /work/SRC/openSUSE:Factory/.gcc7.new.1958/gcc7.spec
++++++ change_spec ++++++
--- /var/tmp/diff_new_pack.O99qwZ/_old 2022-02-28 19:44:26.569960940 +0100
+++ /var/tmp/diff_new_pack.O99qwZ/_new 2022-02-28 19:44:26.569960940 +0100
@@ -120,7 +120,7 @@
sed -i -e '/^# .*-\(BEGIN\|END\)$/d' $f
done
-osc service localrun format_spec_file
+#osc service localrun format_spec_file
-exit 0
+#exit 0
++++++ gcc.spec.in ++++++
--- /var/tmp/diff_new_pack.O99qwZ/_old 2022-02-28 19:44:26.705960991 +0100
+++ /var/tmp/diff_new_pack.O99qwZ/_new 2022-02-28 19:44:26.709960992 +0100
@@ -325,6 +325,7 @@
Patch32: gcc7-pr81942.patch
Patch33: gcc7-sanitizer-cyclades.patch
Patch34: gcc7-ada-MINSTKSZ.patch
+Patch35: gcc7-pr55917.patch
# A set of patches from the RH srpm
Patch51: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
@@ -336,11 +337,32 @@
Patch102: gcc7-aarch64-sls-miti-1.patch
Patch103: gcc7-aarch64-sls-miti-2.patch
Patch104: gcc7-aarch64-sls-miti-3.patch
-
+Patch105: gcc7-pfe-0001-Backport-Add-entry-for-patchable_function_entry.patch
+Patch106: gcc7-pfe-0002-Backport-Skip-fpatchable-function-entry-tests-for-nv.patch
+Patch107: gcc7-pfe-0003-Backport-Error-out-on-nvptx-for-fpatchable-function-.patch
+Patch108: gcc7-pfe-0004-Backport-Adapt-scan-assembler-times-for-alpha.patch
+Patch109: gcc7-pfe-0005-Backport-patchable_function_entry-decl.c-Use-3-NOPs-.patch
+Patch110: gcc7-pfe-0006-Backport-IBM-Z-Use-the-dedicated-NOP-instructions-fo.patch
+Patch111: gcc7-pfe-0007-Backport-Add-regex-to-search-for-uppercase-NOP-instr.patch
+Patch112: gcc7-pfe-0008-Backport-ICE-segmentation-fault-with-patchable_funct.patch
+Patch113: gcc7-pfe-0009-Backport-patchable_function_entry-decl.c-Pass-mcpu-g.patch
+Patch114: gcc7-pfe-0010-Backport-patchable_function_entry-decl.c-Do-not-run-.patch
+Patch115: gcc7-pfe-0011-Backport-patchable_function_entry-decl.c-Add-fno-pie.patch
+Patch116: gcc7-pfe-0012-Backport-PR-c-89946-ICE-in-assemble_start_function-a.patch
+Patch117: gcc7-pfe-0013-Backport-targhooks.c-default_print_patchable_functio.patch
+Patch118: gcc7-pfe-0014-Backport-Align-__patchable_function_entries-to-POINT.patch
+Patch119: gcc7-pfe-0015-Backport-Fix-PR-93242-patchable-function-entry-broke.patch
+Patch120: gcc7-pfe-0016-Backport-Fix-patchable-function-entry-on-arc.patch
+Patch121: gcc7-pfe-0017-Backport-Add-patch_area_size-and-patch_area_entry-to.patch
+Patch122: gcc7-pfe-0018-Backport-testsuite-Adjust-patchable_function-tests-f.patch
+Patch123: gcc7-pfe-0019-Backport-Use-the-section-flag-o-for-__patchable_func.patch
+Patch124: gcc7-pfe-0020-Backport-varasm-Fix-up-__patchable_function_entries-.patch
+Patch125: gcc7-pfe-0021-Backport-rs6000-Avoid-fpatchable-function-entry-regr.patch
+Patch126: gcc7-pfe-0022-Fix-unwinding-issues-when-pfe-is-enabled.patch
# GCC-TESTSUITE-DELETE-BEGIN
-License: GPL-3.0+
# SRC-COMMON-END
+License: GPL-3.0-or-later
Summary: The GNU C Compiler and Support Files
%description
@@ -427,7 +449,7 @@
%package devel
Summary: GCC plugins development enviroment
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: Development/Languages/C and C++
Requires: gcc@base_ver@ = %{version}-%{release}
Requires: gmp-devel
@@ -439,7 +461,7 @@
%package locale
Summary: Locale Data for the GNU Compiler Collection
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: Development/Languages/C and C++
Requires: gcc@base_ver@ = %{version}-%{release}
@@ -451,7 +473,7 @@
# PACKAGE-BEGIN
%package c++@variant@
Summary: The GNU C++ Compiler
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: Development/Languages/C and C++
Requires: gcc@base_ver@@variant@ = %{version}-%{release}
Requires: gcc@base_ver@-c++ = %{version}-%{release}
@@ -465,7 +487,7 @@
# PACKAGE-BEGIN
%package -n libstdc++%{libstdcxx_sover}-devel%{libdevel_suffix}@variant@
Summary: Include Files and Libraries mandatory for Development
-License: GPL-3.0 WITH GCC-exception-3.1
+License: GPL-3.0-or-later WITH GCC-exception-3.1
Group: Development/Languages/C and C++
Requires: libstdc++%{libstdcxx_sover}@variant@ >= %{version}-%{release}
Requires: glibc-devel@variant@
@@ -482,7 +504,7 @@
# PACKAGE-BEGIN
%package -n libgcc_s%{libgcc_s}%{libgcc_s_suffix}@variant@
Summary: C compiler runtime library
-License: GPL-3.0 WITH GCC-exception-3.1
+License: GPL-3.0-or-later WITH GCC-exception-3.1
Group: System/Base
Provides: libgcc_s%{libgcc_s}@variant@ = %{version}-%{release}
# Only one package may provide this - allows multiple gcc versions
@@ -500,7 +522,7 @@
# PACKAGE-BEGIN
%package -n libgomp%{libgomp_sover}%{libgomp_suffix}@variant@
Summary: The GNU compiler collection OpenMP runtime library
-License: GPL-3.0 WITH GCC-exception-3.1
+License: GPL-3.0-or-later WITH GCC-exception-3.1
Group: System/Base
Provides: libgomp%{libgomp_sover}@variant@ = %{version}-%{release}
# Only one package may provide this - allows multiple gcc versions
@@ -522,7 +544,7 @@
# PACKAGE-BEGIN
%package -n libstdc++%{libstdcxx_sover}%{libstdcxx_suffix}@variant@
Summary: The standard C++ shared library
-License: GPL-3.0 WITH GCC-exception-3.1
+License: GPL-3.0-or-later WITH GCC-exception-3.1
Group: System/Libraries
Suggests: libstdc++%{libstdcxx_sover}-locale
Provides: libstdc++%{libstdcxx_sover}@variant@ = %{version}-%{release}
@@ -541,7 +563,7 @@
%package -n libstdc++%{libstdcxx_sover}%{libstdcxx_suffix}-locale
Summary: Standard C++ Library Locales
-License: GPL-3.0 WITH GCC-exception-3.1
+License: GPL-3.0-or-later WITH GCC-exception-3.1
Group: System/Libraries
Provides: libstdc++%{libstdcxx_sover}-locale = %{version}-%{release}
# Only one package may provide this - allows multiple gcc versions
@@ -569,7 +591,7 @@
# PACKAGE-BEGIN
%package objc@variant@
Summary: GNU Objective C Compiler
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: Development/Languages/Other
Requires: gcc@base_ver@@variant@ = %{version}-%{release}
Requires: gcc@base_ver@-objc = %{version}-%{release}
@@ -584,7 +606,7 @@
# PACKAGE-BEGIN
%package -n libobjc%{libobjc_sover}%{libobjc_suffix}@variant@
Summary: Library for the GNU Objective C Compiler
-License: GPL-3.0 WITH GCC-exception-3.1
+License: GPL-3.0-or-later WITH GCC-exception-3.1
Group: Development/Libraries/Other
Provides: libobjc%{libobjc_sover}@variant@ = %{version}-%{release}
# Only one package may provide this - allows multiple gcc versions
@@ -602,7 +624,7 @@
# PACKAGE-BEGIN
%package obj-c++@variant@
Summary: GNU Objective C++ Compiler
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: Development/Languages/Other
Requires: gcc@base_ver@-objc@variant@ = %{version}-%{release}
Requires: gcc@base_ver@-c++@variant@ = %{version}-%{release}
@@ -617,7 +639,7 @@
%package -n cpp@base_ver@
Summary: The GCC Preprocessor
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: Development/Languages/C and C++
%description -n cpp@base_ver@
@@ -628,7 +650,7 @@
# PACKAGE-BEGIN
%package ada@variant@
Summary: GNU Ada Compiler Based on GCC (GNAT)
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: Development/Languages/Other
Requires: gcc@base_ver@@variant@ = %{version}-%{release}
Requires: gcc@base_ver@-ada = %{version}-%{release}
@@ -642,7 +664,7 @@
# PACKAGE-BEGIN
%package -n libada@base_ver@@variant@
Summary: GNU Ada Runtime Libraries
-License: GPL-3.0 WITH GCC-exception-3.1
+License: GPL-3.0-or-later WITH GCC-exception-3.1
Group: System/Libraries
Provides: libgnarl-@base_ver@@variant@ = %{version}-%{release}
Conflicts: %selfconflict libgnarl-@base_ver@@variant@
@@ -665,7 +687,7 @@
# PACKAGE-BEGIN
%package fortran@variant@
Summary: The GNU Fortran Compiler and Support Files
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: Development/Languages/Fortran
Requires: gcc@base_ver@@variant@ = %{version}-%{release}
Requires: gcc@base_ver@-fortran = %{version}-%{release}
@@ -681,7 +703,7 @@
# PACKAGE-BEGIN
%package -n libgfortran%{libgfortran_sover}%{libgfortran_suffix}@variant@
Summary: The GNU Fortran Compiler Runtime Library
-License: GPL-3.0 WITH GCC-exception-3.1
+License: GPL-3.0-or-later WITH GCC-exception-3.1
Group: Development/Languages/Fortran
%ifarch %quadmath_arch
Requires: libquadmath%{libquadmath_sover}@variant@ >= %{version}-%{release}
@@ -780,7 +802,7 @@
# PACKAGE-BEGIN
%package -n libatomic%{libatomic_sover}%{libatomic_suffix}@variant@
Summary: The GNU Compiler Atomic Operations Runtime Library
-License: GPL-3.0 WITH GCC-exception-3.1
+License: GPL-3.0-or-later WITH GCC-exception-3.1
Group: Development/Languages/C and C++
Provides: libatomic%{libatomic_sover}@variant@ = %{version}-%{release}
# Only one package may provide this - allows multiple gcc versions
@@ -912,7 +934,7 @@
%package -n libstdc++%{libstdcxx_sover}%{libdevel_suffix}-doc
Summary: Documentation for the GNU C++ standard library
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: Documentation/HTML
%if 0%{?suse_version} >= 1120
BuildArch: noarch
@@ -924,7 +946,7 @@
# PACKAGE-BEGIN
%package go@variant@
Summary: GNU Go Compiler
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: Development/Languages/Other
Requires: gcc@base_ver@@variant@ = %{version}-%{release}
Requires: gcc@base_ver@-go = %{version}-%{release}
@@ -1101,6 +1123,7 @@
%patch32 -p1
%patch33 -p1
%patch34 -p1
+%patch35 -p1
%patch51
%patch60
%patch61
@@ -1110,6 +1133,28 @@
%patch102 -p1
%patch103 -p1
%patch104 -p1
+%patch105 -p1
+%patch106 -p1
+%patch107 -p1
+%patch108 -p1
+%patch109 -p1
+%patch110 -p1
+%patch111 -p1
+%patch112 -p1
+%patch113 -p1
+%patch114 -p1
+%patch115 -p1
+%patch116 -p1
+%patch117 -p1
+%patch118 -p1
+%patch119 -p1
+%patch120 -p1
+%patch121 -p1
+%patch122 -p1
+%patch123 -p1
+%patch124 -p1
+%patch125 -p1
+%patch126 -p1
#test patching end
@@ -1690,6 +1735,7 @@
rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/bits/statx.h
rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/pthread.h
rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/bits/unistd_ext.h
+rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/sys/rseq.h
%if !%{enable_plugins}
# no plugins
rm -rf $RPM_BUILD_ROOT%{libsubdir}/plugin
++++++ gcc7-pfe-0001-Backport-Add-entry-for-patchable_function_entry.patch ++++++
From 1258c4f8a08681cce523c40352a37584f9ba63bd Mon Sep 17 00:00:00 2001
From: Torsten Duwe <duwe(a)suse.de>
Date: Tue, 25 Jul 2017 14:16:10 +0000
Subject: [PATCH 01/22] Backport "Add entry for "patchable_function_entry".
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2017-07-07 Torsten Duwe <duwe(a)suse.de>
c-family/
* c-attribs.c (c_common_attribute_table): Add entry for
"patchable_function_entry".
lto/
* lto-lang.c (lto_attribute_table): Add entry for
"patchable_function_entry".
* common.opt: Introduce -fpatchable-function-entry
command line option, and its variables function_entry_patch_area_size
and function_entry_patch_area_start.
* opts.c (common_handle_option): Add -fpatchable_function_entry_ case,
including a two-value parser.
* target.def (print_patchable_function_entry): New target hook.
* targhooks.h (default_print_patchable_function_entry): New function.
* targhooks.c (default_print_patchable_function_entry): Likewise.
* toplev.c (process_options): Switch off IPA-RA if
patchable function entries are being generated.
* varasm.c (assemble_start_function): Look at the
patchable-function-entry command line switch and current
function attributes and maybe generate NOP instructions by
calling the print_patchable_function_entry hook.
* doc/extend.texi: Document patchable_function_entry attribute.
* doc/invoke.texi: Document -fpatchable_function_entry
command line option.
* doc/tm.texi.in (TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY):
New target hook.
* doc/tm.texi: Re-generate.
* c-c++-common/patchable_function_entry-default.c: New test.
* c-c++-common/patchable_function_entry-decl.c: Likewise.
* c-c++-common/patchable_function_entry-definition.c: Likewise.
---
gcc/c-family/c-attribs.c | 12 +++++
gcc/common.opt | 11 +++++
gcc/doc/extend.texi | 21 +++++++++
gcc/doc/invoke.texi | 28 +++++++++++
gcc/doc/tm.texi | 9 ++++
gcc/doc/tm.texi.in | 2 +
gcc/lto/lto-lang.c | 12 +++++
gcc/opts.c | 27 +++++++++++
gcc/target.def | 11 +++++
gcc/targhooks.c | 46 +++++++++++++++++++
gcc/targhooks.h | 3 ++
.../patchable_function_entry-decl.c | 16 +++++++
.../patchable_function_entry-default.c | 16 +++++++
.../patchable_function_entry-definition.c | 16 +++++++
gcc/toplev.c | 4 +-
gcc/varasm.c | 46 +++++++++++++++++++
16 files changed, 279 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
create mode 100644 gcc/testsuite/c-c++-common/patchable_function_entry-default.c
create mode 100644 gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c
index 90b17bc00d2..b2820dd1586 100644
--- a/gcc/c-family/c-attribs.c
+++ b/gcc/c-family/c-attribs.c
@@ -139,6 +139,8 @@ static tree handle_bnd_variable_size_attribute (tree *, tree, tree, int, bool *)
static tree handle_bnd_legacy (tree *, tree, tree, int, bool *);
static tree handle_bnd_instrument (tree *, tree, tree, int, bool *);
static tree handle_fallthrough_attribute (tree *, tree, tree, int, bool *);
+static tree handle_patchable_function_entry_attribute (tree *, tree, tree,
+ int, bool *);
/* Table of machine-independent attributes common to all C-like languages.
@@ -345,6 +347,9 @@ const struct attribute_spec c_common_attribute_table[] =
handle_bnd_instrument, false },
{ "fallthrough", 0, 0, false, false, false,
handle_fallthrough_attribute, false },
+ { "patchable_function_entry", 1, 2, true, false, false,
+ handle_patchable_function_entry_attribute,
+ false },
{ NULL, 0, 0, false, false, false, NULL, false }
};
@@ -3178,3 +3183,10 @@ handle_fallthrough_attribute (tree *, tree name, tree, int,
*no_add_attrs = true;
return NULL_TREE;
}
+
+static tree
+handle_patchable_function_entry_attribute (tree *, tree, tree, int, bool *)
+{
+ /* Nothing to be done here. */
+ return NULL_TREE;
+}
diff --git a/gcc/common.opt b/gcc/common.opt
index 437db8e8615..ca1613b6808 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -163,6 +163,13 @@ bool flag_stack_usage_info = false
Variable
int flag_debug_asm
+; How many NOP insns to place at each function entry by default
+Variable
+HOST_WIDE_INT function_entry_patch_area_size
+
+; And how far the real asm entry point is into this area
+Variable
+HOST_WIDE_INT function_entry_patch_area_start
; Balance between GNAT encodings and standard DWARF to emit.
Variable
@@ -2022,6 +2029,10 @@ fprofile-reorder-functions
Common Report Var(flag_profile_reorder_functions)
Enable function reordering that improves code placement.
+fpatchable-function-entry=
+Common Joined Optimization
+Insert NOP instructions at each function entry.
+
frandom-seed
Common Var(common_deferred_options) Defer
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 1ef46799907..6860a391f62 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -3083,6 +3083,27 @@ that affect more than one function.
This attribute should be used for debugging purposes only. It is not
suitable in production code.
+@item patchable_function_entry
+@cindex @code{patchable_function_entry} function attribute
+@cindex extra NOP instructions at the function entry point
+In case the target's text segment can be made writable at run time by
+any means, padding the function entry with a number of NOPs can be
+used to provide a universal tool for instrumentation.
+
+The @code{patchable_function_entry} function attribute can be used to
+change the number of NOPs to any desired value. The two-value syntax
+is the same as for the command-line switch
+@option{-fpatchable-function-entry=N,M}, generating @var{N} NOPs, with
+the function entry point before the @var{M}th NOP instruction.
+@var{M} defaults to 0 if omitted e.g. function entry point is before
+the first NOP.
+
+If patchable function entries are enabled globally using the command-line
+option @option{-fpatchable-function-entry=N,M}, then you must disable
+instrumentation on all functions that are part of the instrumentation
+framework with the attribute @code{patchable_function_entry (0)}
+to prevent recursion.
+
@item pure
@cindex @code{pure} function attribute
@cindex functions that have no side effects
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 8f279e454b0..ad71be54e07 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11417,6 +11417,34 @@ of the function name, it is considered to be a match. For C99 and C++
extended identifiers, the function name must be given in UTF-8, not
using universal character names.
+@item -fpatchable-function-entry=@var{N}[,@var{M}]
+@opindex fpatchable-function-entry
+Generate @var{N} NOPs right at the beginning
+of each function, with the function entry point before the @var{M}th NOP.
+If @var{M} is omitted, it defaults to @code{0} so the
+function entry points to the address just at the first NOP.
+The NOP instructions reserve extra space which can be used to patch in
+any desired instrumentation at run time, provided that the code segment
+is writable. The amount of space is controllable indirectly via
+the number of NOPs; the NOP instruction used corresponds to the instruction
+emitted by the internal GCC back-end interface @code{gen_nop}. This behavior
+is target-specific and may also depend on the architecture variant and/or
+other compilation options.
+
+For run-time identification, the starting addresses of these areas,
+which correspond to their respective function entries minus @var{M},
+are additionally collected in the @code{__patchable_function_entries}
+section of the resulting binary.
+
+Note that the value of @code{__attribute__ ((patchable_function_entry
+(N,M)))} takes precedence over command-line option
+@option{-fpatchable-function-entry=N,M}. This can be used to increase
+the area size or to remove it completely on a single function.
+If @code{N=0}, no pad location is recorded.
+
+The NOP instructions are inserted at---and maybe before, depending on
+@var{M}---the function entry address, even before the prologue.
+
@end table
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 1bb5a9d9579..b4456f7cd40 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -4566,6 +4566,15 @@ will select the smallest suitable mode.
This section describes the macros that output function entry
(@dfn{prologue}) and exit (@dfn{epilogue}) code.
+@deftypefn {Target Hook} void TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY (FILE *@var{file}, unsigned HOST_WIDE_INT @var{patch_area_size}, bool @var{record_p})
+Generate a patchable area at the function start, consisting of
+@var{patch_area_size} NOP instructions. If the target supports named
+sections and if @var{record_p} is true, insert a pointer to the current
+location in the table of patchable functions. The default implementation
+of the hook places the table of pointers in the special section named
+@code{__patchable_function_entries}.
+@end deftypefn
+
@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_PROLOGUE (FILE *@var{file}, HOST_WIDE_INT @var{size})
If defined, a function that outputs the assembler code for entry to a
function. The prologue is responsible for setting up the stack frame,
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index d4047142027..b188c94ae5e 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -3650,6 +3650,8 @@ will select the smallest suitable mode.
This section describes the macros that output function entry
(@dfn{prologue}) and exit (@dfn{epilogue}) code.
+@hook TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY
+
@hook TARGET_ASM_FUNCTION_PROLOGUE
@hook TARGET_ASM_FUNCTION_END_PROLOGUE
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index fdd6ae08a1c..530d9dc31d0 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -48,6 +48,8 @@ static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *);
static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *);
static tree handle_transaction_pure_attribute (tree *, tree, tree, int, bool *);
static tree handle_returns_twice_attribute (tree *, tree, tree, int, bool *);
+static tree handle_patchable_function_entry_attribute (tree *, tree, tree,
+ int, bool *);
static tree ignore_attribute (tree *, tree, tree, int, bool *);
static tree handle_format_attribute (tree *, tree, tree, int, bool *);
@@ -76,6 +78,9 @@ const struct attribute_spec lto_attribute_table[] =
handle_nonnull_attribute, false },
{ "nothrow", 0, 0, true, false, false,
handle_nothrow_attribute, false },
+ { "patchable_function_entry", 1, 2, true, false, false,
+ handle_patchable_function_entry_attribute,
+ false },
{ "returns_twice", 0, 0, true, false, false,
handle_returns_twice_attribute, false },
{ "sentinel", 0, 1, false, true, true,
@@ -473,6 +478,13 @@ handle_returns_twice_attribute (tree *node, tree ARG_UNUSED (name),
return NULL_TREE;
}
+static tree
+handle_patchable_function_entry_attribute (tree *, tree, tree, int, bool *)
+{
+ /* Nothing to be done here. */
+ return NULL_TREE;
+}
+
/* Ignore the given attribute. Used when this attribute may be usefully
overridden by the target, but is not used generically. */
diff --git a/gcc/opts.c b/gcc/opts.c
index b98a0ca73a8..d0430e777ee 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2201,6 +2201,33 @@ common_handle_option (struct gcc_options *opts,
opts->x_flag_ipa_reference = false;
break;
+ case OPT_fpatchable_function_entry_:
+ {
+ char *patch_area_arg = xstrdup (arg);
+ char *comma = strchr (patch_area_arg, ',');
+ if (comma)
+ {
+ *comma = '\0';
+ function_entry_patch_area_size =
+ integral_argument (patch_area_arg);
+ function_entry_patch_area_start =
+ integral_argument (comma + 1);
+ }
+ else
+ {
+ function_entry_patch_area_size =
+ integral_argument (patch_area_arg);
+ function_entry_patch_area_start = 0;
+ }
+ if (function_entry_patch_area_size < 0
+ || function_entry_patch_area_start < 0
+ || function_entry_patch_area_size
+ < function_entry_patch_area_start)
+ error ("invalid arguments for %<-fpatchable_function_entry%>");
+ free (patch_area_arg);
+ }
+ break;
+
case OPT_ftree_vectorize:
if (!opts_set->x_flag_tree_loop_vectorize)
opts->x_flag_tree_loop_vectorize = value;
diff --git a/gcc/target.def b/gcc/target.def
index 6bebfd5b9d6..bea79404836 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -288,6 +288,17 @@ hidden, protected or internal visibility as specified by @var{visibility}.",
void, (tree decl, int visibility),
default_assemble_visibility)
+DEFHOOK
+(print_patchable_function_entry,
+ "Generate a patchable area at the function start, consisting of\n\
+@var{patch_area_size} NOP instructions. If the target supports named\n\
+sections and if @var{record_p} is true, insert a pointer to the current\n\
+location in the table of patchable functions. The default implementation\n\
+of the hook places the table of pointers in the special section named\n\
+@code{__patchable_function_entries}.",
+ void, (FILE *file, unsigned HOST_WIDE_INT patch_area_size, bool record_p),
+ default_print_patchable_function_entry)
+
/* Output the assembler code for entry to a function. */
DEFHOOK
(function_prologue,
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 1cdec068ed8..77ca69105d0 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -72,6 +72,7 @@ along with GCC; see the file COPYING3. If not see
#include "calls.h"
#include "expr.h"
#include "output.h"
+#include "common/common-target.h"
#include "reload.h"
#include "intl.h"
#include "opts.h"
@@ -1609,6 +1610,51 @@ default_compare_by_pieces_branch_ratio (machine_mode)
return 1;
}
+/* Write PATCH_AREA_SIZE NOPs into the asm outfile FILE around a function
+ entry. If RECORD_P is true and the target supports named sections,
+ the location of the NOPs will be recorded in a special object section
+ called "__patchable_function_entries". This routine may be called
+ twice per function to put NOPs before and after the function
+ entry. */
+
+void
+default_print_patchable_function_entry (FILE *file,
+ unsigned HOST_WIDE_INT patch_area_size,
+ bool record_p)
+{
+ const char *nop_templ = 0;
+ int code_num;
+ rtx_insn *my_nop = make_insn_raw (gen_nop ());
+
+ /* We use the template alone, relying on the (currently sane) assumption
+ that the NOP template does not have variable operands. */
+ code_num = recog_memoized (my_nop);
+ nop_templ = get_insn_template (code_num, my_nop);
+
+ if (record_p && targetm_common.have_named_sections)
+ {
+ char buf[256];
+ static int patch_area_number;
+ section *previous_section = in_section;
+
+ patch_area_number++;
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LPFE", patch_area_number);
+
+ switch_to_section (get_section ("__patchable_function_entries",
+ 0, NULL));
+ fputs (integer_asm_op (POINTER_SIZE_UNITS, false), file);
+ assemble_name_raw (file, buf);
+ fputc ('\n', file);
+
+ switch_to_section (previous_section);
+ ASM_OUTPUT_LABEL (file, buf);
+ }
+
+ unsigned i;
+ for (i = 0; i < patch_area_size; ++i)
+ fprintf (file, "\t%s\n", nop_templ);
+}
+
bool
default_profile_before_prologue (void)
{
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 18070df7839..6206fe20823 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -203,6 +203,9 @@ extern bool default_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT,
bool);
extern int default_compare_by_pieces_branch_ratio (machine_mode);
+extern void default_print_patchable_function_entry (FILE *,
+ unsigned HOST_WIDE_INT,
+ bool);
extern bool default_profile_before_prologue (void);
extern reg_class_t default_preferred_reload_class (rtx, reg_class_t);
extern reg_class_t default_preferred_output_reload_class (rtx, reg_class_t);
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
new file mode 100644
index 00000000000..8514b10e820
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
+/* { dg-final { scan-assembler-times "nop" 2 } } */
+
+extern int a;
+
+/* Respect overriding attributes in the declaration. */
+int f3 (void) __attribute__((patchable_function_entry(2)));
+
+/* F3 should now get 2 NOPs. */
+int
+__attribute__((noinline))
+f3 (void)
+{
+ return 5*a;
+}
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
new file mode 100644
index 00000000000..0dcf1181dde
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
+/* { dg-final { scan-assembler-times "nop" 3 } } */
+
+extern int a;
+
+/* Nothing declared must not mean anything. */
+int f3 (void);
+
+/* F3 should get a default-sized NOP area. */
+int
+__attribute__((noinline))
+f3 (void)
+{
+ return 5*a;
+}
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
new file mode 100644
index 00000000000..a007867dcb0
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
+/* { dg-final { scan-assembler-times "nop" 1 } } */
+
+extern int a;
+
+int f3 (void);
+
+/* F3 should now get 1 NOP. */
+int
+__attribute__((noinline))
+__attribute__((patchable_function_entry(1)))
+f3 (void)
+{
+ return 5*a;
+}
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 6f0bc9fe736..7d3aa280f15 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1612,8 +1612,10 @@ process_options (void)
}
/* Do not use IPA optimizations for register allocation if profiler is active
+ or patchable function entries are inserted for run-time instrumentation
or port does not emit prologue and epilogue as RTL. */
- if (profile_flag || !targetm.have_prologue () || !targetm.have_epilogue ())
+ if (profile_flag || function_entry_patch_area_size
+ || !targetm.have_prologue () || !targetm.have_epilogue ())
flag_ipa_ra = 0;
/* Enable -Werror=coverage-mismatch when -Werror and -Wno-error
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 1b9030029ac..6e9a8c3133e 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1829,6 +1829,46 @@ assemble_start_function (tree decl, const char *fnname)
if (DECL_PRESERVE_P (decl))
targetm.asm_out.mark_decl_preserved (fnname);
+ unsigned HOST_WIDE_INT patch_area_size = function_entry_patch_area_size;
+ unsigned HOST_WIDE_INT patch_area_entry = function_entry_patch_area_start;
+
+ tree patchable_function_entry_attr
+ = lookup_attribute ("patchable_function_entry", DECL_ATTRIBUTES (decl));
+ if (patchable_function_entry_attr)
+ {
+ tree pp_val = TREE_VALUE (patchable_function_entry_attr);
+ tree patchable_function_entry_value1 = TREE_VALUE (pp_val);
+
+ if (tree_fits_uhwi_p (patchable_function_entry_value1))
+ patch_area_size = tree_to_uhwi (patchable_function_entry_value1);
+ else
+ gcc_unreachable ();
+
+ patch_area_entry = 0;
+ if (list_length (pp_val) > 1)
+ {
+ tree patchable_function_entry_value2 =
+ TREE_VALUE (TREE_CHAIN (pp_val));
+
+ if (tree_fits_uhwi_p (patchable_function_entry_value2))
+ patch_area_entry = tree_to_uhwi (patchable_function_entry_value2);
+ else
+ gcc_unreachable ();
+ }
+ }
+
+ if (patch_area_entry > patch_area_size)
+ {
+ if (patch_area_size > 0)
+ warning (OPT_Wattributes, "Patchable function entry > size");
+ patch_area_entry = 0;
+ }
+
+ /* Emit the patching area before the entry label, if any. */
+ if (patch_area_entry > 0)
+ targetm.asm_out.print_patchable_function_entry (asm_out_file,
+ patch_area_entry, true);
+
/* Do any machine/system dependent processing of the function name. */
#ifdef ASM_DECLARE_FUNCTION_NAME
ASM_DECLARE_FUNCTION_NAME (asm_out_file, fnname, current_function_decl);
@@ -1837,6 +1877,12 @@ assemble_start_function (tree decl, const char *fnname)
ASM_OUTPUT_FUNCTION_LABEL (asm_out_file, fnname, current_function_decl);
#endif /* ASM_DECLARE_FUNCTION_NAME */
+ /* And the area after the label. Record it if we haven't done so yet. */
+ if (patch_area_size > patch_area_entry)
+ targetm.asm_out.print_patchable_function_entry (asm_out_file,
+ patch_area_size-patch_area_entry,
+ patch_area_entry == 0);
+
if (lookup_attribute ("no_split_stack", DECL_ATTRIBUTES (decl)))
saw_no_split_stack = true;
}
--
2.33.1
++++++ gcc7-pfe-0002-Backport-Skip-fpatchable-function-entry-tests-for-nv.patch ++++++
From c375b71b3f7e6801a5e5a10275b1a0e405f0ab6a Mon Sep 17 00:00:00 2001
From: Tom de Vries <tom(a)codesourcery.com>
Date: Thu, 3 Aug 2017 07:07:38 +0000
Subject: [PATCH 02/22] Backport Skip fpatchable-function-entry tests for nvptx
gcc/testsuite/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
2017-08-03 Tom de Vries <tom(a)codesourcery.com>
PR target/81662
* c-c++-common/patchable_function_entry-decl.c: Skip for nvptx.
* c-c++-common/patchable_function_entry-default.c: Same.
* c-c++-common/patchable_function_entry-definition.c: Same.
---
gcc/testsuite/c-c++-common/patchable_function_entry-decl.c | 2 +-
gcc/testsuite/c-c++-common/patchable_function_entry-default.c | 2 +-
.../c-c++-common/patchable_function_entry-definition.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
index 8514b10e820..5c39a354559 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
/* { dg-final { scan-assembler-times "nop" 2 } } */
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
index 0dcf1181dde..48094f75f78 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
/* { dg-final { scan-assembler-times "nop" 3 } } */
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
index a007867dcb0..af8202f283b 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
/* { dg-final { scan-assembler-times "nop" 1 } } */
--
2.33.1
++++++ gcc7-pfe-0003-Backport-Error-out-on-nvptx-for-fpatchable-function-.patch ++++++
From cbc0c2840906ad6fee93a7423a0212713949e90e Mon Sep 17 00:00:00 2001
From: Tom de Vries <tom(a)codesourcery.com>
Date: Thu, 3 Aug 2017 11:18:09 +0000
Subject: [PATCH 03/22] Backport Error out on nvptx for
fpatchable-function-entry
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2017-08-03 Tom de Vries <tom(a)codesourcery.com>
PR target/81662
* config/nvptx/nvptx.c (nvptx_option_override): Emit sorry if
function_entry_patch_area_size > 0.
* gcc.target/nvptx/patchable_function_entry-default.c: New test.
---
gcc/config/nvptx/nvptx.c | 4 ++++
.../nvptx/patchable_function_entry-default.c | 15 +++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/nvptx/patchable_function_entry-default.c
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 74bce3ec8d0..b0470836fb8 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -178,6 +178,10 @@ nvptx_option_override (void)
if (!global_options_set.x_flag_no_common)
flag_no_common = 1;
+ /* The patch area requires nops, which we don't have. */
+ if (function_entry_patch_area_size > 0)
+ sorry ("not generating patch area, nops not supported");
+
/* Assumes that it will see only hard registers. */
flag_var_tracking = 0;
diff --git a/gcc/testsuite/gcc.target/nvptx/patchable_function_entry-default.c b/gcc/testsuite/gcc.target/nvptx/patchable_function_entry-default.c
new file mode 100644
index 00000000000..42544562725
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/patchable_function_entry-default.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
+
+extern int a;
+
+int f3 (void);
+
+int
+__attribute__((noinline))
+f3 (void)
+{
+ return 5*a;
+}
+
+/* { dg-excess-errors "sorry, unimplemented: not generating patch area, nops not supported" } */
--
2.33.1
++++++ gcc7-pfe-0004-Backport-Adapt-scan-assembler-times-for-alpha.patch ++++++
From 96c0b9515d054bdc339bc379610a9c6b383b5977 Mon Sep 17 00:00:00 2001
From: Uros Bizjak <ubizjak(a)gmail.com>
Date: Wed, 16 Aug 2017 20:44:28 +0200
Subject: [PATCH 04/22] Backport Adapt scan-assembler-times for alpha*-*-*
testsuite/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2017-08-16 Uros Bizjak <ubizjak(a)gmail.com>
* c-c++-common/patchable_function_entry-decl.c (dg-final): Adapt
scan-assembler-times for alpha*-*-*.
* c-c++-common/patchable_function_entry-default.c (dg-final): Ditto.
* c-c++-common/patchable_function_entry-definition.c (dg-final): Ditto.
---
gcc/testsuite/c-c++-common/patchable_function_entry-decl.c | 3 ++-
gcc/testsuite/c-c++-common/patchable_function_entry-default.c | 3 ++-
.../c-c++-common/patchable_function_entry-definition.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
index 5c39a354559..fb61ac31795 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
@@ -1,6 +1,7 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop" 2 } } */
+/* { dg-final { scan-assembler-times "nop" 2 { target { ! alpha*-*-* } } } } */
+/* { dg-final { scan-assembler-times "bis" 2 { target alpha*-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
index 48094f75f78..c18f9e6bd39 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
@@ -1,6 +1,7 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop" 3 } } */
+/* { dg-final { scan-assembler-times "nop" 3 { target { ! alpha*-*-* } } } } */
+/* { dg-final { scan-assembler-times "bis" 3 { target alpha*-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
index af8202f283b..54a57ba7226 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -1,6 +1,7 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop" 1 } } */
+/* { dg-final { scan-assembler-times "nop" 1 { target { ! alpha*-*-* } } } } */
+/* { dg-final { scan-assembler-times "bis" 1 { target alpha*-*-* } } } */
extern int a;
--
2.33.1
++++++ gcc7-pfe-0005-Backport-patchable_function_entry-decl.c-Use-3-NOPs-.patch ++++++
From 73fddef0fed58c74a8d6bcd40c632f1b31a23108 Mon Sep 17 00:00:00 2001
From: Eric Botcazou <ebotcazou(a)adacore.com>
Date: Tue, 16 Jan 2018 21:21:29 +0000
Subject: [PATCH 05/22] Backport patchable_function_entry-decl.c: Use 3 NOPs on
Visium.
testsuite/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2018-01-16 Eric Botcazou <ebotcazou(a)adacore.com>
* c-c++-common/patchable_function_entry-decl.c: Use 3 NOPs on Visium.
* c-c++-common/patchable_function_entry-default.c: 4 NOPs on Visium.
* c-c++-common/patchable_function_entry-definition.c: 2 NOPs on Visium.
---
gcc/testsuite/c-c++-common/patchable_function_entry-decl.c | 3 ++-
gcc/testsuite/c-c++-common/patchable_function_entry-default.c | 3 ++-
.../c-c++-common/patchable_function_entry-definition.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
index fb61ac31795..32e2c06eae3 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
@@ -1,7 +1,8 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop" 2 { target { ! alpha*-*-* } } } } */
+/* { dg-final { scan-assembler-times "nop" 2 { target { ! { alpha*-*-* visium-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 2 { target alpha*-*-* } } } */
+/* { dg-final { scan-assembler-times "nop" 3 { target visium-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
index c18f9e6bd39..be88e431e30 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
@@ -1,7 +1,8 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop" 3 { target { ! alpha*-*-* } } } } */
+/* { dg-final { scan-assembler-times "nop" 3 { target { ! { alpha*-*-* visium-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 3 { target alpha*-*-* } } } */
+/* { dg-final { scan-assembler-times "nop" 4 { target visium-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
index 54a57ba7226..af18dbcd5e6 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -1,7 +1,8 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop" 1 { target { ! alpha*-*-* } } } } */
+/* { dg-final { scan-assembler-times "nop" 1 { target { ! { alpha*-*-* visium-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 1 { target alpha*-*-* } } } */
+/* { dg-final { scan-assembler-times "nop" 2 { target visium-*-* } } } */
extern int a;
--
2.33.1
++++++ gcc7-pfe-0006-Backport-IBM-Z-Use-the-dedicated-NOP-instructions-fo.patch ++++++
From 93132e0ab8aacedc740513c8e3d4ffd3bb0b8db7 Mon Sep 17 00:00:00 2001
From: Andreas Krebbel <krebbel(a)linux.vnet.ibm.com>
Date: Fri, 6 Apr 2018 07:45:42 +0000
Subject: [PATCH 06/22] Backport IBM Z: Use the dedicated NOP instructions for
"nop"
We still use lr r0,r0 as a NOP instruction although we have some kind
of dedicated NOP instruction (nopr) which maps to a "branch never".
As a side-effect this fixes testcases scanning for NOPs
e.g. patchable_function_entry-*.
As another side-effect this makes it difficult to distingiush NOPs
generated for hotpatching from NOPs added when using -O0 to attach
location information to it. Hence I had to make sure that the hotpatch
testcases get skipped when compiling without optimization.
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
gcc/ChangeLog:
2018-04-06 Andreas Krebbel <krebbel(a)linux.vnet.ibm.com>
* config/s390/s390.c (s390_z10_optimize_cmp): Expand dedicated NOP
instructions.
* config/s390/s390.md (UNSPECV_NOP_LR_0, UNSPECV_NOP_LR_1): New
constant definitions.
("nop"): lr 0,0 -> nopr r0
("nop_lr0", "nop_lr1"): New insn definitions.
gcc/testsuite/ChangeLog:
2018-04-06 Andreas Krebbel <krebbel(a)linux.vnet.ibm.com>
* gcc.target/s390/s390.exp: Remove -O0 from list of torture
options.
* gcc.target/s390/hotpatch-1.c: Skip when building without
optimization.
* gcc.target/s390/hotpatch-10.c: Likewise.
* gcc.target/s390/hotpatch-11.c: Likewise.
* gcc.target/s390/hotpatch-12.c: Likewise.
* gcc.target/s390/hotpatch-13.c: Likewise.
* gcc.target/s390/hotpatch-14.c: Likewise.
* gcc.target/s390/hotpatch-15.c: Likewise.
* gcc.target/s390/hotpatch-16.c: Likewise.
* gcc.target/s390/hotpatch-17.c: Likewise.
* gcc.target/s390/hotpatch-18.c: Likewise.
* gcc.target/s390/hotpatch-19.c: Likewise.
* gcc.target/s390/hotpatch-2.c: Likewise.
* gcc.target/s390/hotpatch-3.c: Likewise.
* gcc.target/s390/hotpatch-4.c: Likewise.
* gcc.target/s390/hotpatch-5.c: Likewise.
* gcc.target/s390/hotpatch-6.c: Likewise.
* gcc.target/s390/hotpatch-7.c: Likewise.
* gcc.target/s390/hotpatch-8.c: Likewise.
* gcc.target/s390/hotpatch-9.c: Likewise.
---
gcc/config/s390/s390.c | 4 ++--
gcc/config/s390/s390.md | 17 +++++++++++++++--
gcc/testsuite/gcc.target/s390/hotpatch-1.c | 7 +++++++
gcc/testsuite/gcc.target/s390/hotpatch-10.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-11.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-12.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-13.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-14.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-15.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-16.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-17.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-18.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-19.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-2.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-3.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-4.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-5.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-6.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-7.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-8.c | 1 +
gcc/testsuite/gcc.target/s390/hotpatch-9.c | 1 +
gcc/testsuite/gcc.target/s390/s390.exp | 2 +-
22 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 0161ba03ff3..b1db263d37c 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -13966,9 +13966,9 @@ s390_z10_optimize_cmp (rtx_insn *insn)
&& s390_non_addr_reg_read_p (*op0, prev_insn))
{
if (REGNO (*op1) == 0)
- emit_insn_after (gen_nop1 (), insn);
+ emit_insn_after (gen_nop_lr1 (), insn);
else
- emit_insn_after (gen_nop (), insn);
+ emit_insn_after (gen_nop_lr0 (), insn);
insn_added_p = true;
}
else
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index bb399354855..e134d7f2972 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -267,6 +267,10 @@
UNSPECV_CAS
UNSPECV_ATOMIC_OP
+ ; Non-branch nops used for compare-and-branch adjustments on z10
+ UNSPECV_NOP_LR_0
+ UNSPECV_NOP_LR_1
+
; Hotpatching (unremovable NOPs)
UNSPECV_NOP_2_BYTE
UNSPECV_NOP_4_BYTE
@@ -11006,12 +11010,21 @@
(define_insn "nop"
[(const_int 0)]
""
+ "nopr\t%%r0"
+ [(set_attr "op_type" "RR")])
+
+; non-branch NOPs required for optimizing compare-and-branch patterns
+; on z10
+
+(define_insn "nop_lr0"
+ [(unspec_volatile [(const_int 0)] UNSPECV_NOP_LR_0)]
+ ""
"lr\t0,0"
[(set_attr "op_type" "RR")
(set_attr "z10prop" "z10_fr_E1")])
-(define_insn "nop1"
- [(const_int 1)]
+(define_insn "nop_lr1"
+ [(unspec_volatile [(const_int 0)] UNSPECV_NOP_LR_1)]
""
"lr\t1,1"
[(set_attr "op_type" "RR")])
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-1.c b/gcc/testsuite/gcc.target/s390/hotpatch-1.c
index 5f0f2e19349..67e101ee318 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-1.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-1.c
@@ -3,6 +3,13 @@
/* { dg-do compile } */
/* { dg-options "-mzarch" } */
+/* Without optimization extra NOPs will be added just to attach
+ location info to it. Don't run the test in that case. The torture
+ framework always appears to run the testcase without -O option
+ first. */
+
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
+
#include <stdio.h>
void hp1(void)
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-10.c b/gcc/testsuite/gcc.target/s390/hotpatch-10.c
index 2308d3331a0..21d499e6204 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-10.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-10.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=0,0" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-11.c b/gcc/testsuite/gcc.target/s390/hotpatch-11.c
index 56b3596d497..a37f3117c64 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-11.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-11.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=1,0" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-12.c b/gcc/testsuite/gcc.target/s390/hotpatch-12.c
index 8a91c1b8b06..cb8d1521bfa 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-12.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-12.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=999,0" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-13.c b/gcc/testsuite/gcc.target/s390/hotpatch-13.c
index 70fab74d18d..fb037c2040f 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-13.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-13.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-14.c b/gcc/testsuite/gcc.target/s390/hotpatch-14.c
index 389bf42aee8..fd0368a55ae 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-14.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-14.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-15.c b/gcc/testsuite/gcc.target/s390/hotpatch-15.c
index 0b10fb18b41..a1c3e7c694b 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-15.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-15.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-16.c b/gcc/testsuite/gcc.target/s390/hotpatch-16.c
index 2fcdf1ce765..737c3a1c071 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-16.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-16.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=0,0" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-17.c b/gcc/testsuite/gcc.target/s390/hotpatch-17.c
index 299f82505ee..6d8c40c65c0 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-17.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-17.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=1,2" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-18.c b/gcc/testsuite/gcc.target/s390/hotpatch-18.c
index fd44d118323..02807ff7b6e 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-18.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-18.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=1,2 -mhotpatch=0,0" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-19.c b/gcc/testsuite/gcc.target/s390/hotpatch-19.c
index 899e000a71f..71c2ed13d18 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-19.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-19.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=1,2" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-2.c b/gcc/testsuite/gcc.target/s390/hotpatch-2.c
index 99fe9114f24..ece6cb37e57 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-2.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-2.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=0,1" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-3.c b/gcc/testsuite/gcc.target/s390/hotpatch-3.c
index 20f43c6b458..65ebe353688 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-3.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-3.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=0,2" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-4.c b/gcc/testsuite/gcc.target/s390/hotpatch-4.c
index 32a3c032d65..d0956f14240 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-4.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-4.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=0,3" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-5.c b/gcc/testsuite/gcc.target/s390/hotpatch-5.c
index 72ee5a30056..64d49eecb13 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-5.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-5.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=0,4" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-6.c b/gcc/testsuite/gcc.target/s390/hotpatch-6.c
index 1e1d0e6973a..e6753c8385d 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-6.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-6.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=0,5" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-7.c b/gcc/testsuite/gcc.target/s390/hotpatch-7.c
index 3f60e61e7e2..3f1c9f0e294 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-7.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-7.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-mzarch -mhotpatch=0,6" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-8.c b/gcc/testsuite/gcc.target/s390/hotpatch-8.c
index 012a4ebd44d..a2fb83f2977 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-8.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-8.c
@@ -2,6 +2,7 @@
/* { dg-do compile { target { ! lp64 } } } */
/* { dg-options "-mesa -march=g5 -Wno-deprecated -mhotpatch=0,3" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-9.c b/gcc/testsuite/gcc.target/s390/hotpatch-9.c
index b7d557e43a2..34fae55d3ad 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-9.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-9.c
@@ -2,6 +2,7 @@
/* { dg-do compile { target { ! lp64 } } } */
/* { dg-options "-mesa -march=g5 -Wno-deprecated -mhotpatch=0,4" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.target/s390/s390.exp b/gcc/testsuite/gcc.target/s390/s390.exp
index 420aff19a3f..8489a51693b 100644
--- a/gcc/testsuite/gcc.target/s390/s390.exp
+++ b/gcc/testsuite/gcc.target/s390/s390.exp
@@ -220,7 +220,7 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/md/*.{c,S,C}]] \
# Additional hotpatch torture tests.
torture-init
-set-torture-options [list -Os -O0 -O1 -O2 -O3]
+set-torture-options [list -Os -O1 -O2 -O3]
gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/hotpatch-\[0-9\]*.c]] \
"" $DEFAULT_CFLAGS
torture-finish
--
2.33.1
++++++ gcc7-pfe-0007-Backport-Add-regex-to-search-for-uppercase-NOP-instr.patch ++++++
From 74d2c825af4a197de0aecbaadb66f5ad6d65cbdb Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l(a)mittosystems.com>
Date: Thu, 8 Nov 2018 16:31:27 +0000
Subject: [PATCH 07/22] Backport Add regex to search for uppercase "NOP"
instructions in assembler output.
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2018-11-08 Jozef Lawrynowicz <jozef.l(a)mittosystems.com>
* c-c++-common/patchable_function_entry-decl.c: Add regex to search for
uppercase "NOP" instructions in assembler output.
* c-c++-common/patchable_function_entry-default.c: Likewise.
* c-c++-common/patchable_function_entry-definition.c: Likewise.
---
gcc/testsuite/c-c++-common/patchable_function_entry-decl.c | 2 +-
gcc/testsuite/c-c++-common/patchable_function_entry-default.c | 2 +-
.../c-c++-common/patchable_function_entry-definition.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
index 32e2c06eae3..3bfb7568bee 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop" 2 { target { ! { alpha*-*-* visium-*-* } } } } } */
+/* { dg-final { scan-assembler-times "nop|NOP" 2 { target { ! { alpha*-*-* visium-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 2 { target alpha*-*-* } } } */
/* { dg-final { scan-assembler-times "nop" 3 { target visium-*-* } } } */
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
index be88e431e30..bd7c6e98fc6 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop" 3 { target { ! { alpha*-*-* visium-*-* } } } } } */
+/* { dg-final { scan-assembler-times "nop|NOP" 3 { target { ! { alpha*-*-* visium-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 3 { target alpha*-*-* } } } */
/* { dg-final { scan-assembler-times "nop" 4 { target visium-*-* } } } */
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
index af18dbcd5e6..709113890ef 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop" 1 { target { ! { alpha*-*-* visium-*-* } } } } } */
+/* { dg-final { scan-assembler-times "nop|NOP" 1 { target { ! { alpha*-*-* visium-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 1 { target alpha*-*-* } } } */
/* { dg-final { scan-assembler-times "nop" 2 { target visium-*-* } } } */
--
2.33.1
++++++ gcc7-pfe-0008-Backport-ICE-segmentation-fault-with-patchable_funct.patch ++++++
From c3982f5bddf56bbc96d838ea35540eae81504bb3 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l(a)mittosystems.com>
Date: Fri, 16 Nov 2018 23:53:30 +0000
Subject: [PATCH 08/22] Backport: ICE: segmentation fault with
patchable_function_entry attribute for msp430-elf -mlarge)
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2018-11-16 Jozef Lawrynowicz <jozef.l(a)mittosystems.com>
PR target/87927
* target-def.h: Initialize TARGET_ASM_{,UN}ALIGNED_P{S,D,T}I_OP.
Add them to the TARGET_ASM_{,UN}ALIGNED_INT_OP structs.
* target.def: Enumerate TARGET_ASM_{,UN}ALIGNED_P{S,D,T}I_OP in
the byte_op hook.
* target.h: Add psi, pdi, pti to struct asm_int_op definition.
* targhooks.c (default_print_patchable_function_entry): Assert
asm_int_op does not return a NULL string.
* varasm.c (integer_asm_op): Return the op for a partial int type
when the requested size does not correspond to an integer type.
* config/msp430/msp430.c: Initialize TARGET_ASM_{,UN}ALIGNED_PSI_OP.
* doc/tm.texi: Regenerate.
---
gcc/config/msp430/msp430.c | 5 +++++
gcc/doc/tm.texi | 6 ++++++
gcc/target-def.h | 15 +++++++++++++++
gcc/target.def | 6 ++++++
gcc/target.h | 3 +++
gcc/targhooks.c | 4 +++-
gcc/varasm.c | 14 ++++++++++++++
7 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
index c1f0d5b0026..3ad552d9e94 100644
--- a/gcc/config/msp430/msp430.c
+++ b/gcc/config/msp430/msp430.c
@@ -3391,6 +3391,11 @@ msp430_print_operand_raw (FILE * file, rtx op)
}
}
+#undef TARGET_ASM_ALIGNED_PSI_OP
+#define TARGET_ASM_ALIGNED_PSI_OP "\t.long\t"
+#undef TARGET_ASM_UNALIGNED_PSI_OP
+#define TARGET_ASM_UNALIGNED_PSI_OP TARGET_ASM_ALIGNED_PSI_OP
+
#undef TARGET_PRINT_OPERAND_ADDRESS
#define TARGET_PRINT_OPERAND_ADDRESS msp430_print_operand_addr
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index b4456f7cd40..cb9fabb4295 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -7798,12 +7798,18 @@ hook.
@deftypevr {Target Hook} {const char *} TARGET_ASM_BYTE_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_HI_OP
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PSI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_SI_OP
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PDI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_DI_OP
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PTI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_TI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_HI_OP
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_PSI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_SI_OP
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_PDI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_DI_OP
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_PTI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_TI_OP
These hooks specify assembly directives for creating certain kinds
of integer object. The @code{TARGET_ASM_BYTE_OP} directive creates a
diff --git a/gcc/target-def.h b/gcc/target-def.h
index c99bfaa0105..cbd9fe6b967 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -47,6 +47,15 @@
#define TARGET_ASM_UNALIGNED_TI_OP NULL
#endif /* OBJECT_FORMAT_ELF */
+/* There is no standard way to handle P{S,D,T}Imode, targets must implement them
+ if required. */
+#define TARGET_ASM_ALIGNED_PSI_OP NULL
+#define TARGET_ASM_UNALIGNED_PSI_OP NULL
+#define TARGET_ASM_ALIGNED_PDI_OP NULL
+#define TARGET_ASM_UNALIGNED_PDI_OP NULL
+#define TARGET_ASM_ALIGNED_PTI_OP NULL
+#define TARGET_ASM_UNALIGNED_PTI_OP NULL
+
#if !defined(TARGET_ASM_CONSTRUCTOR) && !defined(USE_COLLECT2)
# ifdef CTORS_SECTION_ASM_OP
# define TARGET_ASM_CONSTRUCTOR default_ctor_section_asm_out_constructor
@@ -89,14 +98,20 @@
#define TARGET_ASM_ALIGNED_INT_OP \
{TARGET_ASM_ALIGNED_HI_OP, \
+ TARGET_ASM_ALIGNED_PSI_OP, \
TARGET_ASM_ALIGNED_SI_OP, \
+ TARGET_ASM_ALIGNED_PDI_OP, \
TARGET_ASM_ALIGNED_DI_OP, \
+ TARGET_ASM_ALIGNED_PTI_OP, \
TARGET_ASM_ALIGNED_TI_OP}
#define TARGET_ASM_UNALIGNED_INT_OP \
{TARGET_ASM_UNALIGNED_HI_OP, \
+ TARGET_ASM_UNALIGNED_PSI_OP, \
TARGET_ASM_UNALIGNED_SI_OP, \
+ TARGET_ASM_UNALIGNED_PDI_OP, \
TARGET_ASM_UNALIGNED_DI_OP, \
+ TARGET_ASM_UNALIGNED_PTI_OP, \
TARGET_ASM_UNALIGNED_TI_OP}
#if !defined (TARGET_FUNCTION_INCOMING_ARG)
diff --git a/gcc/target.def b/gcc/target.def
index bea79404836..c50ed9445cd 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -45,12 +45,18 @@ DEFHOOKPODX (close_paren, const char *, ")")
DEFHOOKPOD
(byte_op,
"@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_HI_OP\n\
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PSI_OP\n\
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_SI_OP\n\
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PDI_OP\n\
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_DI_OP\n\
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PTI_OP\n\
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_TI_OP\n\
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_HI_OP\n\
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_PSI_OP\n\
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_SI_OP\n\
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_PDI_OP\n\
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_DI_OP\n\
+@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_PTI_OP\n\
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_TI_OP\n\
These hooks specify assembly directives for creating certain kinds\n\
of integer object. The @code{TARGET_ASM_BYTE_OP} directive creates a\n\
diff --git a/gcc/target.h b/gcc/target.h
index 393de408b97..5f2b1d6d9cc 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -158,8 +158,11 @@ extern bool stmt_in_inner_loop_p (struct _stmt_vec_info *);
struct asm_int_op
{
const char *hi;
+ const char *psi;
const char *si;
+ const char *pdi;
const char *di;
+ const char *pti;
const char *ti;
};
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 77ca69105d0..c57967966c5 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -1636,13 +1636,15 @@ default_print_patchable_function_entry (FILE *file,
char buf[256];
static int patch_area_number;
section *previous_section = in_section;
+ const char *asm_op = integer_asm_op (POINTER_SIZE_UNITS, false);
+ gcc_assert (asm_op != NULL);
patch_area_number++;
ASM_GENERATE_INTERNAL_LABEL (buf, "LPFE", patch_area_number);
switch_to_section (get_section ("__patchable_function_entries",
0, NULL));
- fputs (integer_asm_op (POINTER_SIZE_UNITS, false), file);
+ fputs (asm_op, file);
assemble_name_raw (file, buf);
fputc ('\n', file);
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 6e9a8c3133e..5711ba69555 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2713,10 +2713,24 @@ integer_asm_op (int size, int aligned_p)
return targetm.asm_out.byte_op;
case 2:
return ops->hi;
+ case 3:
+ return ops->psi;
case 4:
return ops->si;
+ case 5:
+ case 6:
+ case 7:
+ return ops->pdi;
case 8:
return ops->di;
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ return ops->pti;
case 16:
return ops->ti;
default:
--
2.33.1
++++++ gcc7-pfe-0009-Backport-patchable_function_entry-decl.c-Pass-mcpu-g.patch ++++++
From 7e12d4ef76f860574dd7a822522238bdec2687d3 Mon Sep 17 00:00:00 2001
From: Eric Botcazou <ebotcazou(a)adacore.com>
Date: Mon, 10 Dec 2018 11:16:47 +0000
Subject: [PATCH 09/22] Backport patchable_function_entry-decl.c: Pass
-mcpu=gr6 for Visium and remove other specific handling.
gcc/testsuite/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2018-12-10 Eric Botcazou <ebotcazou(a)adacore.com>
* c-c++-common/patchable_function_entry-decl.c: Pass -mcpu=gr6 for
Visium and remove other specific handling.
* c-c++-common/patchable_function_entry-default.c: Likewise.
* c-c++-common/patchable_function_entry-definition.c: Likewise.
---
gcc/testsuite/c-c++-common/patchable_function_entry-decl.c | 4 ++--
gcc/testsuite/c-c++-common/patchable_function_entry-default.c | 4 ++--
.../c-c++-common/patchable_function_entry-definition.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
index 3bfb7568bee..572297ca1f4 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
@@ -1,8 +1,8 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop|NOP" 2 { target { ! { alpha*-*-* visium-*-* } } } } } */
+/* { dg-additional-options "-mcpu=gr6" { target visium-*-* } }
+/* { dg-final { scan-assembler-times "nop|NOP" 2 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 2 { target alpha*-*-* } } } */
-/* { dg-final { scan-assembler-times "nop" 3 { target visium-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
index bd7c6e98fc6..942ec14c8e5 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
@@ -1,8 +1,8 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop|NOP" 3 { target { ! { alpha*-*-* visium-*-* } } } } } */
+/* { dg-additional-options "-mcpu=gr6" { target visium-*-* } }
+/* { dg-final { scan-assembler-times "nop|NOP" 3 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 3 { target alpha*-*-* } } } */
-/* { dg-final { scan-assembler-times "nop" 4 { target visium-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
index 709113890ef..e88b0eb15c1 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -1,8 +1,8 @@
/* { dg-do compile { target { ! nvptx*-*-* } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-final { scan-assembler-times "nop|NOP" 1 { target { ! { alpha*-*-* visium-*-* } } } } } */
+/* { dg-additional-options "-mcpu=gr6" { target visium-*-* } }
+/* { dg-final { scan-assembler-times "nop|NOP" 1 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 1 { target alpha*-*-* } } } */
-/* { dg-final { scan-assembler-times "nop" 2 { target visium-*-* } } } */
extern int a;
--
2.33.1
++++++ gcc7-pfe-0010-Backport-patchable_function_entry-decl.c-Do-not-run-.patch ++++++
From 7314f1ac164bde51f43dd1c96fe2f1e7be5dfe77 Mon Sep 17 00:00:00 2001
From: Eric Botcazou <ebotcazou(a)adacore.com>
Date: Fri, 15 Feb 2019 10:50:27 +0000
Subject: [PATCH 10/22] Backport patchable_function_entry-decl.c: Do not run on
Visium.
gcc/testsuite/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2019-02-15 Eric Botcazou <ebotcazou(a)adacore.com>
* c-c++-common/patchable_function_entry-decl.c: Do not run on Visium.
* c-c++-common/patchable_function_entry-default.c: Likewise.
* c-c++-common/patchable_function_entry-definition.c: Likewise.
---
gcc/testsuite/c-c++-common/patchable_function_entry-decl.c | 3 +--
gcc/testsuite/c-c++-common/patchable_function_entry-default.c | 3 +--
.../c-c++-common/patchable_function_entry-definition.c | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
index 572297ca1f4..1f8009b0faa 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
@@ -1,6 +1,5 @@
-/* { dg-do compile { target { ! nvptx*-*-* } } } */
+/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-additional-options "-mcpu=gr6" { target visium-*-* } }
/* { dg-final { scan-assembler-times "nop|NOP" 2 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 2 { target alpha*-*-* } } } */
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
index 942ec14c8e5..6b0318f0d66 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
@@ -1,6 +1,5 @@
-/* { dg-do compile { target { ! nvptx*-*-* } } } */
+/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-additional-options "-mcpu=gr6" { target visium-*-* } }
/* { dg-final { scan-assembler-times "nop|NOP" 3 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 3 { target alpha*-*-* } } } */
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
index e88b0eb15c1..6667d3c558c 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -1,6 +1,5 @@
-/* { dg-do compile { target { ! nvptx*-*-* } } } */
+/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
-/* { dg-additional-options "-mcpu=gr6" { target visium-*-* } }
/* { dg-final { scan-assembler-times "nop|NOP" 1 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 1 { target alpha*-*-* } } } */
--
2.33.1
++++++ gcc7-pfe-0011-Backport-patchable_function_entry-decl.c-Add-fno-pie.patch ++++++
From 030d757e6f0f86b5f899737ab2fe73261a759dc7 Mon Sep 17 00:00:00 2001
From: Eric Botcazou <ebotcazou(a)adacore.com>
Date: Sat, 16 Feb 2019 14:40:53 +0000
Subject: [PATCH 11/22] Backport patchable_function_entry-decl.c: Add -fno-pie
on SPARC.
gcc/testsuite/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2019-02-16 Eric Botcazou <ebotcazou(a)adacore.com>
* c-c++-common/patchable_function_entry-decl.c: Add -fno-pie on SPARC.
* c-c++-common/patchable_function_entry-default.c: Likewise.
* c-c++-common/patchable_function_entry-definition.c: Likewise.
---
gcc/testsuite/c-c++-common/patchable_function_entry-decl.c | 1 +
gcc/testsuite/c-c++-common/patchable_function_entry-default.c | 1 +
gcc/testsuite/c-c++-common/patchable_function_entry-definition.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
index 1f8009b0faa..4f707b31f0d 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
@@ -1,5 +1,6 @@
/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
+/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
/* { dg-final { scan-assembler-times "nop|NOP" 2 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 2 { target alpha*-*-* } } } */
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
index 6b0318f0d66..97d8a81fbc6 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
@@ -1,5 +1,6 @@
/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
+/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
/* { dg-final { scan-assembler-times "nop|NOP" 3 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 3 { target alpha*-*-* } } } */
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
index 6667d3c558c..ab94533ffec 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -1,5 +1,6 @@
/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
+/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
/* { dg-final { scan-assembler-times "nop|NOP" 1 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 1 { target alpha*-*-* } } } */
--
2.33.1
++++++ gcc7-pfe-0012-Backport-PR-c-89946-ICE-in-assemble_start_function-a.patch ++++++
From dd42709efc288ce501b52d95b8ef0d05713a07f6 Mon Sep 17 00:00:00 2001
From: Jakub Jelinek <jakub(a)redhat.com>
Date: Fri, 12 Apr 2019 09:28:35 +0200
Subject: [PATCH 12/22] Backport PR c/89946 (ICE in assemble_start_function, at
varasm.c:1871)
gcc/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2019-04-12 Jakub Jelinek <jakub(a)redhat.com>
PR c/89946
* varasm.c (assemble_start_function): Don't use tree_fits_uhwi_p
and gcc_unreachable if it fails, just call tree_to_uhwi which
verifies that too. Test TREE_CHAIN instead of list_length > 1.
Start warning message with a lower-case letter. Formatting fixes.
PR rtl-optimization/90026
* cfgcleanup.c (try_optimize_cfg): When removing empty bb with no
successors, look for BARRIERs inside of the whole BB_FOOTER chain
rather than just at the start of it. If e->src BB_FOOTER is not NULL
in cfglayout mode, use emit_barrier_after_bb.
gcc/c-family/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport of mainline
2019-04-12 Jakub Jelinek <jakub(a)redhat.com>
PR c/89946
* c-attribs.c (handle_patchable_function_entry_attribute): Add
function comment. Warn if arguments of the attribute are not positive
integer constants.
gcc/testsuite/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2019-04-12 Jakub Jelinek <jakub(a)redhat.com>
PR c/89946
* c-c++-common/pr89946.c: New test.
PR rtl-optimization/90026
* g++.dg/opt/pr90026.C: New test.
---
gcc/c-family/c-attribs.c | 23 +++++++++++++++++++++--
gcc/testsuite/c-c++-common/pr89946.c | 7 +++++++
gcc/varasm.c | 23 ++++++++---------------
3 files changed, 36 insertions(+), 17 deletions(-)
create mode 100644 gcc/testsuite/c-c++-common/pr89946.c
diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c
index b2820dd1586..f0d2b1ed500 100644
--- a/gcc/c-family/c-attribs.c
+++ b/gcc/c-family/c-attribs.c
@@ -3184,9 +3184,28 @@ handle_fallthrough_attribute (tree *, tree name, tree, int,
return NULL_TREE;
}
+/* Handle a "patchable_function_entry" attributes; arguments as in
+ struct attribute_spec.handler. */
+
static tree
-handle_patchable_function_entry_attribute (tree *, tree, tree, int, bool *)
+handle_patchable_function_entry_attribute (tree *, tree name, tree args,
+ int, bool *no_add_attrs)
{
- /* Nothing to be done here. */
+ for (; args; args = TREE_CHAIN (args))
+ {
+ tree val = TREE_VALUE (args);
+ if (val && TREE_CODE (val) != IDENTIFIER_NODE
+ && TREE_CODE (val) != FUNCTION_DECL)
+ val = default_conversion (val);
+
+ if (!tree_fits_uhwi_p (val))
+ {
+ warning (OPT_Wattributes,
+ "%qE attribute argument %qE is not an integer constant",
+ name, val);
+ *no_add_attrs = true;
+ return NULL_TREE;
+ }
+ }
return NULL_TREE;
}
diff --git a/gcc/testsuite/c-c++-common/pr89946.c b/gcc/testsuite/c-c++-common/pr89946.c
new file mode 100644
index 00000000000..23acd63fc6a
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr89946.c
@@ -0,0 +1,7 @@
+/* PR c/89946 */
+
+__attribute__((patchable_function_entry (-1))) void foo (void) {} /* { dg-warning "'patchable_function_entry' attribute argument '-1' is not an integer constant" } */
+__attribute__((patchable_function_entry (5, -5))) void bar (void) {} /* { dg-warning "'patchable_function_entry' attribute argument '-5' is not an integer constant" } */
+int i, j;
+__attribute__((patchable_function_entry (i))) void baz (void) {} /* { dg-warning "'patchable_function_entry' attribute argument 'i' is not an integer constant" } */
+__attribute__((patchable_function_entry (2, j))) void qux (void) {} /* { dg-warning "'patchable_function_entry' attribute argument 'j' is not an integer constant" } */
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 5711ba69555..0e6f20db361 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1839,28 +1839,20 @@ assemble_start_function (tree decl, const char *fnname)
tree pp_val = TREE_VALUE (patchable_function_entry_attr);
tree patchable_function_entry_value1 = TREE_VALUE (pp_val);
- if (tree_fits_uhwi_p (patchable_function_entry_value1))
- patch_area_size = tree_to_uhwi (patchable_function_entry_value1);
- else
- gcc_unreachable ();
-
+ patch_area_size = tree_to_uhwi (patchable_function_entry_value1);
patch_area_entry = 0;
- if (list_length (pp_val) > 1)
+ if (TREE_CHAIN (pp_val) != NULL_TREE)
{
- tree patchable_function_entry_value2 =
- TREE_VALUE (TREE_CHAIN (pp_val));
-
- if (tree_fits_uhwi_p (patchable_function_entry_value2))
- patch_area_entry = tree_to_uhwi (patchable_function_entry_value2);
- else
- gcc_unreachable ();
+ tree patchable_function_entry_value2
+ = TREE_VALUE (TREE_CHAIN (pp_val));
+ patch_area_entry = tree_to_uhwi (patchable_function_entry_value2);
}
}
if (patch_area_entry > patch_area_size)
{
if (patch_area_size > 0)
- warning (OPT_Wattributes, "Patchable function entry > size");
+ warning (OPT_Wattributes, "patchable function entry > size");
patch_area_entry = 0;
}
@@ -1880,7 +1872,8 @@ assemble_start_function (tree decl, const char *fnname)
/* And the area after the label. Record it if we haven't done so yet. */
if (patch_area_size > patch_area_entry)
targetm.asm_out.print_patchable_function_entry (asm_out_file,
- patch_area_size-patch_area_entry,
+ patch_area_size
+ - patch_area_entry,
patch_area_entry == 0);
if (lookup_attribute ("no_split_stack", DECL_ATTRIBUTES (decl)))
--
2.33.1
++++++ gcc7-pfe-0013-Backport-targhooks.c-default_print_patchable_functio.patch ++++++
From 2d35914acc611b8780c52c2e6df78d56da37a61d Mon Sep 17 00:00:00 2001
From: Joao Moreira <jmoreira(a)suse.de>
Date: Wed, 17 Apr 2019 18:24:23 +0000
Subject: [PATCH 13/22] Backport targhooks.c
(default_print_patchable_function_entry): Emit __patchable_function_entries
section with writable flags to allow...
gcc/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2019-04-10 Joao Moreira <jmoreira(a)suse.de>
* targhooks.c (default_print_patchable_function_entry): Emit
__patchable_function_entries section with writable flags to allow
relocation resolution.
---
gcc/targhooks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index c57967966c5..be0c557f1a2 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -1643,7 +1643,7 @@ default_print_patchable_function_entry (FILE *file,
ASM_GENERATE_INTERNAL_LABEL (buf, "LPFE", patch_area_number);
switch_to_section (get_section ("__patchable_function_entries",
- 0, NULL));
+ SECTION_WRITE | SECTION_RELRO, NULL));
fputs (asm_op, file);
assemble_name_raw (file, buf);
fputc ('\n', file);
--
2.33.1
++++++ gcc7-pfe-0014-Backport-Align-__patchable_function_entries-to-POINT.patch ++++++
From e469ad6db5edd55f07cbf1ba5b4a49e2e9c7c72b Mon Sep 17 00:00:00 2001
From: Fangrui Song <maskray(a)google.com>
Date: Tue, 7 Jan 2020 20:46:26 -0800
Subject: [PATCH 14/22] Backport Align __patchable_function_entries to
POINTER_SIZE [PR93194]
gcc/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2020-01-20 Fangrui Song <maskray(a)google.com>
PR middle-end/93194
* targhooks.c (default_print_patchable_function_entry): Align to
POINTER_SIZE.
---
gcc/targhooks.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index be0c557f1a2..aaf536acf17 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -1644,6 +1644,7 @@ default_print_patchable_function_entry (FILE *file,
switch_to_section (get_section ("__patchable_function_entries",
SECTION_WRITE | SECTION_RELRO, NULL));
+ assemble_align (POINTER_SIZE);
fputs (asm_op, file);
assemble_name_raw (file, buf);
fputc ('\n', file);
--
2.33.1
++++++ gcc7-pfe-0015-Backport-Fix-PR-93242-patchable-function-entry-broke.patch ++++++
From 770fcd0a31f3d557e5c79004161fa4c14fdaeced Mon Sep 17 00:00:00 2001
From: Andrew Pinski <apinski(a)marvell.com>
Date: Sat, 18 Jan 2020 00:41:06 +0000
Subject: [PATCH 15/22] Backport Fix PR 93242: patchable-function-entry broken
on MIPS
On MIPS, .set noreorder/reorder needs to emitted around
the nop. The template for the nop instruction uses %(/%) to
do that. But default_print_patchable_function_entry uses
fprintf rather than output_asm_insn to output the instruction.
This fixes the problem by using output_asm_insn to emit the nop
instruction.
gcc/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2020-01-20 Andrew Pinski <apinski(a)marvell.com>
PR middle-end/93242
* targhooks.c (default_print_patchable_function_entry): use
output_asm_insn to emit the nop instruction.
---
gcc/targhooks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index aaf536acf17..185dc7b0b6b 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -1655,7 +1655,7 @@ default_print_patchable_function_entry (FILE *file,
unsigned i;
for (i = 0; i < patch_area_size; ++i)
- fprintf (file, "\t%s\n", nop_templ);
+ output_asm_insn (nop_templ, NULL);
}
bool
--
2.33.1
++++++ gcc7-pfe-0016-Backport-Fix-patchable-function-entry-on-arc.patch ++++++
From 3775c56f07ebfba1155721bdaa948a71e26df6b0 Mon Sep 17 00:00:00 2001
From: Andrew Pinski <apinski(a)marvell.com>
Date: Wed, 22 Jan 2020 23:34:34 +0000
Subject: [PATCH 16/22] Backport Fix patchable-function-entry on arc
The problem here is arc looks at current_output_insn unconditional
but sometimes current_output_insn is NULL. With patchable-function-entry,
it will be. This is similar to how the nios2, handles "%.".
Committed as obvious after a simple test with -fpatchable-function-entry=1.
gcc/ChangeLog
2021-10-07 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2020-01-22 Andrew Pinski <apinski(a)marvell.com>
* config/arc/arc.c (output_short_suffix): Check insn for nullness.
---
gcc/config/arc/arc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 92fecad93d9..5e92983929d 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -4195,6 +4195,8 @@ static void
output_short_suffix (FILE *file)
{
rtx_insn *insn = current_output_insn;
+ if (!insn)
+ return;
if (arc_verify_short (insn, cfun->machine->unalign, 1))
{
--
2.33.1
++++++ gcc7-pfe-0017-Backport-Add-patch_area_size-and-patch_area_entry-to.patch ++++++
From 961670bae0c7b37073dbc0bb58d730d1ed603d5d Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools(a)gmail.com>
Date: Fri, 1 May 2020 21:03:10 -0700
Subject: [PATCH 17/22] Backport Add patch_area_size and patch_area_entry to
crtl
Currently patchable area is at the wrong place. It is placed immediately
after function label and before .cfi_startproc. A backend should be able
to add a pseudo patchable area instruction durectly into RTL. This patch
adds patch_area_size and patch_area_entry to crtl so that the patchable
area info is available in RTL passes.
It also limits patch_area_size and patch_area_entry to 65535, which is
a reasonable maximum size for patchable area.
gcc/
PR target/93492
* cfgexpand.c (pass_expand::execute): Set crtl->patch_area_size
and crtl->patch_area_entry.
* emit-rtl.h (rtl_data): Add patch_area_size and patch_area_entry.
* opts.c (common_handle_option): Limit
function_entry_patch_area_size and function_entry_patch_area_start
to USHRT_MAX. Fix a typo in error message.
* varasm.c (assemble_start_function): Use crtl->patch_area_size
and crtl->patch_area_entry.
* doc/invoke.texi: Document the maximum value for
-fpatchable-function-entry.
gcc/c-family/
PR target/93492
* c-attribs.c (handle_patchable_function_entry_attribute): Limit
value to USHRT_MAX (65535).
gcc/testsuite/
PR target/93492
* c-c++-common/patchable_function_entry-error-1.c: New test.
* c-c++-common/patchable_function_entry-error-2.c: Likewise.
* c-c++-common/patchable_function_entry-error-3.c: Likewise.
---
gcc/c-family/c-attribs.c | 9 ++++
gcc/cfgexpand.c | 44 +++++++++++++++++++
gcc/doc/invoke.texi | 1 +
gcc/emit-rtl.h | 6 +++
gcc/opts.c | 4 +-
.../patchable_function_entry-error-1.c | 9 ++++
.../patchable_function_entry-error-2.c | 9 ++++
.../patchable_function_entry-error-3.c | 17 +++++++
gcc/varasm.c | 4 +-
9 files changed, 100 insertions(+), 3 deletions(-)
create mode 100644 gcc/testsuite/c-c++-common/patchable_function_entry-error-1.c
create mode 100644 gcc/testsuite/c-c++-common/patchable_function_entry-error-2.c
create mode 100644 gcc/testsuite/c-c++-common/patchable_function_entry-error-3.c
diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c
index f0d2b1ed500..c01baffbc57 100644
--- a/gcc/c-family/c-attribs.c
+++ b/gcc/c-family/c-attribs.c
@@ -3206,6 +3206,15 @@ handle_patchable_function_entry_attribute (tree *, tree name, tree args,
*no_add_attrs = true;
return NULL_TREE;
}
+
+ if (tree_to_uhwi (val) > USHRT_MAX)
+ {
+ warning (OPT_Wattributes,
+ "%qE attribute argument %qE is out of range (> 65535)",
+ name, val);
+ *no_add_attrs = true;
+ return NULL_TREE;
+ }
}
return NULL_TREE;
}
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 7fd3916a3c7..2a603823a71 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -6481,6 +6481,50 @@ pass_expand::execute (function *fun)
if (crtl->tail_call_emit)
fixup_tail_calls ();
+ unsigned HOST_WIDE_INT patch_area_size = function_entry_patch_area_size;
+ unsigned HOST_WIDE_INT patch_area_entry = function_entry_patch_area_start;
+
+ tree patchable_function_entry_attr
+ = lookup_attribute ("patchable_function_entry",
+ DECL_ATTRIBUTES (cfun->decl));
+ if (patchable_function_entry_attr)
+ {
+ tree pp_val = TREE_VALUE (patchable_function_entry_attr);
+ tree patchable_function_entry_value1 = TREE_VALUE (pp_val);
+
+ patch_area_size = tree_to_uhwi (patchable_function_entry_value1);
+ patch_area_entry = 0;
+ if (TREE_CHAIN (pp_val) != NULL_TREE)
+ {
+ tree patchable_function_entry_value2
+ = TREE_VALUE (TREE_CHAIN (pp_val));
+ patch_area_entry = tree_to_uhwi (patchable_function_entry_value2);
+ }
+ }
+
+ if (patch_area_entry > patch_area_size)
+ {
+ if (patch_area_size > 0)
+ warning (OPT_Wattributes,
+ "patchable function entry %wu exceeds size %wu",
+ patch_area_entry, patch_area_size);
+ patch_area_entry = 0;
+ }
+
+ crtl->patch_area_size = patch_area_size;
+ crtl->patch_area_entry = patch_area_entry;
+
+ /* This function is not present in gcc 7, nor the profile_count datastructures,
+ so it may be safe to assume that there is not enough engine implemented so
+ far to support that. */
+#if 0
+ /* BB subdivision may have created basic blocks that are only reachable
+ from unlikely bbs but not marked as such in the profile. */
+
+ if (optimize)
+ propagate_unlikely_bbs_forward ();
+#endif
+
/* Remove unreachable blocks, otherwise we cannot compute dominators
which are needed for loop state verification. As a side-effect
this also compacts blocks.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index ad71be54e07..9fd3b013ff7 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11445,6 +11445,7 @@ If @code{N=0}, no pad location is recorded.
The NOP instructions are inserted at---and maybe before, depending on
@var{M}---the function entry address, even before the prologue.
+The maximum value of @var{N} and @var{M} is 65535.
@end table
diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h
index da60a2d808c..66bc1bef391 100644
--- a/gcc/emit-rtl.h
+++ b/gcc/emit-rtl.h
@@ -163,6 +163,12 @@ struct GTY(()) rtl_data {
local stack. */
unsigned int stack_alignment_estimated;
+ /* How many NOP insns to place at each function entry by default. */
+ unsigned short patch_area_size;
+
+ /* How far the real asm entry point is into this area. */
+ unsigned short patch_area_entry;
+
/* For reorg. */
/* Nonzero if function being compiled called builtin_return_addr or
diff --git a/gcc/opts.c b/gcc/opts.c
index d0430e777ee..3de12b3662f 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2220,10 +2220,12 @@ common_handle_option (struct gcc_options *opts,
function_entry_patch_area_start = 0;
}
if (function_entry_patch_area_size < 0
+ || function_entry_patch_area_size > USHRT_MAX
|| function_entry_patch_area_start < 0
+ || function_entry_patch_area_start > USHRT_MAX
|| function_entry_patch_area_size
< function_entry_patch_area_start)
- error ("invalid arguments for %<-fpatchable_function_entry%>");
+ error ("invalid arguments for %<-fpatchable-function-entry%>");
free (patch_area_arg);
}
break;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-error-1.c b/gcc/testsuite/c-c++-common/patchable_function_entry-error-1.c
new file mode 100644
index 00000000000..f60bf46cfe3
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-error-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
+/* { dg-options "-O2 -fpatchable-function-entry=65536,1" } */
+/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
+/* { dg-error "invalid arguments for '-fpatchable-function-entry'" "" { target *-*-* } 0 } */
+
+void
+foo (void)
+{
+}
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-error-2.c b/gcc/testsuite/c-c++-common/patchable_function_entry-error-2.c
new file mode 100644
index 00000000000..90f88c78be7
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-error-2.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
+/* { dg-options "-O2 -fpatchable-function-entry=1,65536" } */
+/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
+/* { dg-error "invalid arguments for '-fpatchable-function-entry'" "" { target *-*-* } 0 } */
+
+void
+foo (void)
+{
+}
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-error-3.c b/gcc/testsuite/c-c++-common/patchable_function_entry-error-3.c
new file mode 100644
index 00000000000..4490e5c15ca
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-error-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
+/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
+
+void
+ __attribute__((patchable_function_entry(65536)))
+foo1 (void) { /* { dg-warning "'patchable_function_entry' attribute argument '65536' is out of range" } */
+}
+
+void
+ __attribute__((patchable_function_entry(65536,1)))
+foo2 (void) { /* { dg-warning "'patchable_function_entry' attribute argument '65536' is out of range" } */
+}
+
+void
+ __attribute__((patchable_function_entry(65536,65536)))
+foo3 (void) { /* { dg-warning "'patchable_function_entry' attribute argument '65536' is out of range" } */
+}
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 0e6f20db361..8d4c0386fe3 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1829,8 +1829,8 @@ assemble_start_function (tree decl, const char *fnname)
if (DECL_PRESERVE_P (decl))
targetm.asm_out.mark_decl_preserved (fnname);
- unsigned HOST_WIDE_INT patch_area_size = function_entry_patch_area_size;
- unsigned HOST_WIDE_INT patch_area_entry = function_entry_patch_area_start;
+ unsigned short patch_area_size = crtl->patch_area_size;
+ unsigned short patch_area_entry = crtl->patch_area_entry;
tree patchable_function_entry_attr
= lookup_attribute ("patchable_function_entry", DECL_ATTRIBUTES (decl));
--
2.33.1
++++++ gcc7-pfe-0018-Backport-testsuite-Adjust-patchable_function-tests-f.patch ++++++
From 269286fbce10ce33e07a11f9abab60c74ba84e33 Mon Sep 17 00:00:00 2001
From: Hans-Peter Nilsson <hp(a)bitrange.com>
Date: Fri, 24 Jul 2020 23:50:05 +0200
Subject: [PATCH 18/22] Backport testsuite: Adjust patchable_function tests for
mmix.
There's no reason anyone would want to use the "patchable function"
feature for MMIX and also no reason to exclude those tests. For MMIX,
the NOP equivalent is SWYM ("swymming" is a healthy exercise).
Text-wise, making the tests pass by adjusting the regexp, is shorter,
and it seems unlikely to both appear as a mnemonic for other targets
*and* being emitted in uppercase.
gcc/testsuite:
* c-c++-common/patchable_function_entry-decl.c,
c-c++-common/patchable_function_entry-default.c,
c-c++-common/patchable_function_entry-definition.c: Adjust for mmix.
---
gcc/testsuite/c-c++-common/patchable_function_entry-decl.c | 2 +-
gcc/testsuite/c-c++-common/patchable_function_entry-default.c | 2 +-
.../c-c++-common/patchable_function_entry-definition.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
index 4f707b31f0d..3ce7a5b8790 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
-/* { dg-final { scan-assembler-times "nop|NOP" 2 { target { ! { alpha*-*-* } } } } } */
+/* { dg-final { scan-assembler-times "nop|NOP|SWYM" 2 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 2 { target alpha*-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
index 97d8a81fbc6..7036f7bfbea 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
-/* { dg-final { scan-assembler-times "nop|NOP" 3 { target { ! { alpha*-*-* } } } } } */
+/* { dg-final { scan-assembler-times "nop|NOP|SWYM" 3 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 3 { target alpha*-*-* } } } */
extern int a;
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
index ab94533ffec..ad7d7a9e076 100644
--- a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
-/* { dg-final { scan-assembler-times "nop|NOP" 1 { target { ! { alpha*-*-* } } } } } */
+/* { dg-final { scan-assembler-times "nop|NOP|SWYM" 1 { target { ! { alpha*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 1 { target alpha*-*-* } } } */
extern int a;
--
2.33.1
++++++ gcc7-pfe-0019-Backport-Use-the-section-flag-o-for-__patchable_func.patch ++++++
++++ 974 lines (skipped)
++++++ gcc7-pfe-0020-Backport-varasm-Fix-up-__patchable_function_entries-.patch ++++++
From 686af21802e691f3b08cc45a5cb2c961b9676675 Mon Sep 17 00:00:00 2001
From: Jakub Jelinek <jakub(a)redhat.com>
Date: Wed, 16 Dec 2020 16:15:35 +0100
Subject: [PATCH 20/22] Backport varasm: Fix up __patchable_function_entries
handling
The SECTION_LINK_ORDER changes don't seem to work properly.
If I compile:
static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((patchable_function_entry(0, 0))) int foo (int x)
{
return x + 1;
}
static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((patchable_function_entry(0, 0))) int bar (int x)
{
return x + 2;
}
int
baz (int x)
{
return foo (x) + 1;
}
int
qux (int x)
{
return bar (x) + 2;
}
(distilled from aarch64 Linux kernel) with
-O2 -fpatchable-function-entry=2 on aarch64 compiler configured against
latest binutils, I get:
...
.section __patchable_function_entries,"awo",@progbits,baz
...
.section __patchable_function_entries
...
in the assembly, but when it is assembled, one gets:
[ 4] __patchable_function_entries PROGBITS 0000000000000000 000060 000008 00 WAL 1 0 8
[ 5] .rela__patchable_function_entries RELA 0000000000000000 000280 000018 18 I 12 4 8
[ 6] __patchable_function_entries PROGBITS 0000000000000000 000068 000008 00 0 0 8
[ 7] .rela__patchable_function_entries RELA 0000000000000000 000298 000018 18 I 12 6 8
i.e. one writable allocated section with SHF_LINK_ORDER and another
non-allocated non-writable without link order. In the kernel case there is
always one entry in the WAL section and then dozens or more in the
non-allocated one.
The kernel then fails to link:
WARNING: modpost: vmlinux.o (__patchable_function_entries): unexpected non-allocatable section.
Did you forget to use "ax"/"aw" in a .S file?
Note that for example <linux/init.h> contains
section definitions for use in .S files.
ld: .init.data has both ordered [`__patchable_function_entries' in init/main.o] and unordered [`.init.data' in
+./drivers/firmware/efi/libstub/vsprintf.stub.o] sections
ld: final link failed: bad value
make: *** [Makefile:1175: vmlinux] Error 1
The following patch fixes it by always forcing full section flags for
SECTION_LINK_ORDER sections.
2020-12-16 Jakub Jelinek <jakub(a)redhat.com>
* varasm.c (default_elf_asm_named_section): Always force
section flags even for sections with SECTION_LINK_ORDER flag.
---
gcc/varasm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 7b0792ddaed..9e0e7c0976f 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -6363,9 +6363,10 @@ default_elf_asm_named_section (const char *name, unsigned int flags,
/* If we have already declared this section, we can use an
abbreviated form to switch back to it -- unless this section is
- part of a COMDAT groups, in which case GAS requires the full
- declaration every time. */
+ part of a COMDAT groups or with SHF_GNU_RETAIN or with SHF_LINK_ORDER,
+ in which case GAS requires the full declaration every time. */
if (!(HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE))
+ && !(flags & (SECTION_RETAIN | SECTION_LINK_ORDER))
&& (flags & SECTION_DECLARED))
{
fprintf (asm_out_file, "\t.section\t%s\n", name);
--
2.33.1
++++++ gcc7-pfe-0021-Backport-rs6000-Avoid-fpatchable-function-entry-regr.patch ++++++
From 8e8d2277ff4a6d22467736de3acabaedd0a3a003 Mon Sep 17 00:00:00 2001
From: Jakub Jelinek <jakub(a)redhat.com>
Date: Sat, 3 Apr 2021 10:03:15 +0200
Subject: [PATCH 21/22] Backport rs6000: Avoid -fpatchable-function-entry*
regressions on powerpc64 be [PR98125]
The SECTION_LINK_ORDER changes broke powerpc64-linux ELFv1. Seems
that the assembler/linker relies on the symbol mentioned for the
"awo" section to be in the same section as the symbols mentioned in
the relocations in that section (i.e. labels for the patchable area
in this case). That is the case for most targets, including powerpc-linux
32-bit or powerpc64 ELFv2 (that one has -fpatchable-function-entry*
support broken for other reasons and it doesn't seem to be a regression).
But it doesn't work on powerpc64-linux ELFv1.
We emit:
.section ".opd","aw"
.align 3
_Z3foov:
.quad .L._Z3foov,.TOC.@tocbase,0
.previous
.type _Z3foov, @function
.L._Z3foov:
.section __patchable_function_entries,"awo",@progbits,_Z3foov
.align 3
.8byte .LPFE1
.section .text._Z3foov,"axG",@progbits,_Z3foov,comdat
.LPFE1:
nop
.LFB0:
.cfi_startproc
and because _Z3foov is in the .opd section rather than the function text
section, it doesn't work.
I'm afraid I don't know what exactly should be done, whether e.g.
it could use
.section __patchable_function_entries,"awo",(a)progbits,.L._Z3foov
instead, or whether the linker should be changed to handle it as is, or
something else.
But because we have a P1 regression that didn't see useful progress over the
4 months since it has been filed and we don't really have much time, below
is an attempt to do a targetted reversion of H.J's patch, basically act as
if HAVE_GAS_SECTION_LINK_ORDER is never true for powerpc64-linux ELFv1,
but for 32-bit or 64-bit ELFv2 keep working as is.
This would give us time to resolve it for GCC 12 properly.
2021-10-21 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2021-04-03 Jakub Jelinek <jakub(a)redhat.com>
PR testsuite/98125
* targhooks.h (default_print_patchable_function_entry_1): Declare.
* targhooks.c (default_print_patchable_function_entry_1): New function,
copied from default_print_patchable_function_entry with an added flags
argument.
(default_print_patchable_function_entry): Rewritten into a small
wrapper around default_print_patchable_function_entry_1.
* config/rs6000/rs6000.c (TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY):
Redefine.
(rs6000_print_patchable_function_entry): New function.
* g++.dg/pr93195a.C: Skip on powerpc*-*-* 64-bit.
---
gcc/config/rs6000/rs6000.c | 29 +++++++++++++++++++++++++++++
gcc/targhooks.c | 38 ++++++++++++++++++++++++++------------
gcc/targhooks.h | 3 +++
3 files changed, 58 insertions(+), 12 deletions(-)
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index af0c7ce1656..d0e3ba29c7d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1615,6 +1615,10 @@ static const struct attribute_spec rs6000_attribute_table[] =
#define TARGET_ASM_ASSEMBLE_VISIBILITY rs6000_assemble_visibility
#endif
+#undef TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY
+#define TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY \
+ rs6000_print_patchable_function_entry
+
#undef TARGET_SET_UP_BY_PROLOGUE
#define TARGET_SET_UP_BY_PROLOGUE rs6000_set_up_by_prologue
@@ -24446,6 +24450,31 @@ rs6000_assemble_visibility (tree decl, int vis)
default_assemble_visibility (decl, vis);
}
#endif
+
+/* Write PATCH_AREA_SIZE NOPs into the asm outfile FILE around a function
+ entry. If RECORD_P is true and the target supports named sections,
+ the location of the NOPs will be recorded in a special object section
+ called "__patchable_function_entries". This routine may be called
+ twice per function to put NOPs before and after the function
+ entry. */
+
+void
+rs6000_print_patchable_function_entry (FILE *file,
+ unsigned HOST_WIDE_INT patch_area_size,
+ bool record_p)
+{
+ unsigned int flags = SECTION_WRITE | SECTION_RELRO;
+ /* When .opd section is emitted, the function symbol
+ default_print_patchable_function_entry_1 is emitted into the .opd section
+ while the patchable area is emitted into the function section.
+ Don't use SECTION_LINK_ORDER in that case. */
+ if (!(TARGET_64BIT && DEFAULT_ABI != ABI_ELFv2)
+ && HAVE_GAS_SECTION_LINK_ORDER)
+ flags |= SECTION_LINK_ORDER;
+ default_print_patchable_function_entry_1 (file, patch_area_size, record_p,
+ flags);
+}
+
enum rtx_code
rs6000_reverse_condition (machine_mode mode, enum rtx_code code)
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 8aa610f5cde..958ec4ba6ff 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -1610,17 +1610,15 @@ default_compare_by_pieces_branch_ratio (machine_mode)
return 1;
}
-/* Write PATCH_AREA_SIZE NOPs into the asm outfile FILE around a function
- entry. If RECORD_P is true and the target supports named sections,
- the location of the NOPs will be recorded in a special object section
- called "__patchable_function_entries". This routine may be called
- twice per function to put NOPs before and after the function
- entry. */
+/* Helper for default_print_patchable_function_entry and other
+ print_patchable_function_entry hook implementations. */
void
-default_print_patchable_function_entry (FILE *file,
- unsigned HOST_WIDE_INT patch_area_size,
- bool record_p)
+default_print_patchable_function_entry_1 (FILE *file,
+ unsigned HOST_WIDE_INT
+ patch_area_size,
+ bool record_p,
+ unsigned int flags)
{
const char *nop_templ = 0;
int code_num;
@@ -1642,9 +1640,6 @@ default_print_patchable_function_entry (FILE *file,
patch_area_number++;
ASM_GENERATE_INTERNAL_LABEL (buf, "LPFE", patch_area_number);
- unsigned int flags = SECTION_WRITE | SECTION_RELRO;
- if (HAVE_GAS_SECTION_LINK_ORDER)
- flags |= SECTION_LINK_ORDER;
switch_to_section (get_section ("__patchable_function_entries",
flags, current_function_decl));
assemble_align (POINTER_SIZE);
@@ -1661,6 +1656,25 @@ default_print_patchable_function_entry (FILE *file,
output_asm_insn (nop_templ, NULL);
}
+/* Write PATCH_AREA_SIZE NOPs into the asm outfile FILE around a function
+ entry. If RECORD_P is true and the target supports named sections,
+ the location of the NOPs will be recorded in a special object section
+ called "__patchable_function_entries". This routine may be called
+ twice per function to put NOPs before and after the function
+ entry. */
+
+void
+default_print_patchable_function_entry (FILE *file,
+ unsigned HOST_WIDE_INT patch_area_size,
+ bool record_p)
+{
+ unsigned int flags = SECTION_WRITE | SECTION_RELRO;
+ if (HAVE_GAS_SECTION_LINK_ORDER)
+ flags |= SECTION_LINK_ORDER;
+ default_print_patchable_function_entry_1 (file, patch_area_size, record_p,
+ flags);
+}
+
bool
default_profile_before_prologue (void)
{
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 6206fe20823..7b6d2fb9138 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -203,6 +203,9 @@ extern bool default_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT,
bool);
extern int default_compare_by_pieces_branch_ratio (machine_mode);
+extern void default_print_patchable_function_entry_1 (FILE *,
+ unsigned HOST_WIDE_INT,
+ bool, unsigned int);
extern void default_print_patchable_function_entry (FILE *,
unsigned HOST_WIDE_INT,
bool);
--
2.33.1
++++++ gcc7-pfe-0022-Fix-unwinding-issues-when-pfe-is-enabled.patch ++++++
From e534bd23ac8d259768d67db6f876f75687b109e7 Mon Sep 17 00:00:00 2001
From: Giuliano Belinassi <gbelinassi(a)suse.de>
Date: Mon, 18 Oct 2021 18:00:28 -0300
Subject: [PATCH 22/22] Fix unwinding issues when pfe is enabled.
This patch has basically the same behaviour as 3dcea658c, but avoid
relying on the backend and CET mechanisms which are not implemented in
gcc-7.
gcc/ChangeLog
2021-10-18 Michael Matz <matz(a)suse.de>
* final.c (get_some_local_dynamic_name): Call
emit_patchable_function_entry.
* varasm.c (emit_patchable_function_entry): New.
gcc/testsuite/ChangeLog
2021-10-18 Giuliano Belinassi <gbelinassi(a)suse.de>
Backport from mainline
2020-02-03 H.J. Lu <hjl.tools(a)gmail.com>
PR target/93492
* gcc.target/i386/pr93492-1.c: New test.
* gcc.target/i386/pr93492-2.c: Likewise.
* gcc.target/i386/pr93492-3.c: Likewise.
* gcc.target/i386/pr93492-4.c: Likewise.
* gcc.target/i386/pr93492-5.c: Likewise.
Authored-by: Michael Matz <matz(a)suse.de>
---
gcc/ChangeLog | 6 ++
gcc/final.c | 4 +
gcc/testsuite/gcc.target/i386/pr93492-1.c | 76 +++++++++++++++++++
gcc/testsuite/gcc.target/i386/pr93492-2.c | 12 +++
gcc/testsuite/gcc.target/i386/pr93492-3.c | 13 ++++
gcc/testsuite/gcc.target/i386/pr93492-4.c | 11 +++
gcc/testsuite/gcc.target/i386/pr93492-5.c | 12 +++
gcc/varasm.c | 91 +++++++++++++----------
8 files changed, 187 insertions(+), 38 deletions(-)
create mode 100644 gcc/testsuite/gcc.target/i386/pr93492-1.c
create mode 100644 gcc/testsuite/gcc.target/i386/pr93492-2.c
create mode 100644 gcc/testsuite/gcc.target/i386/pr93492-3.c
create mode 100644 gcc/testsuite/gcc.target/i386/pr93492-4.c
create mode 100644 gcc/testsuite/gcc.target/i386/pr93492-5.c
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 51fed5508dc..537c343e6f1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2021-10-18 Michael Matz <matz(a)suse.de>
+
+ * final.c (get_some_local_dynamic_name): Call
+ emit_patchable_function_entry.
+ * varasm.c (emit_patchable_function_entry): New.
+
2019-11-14 Release Manager
* GCC 7.5.0 released.
diff --git a/gcc/final.c b/gcc/final.c
index 43743f05d84..53528620545 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1745,6 +1745,8 @@ get_some_local_dynamic_name ()
return 0;
}
+void emit_patchable_function_entry (tree decl, bool before);
+
/* Output assembler code for the start of a function,
and initialize some of the variables in this file
for the new function. The label for the function and associated
@@ -1781,6 +1783,8 @@ final_start_function (rtx_insn *first, FILE *file,
if (!dwarf2_debug_info_emitted_p (current_function_decl))
dwarf2out_begin_prologue (0, 0, NULL);
+ emit_patchable_function_entry (current_function_decl, false);
+
#ifdef LEAF_REG_REMAP
if (crtl->uses_only_leaf_regs)
leaf_renumber_regs (first);
diff --git a/gcc/testsuite/gcc.target/i386/pr93492-1.c b/gcc/testsuite/gcc.target/i386/pr93492-1.c
new file mode 100644
index 00000000000..3383b0dc27b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93492-1.c
@@ -0,0 +1,76 @@
+/* { dg-do "compile" } */
+/* { dg-options "-O1" } */
+
+/* Note: this test only checks the instructions in the function bodies,
+ not the placement of the patch label or nops before the function. */
+
+/*
+**f10_none:
+** nop
+** ret
+*/
+void
+__attribute__ ((patchable_function_entry (1, 0)))
+f10_none (void)
+{
+}
+
+/*
+**f10_endbr:
+** endbr(32|64)
+** nop
+** ret
+*/
+void
+__attribute__ ((patchable_function_entry (1, 0)))
+f10_endbr (void)
+{
+}
+
+/*
+**f11_none:
+** ret
+*/
+void
+__attribute__ ((patchable_function_entry (1, 1)))
+f11_none (void)
+{
+}
+
+/*
+**f11_endbr:
+** endbr(32|64)
+** ret
+*/
+void
+__attribute__ ((patchable_function_entry (1, 1)))
+f11_endbr (void)
+{
+}
+
+/*
+**f21_none:
+** nop
+** ret
+*/
+void
+__attribute__ ((patchable_function_entry (2, 1)))
+f21_none (void)
+{
+}
+
+/*
+**f21_endbr:
+** endbr(32|64)
+** nop
+** ret
+*/
+void
+__attribute__ ((patchable_function_entry (2, 1)))
+f21_endbr (void)
+{
+}
+
+/* { dg-final { scan-assembler "\.LPFE1:\n\tnop\n\trep ret" } } */
+/* { dg-final { scan-assembler "\.LPFE2:\n\tnop\n\trep ret" } } */
+/* { dg-final { scan-assembler "f11_none:\n\.LFB2:\n\t\.cfi_startproc\n\trep ret" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr93492-2.c b/gcc/testsuite/gcc.target/i386/pr93492-2.c
new file mode 100644
index 00000000000..d52d7a41637
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93492-2.c
@@ -0,0 +1,12 @@
+/* { dg-do "compile" } */
+/* { dg-options "-O1 -fasynchronous-unwind-tables -Wno-attributes" } */
+
+/* Test the placement of the .LPFE1 label. */
+
+void
+__attribute__ ((cf_check,patchable_function_entry (1, 0)))
+f10_endbr (void)
+{
+}
+
+/* { dg-final { scan-assembler "\.cfi_startproc\n.*\.LPFE1:\n\tnop\n\trep ret" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr93492-3.c b/gcc/testsuite/gcc.target/i386/pr93492-3.c
new file mode 100644
index 00000000000..a3ba22da17d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93492-3.c
@@ -0,0 +1,13 @@
+/* { dg-do "compile" } */
+/* { dg-require-effective-target mfentry } */
+/* { dg-options "-O1 -mfentry -pg -fasynchronous-unwind-tables -Wno-attributes" } */
+
+/* Test the placement of the .LPFE1 label. */
+
+void
+__attribute__ ((cf_check,patchable_function_entry (1, 0)))
+f10_endbr (void)
+{
+}
+
+/* { dg-final { scan-assembler "\t\.cfi_startproc\n.*\.LPFE1:\n\tnop\n1:\tcall\t__fentry__\n.*\t(rep )?ret\n" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr93492-4.c b/gcc/testsuite/gcc.target/i386/pr93492-4.c
new file mode 100644
index 00000000000..d5bfc58f7d8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93492-4.c
@@ -0,0 +1,11 @@
+/* { dg-do "compile" } */
+/* { dg-options "-O1 -fpatchable-function-entry=1 -fasynchronous-unwind-tables -Wno-attributes" } */
+
+/* Test the placement of the .LPFE1 label. */
+
+void
+foo (void)
+{
+}
+
+/* { dg-final { scan-assembler "\t\.cfi_startproc\n.*\.LPFE1:\n\tnop\n\trep ret\n" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr93492-5.c b/gcc/testsuite/gcc.target/i386/pr93492-5.c
new file mode 100644
index 00000000000..69e706ff38e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93492-5.c
@@ -0,0 +1,12 @@
+/* { dg-do "compile" } */
+/* { dg-require-effective-target mfentry } */
+/* { dg-options "-O1 -fpatchable-function-entry=1 -mfentry -pg -fasynchronous-unwind-tables -Wno-attributes" } */
+
+/* Test the placement of the .LPFE1 label. */
+
+void
+foo (void)
+{
+}
+
+/* { dg-final { scan-assembler "\t\.cfi_startproc\n.*\.LPFE1:\n\tnop\n1:\tcall\t__fentry__\n.*\t(rep )?ret\n" } } */
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 9e0e7c0976f..e197fbdaed5 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1698,6 +1698,58 @@ get_fnname_from_decl (tree decl)
return XSTR (x, 0);
}
+/* Emit the patchable function entry NOPs for function DECL.
+ BEFORE is true if we should emit the nops in front of the function
+ label (i.e. before prologue), or the ones after the function label
+ (part of the prologue). */
+void
+emit_patchable_function_entry (tree decl, bool before)
+{
+ unsigned short patch_area_size = crtl->patch_area_size;
+ unsigned short patch_area_entry = crtl->patch_area_entry;
+
+ tree patchable_function_entry_attr
+ = lookup_attribute ("patchable_function_entry", DECL_ATTRIBUTES (decl));
+ if (patchable_function_entry_attr)
+ {
+ tree pp_val = TREE_VALUE (patchable_function_entry_attr);
+ tree patchable_function_entry_value1 = TREE_VALUE (pp_val);
+
+ patch_area_size = tree_to_uhwi (patchable_function_entry_value1);
+ patch_area_entry = 0;
+ if (TREE_CHAIN (pp_val) != NULL_TREE)
+ {
+ tree patchable_function_entry_value2
+ = TREE_VALUE (TREE_CHAIN (pp_val));
+ patch_area_entry = tree_to_uhwi (patchable_function_entry_value2);
+ }
+ }
+
+ if (patch_area_entry > patch_area_size)
+ {
+ if (patch_area_size > 0 && before)
+ warning (OPT_Wattributes, "patchable function entry > size");
+ patch_area_entry = 0;
+ }
+
+ if (before)
+ {
+ /* Emit the patching area before the entry label, if any. */
+ if (patch_area_entry > 0)
+ targetm.asm_out.print_patchable_function_entry (asm_out_file,
+ patch_area_entry, true);
+ }
+ else
+ {
+ /* And the area after the label. Record it if we haven't done so yet. */
+ if (patch_area_size > patch_area_entry)
+ targetm.asm_out.print_patchable_function_entry (asm_out_file,
+ patch_area_size
+ - patch_area_entry,
+ patch_area_entry == 0);
+ }
+}
+
/* Output assembler code for the constant pool of a function and associated
with defining the name of the function. DECL describes the function.
NAME is the function's name. For the constant pool, we use the current
@@ -1829,37 +1881,7 @@ assemble_start_function (tree decl, const char *fnname)
if (DECL_PRESERVE_P (decl))
targetm.asm_out.mark_decl_preserved (fnname);
- unsigned short patch_area_size = crtl->patch_area_size;
- unsigned short patch_area_entry = crtl->patch_area_entry;
-
- tree patchable_function_entry_attr
- = lookup_attribute ("patchable_function_entry", DECL_ATTRIBUTES (decl));
- if (patchable_function_entry_attr)
- {
- tree pp_val = TREE_VALUE (patchable_function_entry_attr);
- tree patchable_function_entry_value1 = TREE_VALUE (pp_val);
-
- patch_area_size = tree_to_uhwi (patchable_function_entry_value1);
- patch_area_entry = 0;
- if (TREE_CHAIN (pp_val) != NULL_TREE)
- {
- tree patchable_function_entry_value2
- = TREE_VALUE (TREE_CHAIN (pp_val));
- patch_area_entry = tree_to_uhwi (patchable_function_entry_value2);
- }
- }
-
- if (patch_area_entry > patch_area_size)
- {
- if (patch_area_size > 0)
- warning (OPT_Wattributes, "patchable function entry > size");
- patch_area_entry = 0;
- }
-
- /* Emit the patching area before the entry label, if any. */
- if (patch_area_entry > 0)
- targetm.asm_out.print_patchable_function_entry (asm_out_file,
- patch_area_entry, true);
+ emit_patchable_function_entry (decl, true);
/* Do any machine/system dependent processing of the function name. */
#ifdef ASM_DECLARE_FUNCTION_NAME
@@ -1869,13 +1891,6 @@ assemble_start_function (tree decl, const char *fnname)
ASM_OUTPUT_FUNCTION_LABEL (asm_out_file, fnname, current_function_decl);
#endif /* ASM_DECLARE_FUNCTION_NAME */
- /* And the area after the label. Record it if we haven't done so yet. */
- if (patch_area_size > patch_area_entry)
- targetm.asm_out.print_patchable_function_entry (asm_out_file,
- patch_area_size
- - patch_area_entry,
- patch_area_entry == 0);
-
if (lookup_attribute ("no_split_stack", DECL_ATTRIBUTES (decl)))
saw_no_split_stack = true;
}
--
2.33.1
++++++ gcc7-pr55917.patch ++++++
From 754d67d5ba4a1f9994210d402893a4cf49ce6a71 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely <jwakely(a)redhat.com>
Date: Mon, 12 Jun 2017 17:37:28 +0100
Subject: [PATCH] PR libstdc++/55917 do not handle exceptions in std::thread
PR libstdc++/55917
* src/c++11/thread.cc (execute_native_thread_routine): Remove
try-block so that exceptions propagate out of the thread and terminate
is called by the exception-handling runtime.
(execute_native_thread_routine_compat): Likewise.
* testsuite/30_threads/thread/cons/terminate.cc: New.
diff --git a/libstdc++-v3/src/c++11/thread.cc b/libstdc++-v3/src/c++11/thread.cc
index 44a230a708e..4a94bdd2f8c 100644
--- a/libstdc++-v3/src/c++11/thread.cc
+++ b/libstdc++-v3/src/c++11/thread.cc
@@ -77,20 +77,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
execute_native_thread_routine(void* __p)
{
thread::_State_ptr __t{ static_cast<thread::_State*>(__p) };
-
- __try
- {
- __t->_M_run();
- }
- __catch(const __cxxabiv1::__forced_unwind&)
- {
- __throw_exception_again;
- }
- __catch(...)
- {
- std::terminate();
- }
-
+ __t->_M_run();
return nullptr;
}
@@ -104,20 +91,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
// the thread state to a local object, breaking the reference cycle
// created in thread::_M_start_thread.
__local.swap(__t->_M_this_ptr);
-
- __try
- {
- __t->_M_run();
- }
- __catch(const __cxxabiv1::__forced_unwind&)
- {
- __throw_exception_again;
- }
- __catch(...)
- {
- std::terminate();
- }
-
+ __t->_M_run();
return nullptr;
}
#endif
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/terminate.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/terminate.cc
new file mode 100644
index 00000000000..4b35b6c6024
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/terminate.cc
@@ -0,0 +1,48 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-rtems* *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* powerpc-ibm-aix* } }
+// { dg-require-effective-target c++11 }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+#include <thread>
+#include <exception>
+#include <cstdlib>
+
+void handle_terminate()
+{
+ std::_Exit(0);
+}
+
+void f() { throw 1; }
+
+void
+test01()
+{
+ std::set_terminate(handle_terminate);
+ std::thread t(f);
+ t.join();
+ std::abort();
+}
+
+int
+main()
+{
+ test01();
+}
--
2.27.0
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-azure-mgmt-batch for openSUSE:Factory checked in at 2022-02-28 19:43:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-azure-mgmt-batch (Old)
and /work/SRC/openSUSE:Factory/.python-azure-mgmt-batch.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-azure-mgmt-batch"
Mon Feb 28 19:43:52 2022 rev:12 rq:958050 version:16.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-azure-mgmt-batch/python-azure-mgmt-batch.changes 2021-08-06 22:45:42.981971021 +0200
+++ /work/SRC/openSUSE:Factory/.python-azure-mgmt-batch.new.1958/python-azure-mgmt-batch.changes 2022-02-28 19:44:21.465959028 +0100
@@ -1,0 +2,9 @@
+Fri Feb 25 09:44:57 UTC 2022 - John Paul Adrian Glaubitz <adrian.glaubitz(a)suse.com>
+
+- New upstream release
+ + Version 16.1.0
+ + For detailed information about changes see the
+ CHANGELOG.md file provided with this package
+- Update Requires from setup.py
+
+-------------------------------------------------------------------
Old:
----
azure-mgmt-batch-16.0.0.zip
New:
----
azure-mgmt-batch-16.1.0.zip
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-azure-mgmt-batch.spec ++++++
--- /var/tmp/diff_new_pack.2lOVpF/_old 2022-02-28 19:44:22.421959386 +0100
+++ /var/tmp/diff_new_pack.2lOVpF/_new 2022-02-28 19:44:22.441959394 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-azure-mgmt-batch
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -21,7 +21,7 @@
%define skip_python2 1
%endif
Name: python-azure-mgmt-batch
-Version: 16.0.0
+Version: 16.1.0
Release: 0
Summary: Microsoft Azure Batch Management Client Library
License: MIT
@@ -38,7 +38,7 @@
Requires: python-azure-common < 2.0.0
Requires: python-azure-common >= 1.1
Requires: python-azure-mgmt-core < 2.0.0
-Requires: python-azure-mgmt-core >= 1.2.0
+Requires: python-azure-mgmt-core >= 1.3.0
Requires: python-azure-mgmt-nspkg >= 3.0.0
Requires: python-azure-nspkg >= 3.0.0
Requires: python-msrest >= 0.6.21
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package openmw for openSUSE:Factory checked in at 2022-02-28 19:43:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openmw (Old)
and /work/SRC/openSUSE:Factory/.openmw.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openmw"
Mon Feb 28 19:43:51 2022 rev:12 rq:935967 version:0.47.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/openmw/openmw.changes 2021-10-23 23:14:19.068991111 +0200
+++ /work/SRC/openSUSE:Factory/.openmw.new.1958/openmw.changes 2022-02-28 19:44:19.801958405 +0100
@@ -1,0 +2,16 @@
+Wed Nov 17 19:24:11 UTC 2021 - Matthias Fehring <buschmann23(a)opensuse.org>
+
+- Removed double source entry
+
+-------------------------------------------------------------------
+Mon Nov 15 19:46:22 UTC 2021 - Matthias Fehring <buschmann23(a)opensuse.org>
+
+- update to 0.47.0:
+ * extremely long list of changes, see
+ https://openmw.org/2021/openmw-0-47-0-released/
+- Removed obsolete patches:
+ * openmw-add-missing-include.patch
+ * 0001-add-GCC-11-needed-includes.patch
+ * openmw-cast-float-to-btScalar.patch
+
+-------------------------------------------------------------------
Old:
----
0001-add-GCC-11-needed-includes.patch
openmw-0.46.0.tar.gz
openmw-add-missing-include.patch
openmw-cast-float-to-btScalar.patch
New:
----
openmw-0.47.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ openmw.spec ++++++
--- /var/tmp/diff_new_pack.oBbVog/_old 2022-02-28 19:44:20.497958666 +0100
+++ /var/tmp/diff_new_pack.oBbVog/_new 2022-02-28 19:44:20.501958667 +0100
@@ -18,22 +18,16 @@
Name: openmw
-Version: 0.46.0
+Version: 0.47.0
Release: 0
Summary: Reimplementation of The Elder Scrolls III: Morrowind
License: GPL-3.0-only AND MIT
Group: Amusements/Games/RPG
URL: https://www.openmw.org
-Source: https://github.com/OpenMW/openmw/archive/%{name}-%{version}.tar.gz
+Source: https://gitlab.com/OpenMW/openmw/-/archive/%{name}-%{version}/%{name}-%{nam…
Source2: %{name}.rpmlintrc
-# PATCH-FIX-UPSTREAM openmw-add-missing-include.patch gh#OpenMW/openmw!2817 malcolmlewis(a)opensuse.org -- Add missing algorithm include for later boost releases.
-Patch0: openmw-add-missing-include.patch
-# PATCH-FIX-UPSTREAM 0001-add-GCC-11-needed-includes.patch https://gitlab.com/OpenMW/openmw/-/issues/6357 adam(a)mizerski.pl -- Fix build on GCC 11 due to new required includes for std::numeric_limit.
-Patch1: 0001-add-GCC-11-needed-includes.patch
# PATCH-FIX-UPSTREAM openmw-sigaltstack.patch https://gitlab.com/OpenMW/openmw/-/issues/6356 adam(a)mizerski.pl -- fix error: size of array 'altstack' is not an integral constant-expression
Patch2: openmw-sigaltstack.patch
-# PATCH-FIX-UPSTREAM openmw-cast-float-to-btScalar.patch adam(a)mizerski.pl -- this will be included in 0.47.0 release
-Patch3: openmw-cast-float-to-btScalar.patch
BuildRequires: MyGUI-devel >= 3.2.1
BuildRequires: cmake
BuildRequires: doxygen
@@ -55,11 +49,13 @@
BuildRequires: pkgconfig(libavdevice)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
+BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libunshield)
BuildRequires: pkgconfig(openal)
BuildRequires: pkgconfig(openscenegraph) >= 3.2
BuildRequires: pkgconfig(openthreads) >= 3.2
+BuildRequires: pkgconfig(recastnavigation)
BuildRequires: pkgconfig(sdl2)
Requires: OpenSceneGraph-plugins
Requires(post): desktop-file-utils
@@ -97,7 +93,7 @@
%prep
%setup -q -n openmw-openmw-%{version}
%autopatch -p1
-cp 'files/mygui/DejaVu Font License.txt' ./DejaVuFontLicense.txt
+cp 'files/mygui/DejaVuFontLicense.txt' ./DejaVuFontLicense.txt
## fix __DATE__ and __TIME__
STATIC_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
@@ -122,7 +118,8 @@
-DDESIRED_QT_VERSION=5 \
-DCMAKE_POLICY_DEFAULT_CMP0063=NEW \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
- -DCMAKE_VISIBILITY_INLINES_HIDDEN=1
+ -DCMAKE_VISIBILITY_INLINES_HIDDEN=1 \
+ -DOPENMW_USE_SYSTEM_RECASTNAVIGATION="ON"
%make_build
@@ -171,9 +168,9 @@
%dir %{_datadir}/appdata
%{_datadir}/appdata/openmw.appdata.xml
%config(noreplace) %{_sysconfdir}/%{name}/openmw.cfg
-%config(noreplace) %{_sysconfdir}/%{name}/openmw-cs.cfg
-%config(noreplace) %{_sysconfdir}/%{name}/settings-default.cfg
%config(noreplace) %{_sysconfdir}/%{name}/gamecontrollerdb*.txt
+%config %{_sysconfdir}/%{name}/defaults.bin
+%config %{_sysconfdir}/%{name}/defaults-cs.bin
%config %{_sysconfdir}/%{name}/version
%{_bindir}/bsatool
%{_bindir}/esmtool
++++++ openmw-0.46.0.tar.gz -> openmw-0.47.0.tar.gz ++++++
++++ 161173 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-parse_type for openSUSE:Factory checked in at 2022-02-28 19:43:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-parse_type (Old)
and /work/SRC/openSUSE:Factory/.python-parse_type.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-parse_type"
Mon Feb 28 19:43:51 2022 rev:5 rq:958027 version:0.6.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-parse_type/python-parse_type.changes 2020-09-23 18:48:08.553748673 +0200
+++ /work/SRC/openSUSE:Factory/.python-parse_type.new.1958/python-parse_type.changes 2022-02-28 19:44:18.893958065 +0100
@@ -1,0 +2,10 @@
+Mon Feb 28 10:33:12 UTC 2022 - pgajdos(a)suse.com
+
+- version update to 0.6.0
+ + issue #17: setup.py: Remove use of "use_2to3"
+ + parse issue #119 (same as: #121): int_convert memory effect with number-base discovery
+ + UPDATE to parse v1.18.0 (needed by: parse issue #119)
+ + parse PR #122: Fixes issue #121 in parse: int_convert memory effect.
+ + parse v1.17.0
+
+-------------------------------------------------------------------
Old:
----
v0.5.3.tar.gz
New:
----
v0.6.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-parse_type.spec ++++++
--- /var/tmp/diff_new_pack.UJYmWC/_old 2022-02-28 19:44:19.465958279 +0100
+++ /var/tmp/diff_new_pack.UJYmWC/_new 2022-02-28 19:44:19.469958280 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-parse_type
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
Name: python-parse_type
-Version: 0.5.3
+Version: 0.6.0
Release: 0
Summary: Extension to the parse module
License: BSD-3-Clause
++++++ v0.5.3.tar.gz -> v0.6.0.tar.gz ++++++
++++ 2082 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-pygit2 for openSUSE:Factory checked in at 2022-02-28 19:43:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pygit2 (Old)
and /work/SRC/openSUSE:Factory/.python-pygit2.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pygit2"
Mon Feb 28 19:43:49 2022 rev:26 rq:958025 version:1.9.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pygit2/python-pygit2.changes 2021-10-23 23:14:15.372989305 +0200
+++ /work/SRC/openSUSE:Factory/.python-pygit2.new.1958/python-pygit2.changes 2022-02-28 19:44:17.981957724 +0100
@@ -1,0 +2,41 @@
+Mon Feb 28 08:15:51 UTC 2022 - pgajdos(a)suse.com
+
+- version update to 1.9.0
+ 1.9.0 (2022-02-22)
+ -------------------------
+ - Upgrade to libgit2 v1.4
+ - Documentation, new recipes for committing and cloning
+ `#1125 <https://github.com/libgit2/pygit2/pull/1125>`_
+ 1.8.0 (2022-02-04)
+ -------------------------
+ - Rename ``RemoteCallbacks.progress(...)`` callback to ``.sideband_progress(...)``
+ `#1120 <https://github.com/libgit2/pygit2/pull/1120>`_
+ - New ``Repository.merge_base_many(...)`` and ``Repository.merge_base_octopus(...)``
+ `#1112 <https://github.com/libgit2/pygit2/pull/1112>`_
+ - New ``Repository.listall_stashes()``
+ `#1117 <https://github.com/libgit2/pygit2/pull/1117>`_
+ - Code cleanup
+ `#1118 <https://github.com/libgit2/pygit2/pull/1118>`_
+ Backward incompatible changes:
+ - The ``RemoteCallbacks.progress(...)`` callback has been renamed to
+ ``RemoteCallbacks.sideband_progress(...)``. This matches the documentation,
+ but may break existing code that still uses the old name.
+ 1.7.2 (2021-12-06)
+ -------------------------
+ - Universal wheels for macOS
+ `#1109 <https://github.com/libgit2/pygit2/pull/1109>`_
+ 1.7.1 (2021-11-19)
+ -------------------------
+ - New ``Repository.amend_commit(...)``
+ `#1098 <https://github.com/libgit2/pygit2/pull/1098>`_
+ - New ``Commit.message_trailers``
+ `#1101 <https://github.com/libgit2/pygit2/pull/1101>`_
+ - Windows wheels for Python 3.10
+ `#1103 <https://github.com/libgit2/pygit2/pull/1103>`_
+ - Changed: now ``DiffDelta.is_binary`` returns ``None`` if the file data has
+ not yet been loaded, cf. `#962 <https://github.com/libgit2/pygit2/issues/962>`_
+ - Document ``Repository.get_attr(...)`` and update theme
+ `#1017 <https://github.com/libgit2/pygit2/issues/1017>`_
+ `#1105 <https://github.com/libgit2/pygit2/pull/1105>`_
+
+-------------------------------------------------------------------
Old:
----
pygit2-1.7.0.tar.gz
New:
----
pygit2-1.9.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pygit2.spec ++++++
--- /var/tmp/diff_new_pack.3rquSP/_old 2022-02-28 19:44:18.545957935 +0100
+++ /var/tmp/diff_new_pack.3rquSP/_new 2022-02-28 19:44:18.549957936 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-pygit2
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2019 Neal Gompa <ngompa13(a)gmail.com>.
#
# All modifications and additions to the file contributed by third parties
@@ -20,7 +20,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-pygit2
-Version: 1.7.0
+Version: 1.9.0
Release: 0
Summary: Python bindings for libgit2
License: GPL-2.0-only
++++++ pygit2-1.7.0.tar.gz -> pygit2-1.9.0.tar.gz ++++++
++++ 1933 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package livecd-openSUSE for openSUSE:Factory checked in at 2022-02-28 19:43:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/livecd-openSUSE (Old)
and /work/SRC/openSUSE:Factory/.livecd-openSUSE.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "livecd-openSUSE"
Mon Feb 28 19:43:49 2022 rev:175 rq:958033 version:unknown
Changes:
--------
--- /work/SRC/openSUSE:Factory/livecd-openSUSE/livecd-openSUSE.changes 2022-02-21 10:22:31.595494181 +0100
+++ /work/SRC/openSUSE:Factory/.livecd-openSUSE.new.1958/livecd-openSUSE.changes 2022-02-28 19:44:16.673957234 +0100
@@ -1,0 +2,5 @@
+Mon Feb 28 10:20:14 UTC 2022 - Fabian Vogt <fvogt(a)suse.com>
+
+- list-x11: Drop ristretto (boo#1193538)
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
livecd-leap-kde.kiwi: same change
++++++ livecd-leap-x11.kiwi ++++++
--- /var/tmp/diff_new_pack.O9Xo4b/_old 2022-02-28 19:44:17.557957565 +0100
+++ /var/tmp/diff_new_pack.O9Xo4b/_new 2022-02-28 19:44:17.557957565 +0100
@@ -577,6 +577,8 @@
<ignore name="7zip"/>
<package name="aaa_base" replaces="tumbler"/>
<ignore name="tumbler"/>
+ <package name="aaa_base" replaces="ristretto"/>
+ <ignore name="ristretto"/>
<package name="aaa_base" replaces="cyrus-sasl"/>
<ignore name="cyrus-sasl"/>
<package name="aaa_base" replaces="deltarpm"/>
@@ -596,7 +598,6 @@
<package name="lightdm"/>
<package name="lightdm-gtk-greeter"/>
<package name="photorec"/>
- <package name="ristretto"/>
<package name="thunar"/>
<package name="thunar-volman"/>
<package name="xfce4-appfinder"/>
livecd-openSUSE.kiwi: same change
livecd-tumbleweed-gnome.kiwi: same change
livecd-tumbleweed-kde.kiwi: same change
++++++ livecd-tumbleweed-x11.kiwi ++++++
--- /var/tmp/diff_new_pack.O9Xo4b/_old 2022-02-28 19:44:17.601957581 +0100
+++ /var/tmp/diff_new_pack.O9Xo4b/_new 2022-02-28 19:44:17.605957583 +0100
@@ -571,6 +571,8 @@
<ignore name="7zip"/>
<package name="aaa_base" replaces="tumbler"/>
<ignore name="tumbler"/>
+ <package name="aaa_base" replaces="ristretto"/>
+ <ignore name="ristretto"/>
<package name="aaa_base" replaces="cyrus-sasl"/>
<ignore name="cyrus-sasl"/>
<package name="aaa_base" replaces="deltarpm"/>
@@ -590,7 +592,6 @@
<package name="lightdm"/>
<package name="lightdm-gtk-greeter"/>
<package name="photorec"/>
- <package name="ristretto"/>
<package name="thunar"/>
<package name="thunar-volman"/>
<package name="xfce4-appfinder"/>
++++++ list-x11.sh ++++++
--- /var/tmp/diff_new_pack.O9Xo4b/_old 2022-02-28 19:44:17.729957629 +0100
+++ /var/tmp/diff_new_pack.O9Xo4b/_new 2022-02-28 19:44:17.729957629 +0100
@@ -78,6 +78,8 @@
# tumbler -> libgepup uses libwebkit2gtk-4_0-37, while epiphany uses libwebkit2gtk-4_1-0.
# We can't have both, too big.
buildignore tumbler
+# ristretto is not that useful without tumbler
+buildignore ristretto
# Moved here from list-common.sh. cyrus-sasl is needed by Pidgin in Xfce Live CD
buildignore cyrus-sasl
@@ -101,7 +103,6 @@
install lightdm
install lightdm-gtk-greeter
install photorec
-install ristretto
install thunar
install thunar-volman
install xfce4-appfinder
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package otpclient for openSUSE:Factory checked in at 2022-02-28 19:43:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/otpclient (Old)
and /work/SRC/openSUSE:Factory/.otpclient.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "otpclient"
Mon Feb 28 19:43:47 2022 rev:12 rq:958045 version:2.4.9.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/otpclient/otpclient.changes 2022-02-18 23:03:47.765408845 +0100
+++ /work/SRC/openSUSE:Factory/.otpclient.new.1958/otpclient.changes 2022-02-28 19:44:15.561956817 +0100
@@ -1,0 +2,15 @@
+Mon Feb 28 12:52:16 UTC 2022 - Paolo Stivanin <info(a)paolostivanin.com>
+
+- Update to 2.4.9.1:
+ * Fix a regression brought by the previous update (non-utf8 string
+ was incorrectly parsed). Now URIs are correctly parsed, whether
+ or not they contain utf-8 chars.
+
+-------------------------------------------------------------------
+Mon Feb 28 09:55:50 UTC 2022 - Paolo Stivanin <info(a)paolostivanin.com>
+
+- Update to 2.4.9:
+ * fix an error when importing a QR code (issue #240)
+ * better error handling when importing a code
+
+-------------------------------------------------------------------
Old:
----
v2.4.8.tar.gz
v2.4.8.tar.gz.asc
New:
----
v2.4.9.1.tar.gz
v2.4.9.1.tar.gz.asc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ otpclient.spec ++++++
--- /var/tmp/diff_new_pack.z7EWOV/_old 2022-02-28 19:44:16.177957048 +0100
+++ /var/tmp/diff_new_pack.z7EWOV/_new 2022-02-28 19:44:16.181957049 +0100
@@ -18,7 +18,7 @@
%define uclname OTPClient
Name: otpclient
-Version: 2.4.8
+Version: 2.4.9.1
Release: 0
Summary: Simple GTK+ client for managing TOTP and HOTP
License: GPL-3.0-or-later
++++++ v2.4.8.tar.gz -> v2.4.9.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.8/CMakeLists.txt new/OTPClient-2.4.9.1/CMakeLists.txt
--- old/OTPClient-2.4.8/CMakeLists.txt 2022-02-18 14:26:46.000000000 +0100
+++ new/OTPClient-2.4.9.1/CMakeLists.txt 2022-02-28 13:48:49.000000000 +0100
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
-project(OTPClient VERSION "2.4.8" LANGUAGES "C")
+project(OTPClient VERSION "2.4.9.1" LANGUAGES "C")
configure_file("src/common/version.h.in" "version.h")
include_directories(${PROJECT_BINARY_DIR})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.8/data/com.github.paolostivanin.OTPClient.appdata.xml new/OTPClient-2.4.9.1/data/com.github.paolostivanin.OTPClient.appdata.xml
--- old/OTPClient-2.4.8/data/com.github.paolostivanin.OTPClient.appdata.xml 2022-02-18 14:26:46.000000000 +0100
+++ new/OTPClient-2.4.9.1/data/com.github.paolostivanin.OTPClient.appdata.xml 2022-02-28 13:48:49.000000000 +0100
@@ -83,6 +83,23 @@
</content_rating>
<releases>
+ <release version="2.4.9.1" date="2022-02-28">
+ <description>
+ <p>OTPClient 2.4.9.1 fix a regression</p>
+ <ul>
+ <li>fix importing QR code both when URI contains and doesn't contain one or more UTF-8 chars.</li>
+ </ul>
+ </description>
+ </release>
+ <release version="2.4.9" date="2022-02-28">
+ <description>
+ <p>OTPClient 2.4.9 fix an import issue</p>
+ <ul>
+ <li>fix importing QR code (issue#240)</li>
+ <li>better error when importing a QR fails</li>
+ </ul>
+ </description>
+ </release>
<release version="2.4.8" date="2022-02-18">
<description>
<p>OTPClient 2.4.8 brings a couple of fixes</p>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.8/src/add-common.c new/OTPClient-2.4.9.1/src/add-common.c
--- old/OTPClient-2.4.8/src/add-common.c 2022-02-18 14:26:46.000000000 +0100
+++ new/OTPClient-2.4.9.1/src/add-common.c 2022-02-28 13:48:49.000000000 +0100
@@ -40,10 +40,9 @@
return g_strdup ("Label can not be empty, otp not imported");
}
- if (otp->secret[0] == '\0') {
+ if (otp->secret == NULL || otp->secret[0] == '\0') {
return g_strdup ("Secret can not be empty, otp not imported");
}
-
if (g_ascii_strcasecmp (otp->type, "TOTP") == 0) {
if (otp->period < 10 || otp->period > 120) {
gchar *msg = g_strconcat("[INFO]: invalid period for '", otp->account_name, "'. Defaulting back to 30 seconds.", NULL);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.8/src/parse-uri.c new/OTPClient-2.4.9.1/src/parse-uri.c
--- old/OTPClient-2.4.8/src/parse-uri.c 2022-02-18 14:26:46.000000000 +0100
+++ new/OTPClient-2.4.9.1/src/parse-uri.c 2022-02-28 13:48:49.000000000 +0100
@@ -69,23 +69,23 @@
parse_parameters (const gchar *modified_uri,
otp_t *otp)
{
- const gchar *mod_uri_copy = modified_uri;
- gchar **tokens = g_strsplit (mod_uri_copy, "?", -1);
+ gchar **tokens = g_strsplit (modified_uri, "?", -1);
gchar *escaped_issuer_and_label = g_uri_unescape_string (tokens[0], NULL);
- mod_uri_copy += g_utf8_strlen (tokens[0], -1) + 1; // "issuer:label?"
+ gchar *mod_uri_copy_utf8 = g_utf8_offset_to_pointer(modified_uri, g_utf8_strlen (tokens[0], -1) + 1);
g_strfreev (tokens);
tokens = g_strsplit (escaped_issuer_and_label, ":", -1);
if (tokens[0] && tokens[1]) {
otp->issuer = g_strdup (g_strstrip (tokens[0]));
otp->account_name = g_strdup (g_strstrip (tokens[1]));
+
} else {
otp->account_name = g_strdup (g_strstrip (tokens[0]));
}
g_free (escaped_issuer_and_label);
g_strfreev (tokens);
- tokens = g_strsplit (mod_uri_copy, "&", -1);
+ tokens = g_strsplit (mod_uri_copy_utf8, "&", -1);
gint i = 0;
while (tokens[i]) {
if (g_ascii_strncasecmp (tokens[i], "secret=", 7) == 0) {
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-nbclient for openSUSE:Factory checked in at 2022-02-28 19:43:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-nbclient (Old)
and /work/SRC/openSUSE:Factory/.python-nbclient.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-nbclient"
Mon Feb 28 19:43:46 2022 rev:18 rq:958022 version:0.5.11
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-nbclient/python-nbclient.changes 2022-02-18 23:03:37.889409616 +0100
+++ /work/SRC/openSUSE:Factory/.python-nbclient.new.1958/python-nbclient.changes 2022-02-28 19:44:12.237955572 +0100
@@ -1,0 +2,5 @@
+Mon Feb 28 10:17:42 UTC 2022 - Ben Greiner <code(a)bnavigator.de>
+
+- Skip more failing tests due to new Exception message format
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-nbclient.spec ++++++
--- /var/tmp/diff_new_pack.quT0lg/_old 2022-02-28 19:44:15.421956765 +0100
+++ /var/tmp/diff_new_pack.quT0lg/_new 2022-02-28 19:44:15.425956766 +0100
@@ -60,6 +60,7 @@
BuildRequires: %{python_module ipywidgets < 8}
BuildRequires: %{python_module nbclient = %{version}}
BuildRequires: %{python_module pytest >= 4.1}
+BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module xmltodict}
%endif
%python_subpackages
@@ -89,9 +90,9 @@
# tests on parallel notebooks randomly fail (4 tests) - https://github.com/jupyter/nbclient/pull/74#issuecomment-635929953
donttest="parallel_notebooks"
# https://github.com/jupyter/nbclient/issues/189
-donttest+=" or (test_run_all_notebooks and Interrupt.ipynb)"
+donttest+=" or (test_run_all_notebooks and (opts6 or opts8 or opts9))"
# extra -v for more verbose error diffs
-%pytest -v -k "not ($donttest)"
+%pytest -v -k "not ($donttest)" --asyncio-mode=auto
%endif
%if ! %{with test}
1
0