From 92f0b1bb66a3a1459df6e783b78f647529abed19f60c481ed17382bcbcb45030 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 13 Jul 2021 11:46:25 +0000 Subject: [PATCH] Accepting request 906063 from home:aloisw:branches:science - Add a patch to fix ODR violations, which were causing segfaults in the respective programs with LTO enabled. OBS-URL: https://build.opensuse.org/request/show/906063 OBS-URL: https://build.opensuse.org/package/show/science/gfan?expand=0&rev=27 --- gfan-odr.patch | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++ gfan.changes | 6 ++++ gfan.spec | 3 +- 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 gfan-odr.patch diff --git a/gfan-odr.patch b/gfan-odr.patch new file mode 100644 index 0000000..08b09b4 --- /dev/null +++ b/gfan-odr.patch @@ -0,0 +1,85 @@ +From a75e670e0e228e0a738eb65c7128a01446b4135c Mon Sep 17 00:00:00 2001 +From: Alois Wohlschlager +Date: Sat, 3 Jul 2021 11:07:23 +0200 +Subject: [PATCH] Fix ODR violations +Upstream: not reachable + +Various traversal code reused class names (Boundary, pathStepRidge, +pathStepFacet) in violation of the one definition rule. Put the +respective classes into anonymous namespaces to comply with ODR. +--- + src/gfanlib_traversal.cpp | 4 ++++ + src/symmetrictraversal.cpp | 4 ++++ + src/tropicaltraverse.cpp | 5 +++++ + 3 files changed, 13 insertions(+) + +diff --git a/src/gfanlib_traversal.cpp b/src/gfanlib_traversal.cpp +index dce38c1..3e9a746 100644 +--- a/src/gfanlib_traversal.cpp ++++ b/src/gfanlib_traversal.cpp +@@ -62,6 +62,8 @@ bool FanBuilder::process(FanTraverser &traverser) + in the computation is made these edges will be deleted. + */ + ++namespace ++{ + + class Boundary + { +@@ -185,6 +187,8 @@ struct pathStepFacet + list ridgesRayUniqueVector;//stores the ray of the link that we came from + }; + ++} ++ + /** + We need to simulate two mutually recursive functions. An actual + implementation of these two functions would probably not work since +diff --git a/src/symmetrictraversal.cpp b/src/symmetrictraversal.cpp +index 8cf6f40..4fe66e0 100644 +--- a/src/symmetrictraversal.cpp ++++ b/src/symmetrictraversal.cpp +@@ -103,6 +103,8 @@ bool SymmetricTargetVertexSetBuilder::process(ConeTraverser &traverser) + in the computation is made these edges will be deleted. + */ + ++namespace ++{ + + class Boundary + { +@@ -258,6 +260,8 @@ struct pathStepFacet + IntegerVectorList ridgesRayUniqueVector;//stores the ray of the link that we came from + }; + ++} ++ + /** + We need to simulate two mutually recursive functions. An actual + implementation of these two functions would probably not work since +diff --git a/src/tropicaltraverse.cpp b/src/tropicaltraverse.cpp +index 05e9747..c01a69f 100644 +--- a/src/tropicaltraverse.cpp ++++ b/src/tropicaltraverse.cpp +@@ -104,6 +104,9 @@ public: + } + }; + ++namespace ++{ ++ + /** + Rewrite these comments. + +@@ -130,6 +133,8 @@ struct pathStepFacet + IntegerVectorList ridges; + }; + ++} ++ + /** + We need to simulate two mutually recursive functions. An actual + implementation of these two functions would propably not work since +-- +2.32.0 + diff --git a/gfan.changes b/gfan.changes index d506374..128203a 100644 --- a/gfan.changes +++ b/gfan.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 13 09:09:06 UTC 2021 - Alois Wohlschlager + +- Add a patch to fix ODR violations, which were causing segfaults + in the respective programs with LTO enabled. + ------------------------------------------------------------------- Sat Sep 19 10:05:47 UTC 2020 - Jan Engelhardt diff --git a/gfan.spec b/gfan.spec index 9633749..73ef826 100644 --- a/gfan.spec +++ b/gfan.spec @@ -1,7 +1,7 @@ # # spec file for package gfan # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,6 +28,7 @@ Source: http://home.imf.au.dk/jensen/software/gfan/%name%version.tar.gz Patch1: gfan-automake.diff Patch2: gfan-warnings.diff Patch3: cddlib.patch +Patch4: gfan-odr.patch BuildRequires: automake BuildRequires: cddlib-devel BuildRequires: gcc-c++