Commit Graph

30 Commits

Author SHA1 Message Date
Brad King
2461dd79e5 liblzma: Suppress MSVC warning parameter difference warning
Some `.c` sources add `restrict` to their pointer types to tell
the optimizer that there is no aliasing.  These do not appear in
the corresponding `.h` declarations so MSVC warns.
2018-08-06 10:29:33 -04:00
Brad King
9f77124ea8 liblzma: Drop checks for inline and restrict keywords
We now require the compiler to support these, except for MSVC where
upstream liblzma already has special cases (in `common/sysdefs.h`).
2018-08-06 10:25:46 -04:00
Brad King
7a976ee742 Merge branch 'upstream-liblzma' into update-liblzma
* upstream-liblzma:
  liblzma 2018-04-29 (b5be61cc)
2018-08-06 10:24:55 -04:00
Brad King
83215720fb liblzma: Name sizeof size_t macro consistently with upstream 2018-08-06 10:23:01 -04:00
Brad King
6166adfdd4 liblzma: Revert "Port from C99 to C89/90"
Revert commit v3.1.0-rc1~255^2~5 (liblzma: Port from C99 to C89/90,
2014-07-13).  We now compile as C99 or above except on MSVC where
we will use another approach.
2018-08-06 10:22:56 -04:00
Brad King
0a3912112d liblzma: Revert "Avoid defining a 'restrict' macro"
Revert commit v3.1.0-rc1~255^2~2 (liblzma: Avoid defining a 'restrict'
macro, 2014-07-24).  We will use another approach to deal with the
'restrict' keyword.
2018-08-06 09:47:42 -04:00
Brad King
fb6142ab2f liblzma: Fix HAVE_INLINE and HAVE___INLINE checks
The checks fail even on compilers that support the keywords because
the linkage is broken:

    src.c:...: undefined reference to 'test'

At the actual use sites we use `static inline` instead of just `inline`,
so perform the check this way too to fix the linkage.
2017-05-17 15:00:16 -04:00
Brad King
60212979ea Merge branch 'upstream-liblzma' into update-liblzma
* upstream-liblzma:
  liblzma 2014-12-21 (265e5ffb)
2016-06-29 10:14:03 -04:00
Brad King
ca4276e435 liblzma: Remove CMake-specific README
We will now manage the liblzma source tree updates using
the `Utilities/Scripts/update-liblzma.bash` script.  Drop
the README that covered the old method.
2016-06-29 10:06:16 -04:00
Daniel Pfeifer
f05f5b01d0 cmliblzma: always build as static library 2016-06-28 23:05:37 +02:00
Brad King
8479dc46f1 liblzma: Avoid possible overflow on signed left shift
Use an unsigned value to produce the needed mask.
2016-05-25 10:02:02 -04:00
Brad King
e5d336beb2 liblzma: Disable GNU 3.3 compiler optimizations
The GNU 3.3 optimizer causes bad behavior in liblzma, so disable it.
2015-04-08 13:52:02 -04:00
Brad King
a2df4a3f76 liblzma: Disable XL compiler optimizations altogether
Revert commit 82c51a8a (liblzma: Disable XL compiler optimizations in
one source to avoid crash, 2015-04-02) and instead add a compiler flag
to disable optimizations in every source of liblzma.  Somehow the XL
compiler optimizations create incorrect behavior in liblzma and lead
to crashes or truncated output during compression.
2015-04-08 13:08:53 -04:00
Brad King
82c51a8ac6 liblzma: Disable XL compiler optimizations in one source to avoid crash
Somehow optimizations of lzma_lzma_optimum_normal by the IBM XL C
compiler cause it to crash.  Simply disable optimizations of this source
file with a pragma.
2015-04-02 13:17:57 -04:00
Brad King
af61d6cb60 liblzma: Use unaligned access only on Intel and PowerPC archs 2015-04-01 11:05:30 -04:00
Chuck Atkins
996f822930 liblzma: fix build on platforms with no SIZE_MAX defined.
Some systems don't define a SIZE_MAX (older versions of HP-UX with aCC).
The logic was already in place to account for this condition but
SIZEOF_SIZE_T was not getting cmoputed at configure time to allow it to
function.  This computes sizeof(size_t) at configure time to allow the
appropriate logic to work.  It also changes SIZEOF_SIZE_T to SIZE_OF_SIZE_T
for consistency.
2014-11-03 14:37:12 -05:00
Brad King
95d84f76d9 Merge topic 'cmake-cmp0054-warnings'
29c3edb8 Avoid if() quoted auto-dereference
2014-10-21 15:08:07 -04:00
Ben Boeckel
29c3edb87a Avoid if() quoted auto-dereference
When testing CMAKE_<LANG>_COMPILER_ID values, do not explicitly
dereference or quote the variable. We want if() to auto-dereference the
variable and not its value. Also replace MATCHES with STREQUAL where
equivalent.
2014-10-20 11:49:16 -04:00
Stephen Kelly
2db55ffa56 Remove borland workarounds.
CMake 3.0 is the last release to require to be able to build with
Borland.
2014-10-15 23:16:44 +02:00
Chuck Atkins
c16d8c7f77 liblzma: Added a missing config check for _Bool
This fixes a current build problem for liblzma on Solaris 10, SPARC,
and the Solaris Studio compiler.
2014-09-02 10:34:47 -04:00
Chuck Atkins
2dd17a546f liblzma: Fix compilation with PGI compiler
- sha265.c is using some C99 specific features, in particular static
array dimensions in a function parameter array (see section 6.7.5-7
of the C99 spec).  A #ifndef check was in place to prevent compilation
under MSVC but it actually needed to check for C99 compliance instead.
Even still, the C99 code fails on a few compilers (PGI being one) so for
compatibility reasons, the C99 version of the function declaration is
removed entirely, leaving only the C89 version.

