diff options
author | Steve Sakoman <steve@sakoman.com> | 2023-01-10 04:51:06 -1000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-13 18:11:19 +0000 |
commit | 2e0077aeb8cf58d83ea55542e3a3adfb3c287f17 (patch) | |
tree | 3c2521a63276f3ebfdf8a8afa8e18619bcbda509 | |
parent | a9f1e9d27714fa324f4965b826d763f0848457b7 (diff) | |
download | poky-2e0077aeb8cf58d83ea55542e3a3adfb3c287f17.tar.gz |
ovmf: fix gcc12 warning in LzmaEnc
Backport [https://github.com/tianocore/edk2/commit/85021f8cf22d1bd4114803c6c610dea5ef0059f1]
Fixes:
Sdk/C/LzmaEnc.c: In function ?LzmaEnc_CodeOneMemBlock?:
Sdk/C/LzmaEnc.c:2828:19: error: storing the address of local variable ?outStream? in ?*p.rc.outStream? [-Werror=dangling-pointer=]
2828 | p->rc.outStream = &outStream.vt;
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
Sdk/C/LzmaEnc.c:2811:28: note: ?outStream? declared here
2811 | CLzmaEnc_SeqOutStreamBuf outStream;
| ^~~~~~~~~
Sdk/C/LzmaEnc.c:2811:28: note: ?pp? declared here
Sdk/C/LzmaEnc.c:2828:19: error: storing the address of local variable ?outStream? in ?*(CLzmaEnc *)pp.rc.outStream? [-Werror=dangling-pointer=]
2828 | p->rc.outStream = &outStream.vt;
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
Sdk/C/LzmaEnc.c:2811:28: note: ?outStream? declared here
2811 | CLzmaEnc_SeqOutStreamBuf outStream;
| ^~~~~~~~~
Sdk/C/LzmaEnc.c:2811:28: note: ?pp? declared here
cc1: all warnings being treated as errors
(From OE-Core rev: 25cc13c1016c2565694d0e0959a69c8b91054309)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/ovmf/ovmf/0001-Basetools-lzmaenc-fix-gcc12-warning.patch | 53 | ||||
-rw-r--r-- | meta/recipes-core/ovmf/ovmf_git.bb | 1 |
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-core/ovmf/ovmf/0001-Basetools-lzmaenc-fix-gcc12-warning.patch b/meta/recipes-core/ovmf/ovmf/0001-Basetools-lzmaenc-fix-gcc12-warning.patch new file mode 100644 index 0000000000..a6ef87aa79 --- /dev/null +++ b/meta/recipes-core/ovmf/ovmf/0001-Basetools-lzmaenc-fix-gcc12-warning.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 24551a99d1f765c891a4dc21a36f18ccbf56e612 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Tue, 10 Jan 2023 06:15:00 -1000 | ||
4 | Subject: [PATCH] BaseTools: fix gcc12 warning | ||
5 | |||
6 | Sdk/C/LzmaEnc.c: In function ?LzmaEnc_CodeOneMemBlock?: | ||
7 | Sdk/C/LzmaEnc.c:2828:19: error: storing the address of local variable ?outStream? in ?*p.rc.outStream? [-Werror=dangling-pointer=] | ||
8 | 2828 | p->rc.outStream = &outStream.vt; | ||
9 | | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ | ||
10 | Sdk/C/LzmaEnc.c:2811:28: note: ?outStream? declared here | ||
11 | 2811 | CLzmaEnc_SeqOutStreamBuf outStream; | ||
12 | | ^~~~~~~~~ | ||
13 | Sdk/C/LzmaEnc.c:2811:28: note: ?pp? declared here | ||
14 | Sdk/C/LzmaEnc.c:2828:19: error: storing the address of local variable ?outStream? in ?*(CLzmaEnc *)pp.rc.outStream? [-Werror=dangling-pointer=] | ||
15 | 2828 | p->rc.outStream = &outStream.vt; | ||
16 | | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ | ||
17 | Sdk/C/LzmaEnc.c:2811:28: note: ?outStream? declared here | ||
18 | 2811 | CLzmaEnc_SeqOutStreamBuf outStream; | ||
19 | | ^~~~~~~~~ | ||
20 | Sdk/C/LzmaEnc.c:2811:28: note: ?pp? declared here | ||
21 | cc1: all warnings being treated as errors | ||
22 | |||
23 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
24 | Reviewed-by: Bob Feng <bob.c.feng@intel.com> | ||
25 | |||
26 | Upstream-Status: Backport [https://github.com/tianocore/edk2/commit/85021f8cf22d1bd4114803c6c610dea5ef0059f1] | ||
27 | Signed-off-by: Steve Sakoman <steve@sakoman.com> | ||
28 | --- | ||
29 | BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 3 ++- | ||
30 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
31 | |||
32 | diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | ||
33 | index e281716fee..b575c4f888 100644 | ||
34 | --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | ||
35 | +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | ||
36 | @@ -2638,12 +2638,13 @@ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, | ||
37 | |||
38 | nowPos64 = p->nowPos64; | ||
39 | RangeEnc_Init(&p->rc); | ||
40 | - p->rc.outStream = &outStream.vt; | ||
41 | |||
42 | if (desiredPackSize == 0) | ||
43 | return SZ_ERROR_OUTPUT_EOF; | ||
44 | |||
45 | + p->rc.outStream = &outStream.vt; | ||
46 | res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize); | ||
47 | + p->rc.outStream = NULL; | ||
48 | |||
49 | *unpackSize = (UInt32)(p->nowPos64 - nowPos64); | ||
50 | *destLen -= outStream.rem; | ||
51 | -- | ||
52 | 2.25.1 | ||
53 | |||
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb index 63e857737a..ddadbac4b7 100644 --- a/meta/recipes-core/ovmf/ovmf_git.bb +++ b/meta/recipes-core/ovmf/ovmf_git.bb | |||
@@ -19,6 +19,7 @@ SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https \ | |||
19 | file://0004-ovmf-Update-to-latest.patch \ | 19 | file://0004-ovmf-Update-to-latest.patch \ |
20 | file://0001-Fix-VLA-parameter-warning.patch \ | 20 | file://0001-Fix-VLA-parameter-warning.patch \ |
21 | file://0001-Basetools-genffs-fix-gcc12-warning.patch \ | 21 | file://0001-Basetools-genffs-fix-gcc12-warning.patch \ |
22 | file://0001-Basetools-lzmaenc-fix-gcc12-warning.patch \ | ||
22 | " | 23 | " |
23 | 24 | ||
24 | PV = "edk2-stable202008" | 25 | PV = "edk2-stable202008" |