Commit Graph

487 Commits

Author SHA1 Message Date
Benjamin Gilbert
bc8003bc64 build: use uname -m to detect processor
Ubuntu patches uname -p to return the processor type:

    https://git.launchpad.net/ubuntu/+source/coreutils/tree/debian/patches/80_fedora_sysinfo.patch?h=ubuntu/oracular

and Fedora also did before Fedora 38:

    cd953e11dd

but in general, uname -p returns "unknown".  Use uname -m instead.

Fixes build error:

    /usr/bin/ld: /tmp/ccgv9E4e.o: in function `_start':
    freestanding.c:(.text+0x6255a): multiple definition of `_start'; /usr/lib/gcc/x86_64-redhat-linux/14/../../../../lib64/crt1.o:(.text+0x0): first defined here
    collect2: error: ld returned 1 exit status
2024-10-06 03:44:41 -07:00
Yann Collet
452f35c3c0 minor: fix test name
obvious insertion mishap
2024-09-07 15:50:10 -07:00
Yann Collet
7c2a2606fc
Merge pull request #1468 from hhoffstaette/start-alignment
Fix stack alignment of _start() in freestanding test
2024-07-24 01:18:13 -07:00
Kai Pastor
ca197e67a0 Add an lz4::lz4 target to the exported package 2024-07-23 20:32:43 +02:00
Holger Hoffstätte
63267a77d8 Fix stack alignment of _start() in freestanding test
When the freestanding test is built with any kind of optimization
that enables vectorized loops, special care must be taken to align
the stack for _start() at a 16-byte boundary.
2024-07-22 22:16:16 +02:00
Yann Collet
8ce9e94cd5 improved lorem ipsum generator speed by a factor > x8 2024-07-20 14:29:58 -07:00
Yann Collet
2a1de07855 improved speed of lorem ipsum generator
by > +80%.

This should help complete tests faster
2024-07-20 12:35:41 -07:00
Yann Collet
f458b2b1a5 LZ4_loadDictHC is compatible with LZ4MID level 2
But the state must have its compression level set _before_ loading the dictionary.
2024-07-17 23:01:08 -07:00
Yann Collet
7480aeed02 added a dictionary loader dedicated to level 2 (LZ4MID) 2024-07-17 12:44:52 -07:00
Yann Collet
a2a21bc773 removed failing tests
the complexity of test-lz4-list.py is overkill,
it's unclear why some tests are failing after sending output to stdout instead of stderr,
seems like a fairly obscure parsing logic,
there's no point maintaining that complexity.
2024-07-15 12:01:01 -07:00
Yann Collet
2db419ee23 removed implicit stdout
fixes #1193.

Implicit `stdout` has been a behavior of the `lz4` cli since its early days,
but it ends up being confusing for users, which do not expect this behavior.

The feature is already deprecated, it has been issuing a warning message for several years.
It's time to cut it out.
2024-07-12 22:24:42 -07:00
Yann Collet
aafb56ee2e update gpl license to 2.0-or-later
The text at the top of each source file was already specifying 2.0-or-later,
but this wasn't clearly reflected in the full-text license in COPYING,
which was the old 2.0 license, which can be interpreted as 2.0-only.

Note that the license of `liblz4`, the library in `lib/` directory,
is unchanged, and remains the more permissive `BSD 2-clause`.
2024-07-10 07:26:20 +02:00
Theodore Tsirpanis
2a7cb5207e Update CMake tests to verify that the unified target always exists. 2024-06-12 22:03:31 +03:00
Yann Collet
fab3068680 add test for bug #1374 2024-03-21 23:33:30 -07:00
Yann Collet
ed37236307 minor: fix missing include 2024-02-20 15:43:32 -08:00
Yann Collet
ad204dc099 fix "source has 2 buffers" for level 2
by not searching into the 2nd buffer
which is an inefficiency (less compression opportunities)
but makes the code sensibly simpler to read
and is a use-case avoided by lz4frame.
2024-02-07 15:24:44 -08:00
Yann Collet
95cb4da71e minor: lower literal range
to ensure all characters are printable
2024-01-29 12:55:44 -08:00
Yann Collet
f8a0a37c1f improve LZ4F dictionary compression in fast mode
and fix the seed 571 test that was failing due to poor efficiency
2024-01-29 12:17:05 -08:00
Yann Collet
ef7baa60d4 fixed visual studio solution
and refactor a few minor code comments
2024-01-28 15:33:12 -08:00
Yann Collet
93a905cad4 removed COMPRESSIBILITY_DEFAULT
replaced by `COMPRESSIBILITY_NOT_SET`,
so that it's still possible to request `-P50`.
2024-01-28 15:08:42 -08:00
Yann Collet
65362838cb datagen uses lorem ipsum generator by default
switches back to statistical generator when specific statistics requested.
2024-01-28 14:05:21 -08:00
Yann Collet
64855b689d
Merge pull request #1353 from likema/fix-test-lz4-list
Fix Python 3.6 string interpolation
2024-01-28 13:23:22 -08:00
Yann Collet
823d37f730 bench.c does not longer need datagen
datagen transferred to tests/
2024-01-28 00:56:56 -08:00
Like Ma
87ad5e8ac2 Fix Python 3.6 string interpolation 2024-01-23 02:53:29 +08:00
Yann Collet
128666662e fix potential leak after failure in legacy format
also:
display time/cpu statistics after legacy compression
2023-12-29 18:07:57 -08:00
Yann Collet
6a3932d1c9 make file open errors recoverable in legacy mode 2023-12-29 16:53:58 -08:00
Yann Collet
8e114d9b9c fix MT compatibility with dictionaries 2023-12-29 16:28:37 -08:00
Yann Collet
3227a55269 added a simple test for MT CLI commands
and documented the new command.
2023-12-28 22:32:13 -08:00
Yann Collet
5fb1bd2395 fix VS2010 solution
and some minor printf limitations on Windows.
2023-12-28 21:45:03 -08:00
Yann Collet
c6762ec1c0 fixed meson build
and make it build the MT version of lz4
with an option that is enabled by default but can be disabled on demand.

