SHA256
1
0
forked from pool/qemu

Accepting request 893748 from home:marxin:branches:Virtualization

- Add fix-brotli-vla-error.patch in order to fix bsc#1181922.

OBS-URL: https://build.opensuse.org/request/show/893748
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=647
This commit is contained in:
José Ricardo Ziviani 2021-05-17 13:36:06 +00:00 committed by Git OBS Bridge
parent c69850f122
commit ca7247c1a8
3 changed files with 85 additions and 1 deletions

View File

@ -0,0 +1,77 @@
Author: Adrian Herrera <adr.her.arc.95@gmail.com>
Date: Mon Mar 22 21:06:47 2021 +0000
Subject: Fix VLA parameter warning
Make VLA buffer types consistent in declarations and definitions.
Resolves build crash when using -Werror due to "vla-parameter" warning.
Signed-off-by: Adrian Herrera <adr.her.arc.95@gmail.com>
Taken from: https://github.com/google/brotli/pull/893
diff --git a/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c b/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
index 114c5057d..bb6f1ab6c 100644
--- a/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
+++ b/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
@@ -2030,8 +2030,10 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands(
}
BrotliDecoderResult BrotliDecoderDecompress(
- size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size,
- uint8_t* decoded_buffer) {
+ size_t encoded_size,
+ const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
+ size_t* decoded_size,
+ uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]) {
BrotliDecoderState s;
BrotliDecoderResult result;
size_t total_out = 0;
diff --git a/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c b/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
index 68548ef55..ab0a49060 100644
--- a/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
+++ b/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
@@ -1470,8 +1470,9 @@ static size_t MakeUncompressedStream(
BROTLI_BOOL BrotliEncoderCompress(
int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
- const uint8_t* input_buffer, size_t* encoded_size,
- uint8_t* encoded_buffer) {
+ const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
+ size_t* encoded_size,
+ uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]) {
BrotliEncoderState* s;
size_t out_size = *encoded_size;
const uint8_t* input_start = input_buffer;
diff --git a/roms/edk2/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c b/roms/edk2/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c
index 114c5057d..bb6f1ab6c 100644
--- a/roms/edk2/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c
+++ b/roms/edk2/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c
@@ -2030,8 +2030,10 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands(
}
BrotliDecoderResult BrotliDecoderDecompress(
- size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size,
- uint8_t* decoded_buffer) {
+ size_t encoded_size,
+ const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
+ size_t* decoded_size,
+ uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]) {
BrotliDecoderState s;
BrotliDecoderResult result;
size_t total_out = 0;
diff --git a/roms/edk2/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/enc/encode.c b/roms/edk2/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/enc/encode.c
index 68548ef55..ab0a49060 100644
--- a/roms/edk2/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/enc/encode.c
+++ b/roms/edk2/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/enc/encode.c
@@ -1470,8 +1470,9 @@ static size_t MakeUncompressedStream(
BROTLI_BOOL BrotliEncoderCompress(
int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
- const uint8_t* input_buffer, size_t* encoded_size,
- uint8_t* encoded_buffer) {
+ const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
+ size_t* encoded_size,
+ uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]) {
BrotliEncoderState* s;
size_t out_size = *encoded_size;
const uint8_t* input_start = input_buffer;

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon May 17 09:30:58 UTC 2021 - Martin Liška <mliska@suse.cz>
- Add fix-brotli-vla-error.patch in order to fix bsc#1181922.
-------------------------------------------------------------------
Thu May 6 00:33:36 UTC 2021 - Bruce Rogers <brogers@suse.com>

View File

@ -1,5 +1,5 @@
#
# spec file for package qemu
# spec file
#
# Copyright (c) 2021 SUSE LLC
#
@ -177,6 +177,7 @@ Patch00041: usb-Help-compiler-out-to-avoid-a-warning.patch
Patch00042: module-for-virtio-gpu-pre-load-module-to.patch
Patch00043: qom-handle-case-of-chardev-spice-module-.patch
Patch00044: doc-add-our-support-doc-to-the-main-proj.patch
Patch00045: fix-brotli-vla-error.patch
# Patches applied in roms/seabios/:
Patch01000: seabios-use-python2-explicitly-as-needed.patch
Patch01001: seabios-switch-to-python3-as-needed.patch
@ -1052,6 +1053,7 @@ This package records qemu testsuite results and represents successful testing.
%if %{legacy_qemu_kvm}
%patch00044 -p1
%endif
%patch00045 -p1
%patch01000 -p1
%patch01001 -p1
%patch01002 -p1