From d5cee582316f30f6ddc87f2061b1799b13464c91 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 4 Dec 2020 21:42:01 -0700 Subject: [PATCH] Fix undesirable strncpy call to instead use memcpy to avoid gcc-11 diagnostic --- spirv-tools-gcc11.patch | 13 +++++++++++++ spirv-tools.spec | 7 ++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 spirv-tools-gcc11.patch diff --git a/spirv-tools-gcc11.patch b/spirv-tools-gcc11.patch new file mode 100644 index 0000000..f5c82da --- /dev/null +++ b/spirv-tools-gcc11.patch @@ -0,0 +1,13 @@ +diff --git a/source/diagnostic.cpp b/source/diagnostic.cpp +index edc27c8..77c29d7 100644 +--- a/source/diagnostic.cpp ++++ b/source/diagnostic.cpp +@@ -37,7 +37,7 @@ spv_diagnostic spvDiagnosticCreate(const spv_position position, + diagnostic->position = *position; + diagnostic->isTextSource = false; + memset(diagnostic->error, 0, length); +- strncpy(diagnostic->error, message, length); ++ memcpy(diagnostic->error, message, length); + return diagnostic; + } + diff --git a/spirv-tools.spec b/spirv-tools.spec index 676c07d..4970e9d 100644 --- a/spirv-tools.spec +++ b/spirv-tools.spec @@ -7,12 +7,13 @@ Name: spirv-tools Version: 2020.5 -Release: 2%{?gitrel}%{?dist} +Release: 3%{?gitrel}%{?dist} Summary: API and commands for processing SPIR-V modules License: ASL 2.0 URL: https://github.com/KhronosGroup/SPIRV-Tools Source0: %url/archive/%{commit}.tar.gz#/%{name}-%{commit}.tar.gz +Patch0: %{name}-gcc11.patch BuildRequires: cmake3 BuildRequires: gcc-c++ @@ -87,6 +88,10 @@ Development files for %{name} %{_libdir}/pkgconfig/SPIRV-Tools.pc %changelog +* Fri Dec 04 2020 Jeff Law - 2020.5-3.20201031.gitf7da5277 +- Fix undesirable strncpy call to instead use memcpy to avoid + gcc-11 diagnostic + * Mon Nov 02 2020 Dave Airlie - 2020.5-2.20201031.gitf7da5277 - update to latest spirv-tools