From nobody Thu May 05 10:25:59 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8D1101ABA4BA; Thu, 5 May 2022 10:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kv8x33bLLz3wV4; Thu, 5 May 2022 10:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651746359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QkyXEFMYlnzxCWDaUt18RQGBxI3QL7YucdBxFbowkwg=; b=nQTpnfRwT+Rz0ooCE4rN818F7C8VUmPZC23hGE54Q1ki04+8QqxgGn9xpE6wTXiu9PURqx hgC3kfelPgiZDRrAron+aA8IXrh6smPxLs+WzGL1yvA91eGulCA3t2sLddF/7mXF8VvtZn F6iN2QAQ9ong72uBgdRKKUY9UCBJJaDLoARWEx0qRikwMt232Yb+ZYsDgqDbe+Tchox0AF Yaj48V6bghI0467bV2nRozb14Lt1TQyPeYS3ZkpMfuSg0xydIBwKb+2y+tykeiHSTNtR1V BzukEb+IeP55aCb3TTLga1KXlFkhcb1WmVJmSHug3TI62RzTTFiuzu2gus36JA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B6B325A8E; Thu, 5 May 2022 10:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 245APxYn074408; Thu, 5 May 2022 10:25:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 245APxLV074407; Thu, 5 May 2022 10:25:59 GMT (envelope-from git) Date: Thu, 5 May 2022 10:25:59 GMT Message-Id: <202205051025.245APxLV074407@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dima Panov Subject: git: 345fdf99b13a - main - sysutils/uefi-edk2-bhyve: fix build with modern compilers List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fluffy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 345fdf99b13a6ddecf78058ab92ea89fa12b0d21 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651746359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QkyXEFMYlnzxCWDaUt18RQGBxI3QL7YucdBxFbowkwg=; b=NmD+q6awI2oKdrWkedwvO7hINUclrZRmDCGPJ3/3D51zEC+zziZx9lMECaVWNflVjCeYRX g7hJE7csSJ+qdk1/ZXgKkpCD8HclLnePUwuzradKeYTNhnaKA6wBDLg3Le8SEixrkEd1sU LKHMiZQRFycNGIUJXlPdxb2Ge7y/0mhoIQcFcskhsgDG8qKIl9sdxPDw6KJtHixHY4SngC QxuIaC93mdBrBlTMcLm+8z1u+Y1tcwsNyC6ZX8idR6+FW1WN8g5BdU9bsYYFhPsGQH/ovI UEGFMwkAv3M9ub+T8+8rEK51tw57IB9jwk7uBwSY8YODSJLrT+LBUc0ZQqIixg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651746359; a=rsa-sha256; cv=none; b=Ap8LqBVJsoAqOWVpbbQ/vfI6YgCesgA+onMrXXkFlEsqMooVdi80is7VOhJjLjocAMMHDn cnUC3gSvnkzId+BBvjp3NLIc5erhpUG6xkj7qgupeP2l8IC0PStOIGcxxlifDU4EEs2qIM r9LSP0ptKtYoaO26R8k8kdZhjPGQkAkEVkxkymAUX6i9P8hfVfozrLIcaKblCMe4sMvmYd vhDQKu+ZbLzcOrThf68EXtaKHii6MZb0o/pNMbMmwLpO9ouqGWUXHPuESOIbL0Wy/ZU4zY 9EC6jxy2EnSfplICZh1XOU6bjA5gMUH+3uMG5RB2m9uCOI7WD65R1qHyrpzK9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fluffy: URL: https://cgit.FreeBSD.org/ports/commit/?id=345fdf99b13a6ddecf78058ab92ea89fa12b0d21 commit 345fdf99b13a6ddecf78058ab92ea89fa12b0d21 Author: Dima Panov AuthorDate: 2022-05-05 10:18:05 +0000 Commit: Dima Panov CommitDate: 2022-05-05 10:25:47 +0000 sysutils/uefi-edk2-bhyve: fix build with modern compilers Since GCC11/Clang13, build was failed with error: argument 2 of type 'const uint8_t *' {aka 'const unsigned char *'} declared as a pointer [-Werror=vla-parameter] Backport patch from brotli upstream While here, fix string pointer overflows in USB handler code [1] PR: 263545 Approved by: portmgr blanket (Tier 1 fix build) Obtained from: Gentoo bug#801925 [1] --- sysutils/uefi-edk2-bhyve/Makefile | 1 + sysutils/uefi-edk2-bhyve/files/patch-fix-warnings | 29 ++++++++++++++++++++++ .../files/patch-stringpop-overflows | 22 ++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/sysutils/uefi-edk2-bhyve/Makefile b/sysutils/uefi-edk2-bhyve/Makefile index a13311675305..9769fc41316b 100644 --- a/sysutils/uefi-edk2-bhyve/Makefile +++ b/sysutils/uefi-edk2-bhyve/Makefile @@ -1,5 +1,6 @@ PORTNAME= uefi-edk2-bhyve PORTVERSION= g20210226 +PORTREVISION= 1 PORTEPOCH= 2 CATEGORIES= sysutils diff --git a/sysutils/uefi-edk2-bhyve/files/patch-fix-warnings b/sysutils/uefi-edk2-bhyve/files/patch-fix-warnings new file mode 100644 index 000000000000..10e373e824a6 --- /dev/null +++ b/sysutils/uefi-edk2-bhyve/files/patch-fix-warnings @@ -0,0 +1,29 @@ +--- BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c ++++ BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c +@@ -2033,8 +2033,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; +--- BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c ++++ 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/sysutils/uefi-edk2-bhyve/files/patch-stringpop-overflows b/sysutils/uefi-edk2-bhyve/files/patch-stringpop-overflows new file mode 100644 index 000000000000..9f7a4986a53f --- /dev/null +++ b/sysutils/uefi-edk2-bhyve/files/patch-stringpop-overflows @@ -0,0 +1,22 @@ +--- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c ++++ MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c +@@ -285,7 +285,7 @@ UsbHcBulkTransfer ( + IN UINT8 DevSpeed, + IN UINTN MaxPacket, + IN UINT8 BufferNum, +- IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM], ++ IN OUT VOID **Data, + IN OUT UINTN *DataLength, + IN OUT UINT8 *DataToggle, + IN UINTN TimeOut, +--- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.h ++++ MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.h +@@ -149,7 +149,7 @@ UsbHcBulkTransfer ( + IN UINT8 DevSpeed, + IN UINTN MaxPacket, + IN UINT8 BufferNum, +- IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM], ++ IN OUT VOID **Data, + IN OUT UINTN *DataLength, + IN OUT UINT8 *DataToggle, + IN UINTN TimeOut,