[vlc-commits] [Git][videolan/vlc][master] 2 commits: contrib: libarchive: update to 3.6.2

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Jun 29 13:52:52 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
37e03085 by Khalid Masum at 2023-06-29T12:57:04+00:00
contrib: libarchive: update to 3.6.2

Co-authored-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -
82f19b9f by Steve Lhomme at 2023-06-29T12:57:04+00:00
contrib: libarchive: fix build with clang 16

- - - - -


4 changed files:

- + contrib/src/libarchive/0001-Make-single-bit-bitfields-unsigned-to-avoid-clang-16.patch
- contrib/src/libarchive/0006-Use-CreateFile2-instead-of-CreateFileW-on-Win8-build.patch
- contrib/src/libarchive/SHA512SUMS
- contrib/src/libarchive/rules.mak


Changes:

=====================================
contrib/src/libarchive/0001-Make-single-bit-bitfields-unsigned-to-avoid-clang-16.patch
=====================================
@@ -0,0 +1,101 @@
+From f180dcab3321149ef348e9899737db29eeaaecf0 Mon Sep 17 00:00:00 2001
+From: Dimitry Andric <dimitry at andric.com>
+Date: Tue, 18 Apr 2023 02:59:32 +0200
+Subject: [PATCH] Make single bit bitfields unsigned to avoid clang 16 warning
+ (#1860)
+
+Clang 16 introduced a warning about single bit bitfields in structs,
+which is triggered by a few libarchive formats:
+
+libarchive/archive_write_set_format_7zip.c:1541:13: error: implicit
+truncation from 'int' to a one-bit wide bit-field changes value from 1
+to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
+                    file->dir = 1;
+                              ^ ~
+
+This is because single bit bitfields only support values -1 and 0, if
+they are signed.
+
+For bitfields with two or more bits this can be intentional, but single
+bit bitfields are typically used as booleans, so it is better to make
+them unsigned.
+---
+ libarchive/archive_write_set_format_7zip.c    |  2 +-
+ libarchive/archive_write_set_format_iso9660.c | 14 +++++++-------
+ libarchive/archive_write_set_format_xar.c     |  4 ++--
+ 3 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/libarchive/archive_write_set_format_7zip.c b/libarchive/archive_write_set_format_7zip.c
+index d5ca9a66..95fd7164 100644
+--- a/libarchive/archive_write_set_format_7zip.c
++++ b/libarchive/archive_write_set_format_7zip.c
+@@ -165,7 +165,7 @@ struct file {
+ 	mode_t			 mode;
+ 	uint32_t		 crc32;
+ 
+-	signed int		 dir:1;
++	unsigned		 dir:1;
+ };
+ 
+ struct _7zip {
+diff --git a/libarchive/archive_write_set_format_iso9660.c b/libarchive/archive_write_set_format_iso9660.c
+index 197b0ee6..2a3ae07f 100644
+--- a/libarchive/archive_write_set_format_iso9660.c
++++ b/libarchive/archive_write_set_format_iso9660.c
+@@ -289,12 +289,12 @@ struct isoent {
+ 		struct extr_rec	*current;
+ 	}			 extr_rec_list;
+ 
+-	signed int		 virtual:1;
++	unsigned int		 virtual:1;
+ 	/* If set to one, this file type is a directory.
+ 	 * A convenience flag to be used as
+ 	 * "archive_entry_filetype(isoent->file->entry) == AE_IFDIR".
+ 	 */
+-	signed int		 dir:1;
++	unsigned int		 dir:1;
+ };
+ 
+ struct hardlink {
+@@ -755,9 +755,9 @@ struct iso9660 {
+ 
+ 	/* Used for making zisofs. */
+ 	struct {
+-		signed int	 detect_magic:1;
+-		signed int	 making:1;
+-		signed int	 allzero:1;
++		unsigned int	 detect_magic:1;
++		unsigned int	 making:1;
++		unsigned int	 allzero:1;
+ 		unsigned char	 magic_buffer[64];
+ 		int		 magic_cnt;
+ 
+@@ -7798,8 +7798,8 @@ struct zisofs_extract {
+ 	uint64_t	 pz_uncompressed_size;
+ 	size_t		 uncompressed_buffer_size;
+ 
+-	signed int	 initialized:1;
+-	signed int	 header_passed:1;
++	unsigned int	 initialized:1;
++	unsigned int	 header_passed:1;
+ 
+ 	uint32_t	 pz_offset;
+ 	unsigned char	*block_pointers;
+diff --git a/libarchive/archive_write_set_format_xar.c b/libarchive/archive_write_set_format_xar.c
+index 7849062c..7307757d 100644
+--- a/libarchive/archive_write_set_format_xar.c
++++ b/libarchive/archive_write_set_format_xar.c
+@@ -212,8 +212,8 @@ struct file {
+ 	struct heap_data	 data;
+         struct archive_string    script;
+ 
+-	signed int		 virtual:1;
+-	signed int		 dir:1;
++	unsigned int		 virtual:1;
++	unsigned int		 dir:1;
+ };
+ 
+ struct hardlink {
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/libarchive/0006-Use-CreateFile2-instead-of-CreateFileW-on-Win8-build.patch
=====================================
@@ -1,19 +1,19 @@
-From e6da44580b3b700b1e194c7b1a465d28aa7ea6f3 Mon Sep 17 00:00:00 2001
+From 819a3a0ccd62de4ba34fb90a25dcf4fdfa915750 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 26 May 2023 09:57:40 +0200
-Subject: [PATCH 6/9] Use CreateFile2 instead of CreateFileW on Win8+ builds
+Subject: [PATCH 6/8] Use CreateFile2 instead of CreateFileW on Win8+ builds
 
 CreateFileW is not allowed in Universal Windows Platform (UWP) builds but
 CreateFile2 is available. We could just enable this code for UWP but
 it's probably to use it going forward so the code is properly tested on
 both sides.
 ---
- cpio/cpio_windows.c                     | 15 +++++
- libarchive/archive_read_disk_windows.c  | 83 ++++++++++++++++++++++---
- libarchive/archive_util.c               | 15 +++++
- libarchive/archive_windows.c            | 15 +++++
- libarchive/archive_write_disk_windows.c | 51 +++++++++++++++
- 5 files changed, 172 insertions(+), 7 deletions(-)
+ cpio/cpio_windows.c                     | 15 ++++++
+ libarchive/archive_read_disk_windows.c  | 72 ++++++++++++++++++++++++-
+ libarchive/archive_util.c               | 15 ++++++
+ libarchive/archive_windows.c            | 15 ++++++
+ libarchive/archive_write_disk_windows.c | 51 ++++++++++++++++++
+ 5 files changed, 166 insertions(+), 2 deletions(-)
 
 diff --git a/cpio/cpio_windows.c b/cpio/cpio_windows.c
 index 63f6df03..15cccaf9 100644
@@ -52,15 +52,13 @@ index 63f6df03..15cccaf9 100644
  	return (handle);
  }
 diff --git a/libarchive/archive_read_disk_windows.c b/libarchive/archive_read_disk_windows.c
-index ea32e2aa..21356ee6 100644
+index f9d13955..f92a78a2 100644
 --- a/libarchive/archive_read_disk_windows.c
 +++ b/libarchive/archive_read_disk_windows.c
-@@ -418,8 +418,19 @@ la_linkname_from_pathw(const wchar_t *path, wchar_t **outbuf, int *linktype)
+@@ -418,9 +418,19 @@ la_linkname_from_pathw(const wchar_t *path, wchar_t **outbuf, int *linktype)
  	    FILE_FLAG_OPEN_REPARSE_POINT;
  	int ret;
  
--	h = CreateFileW(path, 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, flag,
--	    NULL);
 +# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
 +	CREATEFILE2_EXTENDED_PARAMETERS createExParams;
 +	ZeroMemory(&createExParams, sizeof(createExParams));
@@ -70,14 +68,14 @@ index ea32e2aa..21356ee6 100644
 +	    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
 +	    OPEN_EXISTING, &createExParams);
 +#else
-+	h = CreateFileW(path, 0,
-+	    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
-+	    OPEN_EXISTING, flag, NULL);
+ 	h = CreateFileW(path, 0,
+ 	    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
+ 	    OPEN_EXISTING, flag, NULL);
 +#endif
  	if (h == INVALID_HANDLE_VALUE) {
  		la_dosmaperr(GetLastError());
  		return (-1);
-@@ -1066,14 +1077,27 @@ next_entry(struct archive_read_disk *a, struct tree *t,
+@@ -1067,16 +1077,29 @@ next_entry(struct archive_read_disk *a, struct tree *t,
  	if (archive_entry_filetype(entry) == AE_IFREG &&
  	    archive_entry_size(entry) > 0) {
  		DWORD flags = FILE_FLAG_BACKUP_SEMANTICS;
@@ -100,12 +98,14 @@ index ea32e2aa..21356ee6 100644
 +		    OPEN_EXISTING, &createExParams);
 +#else
  		t->entry_fh = CreateFileW(tree_current_access_path(t),
- 		    GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, flags, NULL);
+ 		    GENERIC_READ,
+ 		    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ 		    NULL, OPEN_EXISTING, flags, NULL);
 +#endif
  		if (t->entry_fh == INVALID_HANDLE_VALUE) {
  			la_dosmaperr(GetLastError());
  			archive_set_error(&a->archive, errno,
-@@ -1544,6 +1568,9 @@ close_and_restore_time(HANDLE h, struct tree *t, struct restore_time *rt)
+@@ -1547,6 +1570,9 @@ close_and_restore_time(HANDLE h, struct tree *t, struct restore_time *rt)
  {
  	HANDLE handle;
  	int r = 0;
@@ -115,7 +115,7 @@ index ea32e2aa..21356ee6 100644
  
  	if (h == INVALID_HANDLE_VALUE && AE_IFLNK == rt->filetype)
  		return (0);
-@@ -1557,8 +1584,16 @@ close_and_restore_time(HANDLE h, struct tree *t, struct restore_time *rt)
+@@ -1560,8 +1586,16 @@ close_and_restore_time(HANDLE h, struct tree *t, struct restore_time *rt)
  	if ((t->flags & needsRestoreTimes) == 0)
  		return (r);
  
@@ -132,7 +132,7 @@ index ea32e2aa..21356ee6 100644
  	if (handle == INVALID_HANDLE_VALUE) {
  		errno = EINVAL;
  		return (-1);
-@@ -2043,11 +2078,23 @@ tree_current_file_information(struct tree *t, BY_HANDLE_FILE_INFORMATION *st,
+@@ -2046,12 +2080,24 @@ tree_current_file_information(struct tree *t, BY_HANDLE_FILE_INFORMATION *st,
  	HANDLE h;
  	int r;
  	DWORD flag = FILE_FLAG_BACKUP_SEMANTICS;
@@ -151,13 +151,14 @@ index ea32e2aa..21356ee6 100644
 +	    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
 +	    OPEN_EXISTING, &createExParams);
 +#else
- 	h = CreateFileW(tree_current_access_path(t), 0, FILE_SHARE_READ, NULL,
+ 	h = CreateFileW(tree_current_access_path(t), 0,
+ 	    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
  	    OPEN_EXISTING, flag, NULL);
 +#endif
  	if (h == INVALID_HANDLE_VALUE) {
  		la_dosmaperr(GetLastError());
  		t->tree_errno = errno;
-@@ -2253,7 +2300,10 @@ archive_read_disk_entry_from_file(struct archive *_a,
+@@ -2257,7 +2303,10 @@ archive_read_disk_entry_from_file(struct archive *_a,
  		} else {
  			WIN32_FIND_DATAW findData;
  			DWORD flag, desiredAccess;
@@ -169,7 +170,7 @@ index ea32e2aa..21356ee6 100644
  			h = FindFirstFileW(path, &findData);
  			if (h == INVALID_HANDLE_VALUE) {
  				la_dosmaperr(GetLastError());
-@@ -2275,8 +2325,17 @@ archive_read_disk_entry_from_file(struct archive *_a,
+@@ -2279,9 +2328,18 @@ archive_read_disk_entry_from_file(struct archive *_a,
  			} else
  				desiredAccess = GENERIC_READ;
  
@@ -181,13 +182,14 @@ index ea32e2aa..21356ee6 100644
 +			    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
 +			    OPEN_EXISTING, &createExParams);
 +#else
- 			h = CreateFileW(path, desiredAccess, FILE_SHARE_READ, NULL,
+ 			h = CreateFileW(path, desiredAccess,
+ 			    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
  			    OPEN_EXISTING, flag, NULL);
 +#endif
  			if (h == INVALID_HANDLE_VALUE) {
  				la_dosmaperr(GetLastError());
  				archive_set_error(&a->archive, errno,
-@@ -2337,8 +2396,18 @@ archive_read_disk_entry_from_file(struct archive *_a,
+@@ -2342,9 +2400,19 @@ archive_read_disk_entry_from_file(struct archive *_a,
  		if (fd >= 0) {
  			h = (HANDLE)_get_osfhandle(fd);
  		} else {
@@ -200,7 +202,8 @@ index ea32e2aa..21356ee6 100644
 +			    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
 +			    OPEN_EXISTING, &createExParams);
 +#else
- 			h = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL,
+ 			h = CreateFileW(path, GENERIC_READ,
+ 			    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
  			    OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
 +#endif
  			if (h == INVALID_HANDLE_VALUE) {
@@ -283,7 +286,7 @@ index 624e2700..53d4b558 100644
  	return (handle);
  }
 diff --git a/libarchive/archive_write_disk_windows.c b/libarchive/archive_write_disk_windows.c
-index 0d838c14..7521fbe1 100644
+index 7280d99b..b4a73e71 100644
 --- a/libarchive/archive_write_disk_windows.c
 +++ b/libarchive/archive_write_disk_windows.c
 @@ -266,6 +266,9 @@ file_information(struct archive_write_disk *a, wchar_t *path,
@@ -324,7 +327,7 @@ index 0d838c14..7521fbe1 100644
  		free(full);
  	}
  	if (h == INVALID_HANDLE_VALUE) {
-@@ -1671,6 +1687,9 @@ create_filesystem_object(struct archive_write_disk *a)
+@@ -1672,6 +1688,9 @@ create_filesystem_object(struct archive_write_disk *a)
  	mode_t final_mode, mode;
  	int r;
  	DWORD attrs = 0;
@@ -334,7 +337,7 @@ index 0d838c14..7521fbe1 100644
  
  	/* We identify hard/symlinks according to the link names. */
  	/* Since link(2) and symlink(2) don't handle modes, we're done here. */
-@@ -1734,8 +1753,16 @@ create_filesystem_object(struct archive_write_disk *a)
+@@ -1735,8 +1754,16 @@ create_filesystem_object(struct archive_write_disk *a)
  			a->todo = 0;
  			a->deferred = 0;
  		} else if (r == 0 && a->filesize > 0) {
@@ -351,7 +354,7 @@ index 0d838c14..7521fbe1 100644
  			if (a->fh == INVALID_HANDLE_VALUE) {
  				la_dosmaperr(GetLastError());
  				r = errno;
-@@ -1798,14 +1825,27 @@ create_filesystem_object(struct archive_write_disk *a)
+@@ -1799,14 +1826,27 @@ create_filesystem_object(struct archive_write_disk *a)
  		a->tmpname = NULL;
  		fullname = a->name;
  		/* O_WRONLY | O_CREAT | O_EXCL */
@@ -379,7 +382,7 @@ index 0d838c14..7521fbe1 100644
  		}
  		if (a->fh == INVALID_HANDLE_VALUE) {
  			if (GetLastError() == ERROR_ACCESS_DENIED) {
-@@ -2561,14 +2601,25 @@ set_times(struct archive_write_disk *a,
+@@ -2567,14 +2607,25 @@ set_times(struct archive_write_disk *a,
  		hw = NULL;
  	} else {
  		wchar_t *ws;


=====================================
contrib/src/libarchive/SHA512SUMS
=====================================
@@ -1 +1 @@
-58f7ac0c52116f73326a07dec10ff232be33b318862078785dc39f1fb2f8773b5194eabfa14764bb51ce6a5a1aa8820526e7f4c76087a6f4fcbe7789a22275b4  libarchive-3.6.1.tar.gz
+24e476465054a29a2d48adf3c197a171b5361fa5038729a1f14d578c6701424de4e5dd6a2b20a6b697969ab43bdd8afc1585f8de0465c266f455d7eaa19e5048  libarchive-3.6.2.tar.gz


=====================================
contrib/src/libarchive/rules.mak
=====================================
@@ -1,5 +1,5 @@
 # LIBARCHIVE
-LIBARCHIVE_VERSION := 3.6.1
+LIBARCHIVE_VERSION := 3.6.2
 LIBARCHIVE_URL := $(GITHUB)/libarchive/libarchive/releases/download/v$(LIBARCHIVE_VERSION)/libarchive-$(LIBARCHIVE_VERSION).tar.gz
 
 PKGS += libarchive
@@ -45,6 +45,7 @@ libarchive: libarchive-$(LIBARCHIVE_VERSION).tar.gz .sum-libarchive
 	$(APPLY) $(SRC)/libarchive/0006-Use-CreateFile2-instead-of-CreateFileW-on-Win8-build.patch
 	$(APPLY) $(SRC)/libarchive/0007-Disable-CreateFileA-calls-in-UWP-builds.patch
 	$(APPLY) $(SRC)/libarchive/0008-Disable-program-call-with-stdin-stdout-usage-on-UWP-.patch
+	$(APPLY) $(SRC)/libarchive/0001-Make-single-bit-bitfields-unsigned-to-avoid-clang-16.patch
 	$(call pkg_static,"build/pkgconfig/libarchive.pc.in")
 	$(MOVE)
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e133197b64d2fd91553f2ba9252f2b11239ccfab...82f19b9fbb7961522f39921047f15402284c7deb

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e133197b64d2fd91553f2ba9252f2b11239ccfab...82f19b9fbb7961522f39921047f15402284c7deb
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list