summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-05-03 15:49:13 +0000
committerCoprDistGit <infra@openeuler.org>2025-05-03 15:49:13 +0000
commit5ff7c872058e53804239fee285014d78987954a2 (patch)
tree4f0d742caf87d519c142002d4a0c2c1ad9b4904b
parent7421880c6c4fce7c9d3c057dd4d463a2b880b54c (diff)
automatic import of bisonopeneuler24.03_LTS
-rw-r--r--.gitignore1
-rw-r--r--backport-tests-make-it-easier-to-spot-failures.patch75
-rw-r--r--bison-3.8.2-gcc15-glibcxx-assertions.patch69
-rw-r--r--bison.spec154
-rw-r--r--sources1
5 files changed, 300 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..1d8ae43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/bison-3.8.2.tar.xz
diff --git a/backport-tests-make-it-easier-to-spot-failures.patch b/backport-tests-make-it-easier-to-spot-failures.patch
new file mode 100644
index 0000000..9648416
--- /dev/null
+++ b/backport-tests-make-it-easier-to-spot-failures.patch
@@ -0,0 +1,75 @@
+From 4fe5a375fa6cb07f1c5cb6507b3c4e3b38e6fcef Mon Sep 17 00:00:00 2001
+From: Akim Demaille <akim.demaille@gmail.com>
+Date: Sat, 9 Oct 2021 10:29:50 +0200
+Subject: [PATCH] tests: make it easier to spot failures
+
+* examples/c/glr/c++-types.test: Split in several small test cases.
+---
+ examples/c/glr/c++-types.test | 37 ++++++++++++++++++++++++-----------
+ 1 file changed, 26 insertions(+), 11 deletions(-)
+
+diff --git a/examples/c/glr/c++-types.test b/examples/c/glr/c++-types.test
+index 074d72cc..e63dd31e 100644
+--- a/examples/c/glr/c++-types.test
++++ b/examples/c/glr/c++-types.test
+@@ -17,31 +17,46 @@
+
+ cat >input <<EOF
+ z + q;
++EOF
++run 0 "1.0-5: +(z, q)"
+
++cat >input <<EOF
+ T x;
++EOF
++run 0 "1.0-3: <declare>(T, x)"
+
++cat >input <<EOF
+ T x = y;
++EOF
++run 0 "1.0-7: <init-declare>(T, x, y)"
+
++cat >input <<EOF
+ x = y;
++EOF
++run 0 "1.0-5: =(x, y)"
+
++cat >input <<EOF
+ T (x) + y;
++EOF
++run 0 "1.0-9: +(<cast>(x, T), y)"
+
++cat >input <<EOF
+ T (x);
++EOF
++run 0 "1.0-5: <OR>(<declare>(T, x), <cast>(x, T))"
+
++cat >input <<EOF
+ T (y) = z + q;
++EOF
++run 0 "1.0-13: <OR>(<init-declare>(T, y, +(z, q)), =(<cast>(y, T), +(z, q)))"
+
++cat >input <<EOF
+ T (y y) = z + q;
++EOF
++run 0 "1.0-15: <error>
++err: 1.5: syntax error, unexpected identifier, expecting '=' or '+' or ')'"
+
++cat >input <<EOF
+ z + q;
+ EOF
+-run 0 "\
+-1.0-5: +(z, q)
+-3.0-3: <declare>(T, x)
+-5.0-7: <init-declare>(T, x, y)
+-7.0-5: =(x, y)
+-9.0-9: +(<cast>(x, T), y)
+-11.0-5: <OR>(<declare>(T, x), <cast>(x, T))
+-13.0-13: <OR>(<init-declare>(T, y, +(z, q)), =(<cast>(y, T), +(z, q)))
+-15.0-15: <error>
+-17.0-5: +(z, q)
+-err: 15.5: syntax error, unexpected identifier, expecting '=' or '+' or ')'"
++run 0 "1.0-5: +(z, q)"
+--
+2.27.0
+
diff --git a/bison-3.8.2-gcc15-glibcxx-assertions.patch b/bison-3.8.2-gcc15-glibcxx-assertions.patch
new file mode 100644
index 0000000..245cc84
--- /dev/null
+++ b/bison-3.8.2-gcc15-glibcxx-assertions.patch
@@ -0,0 +1,69 @@
+https://bugs.gentoo.org/935754
+https://lists.gnu.org/archive/html/bison-patches/2024-07/msg00000.html
+
+* data/skeletons/glr2.cc (yyundeleteLastStack): Recover
+yylookaheadNeeds stack entry also, to prevent desyncing the sizes
+of yystates and yylookaheadNeeds.
+(class glr_state_set): New field yylookaheadNeedLastDeleted,
+tracks lookahead need of last deleted state.
+(yymarkStackDeleted): Save yylookaheadNeeds also.
+---
+Hi!
+
+GCC 15 has added bounds-checks to vector<bool> when assertions are
+enabled. This has caught a bug in Bison. See bug referenced above.
+
+Now, WRT the fix: I am not sure of its correctness, but it appears to
+pass tests and everything seems to indicate that the presumption it is
+based on is correct. That presumption is that the two stacks mentioned
+above (yylookaheadNeeds and yystates) ought to be the same size. I
+inferred this because all other locations that alter the size of the two
+vectors appear to do so in lock-step.
+
+TIA, have a lovely day.
+
+ data/skeletons/glr2.cc | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/data/skeletons/glr2.cc b/data/skeletons/glr2.cc
+index 970ccfdf..8b962d6f 100644
+--- a/data/skeletons/glr2.cc
++++ b/data/skeletons/glr2.cc
+@@ -1080,7 +1080,10 @@ namespace
+ {
+ size_t k = yyk.uget ();
+ if (yystates[k] != YY_NULLPTR)
+- yylastDeleted = yystates[k];
++ {
++ yylastDeleted = yystates[k];
++ yylookaheadNeedLastDeleted = yylookaheadNeeds[k];
++ }
+ yystates[k] = YY_NULLPTR;
+ }
+
+@@ -1093,6 +1096,7 @@ namespace
+ if (yylastDeleted == YY_NULLPTR || !yystates.empty ())
+ return;
+ yystates.push_back (yylastDeleted);
++ yylookaheadNeeds.push_back (yylookaheadNeedLastDeleted);
+ YYCDEBUG << "Restoring last deleted stack as stack #0.\n";
+ clearLastDeleted ();
+ }
+@@ -1102,6 +1106,7 @@ namespace
+ void
+ yyremoveDeletes ()
+ {
++ YYASSERT(yystates.size () == yylookaheadNeeds.size ());
+ size_t newsize = yystates.size ();
+ /* j is the number of live stacks we have seen. */
+ for (size_t i = 0, j = 0; j < newsize; ++i)
+@@ -1160,6 +1165,7 @@ namespace
+
+ /** The last stack we invalidated. */
+ glr_state* yylastDeleted;
++ bool yylookaheadNeedLastDeleted;
+ }; // class glr_state_set
+ } // namespace
+
+--
+2.45.2
diff --git a/bison.spec b/bison.spec
new file mode 100644
index 0000000..cdb636b
--- /dev/null
+++ b/bison.spec
@@ -0,0 +1,154 @@
+Name: bison
+Version: 3.8.2
+Release: 4
+Summary: A GNU general-purpose parser generator
+License: GPL-3.0-or-later AND GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 AND GPL-3.0-or-later WITH Bison-exception-2.2 AND GPL-2.0-or-later AND GPL-2.0-or-later WITH Autoconf-exception-generic AND LGPL-3.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later AND FSFULLR AND GFDL-1.3-or-later AND X11
+URL: https://www.gnu.org/software/bison/
+Source0: https://ftp.gnu.org/gnu/bison/bison-%{version}.tar.xz
+
+Patch1: backport-tests-make-it-easier-to-spot-failures.patch
+Patch2: bison-3.8.2-gcc15-glibcxx-assertions.patch
+
+BuildRequires: gcc-c++ autoconf automake m4 flex
+Requires: m4 >= 1.4
+Provides: bundled(gnulib)
+
+%description
+Bison is a general-purpose parser generator that converts an
+annotated context-free grammar into a deterministic LR or
+generalized LR (GLR) parser employing LALR(1) parser tables.
+As an experimental feature, Bison can also generate IELR(1)
+or canonical LR(1) parser tables. Once you are proficient with
+Bison, you can use it to develop a wide range of language
+parsers, from those used in simple desk calculators to complex
+programming languages.
+
+%package_help
+
+%package devel
+Summary: -ly library for development using bison-generated parsers
+Requires: %{name} = %{version}-%{release}
+Provides: %{name}-static = %{version}-%{release}
+
+%description devel
+This package contains libraries used by programs using bison-generated parsers.
+
+%package lang
+Summary: Language files for bison.
+Buildarch: noarch
+Requires: %{name} = %{version}-%{release}
+Provides: %{name}-runtime = %{version}-%{release}
+Obsoletes: bison-runtime < %{version}-%{release}
+
+%description lang
+This package contains language support files and locale.
+
+%prep
+%autosetup -n %{name}-%{version} -p1
+
+%build
+%configure
+%make_build
+
+%check
+%make_build check
+
+%install
+%make_install
+
+# Remove unpackaged files.
+rm -f %{buildroot}/%{_bindir}/yacc
+rm -f %{buildroot}/%{_infodir}/dir
+rm -f %{buildroot}/%{_mandir}/man1/yacc*
+rm -f %{buildroot}/%{_docdir}/%{name}/{AUTHORS,COPYING,NEWS,README,THANKS,TODO}
+
+%find_lang %{name}
+%find_lang %{name}-runtime
+%find_lang %{name}-gnulib
+
+%files -f %{name}.lang -f %{name}-gnulib.lang
+%license COPYING
+%{_datadir}/aclocal/bison*.m4
+%{_datadir}/bison
+%{_bindir}/bison
+
+%files help
+%doc AUTHORS ChangeLog NEWS README THANKS TODO
+%{_mandir}/man1/*
+%{_infodir}/bison*
+
+%files devel
+%{_libdir}/liby.a
+%{_docdir}/bison/examples
+
+%files lang -f %{name}-runtime.lang
+
+%changelog
+* Sat May 03 2025 Funda Wang <fundawang@yeah.net> - 3.8.2-4
+- fix build with gcc 15
+
+* Fri Aug 09 2024 Funda Wang <fundawang@yeah.net> - 3.8.2-3
+- Cleanup spec
+
+* Sat Oct 22 2022 yixiangzhike <yixiangzhike007@163.com> - 3.8.2-2
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:make it easier to spot tests failures
+
+* Wed Dec 29 2021 wangchen <wangchen137@huawei.com> - 3.8.2-1
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:update to 3.8.2
+
+* Mon Apr 19 2021 panxiaohe <panxiaohe@huawei.com> - 3.7.4-2
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:use make macros to run check in parallel
+
+* Thu Jan 21 2021 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 3.7.4-1
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:update to 3.7.4
+
+* Wed Oct 28 2020 wangchen <wangchen137@huawei.com> - 3.7.3-1
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:update to 3.7.3
+
+* Thu Jul 16 2020 wangchen <wangchen137@huawei.com> - 3.6.4-1
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:update to 3.6.4
+
+* Sat Mar 21 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.5-2
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:exclude yacc.gz from help
+
+* Tue Jan 7 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.5-1
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:update version to 3.5
+
+* Wed Oct 16 2019 shenyangyang <shenyangyang4@huawei.com> - 3.0.5-4
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC:delete unneeded files that conflicts with byacc package
+
+* Sun Sep 29 2019 shenyangyang <shenyangyang4@huawei.com> - 3.0.5-3
+- Type:NA
+- ID:NA
+- SUG:NA
+- DESC:move directory of license file
+
+* Thu Aug 29 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.0.5-2
+- Package Init
diff --git a/sources b/sources
new file mode 100644
index 0000000..d3504f4
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+c28f119f405a2304ff0a7ccdcc629713 bison-3.8.2.tar.xz