]> wimlib.net Git - wimlib/log
wimlib
4 days agomount_image.c: add fallback definitions of RENAME_* constants master
Eric Biggers [Sat, 20 Apr 2024 05:21:52 +0000 (22:21 -0700)]
mount_image.c: add fallback definitions of RENAME_* constants

This is needed on older distros.

Reported at https://wimlib.net/forums/viewtopic.php?t=743

8 weeks agov1.14.4 v1.14.4
Eric Biggers [Sat, 24 Feb 2024 18:40:45 +0000 (10:40 -0800)]
v1.14.4

2 months agoREADME.md: improve the installation directions
Eric Biggers [Fri, 9 Feb 2024 23:36:21 +0000 (15:36 -0800)]
README.md: improve the installation directions

2 months agoconfigure.ac: mention development file packages
Eric Biggers [Fri, 9 Feb 2024 23:36:21 +0000 (15:36 -0800)]
configure.ac: mention development file packages

2 months agowindows-build.sh: ensure that -static-libgcc is used with MSYS2 gcc
Eric Biggers [Wed, 7 Feb 2024 06:26:50 +0000 (22:26 -0800)]
windows-build.sh: ensure that -static-libgcc is used with MSYS2 gcc

In MSYS2 MINGW32, the gcc version is "i686-w64-mingw32-cc.exe (Rev4,
Built by MSYS2 project) 13.2.0" which does not contain the string
"(GCC)" as expected.  Similarly for MSYS2 MINGW64.  This means that
-static-libgcc does not get used as intended.  As a quick fix, just
invert the check, so gcc is now detected by checking for not clang..

2 months agoci.yml: use actions/checkout@v4 and actions/upload-artifact@v4
Eric Biggers [Wed, 7 Feb 2024 06:26:50 +0000 (22:26 -0800)]
ci.yml: use actions/checkout@v4 and actions/upload-artifact@v4

This addresses the following warnings from GitHub Actions:

    Node.js 16 actions are deprecated. Please update the following
    actions to use Node.js 20: actions/checkout@v3. For more information
    see:
    https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

    Node.js 16 actions are deprecated. Please update the following
    actions to use Node.js 20: actions/upload-artifact@v3. For more
    information see:
    https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

A near-identical warning forced everyone to upgrade to v3 last year, so
this is some pointless churn, but let's just get it over with again...

2 months agowin32-test-imagex-capture_and_apply.bat: exclude a test due to DISM bug
Eric Biggers [Wed, 7 Feb 2024 06:26:50 +0000 (22:26 -0800)]
win32-test-imagex-capture_and_apply.bat: exclude a test due to DISM bug

2 months agoxmlproc: fix buffer enlargement logic
Eric Biggers [Wed, 7 Feb 2024 06:26:50 +0000 (22:26 -0800)]
xmlproc: fix buffer enlargement logic

This fixes a heap buffer overflow caught by the xmlproc fuzzer.

5 months agofuzz.sh: add --max-len option
Eric Biggers [Sat, 28 Oct 2023 04:04:32 +0000 (21:04 -0700)]
fuzz.sh: add --max-len option

7 months agoREADME.WINDOWS.md: use https URL instead of git
Eric Biggers [Sat, 16 Sep 2023 23:21:11 +0000 (16:21 -0700)]
README.WINDOWS.md: use https URL instead of git

7 months agov1.14.3 v1.14.3
Eric Biggers [Mon, 4 Sep 2023 18:41:23 +0000 (11:41 -0700)]
v1.14.3

7 months agoFix xml_legal_value() with signed char
Eric Biggers [Tue, 29 Aug 2023 04:00:04 +0000 (21:00 -0700)]
Fix xml_legal_value() with signed char

Fixes: cd9959b4f62a ("Eliminate the dependency on libxml2")
Resolves https://wimlib.net/forums/viewtopic.php?p=1608

8 months agov1.14.2 v1.14.2
Eric Biggers [Sun, 6 Aug 2023 17:30:39 +0000 (10:30 -0700)]
v1.14.2

