Commit Graph

237 Commits

Author SHA1 Message Date
Alex Turbov
2be5a7de4e Build: Use imported target ZLIB::ZLIB instead of variables 2022-09-22 10:20:30 -04:00
Brad King
c7c3e39e4f Utilities: Activate POSIX APIs even without compiler extensions
Compile some third-party libraries with preprocessor definitions that
activate POSIX APIs even when compiler extensions are not enabled.
We already do this in libuv, inherited from the upstream buildsystem.

This extends commit f034b0f663 (CMake compilation: do not use compiler
extensions, 2020-03-14, v3.18.0-rc1~494^2).

Issue: #20454
2022-06-04 09:08:27 -04:00
Brad King
3ba324b6b6 libarchive: Remove a system preprocessor macro that conflicts with a local var
On SunOS i386, the system headers sometimes define macro names
corresponding to register names, short and with no prefix.
Undefine one that conflicts with our code.
2022-06-04 08:15:20 -04:00
Brad King
0bd5685867 Merge topic 'update-libarchive'
be9ebc104a libarchive: Simplify code selecting CMake-specific build options
4a7a5718c6 libarchive: Update build within CMake after changes in 3.6.0
85cdeefc37 libarchive: include archive_platform.h first in blake2s sources
b3644e460f Merge branch 'upstream-LibArchive' into update-libarchive
5d50940288 LibArchive 2022-02-09 (9147def1)
406503f620 libarchive: Update script to get 3.6.0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6988
2022-02-18 09:04:00 -05:00
Brad King
483a1c248c libarchive: Fix OpenSSL crypto library checks for build inside CMake
libarchive's crypto library checks use its `config.h` inside the
`try_compile` project.  Since commit ade3b16e63 (libarchive: Use KWIML
to get fixed-size integer types, 2020-06-01, v3.18.0-rc1~33^2),
that header depends on KWIML inside CMake.  Add the include directory
for KWIML to the crypto library checks.  Otherwise, they always fail
due to not finding the KWIML headers, and libarchive decides not
to link the crypto library.

libarchive has other code besides the hash algorithms that depends on
the crypto library if its ENABLE_OPENSSL option is enabled (which in
CMake is controlled by CMAKE_USE_OPENSSL).  It seems to be missing some
conditions to link the crypto library in those cases, and instead relies
on at least one of the above-mentioned checks to pass.  If they all
fail, and we are using system curl, we might not link the crypto
library.

Fixes: #23234
2022-02-17 08:06:01 -05:00
Brad King
be9ebc104a libarchive: Simplify code selecting CMake-specific build options
Reduce differences from upstream libarchive `CMakeLists.txt` code.
Remove modifications inside code we disable anyway.
2022-02-17 07:28:09 -05:00
Brad King
4a7a5718c6 libarchive: Update build within CMake after changes in 3.6.0 2022-02-16 07:41:50 -05:00
Brad King
85cdeefc37 libarchive: include archive_platform.h first in blake2s sources
Move the inclusion added in 3.6.0 to be first.  This is the libarchive
convention in all other `.c` sources.  It ensures that the configured
`_WIN32_WINNT` value is defined before including any system headers.
2022-02-16 07:41:49 -05:00
Brad King
b3644e460f Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2022-02-09 (9147def1)
2022-02-15 13:03:49 -05:00
Aaron Liu
24da80b70a Utilities: Suppress warnings in third-party code with IBMClang 2022-01-27 09:38:01 -05:00
makise-homura
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
Divert LCC compiler as a new one, instead of treating it as GNU.

Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been
passing checks for GNU compilers, so it has been identified as GNU.
Now, with intent of seriously upstreaming its support, it has been
added as a separate LCC compiler, and its version displays not a
supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead
of GNU 7.3.0).

This commit adds its support for detection, and also converts basically
every check like 'is this compiler GNU?' to 'is this compiler GNU or
LCC?'. The only places where this check is untouched, is where it
regards other platforms where LCC is unavailable (primarily non-Linux),
and where it REALLY differs from GNU compiler.

Note: this transition may break software that are already ported to
Elbrus, but hardly relies that LCC will be detected as GNU; still such
software is not known.
2021-10-15 05:05:19 +03:00
Brad King
6287b02147 libarchive: Limit xz compression level to 6 on AIX
Since libarchive commit `aff9809c` (Enable compression level up to 9 for
xz, xar, 7zip, 2020-07-26, v3.5.0~19^2), libarchive fails to initialize
xz compression on AIX with error

    Internal error initializing compression library: Cannot allocate memory

Revert to the old limit of level 6 on AIX.

Issue: #22553
2021-08-24 13:02:57 -04:00
Brad King
107df8e650 Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2020-12-26 (227a4b97)
2021-08-24 10:13:10 -04:00
Brad King
e2c06736e5 libarchive: Add missing cm3p prefixes on includes
Issue: #20666
2021-08-20 11:22:41 -04:00
Brad King
408e6d6185 Utilities: Suppress warnings in third-party code with NVHPC 2021-04-20 11:44:25 -04:00
Brad King
951c34b90e Merge topic 'libarchive-u_char'
a9fc751e65 libarchive: Use uint8_t instead of u_char

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5981
2021-04-06 08:28:22 -04:00
Brad King
a9fc751e65 libarchive: Use uint8_t instead of u_char
The latter is not a standard type.

Fixes: #22013
2021-04-05 10:07:46 -04:00
Brad King
87909f0600 Utilities: Suppress warnings in third-party code when using IntelLLVM 2021-01-28 09:07:00 -05:00
Rodolfo Lima
bcdb5b52a0 libarchive: Fix lzma_stream_encoder_mt detection
The test for lzma_stream_encoder_mt was always failing
because the lzma libraries weren't being used by linker.
2021-01-26 16:23:37 +01:00
Brad King
9f3923893c libarchive: Map fixed-size integer types from KWIML as typedefs
Refactoring in commit ade3b16e63 (libarchive: Use KWIML to get
fixed-size integer types, 2020-06-01) accidentally changed the method of
defining `int#_t` types from `typedef` to `#define`.  Change it back to
`typedef`.

Reported-by: Rolf Eike Beer <eike@sf-mail.de>
2020-06-03 11:54:37 -04:00
Brad King
ade3b16e63 libarchive: Use KWIML to get fixed-size integer types 2020-06-02 06:56:51 -04:00
Brad King
22c5b0c244 libarchive: Avoid configure-time checks for integer range constants 2020-06-01 15:59:10 -04:00
Brad King
a7e66cac16 libarchive: Drop unused code providing uintmax_t and intmax_t
The libarchive library code we use within CMake does not need these.
2020-06-01 15:38:06 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
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
Ben Boeckel
701a5c60e0 cmake: avoid marking local or unused variables as advanced 2020-01-20 15:49:29 -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
1699f5c231 Utilities: Suppress warnings in third-party code when using XLClang 2019-02-25 08:26:17 -05:00
Brad King
214fcefa52 Remove now-unused code once used for MIPSpro on IRIX
In commit beb991110d (Remove now-unused code once used on IRIX,
2019-01-11, v3.14.0-rc1~167^2) we removed remnants of IRIX support.
Also remove remnants of MIPSpro compiler support.
2019-02-21 11:12:51 -05: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
29528cc33e libarchive: Remove liblzma from introspection tests
This was added upstream but does not make sense in CMake because we
may replace the library with a logical target name that will not
work inside a `try_compile`.
2017-02-27 08:53:08 -05: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