Commit Graph

153 Commits

Author SHA1 Message Date
Brad King
b83d96f164 libarchive: Update to build within CMake
Hard-code more libarchive options as internal cache entries.  Doing so
makes some of our `IF(0)` conditions unnecessary, so remove those.
2020-02-13 12:59:29 -05:00
Brad King
5d8b3aec0c Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2020-02-11 (3288ebb0)

Also manually restore content from upstream libarchive's main
`CMakeLists.txt` file that was removed by previous commits and
exclude it with `IF(0)` blocks.  Do this as an evil merge so
that `git blame -C` can follow the content to upstream.
2020-02-13 12:57:52 -05:00
Brad King
b428224867 Merge topic 'libarchive-win-codepage'
16e31523ba libarchive: Add support for UTF-8 locale on Windows
f7c54d2049 libarchive: Fix WideCharToMultiByte output buffer size

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4332
2020-02-07 10:23:45 -05:00
Brad King
16e31523ba libarchive: Add support for UTF-8 locale on Windows
Backport libarchive upstream commit `c46e7993` (windows: Support UTF-8
locale, 2018-07-23, v3.4.0~105^2).

Fixes: #20320
2020-02-06 15:04:47 -05:00
Brad King
f7c54d2049 libarchive: Fix WideCharToMultiByte output buffer size
Fix `archive_string_append_from_wcs_in_codepage` to account for the
already-used portion of the buffer when computing the size of the
remaining buffer for ``WideCharToMultiByte` output.
2020-02-06 15:04:47 -05:00
Brad King
f70b49b498 libarchive: Fix detection of 'major' on Solaris 11.4
In `archive_pack_dev.c` there is code checking the `HAVE_MAJOR` macro,
but it is not computed.  Port the equivalent logic from
`archive_entry.c`.
2020-01-30 09:26:35 -05:00
Brad King
974f4abbf8 Merge topic 'libarchive-solaris-11.4'
6c81c6538b libarchive: avoid b64_encode name conflict with Solaris built-in function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3351
2019-05-22 09:44:28 -04:00
Brad King
6c81c6538b libarchive: avoid b64_encode name conflict with Solaris built-in function
Solaris 11.4 has a built-in function named `b64_encode`.  Add a
`la_` prefix to our internal function to avoid conflict.

Fixes: #19268
2019-05-21 09:32:21 -04:00
Brad King
1761a9a546 CMake: Enable use of zstd in libarchive
Build zstd as part of CMake or find one on the system.  Modify our
port of libarchive to use the zstd configured for use with CMake.

Issue: #18657
2019-03-13 10:47:21 -04:00
Brad King
6a4b1006f9 Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2018-09-03 (5fe69dd0)
2018-09-26 09:53:15 -04:00
Brad King
e7e88e955b libarchive: Backport fix for build with LibreSSL 2.7
Backport libarchive commit v3.3.3~16^2 (fix build with LibreSSL 2.7,
2018-04-01).  LibreSSL 2.7 adds OpenSSL 1.1 API leading to conflicts on
method names.

Fixes: #18404
2018-09-26 09:47:53 -04:00
Brad King
96329d5dff libarchive: Do not use nanosecond file time APIs on macOS < 10.13
The SDK for macOS 10.13 adds `futimens` and `utimensat` so our checks
for these symbols may pass.  However, the symbols are not available at
runtime on older macOS versions.  Instead on macOS we can check for
availability based on the deployment target version.

Issue: #17101
2017-09-20 11:28:40 -04:00
Brad King
c80d8cb293 libarchive: Fix inclusion of zlib, bzlib, and lzma for build within CMake
Update a new source file imported from libarchive upstream to include
the headers for compression libraries using the CMake wrappers.
2017-07-20 12:52:54 -04:00
Brad King
6df1bda1c5 Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2017-07-09 (98a69539)
2017-07-20 11:36:18 -04:00
Brad King
59032a3847 Merge topic 'libarchive-backport-rc4-crypto-rec'
18009aaf libarchive: backport rc4 crypto requirement update

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !598
2017-03-22 08:49:35 -04:00
Brad King
18009aaf5e libarchive: backport rc4 crypto requirement update
Backport upstream libarchive commit 70f497f456 (As per Cryptographic
Requirements, 2017-03-19).  Discard more bytes of the RC4 keystream
to reduce the possibility of non-random bytes.
2017-03-21 11:09:25 -04:00
Brad King
62d0e22325 Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2017-02-25 (d6b1bb9f)
2017-02-27 08:51:36 -05:00
Brad King
d49176e91e libarchive: Avoid using isblank
It is not available on VS 2012 and below.  Use our own impl instead.
2017-02-23 07:15:21 -05:00
Brad King
ce8f117fe2 libarchive: Avoid declaration after statement in C code 2017-02-23 07:15:21 -05:00
Brad King
e0f725f821 libarchive: Fix use of ssize_t in archive_entry.h
This type is not available on Windows compilers so for clients including
this header we need to use `la_ssize_t` instead as we do in `archive.h`.
2017-02-23 07:15:21 -05:00
Brad King
ae4861ec22 libarchive: Define __LA_DEPRECATED consistently
Upstream libarchive now defines this macro in two places with the same
logic in both.  However, CMake's bundled copy disables this macro, so
we need to update the new location of its definition to be consistent.
2017-02-23 07:15:20 -05:00
Brad King
a59a7ee956 Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2017-02-19 (100ee75a)
2017-02-20 08:04:00 -05:00
Brad King
6f23daea43 libarchive: Add support for building with OpenSSL 1.1
OpenSSL 1.1 made some CTX structures opaque.  Port our code to use the
structures only through pointers via OpenSSL 1.1 APIs.  Use our adaption
layer to make this work with OpenSSL 1.0 and below.

Patch-by: Tomas Mraz <tmraz@redhat.com>
Patch-from: https://bugzilla.redhat.com/1383744
2016-11-28 14:55:42 -05:00
Brad King
7d433206cf libarchive: Add headers to adapt between OpenSSL 1.1 and older versions
Add private forwarding headers for `openssl/{evp,hmac}.h` to give us a
central place to add adaptation code to work across multiple
incompatible OpenSSL versions.  Provide compatibility implementations of
some OpenSSL 1.1 APIs when using older OpenSSL versions.
2016-11-28 14:55:42 -05:00
Brad King
481c9003fa libarchive: Fix include order in xxhash.c
We need to include `archive_platform.h` before any system headers in
order to ensure that `_WIN32_WINNT` is defined early enough.
2016-08-17 10:48:28 -04:00
Brad King
52f58267c3 Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2016-06-19 (139d0576)
2016-06-20 10:50:13 -04:00
Brad King
e9bc469b2a Merge branch 'upstream-LibArchive' into update-libarchive
Resolve conflicts in C code by taking their side.  Resolve conflicts in
CMake code by integrating the changes.
2016-05-02 10:48:48 -04:00
Felix Geyer
49e82c15d5 Fix spelling typos in comments and documentation (#16037)
The Debian package checker tool (lintian) detected several typos in
CMake.
2016-03-29 14:31:02 -04:00
Brad King
1e47381730 libarchive: Do not use pthread.h API without header 2015-10-28 08:44:47 -04:00
Brad King
43d577dcb9 libarchive: Test for Clang builtin before using it
The __builtin_bswap16 builtin is not available on Clang 2.1.
2015-10-28 08:44:47 -04:00
Brad King
85e0bb84f5 libarchive: Avoid using 'uint8_t' as bitfield type
The IBM XL compiler does not like it.  Use plain 'unsigned' instead.
2015-10-22 10:18:27 -04:00
Brad King
c70491d671 libarchive: Avoid using name 'hz'
AIX system headers define the symbol 'hz' as a preprocessor macro.
2015-10-22 10:18:27 -04:00
Brad King
1bbba477c7 libarchive: Drop outdated CMake portability snprintf
The archive_read_support_format_zip.c source no longer calls snprintf
directly so we do not need a portability macro for it.
2015-10-22 10:18:26 -04:00
Brad King
64bdf0b746 libarchive: Avoid non-portable u_int8_t
Use uint8_t that we prepare in config.h instead.
2015-10-22 10:18:26 -04:00
Brad King
8f837fc9a9 libarchive: Use CommonCrypto APIs on OS X only when available
Use each CommonCrypto API only when using an OS X SDK version new enough
to provide it.
2015-10-22 10:18:26 -04:00
Brad King
61a0251e82 libarchive: Define O_CLOEXEC when missing
Do this in archive_random.c as we do in several other sources already.
2015-10-22 10:18:26 -04:00
Brad King
832fe4b133 libarchive: Fix VS 7.1 Debug build
This version of the MS C runtime library forgets to export
_byteswap_ushort.
2015-10-21 11:34:28 -04:00
Brad King
0b82f51a30 libarchive: Guard bcyrpt.h with HAVE_BCRYPT_H 2015-10-21 11:18:50 -04:00
Brad King
5333c04cd0 libarchive: Drop CMake-specific Borland compiler workaround
We no longer build CMake with the Borland compiler.
2015-10-21 10:31:57 -04:00
Brad King
e861e12f6e libarchive: Define version macro before first use 2015-10-21 10:30:29 -04:00
Brad King
932848f420 Merge branch 'libarchive-upstream' into update-libarchive
Resolve conflicts by integrating changes from both sides.
2015-10-21 10:18:52 -04:00
Brad King
8b4c40155a Merge topic 'fix-libarchive-mktemp'
1f33b45d libarchive: Fix string concatentation in Windows mktemp implementation
2015-04-10 08:31:01 -04:00
Nils Gladitz
ad194ae0b1 libarchive: Use base-256 encoding for UID/GID like GNU tar does 2015-04-09 14:27:16 -04:00
Tim Kientzle
1f33b45d5d libarchive: Fix string concatentation in Windows mktemp implementation
Port upstream LibArchive commit "compute string pointers after
concatenation" (2014-09-25) and commit "Move variables to top of
function for non-C99 compilers" (2014-11-15) to our CMake copy.
Otherwise we may compute a pointer to memory that is about to be freed
and then compute a bad size to give to CryptGenRandom.

Inspired-by: Tim Kientzle <kientzle@gmail.com>
2015-04-09 14:08:43 -04:00
Brad King
6b9a0e1797 libarchive: Constify internal __archive_get_date implementation
The caller of this API already re-declares it as const, so update the
implementation accordingly.
2015-01-15 11:48:10 -05:00
Geoff Viola
bef23e8181 Fix some spelling errors in comments 2014-10-13 10:00:53 -04:00
Daniel Pfeifer
8436d18115 CMake: Enable use of liblzma in libarchive (#14504)
Build liblzma as part of CMake or find one on the system.  Modify our
port of libarchive to use the liblzma configured for use with CMake.
2014-07-29 08:45:36 -04:00
Brad King
f56e74ef56 Merge topic 'hpux-libarchive-compile'
c1ddd77d libarchive: Fix compilation on Tru64 with F_SETTIMES
2014-06-09 10:36:13 -04:00
Brad King
c1ddd77d0c libarchive: Fix compilation on Tru64 with F_SETTIMES
The parent commit left a typo in the conditional code path for Tru64.
Add the missing '.'.
2014-06-09 10:36:41 -04:00
Brad King
8c29d8d1e7 Merge topic 'hpux-libarchive-compile'
478b1c8b libarchive: fix compilation on newer HP-UX versions
2014-06-09 10:28:40 -04:00