diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-02-27 00:18:11 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-11 15:25:57 +0000 |
commit | 87cf634ac3ad72b15b91d3da959a1b91970970d5 (patch) | |
tree | 9a7b6011d8d20c99738610fdfa55eb7cac8f305a /meta | |
parent | 79ae4019579f80f78d82d8619b8dbab11af49f45 (diff) | |
download | poky-87cf634ac3ad72b15b91d3da959a1b91970970d5.tar.gz |
spirv-tools: Replace strncpy with memcpy
Fixes warnings produced with gcc 11
(From OE-Core rev: 09cfa5ce1eca27c810d86680f89ab881533fb0a5)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-graphics/spir/files/0001-fix-strncpy-bound-error.patch | 30 | ||||
-rw-r--r-- | meta/recipes-graphics/spir/spirv-tools_2020.6.bb | 4 |
2 files changed, 33 insertions, 1 deletions
diff --git a/meta/recipes-graphics/spir/files/0001-fix-strncpy-bound-error.patch b/meta/recipes-graphics/spir/files/0001-fix-strncpy-bound-error.patch new file mode 100644 index 0000000000..bc59faa37b --- /dev/null +++ b/meta/recipes-graphics/spir/files/0001-fix-strncpy-bound-error.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 1ba007583b83468494c4146bcb7267d863de6a7b Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 26 Feb 2021 23:54:10 -0800 | ||
4 | Subject: [PATCH] fix strncpy bound error | ||
5 | |||
6 | This patch fixes the following error while using gcc 11 | ||
7 | error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=] | ||
8 | |||
9 | Upstream-Status: Submitted [https://github.com/KhronosGroup/SPIRV-Tools/pull/4151] | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | source/diagnostic.cpp | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/source/diagnostic.cpp b/source/diagnostic.cpp | ||
16 | index edc27c8fd..77c29d70c 100644 | ||
17 | --- a/source/diagnostic.cpp | ||
18 | +++ b/source/diagnostic.cpp | ||
19 | @@ -37,7 +37,7 @@ spv_diagnostic spvDiagnosticCreate(const spv_position position, | ||
20 | diagnostic->position = *position; | ||
21 | diagnostic->isTextSource = false; | ||
22 | memset(diagnostic->error, 0, length); | ||
23 | - strncpy(diagnostic->error, message, length); | ||
24 | + memcpy(diagnostic->error, message, length); | ||
25 | return diagnostic; | ||
26 | } | ||
27 | |||
28 | -- | ||
29 | 2.30.1 | ||
30 | |||
diff --git a/meta/recipes-graphics/spir/spirv-tools_2020.6.bb b/meta/recipes-graphics/spir/spirv-tools_2020.6.bb index f1fe40096e..ea89766e92 100644 --- a/meta/recipes-graphics/spir/spirv-tools_2020.6.bb +++ b/meta/recipes-graphics/spir/spirv-tools_2020.6.bb | |||
@@ -8,7 +8,9 @@ LICENSE = "Apache-2.0" | |||
8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" | 8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" |
9 | 9 | ||
10 | SRCREV = "b27b1afd12d05bf238ac7368bb49de73cd620a8e" | 10 | SRCREV = "b27b1afd12d05bf238ac7368bb49de73cd620a8e" |
11 | SRC_URI = "git://github.com/KhronosGroup/SPIRV-Tools.git" | 11 | SRC_URI = "git://github.com/KhronosGroup/SPIRV-Tools.git \ |
12 | file://0001-fix-strncpy-bound-error.patch \ | ||
13 | " | ||
12 | UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>\d+(\.\d+)+)$" | 14 | UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>\d+(\.\d+)+)$" |
13 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |
14 | 16 | ||