- CHECK_SYMBOL_EXISTS is used to determine the presense of bswap
functions from byteswap.h.  Most compilers re-dedefine the bswap_N
functions as a __bswap_N function implemented by the compiler.  Since
bswap_N is usually defined as a macro then it's mere presence passes
the check.  Some versions of the PGI compiler though have shipped
broken headers for byteswap.h, in particular 11.3 for x64 linux
provides byteswap.h but is missing an associated bits/byteswap.h which
causes some of the bswap_N macros to be defined but broken and unusable.
The bswap_N checks have been converted to CHECK_SOURCE_COMPILES to
ensure that the bswap_N calls are actually usable and not just merely
defined.
2014-08-04 10:12:51 -04:00
Brad King
73eab246fb liblzma: Avoid defining a 'restrict' macro
Any "#define restrict ..." line may conflict with MSVC header files
that use "__declspec(restrict)".  Define our own LZMA_RESTRICT macro
in "Utilities/cmliblzma/config.h.in" and transform liblzma code to
use it:

 git grep -lE '\<restrict\>' Utilities/cmliblzma/liblzma |
   xargs sed -i 's/\<restrict\>/LZMA_RESTRICT/g'
2014-07-29 08:45:36 -04:00
Brad King
90e7a4d41f liblzma: Disable warnings to avoid changing 3rd party code 2014-07-29 08:45:36 -04:00
Daniel Pfeifer
c20b45027e liblzma: Port to VS 6, 7.0
Also remove use of MSVC intrinsic.
2014-07-29 08:45:36 -04:00
Daniel Pfeifer
7a92eddbcb liblzma: Port from C99 to C89/90
Remove use of designated initializers and declarations of variables
after statements.  Leave "//" comments as-is for now.
2014-07-29 08:44:36 -04:00
Daniel Pfeifer
b2a07ca49c liblzma: Add CMake build system
Modify sources just enough to build without the full xz common
directory.
2014-07-23 10:34:55 -04:00
Brad King
d44ad1612b liblzma: Remove unused Makefile.* files
We will provide our own CMake-based build system.
2014-07-23 10:34:55 -04:00
Brad King
a53caea3b6 liblzma: Add README-CMake.txt
Describe how to update liblzma from upstream.
2014-07-23 10:34:55 -04:00
Brad King
133d42fe59 Merge branch 'liblzma-upstream' into add-liblzma 2014-07-21 15:54:44 -04:00
Brad King
8510533f0e liblzma: Add .gitattributes to ignore whitespace checks
Tell Git not to check whitespace in third-party code.
2014-07-21 14:08:46 -04:00