9 months agoAdd a clang-format file
Eric Biggers [Sat, 22 Jul 2023 23:33:08 +0000 (16:33 -0700)]
Add a clang-format file

This approximates the de facto coding style of this project, which is
quite similar to the Linux kernel coding style.

This is just in case people to use it with 'git clang-format', as
requested at https://wimlib.net/forums/viewtopic.php?t=666.  I'm not
planning to reformat all the existing code to make it match exactly.

9 months agov1.14.2-BETA2
Eric Biggers [Sat, 22 Jul 2023 22:01:50 +0000 (15:01 -0700)]
v1.14.2-BETA2

9 months agowin32-test-imagex-capture_and_apply: re-enable more compatibility tests
Eric Biggers [Sat, 22 Jul 2023 22:01:50 +0000 (15:01 -0700)]
win32-test-imagex-capture_and_apply: re-enable more compatibility tests

After the previous commit, these tests now pass.

9 months agoFix compatibility issues with directory streams
Eric Biggers [Sat, 22 Jul 2023 22:01:50 +0000 (15:01 -0700)]
Fix compatibility issues with directory streams

Fix two related bugs where a WIM image metadata resource written by
wimlib could not be understood by some MS software versions:

- Never write an extra stream entry for the unnamed data stream of
  directories.  The concept of "unnamed data stream" isn't applicable to
  directories.  This fixes compatibility with DISM when the WIM image
  contains a directory with named data stream(s).  (I think DISM used to
  be okay with this, but on 10.0.20348.681 I'm seeing this issue.)

- Store the reparse point hash in main_hash when no extra stream entries
  are otherwise needed, i.e. when the file is a directory with no named
  data streams.  This fixes compatibility with the Windows 8 setup
  wizard, at least for some specific version of Windows 8, as reported
  at https://wimlib.net/forums/viewtopic.php?t=671.

Resolves https://wimlib.net/forums/viewtopic.php?t=671

9 months agowin32-test-imagex-capture_and_apply: re-enable some compatibility tests
Eric Biggers [Sat, 22 Jul 2023 22:01:50 +0000 (15:01 -0700)]
win32-test-imagex-capture_and_apply: re-enable some compatibility tests

These tests are currently passing.

9 months agov1.14.2-BETA1
Eric Biggers [Sat, 8 Jul 2023 19:27:49 +0000 (12:27 -0700)]
v1.14.2-BETA1

9 months agoImprove encoding detection of wimupdate command files
Eric Biggers [Sat, 8 Jul 2023 19:12:08 +0000 (12:12 -0700)]
Improve encoding detection of wimupdate command files

Make wimupdate command files (read from stdin) and wimcapture source
list files be interpreted as UTF-8 or UTF-16LE (autodetected).
Previously these files were interpreted as the Windows codepage or
UTF-16LE on Windows (autodetected), and UTF-8 on non-Windows.

This makes these files be consistent with wimextract pathlist files and
wimcapture config files, which already had the behavior of "autodetect
UTF-8 or UTF-16LE on all platforms".

Resolves https://wimlib.net/forums/viewtopic.php?p=1545

9 months agoAlign stack when entering wimlib on 32-bit x86
Eric Biggers [Mon, 26 Jun 2023 01:06:41 +0000 (18:06 -0700)]
Align stack when entering wimlib on 32-bit x86

This may resolve https://wimlib.net/forums/viewtopic.php?t=669.  The
reported crash happened in sha1_blocks_x86_avx_bmi2() on the first
instruction that writes to the stack with vmovqda.  That suggests the
stack was misaligned.  If this indeed fixes the bug, then it has
actually always existed but it got exposed by new code in v1.14.0.

11 months agomount_image.c: silence a -Wmaybe-uninitialized warning
Eric Biggers [Sun, 14 May 2023 21:22:47 +0000 (14:22 -0700)]
mount_image.c: silence a -Wmaybe-uninitialized warning

Silence a false positive -Wmaybe-uninitialized warning in
do_unmount_commit() with gcc 13.1.1.

11 months agov1.14.1 v1.14.1
Eric Biggers [Fri, 28 Apr 2023 06:26:32 +0000 (23:26 -0700)]
v1.14.1

11 months agocpu_features.c: fix unconditional execution of xgetbv
Eric Biggers [Thu, 27 Apr 2023 00:35:37 +0000 (17:35 -0700)]
cpu_features.c: fix unconditional execution of xgetbv

Ensure that the execution of the xgetbv instruction doesn't get moved
out from under the check for OSXSAVE support by a compiler optimization.
This fixes a crash on older CPUs, introduced in v1.14.0.

Reported at https://wimlib.net/forums/viewtopic.php?p=1527

12 months agov1.14.0 v1.14.0
Eric Biggers [Sun, 23 Apr 2023 07:15:50 +0000 (00:15 -0700)]
v1.14.0

12 months agothreads.c: fix file comment
Eric Biggers [Sun, 23 Apr 2023 06:51:01 +0000 (23:51 -0700)]
threads.c: fix file comment

12 months agolibFuzzer: add encoding fuzzer
Eric Biggers [Mon, 10 Apr 2023 00:02:21 +0000 (17:02 -0700)]
libFuzzer: add encoding fuzzer

12 months agoFix win32-test-imagex-capture_and_apply.bat and add to CI
Eric Biggers [Mon, 10 Apr 2023 00:02:21 +0000 (17:02 -0700)]
Fix win32-test-imagex-capture_and_apply.bat and add to CI

12 months agolibFuzzer: rename xml fuzzer to xmlproc
Eric Biggers [Sun, 9 Apr 2023 20:07:46 +0000 (13:07 -0700)]
libFuzzer: rename xml fuzzer to xmlproc

12 months agolibFuzzer: add xml_windows fuzzer
Eric Biggers [Sun, 9 Apr 2023 19:39:48 +0000 (12:39 -0700)]
libFuzzer: add xml_windows fuzzer

12 months agolibFuzzer: increase max_len from 4K to 32K
Eric Biggers [Sun, 9 Apr 2023 19:39:48 +0000 (12:39 -0700)]
libFuzzer: increase max_len from 4K to 32K

12 months agoFix wlfuzz and enable in CI
Eric Biggers [Sun, 9 Apr 2023 18:39:36 +0000 (11:39 -0700)]
Fix wlfuzz and enable in CI

- Fix build failure on Linux by linking with the math library.

- Don't hard-code the temporary directory to E:\ on Windows.

- Relax some comparisons that don't work reliably on Windows:
   - Security descriptor
   - Last access time
   - Sparse file attribute (clear only)

- Relax the timestamp comparisons when running on an ext4 filesystem,
  since ext4 doesn't support the full timestamp range that Windows does.
  Also, generate more timestamps that are close to the present date.

- Make the command-line argument give the number of seconds to run,
  rather than the number of iterations.  This makes it possible to run
  wlfuzz for 2 minutes in GitHub Actions, like the libFuzzer jobs.

- Increase coverage by using a different random seed on each run.

- Make wlfuzz initialize wimlib with STRICT_{CAPTURE,APPLY}_PRIVILIGES
  on Windows.  I.e., don't allow running wlfuzz as non-Administrator.

- Print security descriptors and timestamps when they differ.

- Add GitHub Actions jobs that run wlfuzz on Linux and Windows.

12 months agowin32_apply: retry creating hard links
Eric Biggers [Sun, 9 Apr 2023 18:39:36 +0000 (11:39 -0700)]
win32_apply: retry creating hard links

12 months agowimoptimize.1: fix ESD => WIM example
Eric Biggers [Tue, 4 Apr 2023 05:40:41 +0000 (22:40 -0700)]
wimoptimize.1: fix ESD => WIM example

12 months agowimoptimize: better defaults for WIM <=> ESD
Eric Biggers [Mon, 3 Apr 2023 05:36:40 +0000 (22:36 -0700)]
wimoptimize: better defaults for WIM <=> ESD

Resolves https://wimlib.net/forums/viewtopic.php?t=508
Resolves https://wimlib.net/forums/viewtopic.php?t=654

12 months agowimupdate: add --ref option for updating delta WIMs
Eric Biggers [Sun, 2 Apr 2023 19:32:46 +0000 (12:32 -0700)]
wimupdate: add --ref option for updating delta WIMs

Resolves https://wimlib.net/forums/viewtopic.php?t=450

12 months agomount_image.c: call file_contents_changed() on extending truncates
Eric Biggers [Sun, 2 Apr 2023 19:32:46 +0000 (12:32 -0700)]
mount_image.c: call file_contents_changed() on extending truncates

12 months agov1.14.0-BETA3
Eric Biggers [Sun, 2 Apr 2023 06:46:11 +0000 (23:46 -0700)]
v1.14.0-BETA3

12 months agoREADME.md: 7-Zip supports solid WIMs now
Eric Biggers [Sun, 2 Apr 2023 06:29:14 +0000 (23:29 -0700)]
README.md: 7-Zip supports solid WIMs now

12 months agowimlib.h: remove outdated list of Windows architectures
Eric Biggers [Sun, 2 Apr 2023 06:29:14 +0000 (23:29 -0700)]
wimlib.h: remove outdated list of Windows architectures

12 months agoConvert README* and NEWS to Markdown
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
Convert README* and NEWS to Markdown

This is the usual convention for new projects.

12 months agomount_image.c: avoid UBSAN warning in wimfs_listxattr()
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
mount_image.c: avoid UBSAN warning in wimfs_listxattr()

When 'list == NULL && size == 0', the statement 'end = list + size'
executes 'NULL + 0'.  clang's UndefinedBehaviorSanitizer complains that
this is undefined:

    src/mount_image.c:1518:19: runtime error: applying zero offset to null pointer

This is questionable, but let's avoid it...

12 months agoUpgrade WIM mounting support from fuse2 to fuse3
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
Upgrade WIM mounting support from fuse2 to fuse3

fuse2 is no longer maintained, and the various Linux distros want all
packages to move to fuse3.  So, let's add fuse3 support.

Moreover, as it's been over 5 years since fuse3 was released, it doesn't
seem worth it to support both fuse2 and fuse3.  So, remove support for
fuse2, and just support fuse3.

Note: as before, WIM mounting support can still be disabled by
configuring --without-fuse.  That removes the dependency.

12 months agoconfigure.ac: explicitly call PKG_PROG_PKG_CONFIG
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
configure.ac: explicitly call PKG_PROG_PKG_CONFIG

Without this, pkg-config only worked if the first PKG_CHECK_MODULES that
appears *in the file* was executed, i.e. only if WITH_NTFS_3G=yes.

12 months agoci.yml: add shellcheck job
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
ci.yml: add shellcheck job

12 months agotools: address all shellcheck warnings
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
tools: address all shellcheck warnings

12 months agotools: make all shell scripts have the .sh extension
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
tools: make all shell scripts have the .sh extension

12 months agoUpdate hyperlinks
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
Update hyperlinks

Use https whenever possible, and replace some outdated links.

12 months agoUpdate to latest ax_pthread.m4
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
Update to latest ax_pthread.m4

12 months agowindows-build.sh: misc cleanups
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
windows-build.sh: misc cleanups

12 months agov1.14.0-BETA2
Eric Biggers [Fri, 31 Mar 2023 07:44:15 +0000 (00:44 -0700)]
v1.14.0-BETA2

12 months agoxmlproc: fix parsing empty elements
Eric Biggers [Fri, 31 Mar 2023 07:44:09 +0000 (00:44 -0700)]
xmlproc: fix parsing empty elements

12 months agov1.14.0-BETA1
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
v1.14.0-BETA1

12 months agowindows-build.sh: hint about installing prerequisites
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
windows-build.sh: hint about installing prerequisites

12 months agoAdd tools/repack-windows-release.sh
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
Add tools/repack-windows-release.sh

12 months agoInclude windows-build.sh in the release tarballs
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
Include windows-build.sh in the release tarballs

12 months agoRename make-windows-release to windows-build.sh
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
Rename make-windows-release to windows-build.sh

This has turned into a much more generic build script than it was
originally, so rename it appropriately.

12 months agoAdd a gitattributes file
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
Add a gitattributes file

This is needed to avoid all files showing as "modified" on Windows.

12 months agoci.yml: upload Windows binaries when done
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
ci.yml: upload Windows binaries when done

12 months agoci.yml: add ARM64 Windows build
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
ci.yml: add ARM64 Windows build

12 months agomake-windows-release: support cross-compiling for ARM64 in MSYS2
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
make-windows-release: support cross-compiling for ARM64 in MSYS2

Cross-compiling for ARM64 is not possible with MSYS2 CLANGARM64 out of
the box, but it is possible to do by downloading and using a prebuilt
toolchain from https://github.com/mstorsjo/llvm-mingw.  Make the
'make-windows-release' script support doing this.

Suggested at https://wimlib.net/forums/viewtopic.php?p=1488#p1488

12 months agomake-windows-release: split into functions for readability
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
make-windows-release: split into functions for readability

12 months agoxml_windows.c: update the language ID map
Eric Biggers [Thu, 30 Mar 2023 08:16:52 +0000 (01:16 -0700)]
xml_windows.c: update the language ID map

12 months agoxml: fix wimlib_set_image_property()
Eric Biggers [Thu, 30 Mar 2023 08:16:52 +0000 (01:16 -0700)]
xml: fix wimlib_set_image_property()

The recent XML changes introduced a bug where
wimlib_set_image_property() rejected values of property_name containing
'/', '[', or ']', which are part of the "path" syntax.

12 months agoRemove the outdated 'INSTALL' file
Eric Biggers [Thu, 30 Mar 2023 07:58:20 +0000 (00:58 -0700)]
Remove the outdated 'INSTALL' file

The INSTALL file was an old version of the generic GNU installation
instructions that was not customized to this package at all and was not
referenced by any other documentation.  It's unlikely to be useful.

12 months agowin32_*.c: avoid some format string warnings
Eric Biggers [Thu, 30 Mar 2023 07:34:14 +0000 (00:34 -0700)]
win32_*.c: avoid some format string warnings

These aren't real issues as all the types in question are 32-bit ints,
but fixing these will prevent warnings later if we're ever able to
enable __attribute__((format)) on Windows (hopefully due to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64862 being fixed).

12 months agocompiler.h: remove _cold_attribute
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove _cold_attribute

This abstraction layer serves no purpose other than supporting gcc 4.3
and earlier, which is too old to bother supporting.  Just use
__attribute__((cold)) directly.

12 months agocompiler.h: remove _unused_attribute
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove _unused_attribute

This abstraction layer serves no purpose.  Just use
__attribute__((unused)) directly.

12 months agocompiler.h: remove _may_alias_attribute
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove _may_alias_attribute

This abstraction layer serves no purpose.  Just use
__attribute__((may_alias)) directly.

12 months agocompiler.h: remove _packed_attribute
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove _packed_attribute

This abstraction layer serves no purpose.  Just use
__attribute__((packed)) directly.

12 months agocompiler.h: remove _aligned_attribute
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove _aligned_attribute

This abstraction layer serves no purpose.  Just use
__attribute__((aligned(n))) directly.

12 months agocompiler.h: remove typeof
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove typeof

wimlib is compiled with -std=gnu99, so this is unnecessary.

12 months agoendianness.h: use builtins directly
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
endianness.h: use builtins directly

The compiler_bswap* macros serve no real purpose.  In endianness.h, just
use the builtins directly.

12 months agobitops: use builtins directly
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
bitops: use builtins directly

The compiler_bs{r,f}{32,64} macros serve no real purpose.  In bitops.h,
just use the builtins directly.

12 months agocompiler.h: define UNALIGNED_ACCESS_IS_FAST on powerpc64
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: define UNALIGNED_ACCESS_IS_FAST on powerpc64

12 months agoerror.h: cleanup debris from removal of --disable-error-messages
Eric Biggers [Thu, 30 Mar 2023 07:00:55 +0000 (00:00 -0700)]
error.h: cleanup debris from removal of --disable-error-messages

12 months ago'extern' in function declarations is redundant
Eric Biggers [Thu, 30 Mar 2023 07:00:55 +0000 (00:00 -0700)]
'extern' in function declarations is redundant

12 months agoxml: miscellaneous cleanups
Eric Biggers [Thu, 30 Mar 2023 07:00:55 +0000 (00:00 -0700)]
xml: miscellaneous cleanups

12 months agoci.yml: install the ntfs-3g package
Eric Biggers [Tue, 28 Mar 2023 06:14:42 +0000 (23:14 -0700)]
ci.yml: install the ntfs-3g package

Install ntfs-3g so that test-imagex-ntfs can run.  While we're here,
also install pkgconf (new name) instead of pkg-config (old name).

12 months agoci.yml: use -fno-sanitize-recover when using -fsanitize
Eric Biggers [Tue, 28 Mar 2023 06:14:42 +0000 (23:14 -0700)]
ci.yml: use -fno-sanitize-recover when using -fsanitize

Unlike ASAN, by default UBSAN doesn't abort the program on error but
instead just prints an error message.  Use -fno-sanitize-recover to
explicitly request the abort-on-error behavior for testing purposes.

12 months agotest-imagex-ntfs: find mkntfs on Debian
Eric Biggers [Tue, 28 Mar 2023 06:14:42 +0000 (23:14 -0700)]
test-imagex-ntfs: find mkntfs on Debian

Add /sbin to the PATH so that mkntfs is found on Debian.

12 months agoencoding.c: avoid UBSAN warning in convert_string()
Eric Biggers [Tue, 28 Mar 2023 06:14:42 +0000 (23:14 -0700)]
encoding.c: avoid UBSAN warning in convert_string()

When 'in == NULL && in_nbytes == 0', the statement 'in_end = in +
in_nbytes' executes 'NULL + 0'.  clang's UndefinedBehaviorSanitizer
complains that this is undefined:

    src/encoding.c:223:31: runtime error: applying zero offset to null pointer

This is questionable, but let's avoid it...

12 months agosha1.c: fix arm64 build with clang 12 and earlier
Eric Biggers [Tue, 28 Mar 2023 06:14:41 +0000 (23:14 -0700)]
sha1.c: fix arm64 build with clang 12 and earlier

clang 12 and earlier only defined the SHA-1 intrinsics when
__ARM_FEATURE_CRYPTO is defined.

12 months agomake-windows-release: support MSYS2 clang environments
Eric Biggers [Mon, 27 Mar 2023 05:30:54 +0000 (22:30 -0700)]
make-windows-release: support MSYS2 clang environments

Update tools/make-windows-release to support the CLANG32 and CLANG64
MSYS2 environments, and update ci.yml to test them in GitHub Actions.

Also try to support CLANGARM64, though I have no way to test that yet.

Finally, make a couple more tweaks to make-windows-release:

- Run the configure script unless it's explicitly requested to be
  skipped, as the previous logic was too fragile.

- Default to no docs and no zip.

12 months agoFix clang warnings about inconsistent use of dllexport
Eric Biggers [Mon, 27 Mar 2023 05:30:54 +0000 (22:30 -0700)]
Fix clang warnings about inconsistent use of dllexport

In MSYS2, clang emits many warnings like the following:

    warning: redeclaration of 'wimlib_add_empty_image' should not add 'dllexport' attribute

The problem is that dllexport is used when defining the wimlib API
functions but not when declaring them.  Fix this by using dllexport in
both places.

12 months agoAdd tools/get-version-number to the distribution tarballs
Eric Biggers [Mon, 27 Mar 2023 05:30:54 +0000 (22:30 -0700)]
Add tools/get-version-number to the distribution tarballs

Without this, 'autoreconf' only works in the git repo, not in tarballs.

12 months agomake-windows-release: fix generation of the cmd files
Eric Biggers [Mon, 27 Mar 2023 00:46:45 +0000 (17:46 -0700)]
make-windows-release: fix generation of the cmd files

12 months agoImprove fuzz testing
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Improve fuzz testing

- Convert fuzzing scripts from afl-fuzz to libFuzzer
- Add xml and wim fuzzers, including malloc failure injection
- Fuzz for 2 minutes as part of the GitHub Actions CI

12 months agoPrevent huge memory allocations from fuzzed header fields
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Prevent huge memory allocations from fuzzed header fields

12 months agosecurity.c: avoid NULL + 0 UBSAN error
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
security.c: avoid NULL + 0 UBSAN error

UBSAN complains about adding 0 to NULL.  Avoid this.

12 months agoREADME.WINDOWS: simplify the build procedure
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
README.WINDOWS: simplify the build procedure

Rework the build directions to use MSYS2 instead of Cygwin and to take
advantage of the improved make-windows-release script.

12 months agoREADME: remove an unnecessary notice
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
README: remove an unnecessary notice

The "copyright years may be listed using range notation" notice is
recommended by the GNU project, but most other people don't consider it
to be necessary or meaningful.

12 months agoci.yml: use make-windows-release script on Windows
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
ci.yml: use make-windows-release script on Windows

12 months agoImprove the make-windows-release script
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Improve the make-windows-release script

- Automatically bootstrap the repository if needed
- Add --no-zip and --no-docs options
- Add --install-msys2-packages to install the needed MSYS2 packages
- Autodetect the architecture when using MSYS2
- Use 'strip' instead of ${ARCH}-w64-mingw32-strip, for compatibility
  with MSYS2
- Make it pass 'shellcheck'
- Other cleanups

12 months agoEliminate the dependency on libxml2
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Eliminate the dependency on libxml2

libxml2 is the only remaining third-party library that Windows builds of
wimlib need.  It's a bit of a pain to have to download it, build it, and
trick libtool into linking it into the resulting DLL.  It then
constitutes a significant part of the size of the resulting DLL, even
with the minimal libxml2 configuration options being used.

In reality, WIM files only use a small subset of XML containing the most
commonly used XML features.  Using a full-featured XML library (that
supports "features" like External Entities that we have to remember to
disable) is a bit dangerous and not actually necessary.  7-Zip's WIM
support, for example, just uses a very minimal home-brew XML processor.

Another issue is that the libxml2 API always uses UTF-8, which causes
the conversion UTF-16LE => UTF-8 => UTF-16LE to be needed on Windows.
This isn't really an "issue", per se, but it shouldn't be necessary.

Finally, wimlib was integrating with libxml2 at a low level via the tree
API, and it overlooked some things.  For example, libxml2 trees have
separate CDATA and TEXT nodes, but wimlib was only looking at TEXT, so
CDATA was ignored.  It was also possible for wimlib to create a document
containing control characters, which is not valid XML so it could not be
read.  These weren't very important issues, but the point is, just using
an XML library doesn't solve quite as many problems as one would hope...

Therefore, just add a simple XML 1.0 processor directly in the source
code.  It handles all XML features that are used in WIM files, plus a
bit more for futureproofing.  It's also faster than libxml2.

12 months agotest_support.c: add some missing endianness conversions
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
test_support.c: add some missing endianness conversions

12 months agoAdd configure~ to gitignore
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Add configure~ to gitignore

12 months agoRemove some outdated scripts
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Remove some outdated scripts

12 months agoSimplify check for __NR_getrandom
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Simplify check for __NR_getrandom

There is no need for the configure script to check whether
__NR_getrandom is defined, as the source code can just use #ifdef.

13 months agosha1.c: fix arm64 build with clang 16
Eric Biggers [Thu, 23 Mar 2023 08:07:16 +0000 (01:07 -0700)]
sha1.c: fix arm64 build with clang 16

Reported at https://wimlib.net/forums/viewtopic.php?p=1480#p1480