insighttoolkit/insighttoolkit-fno-sized-deallocation.patch
Atri Bhattacharya 12de020958 Accepting request 999780 from home:badshah400:branches:Application:Geo
- Disable python bindings for openSUSE >= 1550 until swig related issues are sorted [gh#InsightSoftwareConsortium/ITK#3452].
- Add insighttoolkit-fno-sized-deallocation.patch: Add -fno-sized-deallocation for GCC 12; patch taken from upstream commit.

OBS-URL: https://build.opensuse.org/request/show/999780
OBS-URL: https://build.opensuse.org/package/show/Application:Geo/insighttoolkit?expand=0&rev=46
2022-09-01 01:29:08 +00:00

33 lines
1.2 KiB
Diff

From 58ce6e84f2b93a963f5e4ec58b87f72886a0aa6f Mon Sep 17 00:00:00 2001
From: Matt McCormick <matt.mccormick@kitware.com>
Date: Wed, 10 Aug 2022 15:23:47 -0400
Subject: [PATCH] COMP: Add -fno-sized-deallocation for GCC 12
Addresses:
```
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/new_allocator.h:158:2: error: call to '__builtin_operator_delete' selects non-usual deallocation function
_GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
```
Fixes #3452
---
CMake/ITKSetStandardCompilerFlags.cmake | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/CMake/ITKSetStandardCompilerFlags.cmake b/CMake/ITKSetStandardCompilerFlags.cmake
index 7886b169e52..8c3eabe3aab 100644
--- a/CMake/ITKSetStandardCompilerFlags.cmake
+++ b/CMake/ITKSetStandardCompilerFlags.cmake
@@ -344,6 +344,10 @@ macro(check_compiler_platform_flags)
endforeach()
endif()
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12")
+ set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -fno-sized-deallocation")
+ endif()
+
# gcc must have -msse2 option to enable sse2 support
if(VNL_CONFIG_ENABLE_SSE2 OR VNL_CONFIG_ENABLE_SSE2_ROUNDING)
set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -msse2")