From 40a5b2e8c22cecaf37bd54e0db87ef862d8d3740d5bd150db01e16560755dd07 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 10 Feb 2021 10:45:19 +0000 Subject: [PATCH] - Add gcc11.diff [boo#1181882] OBS-URL: https://build.opensuse.org/package/show/X11:Wayland/spirv-tools?expand=0&rev=59 --- gcc11.diff | 37 +++++++++++++++++++++++++++++++++++++ spirv-tools.changes | 5 +++++ spirv-tools.spec | 5 ++++- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 gcc11.diff diff --git a/gcc11.diff b/gcc11.diff new file mode 100644 index 0000000..b2b5bf8 --- /dev/null +++ b/gcc11.diff @@ -0,0 +1,37 @@ +From: Jan Engelhardt +Date: 2021-02-10 11:35:55.577457480 +0100 + +gcc-11 is just too picky. +Unrelatedly, -Werror is stupid for distributions. + +--- + CMakeLists.txt | 2 +- + source/diagnostic.cpp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: SPIRV-Tools-2020.6/CMakeLists.txt +=================================================================== +--- SPIRV-Tools-2020.6.orig/CMakeLists.txt ++++ SPIRV-Tools-2020.6/CMakeLists.txt +@@ -106,7 +106,7 @@ if(${COMPILER_IS_LIKE_GNU}) + endif() + + if(${SPIRV_WERROR}) +- set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Werror) ++ set(SPIRV_WARNINGS ${SPIRV_WARNINGS}) + endif() + elseif(MSVC) + set(SPIRV_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /wd4800) +Index: SPIRV-Tools-2020.6/source/diagnostic.cpp +=================================================================== +--- SPIRV-Tools-2020.6.orig/source/diagnostic.cpp ++++ SPIRV-Tools-2020.6/source/diagnostic.cpp +@@ -37,7 +37,7 @@ spv_diagnostic spvDiagnosticCreate(const + diagnostic->position = *position; + diagnostic->isTextSource = false; + memset(diagnostic->error, 0, length); +- strncpy(diagnostic->error, message, length); ++ strcpy(diagnostic->error, message); + return diagnostic; + } + diff --git a/spirv-tools.changes b/spirv-tools.changes index 7af859d..87829a9 100644 --- a/spirv-tools.changes +++ b/spirv-tools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 10 10:37:23 UTC 2021 - Jan Engelhardt + +- Add gcc11.diff [boo#1181882] + ------------------------------------------------------------------- Tue Dec 8 12:30:46 UTC 2020 - Jan Engelhardt diff --git a/spirv-tools.spec b/spirv-tools.spec index 0a62031..4530e99 100644 --- a/spirv-tools.spec +++ b/spirv-tools.spec @@ -1,7 +1,7 @@ # # spec file for package spirv-tools # -# 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 @@ -31,6 +31,7 @@ Source: https://github.com/KhronosGroup/SPIRV-Tools/archive/v%version.ta Source9: baselibs.conf Patch1: ver.diff Patch2: gcc48.diff +Patch3: gcc11.diff BuildRequires: bison BuildRequires: cmake >= 2.8.12 BuildRequires: gcc-c++ @@ -68,6 +69,8 @@ integration into other code bases directly. %autosetup -p1 -n SPIRV-Tools-%version %build +# silence false positive +export CFLAGS="%optflags -Wno-error=stringop-overflow" CXXFLAGS="$CFLAGS" %cmake -DSPIRV-Headers_SOURCE_DIR="%_prefix" \ -DSPIRV_TOOLS_BUILD_STATIC:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=ON %cmake_build