Also :
- added make target mesonbuild, for easy local build
- made huge tests friendlier to MT variant, for faster testing time
2023-12-28 20:22:23 -08:00
Yann Collet
39845fabdc fix minor unused assignment 2023-12-28 16:45:46 -08:00
Yann Collet
da5e8b7b0f lz4frame: new API: LZ4F_compressBegin_usingDict()
Note: effectively limited to using the dictionary once for now,
as opposed to once per block when blocks are independent
(no impact when blocks are linked: dictionary is supposed to be used once anyway)

Also :
- clarifies that default lz4frame block size is 64 KB
- refactor LZ4 Frame spec, dictionary paragraph
- updated manual
2023-12-28 13:47:08 -08:00
Yann Collet
95c2bc7f1f fix legacy format compression 2023-12-27 23:32:38 -08:00
Yann Collet
88e477db6b fix 1308
PR #1308 introduces a new symbol, `LZ4_compress_fast_extState_destSize()`,
which, upon inspection, doesn't seem to work as advertised.
In particular, it fails if `dstCapacity` is not large enough,
as opposed to adjusting input size to fit within `dstCapacity`.

Even if it had worked, it would have resulted in problems
for the existing `LZ4_compress_fast_extState()`,
that would have stopped failing when `dstCapacity` is not large enough,
resulting in silent input truncation.

Changed the approach.
It appears the wanted functionality already exists within `lz4` source code,
and is called `LZ4_compress_destSize_extState()`.
It wasn't exposed dues to a (non-verified) problem regarding lz4 state on exit:
it's claimed that since the `_destSize` doesn't completely consume the input,
the state may end up in an "unfinished" status,
making it dangerous to re-employ in later invocations.

Fixed that by enforcing a state initialization at the end of operation.

Also : added some tests,
ensure that `LZ4_compress_fast_extState()` fails as expected when `dstCapacity` is not large enough,
and ensure that `LZ4_compress_destSize_extState()` does succeed in the same circumstance,
by consume less input.

Finally, expose `LZ4_compress_destSize_extState()` as an advanced experimental symbol.
2023-12-27 20:56:27 -08:00
Yann Collet
efd7029a18 create local_LZ4_decompress_safe() to circumvent dllimport warning
Visual Studio only
2023-12-26 00:41:41 -08:00
Yann Collet
467db788e1 make arrays static 2023-12-26 00:27:56 -08:00
Yann Collet
f239a17a6b fix read when requesting out-of-range codec 2023-12-26 00:11:47 -08:00
Yann Collet
ded75e76ea fixed minor conversion warning 2023-12-26 00:02:03 -08:00
Yann Collet
a03e877bfd fullbench: -i0 runs a very fast (but still measured) run
as opposed to just listing, as it did before,
which is now convered by -l and -h.
2023-12-25 23:57:40 -08:00
Yann Collet
f5d14ab9e5 can list algorithms to benchmark
with -l (list only) or as part of -h and -H
2023-12-25 21:00:39 -08:00
Yann Collet
d7674fad29 Merge branch 'makefile' into fasterfbench 2023-12-25 20:53:18 -08:00
Yann Collet
df3b602a94 array for benched compressors 2023-12-25 11:37:03 -08:00
Yann Collet
fde31574e5 fullbench: record benched decompressors into a C90 array
will make listing possible.
2023-12-25 07:56:30 -08:00
Yann Collet
a0abf19ecb fixed -j for versionsTest
Apparently, the `-j` flag for `make` manages to get passed to even a `make` started by python.
2023-12-24 21:09:03 -08:00
Yann Collet
5c9e349c4a changed test name cpp->cxx
cpp evokes the C PreProcessor, rather than C++
2023-12-24 17:09:52 -08:00
Yann Collet
dd7e99917b rename variable LIBDIR for consistency 2023-12-24 16:00:21 -08:00
Yann Collet
7b7cecd14a fix attempt for ppc64 test on circleci 2023-12-23 01:05:53 -08:00
Yann Collet
cecb7f0491 versionsTest: pass variables via MOREFLAGS
for older versions of `lz4` that may require it
2023-12-22 23:33:42 -08:00
Yann Collet
669e2559d3 add traces to versionsTest 2023-12-22 23:02:11 -08:00
Yann Collet
736bcf76d6 minor CI adjustments 2023-12-22 20:32:30 -08:00