Commit Graph

249 Commits

Author SHA1 Message Date
Brad King
80ec307900 curl: Set build options the way we need for CMake
Set options added by the update to curl 8.12.1.

In particular, now that upstream curl's CMake code depends on
OpenSSL via imported targets from FindOpenSSL, we can let it
handle the transitive dependency on posix threads.
2025-02-14 08:57:11 -05:00
Brad King
2bfb9f7e8a libarchive: Restore explicit linking to openssl crypto library
This is present in the upstream libarchive CMake code.  We removed it
in commit 59d28b2849 (libarchive: Drop early use of crypto library,
2016-05-03, v3.6.0-rc1~100^2), but didn't record details for why.
Many other changes have been made since then, so the original problem
may no longer occur.  Restore the link dependency since it reflects
a real dependency of the implementation.
2025-02-09 13:23:56 -05:00
Brad King
ddb72eb3e6 Merge branch 'upstream-LibArchive' into update-libarchive
# By LibArchive Upstream
* upstream-LibArchive:
  LibArchive 2024-10-13 (b439d586)
2024-11-18 14:17:22 -05:00
Brad King
387a9a746a libarchive: tar: fix memory leaks when reading symlinks or parsing pax headers
Backport [libarchive PR 2338] to fix [libarchive issue 2336].

[libarchive PR 2338]: https://github.com/libarchive/libarchive/pull/2338
[libarchive issue 2336]: https://github.com/libarchive/libarchive/issues/2336
2024-09-19 10:01:04 -04:00
Brad King
fe3f0d469f Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2024-09-13 (12ecf841)
2024-09-17 13:03:03 -04:00
makise-homura
1dbb31cea2 libarchive: avoid lchmod not implemented warning on old LCC 2024-01-16 22:12:06 +03:00
Brad King
b281fd471a libarchive: Add cm3p prefixes on includes new to version 3.7.2 2023-10-16 18:55:54 -04:00
Brad King
c4fec0edd6 Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2023-09-12 (6468cd1f)
2023-10-16 18:53:19 -04:00
Clemens Wasser
6aaefdb3be libarchive: Precompile common expensive headers 2023-06-22 18:11:45 +02:00
Brad King
48297cf770 libarchive: Suppress clang-analyzer warnings 2023-05-22 16:51:15 -04:00
Brad King
ba5ced1be6 libarchive: Set build options the way we need for CMake 2023-04-25 10:35:27 -04:00
Brad King
1e2bce305f Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive:
  LibArchive 2022-12-09 (ba80276c)
2023-04-25 10:28:08 -04:00
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