From a57598defe119bcd1e7c564ddec6fe8f3705ed4b Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Thu, 11 Feb 2021 10:35:51 -0500 Subject: [PATCH] doxygen: fix gcc getting stuck in an infinite loop (#21614) --- .../doxygen/gcc-partial-inlining-bug.patch | 14 ++++++++++++++ .../repos/builtin/packages/doxygen/package.py | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 var/spack/repos/builtin/packages/doxygen/gcc-partial-inlining-bug.patch diff --git a/var/spack/repos/builtin/packages/doxygen/gcc-partial-inlining-bug.patch b/var/spack/repos/builtin/packages/doxygen/gcc-partial-inlining-bug.patch new file mode 100644 index 0000000000..13d0a78e80 --- /dev/null +++ b/var/spack/repos/builtin/packages/doxygen/gcc-partial-inlining-bug.patch @@ -0,0 +1,14 @@ +--- a/src/CMakeLists.txt 2021-02-10 22:55:14.766411242 -0500 ++++ b/src/CMakeLists.txt 2021-02-10 23:10:17.651541580 -0500 +@@ -305,6 +305,11 @@ + xmldocvisitor.cpp + xmlgen.cpp + ) ++# Work aroung for GCC bug getting stuck in an infinite loop ++if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ++set_source_files_properties(doxygen.cpp PROPERTIES COMPILE_FLAGS -fno-partial-inlining) ++endif() ++ + add_sanitizers(doxymain) + + # LLVM/clang headers give a lot of warnings with -Wshadow and -Wcast-align so we disable them for diff --git a/var/spack/repos/builtin/packages/doxygen/package.py b/var/spack/repos/builtin/packages/doxygen/package.py index bac517bbb2..85ec0061c0 100644 --- a/var/spack/repos/builtin/packages/doxygen/package.py +++ b/var/spack/repos/builtin/packages/doxygen/package.py @@ -75,6 +75,9 @@ def determine_variants(cls, exes, version_str): # Also - https://github.com/doxygen/doxygen/pull/6588 patch('shared_ptr.patch', when='@1.8.14') + # Workaround for gcc getting stuck in an infinite loop + patch('gcc-partial-inlining-bug.patch', when='@1.8.20: %gcc@7') + def patch(self): if self.spec['iconv'].name == 'libc': return