diff --git a/fix-brotli-vla-error.patch b/fix-brotli-vla-error.patch new file mode 100644 index 00000000..1c50c246 --- /dev/null +++ b/fix-brotli-vla-error.patch @@ -0,0 +1,77 @@ +Author: Adrian Herrera +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 + +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; diff --git a/qemu.changes b/qemu.changes index fc78fe35..f0be09ca 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 17 09:30:58 UTC 2021 - Martin Liška + +- Add fix-brotli-vla-error.patch in order to fix bsc#1181922. + ------------------------------------------------------------------- Thu May 6 00:33:36 UTC 2021 - Bruce Rogers diff --git a/qemu.spec b/qemu.spec index 835674f0..72d7af00 100644 --- a/qemu.spec +++ b/qemu.spec @@ -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