Commit Graph

2868 Commits

Author SHA1 Message Date
Eddy Jansson
0a0922067f Don't reuse state memory that's too small.
Ensure that the memory block we're trying
to reuse is large enough for the new state.

Fixes #974
2021-07-31 19:05:29 +02:00
Eddy Jansson
80e3e7034e Define LZ4_STREAMSIZE in terms of LZ4_MEMORY_USAGE
This is required to correctly size a static member
to hold the hash table, whose size is derived from
LZ4_MEMORY_USAGE.
2021-07-31 18:59:15 +02:00
Yann Collet
4de56b3da3
Merge pull request #1012 from eloj/print-install-dirs
Print target directories during 'make install'.
2021-07-25 00:44:40 +02:00
Yann Collet
7be5039648
Merge pull request #1011 from eloj/improve-pkgconfig
Expand use of pkg-config variables.
2021-07-25 00:43:27 +02:00
Eddy Jansson
eba110ad5b Print target directories during 'make install'.
This takes #975 to its logical conclusion.
2021-07-24 17:20:37 +02:00
Eddy Jansson
c1f514f3db Expand use of pkg-config variables.
Change pkg-config generation such that the path variables,
not their values, are used in the definitions of Libs and Cflags,
and that $prefix is substituted into libdir and includedir iff
they start with its value.

This makes it easier to modify the already installed file if necessary.
2021-07-24 16:05:15 +02:00
Yann Collet
c240126068
Merge pull request #1000 from lifegpc/patch1
fix link problem on win32 MSVC
2021-07-01 09:12:55 -07:00
lifegpc
afa7329622
add missing if for lz4c 2021-07-01 22:16:06 +08:00
lifegpc
756ca1a7f2
Link static library first otherwise rebuild source files. 2021-07-01 19:48:30 +08:00
Yann Collet
11efc95c3f
Merge pull request #1005 from ITotalJustice/fix_LZ4HC_HEAPMODE_macro
fix LZ4HC_HEAPMODE macro guard
2021-06-25 16:57:33 -07:00
TotalJustice
2216d45e04 fix LZ4HC_HEAPMODE macro guard 2021-06-25 15:16:22 +01:00
Yann Collet
e3082cd890
Merge pull request #980 from sandyharvie/dev
Fix issue #979
2021-06-25 02:48:22 -07:00
Yann Collet
4f0c7e45c5
Merge pull request #1001 from GabeNI/dev
Cast ALLOC return value to satisfy C++
2021-06-15 22:31:01 -07:00
Yann Collet
e51a6be463
Merge pull request #1002 from t-mat/dev
Fix package related GH-Actions errors
2021-06-15 22:30:03 -07:00
Takayuki Matsuoka
a9b93547a0 Fix package related errors
Add explicit "apt-get update" for all test cases which uses "apt-get".
- It may help to stabilize fetching from apt archive.

As for "CC=gcc-11"
- Add "g++-11" package.
- "g++-11" has been removed from the default virtual environment.
  https://github.com/actions/virtual-environments/issues/3467
2021-06-16 12:44:48 +09:00
Gabe Jones
b3d46ae07f Cast ALLOC return value to satisfy C++ 2021-06-15 12:09:14 -05:00
lifegpc
5ed199da04
fix link problem on win32 MSVC 2021-06-06 10:09:16 +08:00
Yann Collet
355f609529
Merge pull request #996 from t-mat/gha-3
Improve CI script
2021-06-02 18:31:56 -07:00
Claes Nästén
c756d90da9 add -lrt on Solaris 10, required for nanosleep 2021-06-02 09:09:16 +02:00
Takayuki Matsuoka
f0ea466c36 Fix error in ci.yml
Fix the following error
```
lz4 CI : .github#L1
Error when evaluating 'runs-on' for job 'lz4-check-tag'. (Line: 593, Col: 14): Unexpected value ''
```
2021-06-02 04:59:23 +09:00
Takayuki Matsuoka
5b01b5805a Update document for .github/workflows 2021-06-01 20:03:48 +09:00
Takayuki MATSUOKA
02a41178b7 Merge branch 'lz4:dev' into gha-3 2021-06-01 12:00:00 +09:00
Takayuki Matsuoka
8d4005a1ca Add label for checkTag test 2021-05-31 13:54:58 +09:00
Takayuki Matsuoka
44b8b10f84 Add make -C tests checkTag to ci.yml 2021-05-31 13:28:49 +09:00
Yann Collet
145a92bcc5
Merge pull request #998 from t-mat/travis-remove-tests-2
Remove tests from .travis.yml (part 2/2)
2021-05-30 21:06:40 -07:00
Takayuki Matsuoka
ba752cfec9 Disable "(Trusty) gcc-4.4 compilation"
[lz4-c-compilers] contains the following commands

```
make all
CFLAGS=-fPIC LDFLAGS='-pie -fPIE -D_FORTIFY_SOURCE=2' make -C programs
```

[lz4-c-compilers] 025c3ce8f9/.github/workflows/ci.yml (L17-L154)
2021-05-31 11:25:21 +09:00
Takayuki Matsuoka
60b1f8dfbd Disable "(Trusty) scan-build + cppcheck"
[lz4-scan-build] contains the following command

```
make staticAnalyze
```

[lz4-cppcheck]contains the following command

```
make cppcheck
```

We ignore the exit code of cppcheck.  We refer its output as a guideline.

[lz4-scan-build] 025c3ce8f9/.github/workflows/ci.yml (L285-L302)
[lz4-cppcheck] 025c3ce8f9/.github/workflows/ci.yml (L268-L282)
2021-05-31 11:24:11 +09:00
Takayuki Matsuoka
0e3819cadb Disable "(Trusty) clang-3.8 compilation"
[lz4-c-compilers] contains the following command for clang-3.8.

```
make -C tests test-lz4
```

[lz4-c-compilers] 025c3ce8f9/.github/workflows/ci.yml (L17-L154)
2021-05-31 11:23:10 +09:00
Takayuki Matsuoka
42c3351af6 Disable "(Xenial) gcc-5 compilation"
[lz4-c-compilers] contains the following commands for gcc-5

```
make -C tests test-lz4
make -C tests test-lz4c32
```

[lz4-c-compilers] 025c3ce8f9/.github/workflows/ci.yml (L17-L154)
2021-05-31 11:22:25 +09:00
Takayuki Matsuoka
f2a5599c8d Disable "(Trusty) gcc-6 standard C compilation"
Disable "(Trusty) gcc-6 standard C compilation"

[lz4-c-compilers] contains the following commands for gcc-6

```
make c_standards
make -C tests test-lz4
```

[lz4-c-compilers] 025c3ce8f9/.github/workflows/ci.yml (L17-L154)
2021-05-31 11:21:41 +09:00
Takayuki Matsuoka
3887bc6d81 Disable "(Trusty) i386 frame + fuzzer test"
[lz4-frame] contains the following command

```
make -C tests test-frametest32
```
`
[lz4-fuzzer] contains the following command

```
make -C tests test-fuzzer32
```

[lz4-frame] 025c3ce8f9/.github/workflows/ci.yml (L224-L237)
[lz4-fuzzer] 025c3ce8f9/.github/workflows/ci.yml (L192-L208)
2021-05-31 11:20:45 +09:00
Takayuki Matsuoka
febc3ec9b2 Disable "(Trusty) i386 benchmark + version test"
[lz4-c-compilers] contains the following command

```
make -C tests test-lz4c32
```

[lz4-benchmark] contains the following command

```
make -C tests test-fullbench32
```

[lz4-versions] contains the following command

```
make -C tests versionsTest
```

[lz4-c-compilers] 025c3ce8f9/.github/workflows/ci.yml (L17-L154)
[lz4-benchmark] 025c3ce8f9/.github/workflows/ci.yml (L167-L189)
[lz4-versions] 025c3ce8f9/.github/workflows/ci.yml (L211-L221)
2021-05-31 11:19:54 +09:00
Takayuki Matsuoka
40f4acb6ce Disable "(Trusty) c-to-c++ test"
[lz4-c-compilers] contains the following command

```
make ctocpptest
```

[lz4-c-compilers] 025c3ce8f9/.github/workflows/ci.yml (L17-L154)
2021-05-31 11:18:17 +09:00
Takayuki Matsuoka
81ee36cf40 Disable "(Trusty) valgrind test"
[lz4-c-compilers] contains the following command

```
make c_standards
```

[lz4-valgrind] contains the following command

```
make -C tests test-lz4 test-mem
```

[lz4-c-compilers] 025c3ce8f9/.github/workflows/ci.yml (L17-L154)
[lz4-valgrind] 025c3ce8f9/.github/workflows/ci.yml (L305-L316)
2021-05-31 11:17:35 +09:00
Takayuki Matsuoka
e88b2b14d0 Disable "(Trusty) USan test"
[lz4-ubsan-x64] contains the following command

```
make usan MOREFLAGS=-Wcomma -Werror
```

[lz4-ubsan-x64] 025c3ce8f9/.github/workflows/ci.yml (L322-L336)
2021-05-31 11:04:58 +09:00
Takayuki Matsuoka
abbd46b0d0 Disable "x32 compatibility test"
[lz4-c-compilers] contains the following command

```
make -C tests test MOREFLAGS=-mx32
```

[lz4-c-compilers] 025c3ce8f9/.github/workflows/ci.yml (L17-L154)
2021-05-31 11:03:04 +09:00
Takayuki Matsuoka
33580eb4a6 Disable "(Precise) g++ and clang CMake test"
[lz4-compilers] contains the following commands.
Note that `make all` contains `make examples`

```
make cxxtest
make clean
make examples
make clean cmake
make clean clangtest
```

[lz4-build-make-travis-install] contains the following commands.

```
make travis-install
```

[lz4-c-compilers] 025c3ce8f9/.github/workflows/ci.yml (L17-L154)
[lz4-build-make-travis-install] 025c3ce8f9/.github/workflows/ci.yml (L498-L510)
2021-05-31 11:00:53 +09:00
Takayuki Matsuoka
9e72f2c01f Disable "Custom LZ4_DISTANCE_MAX ; ..."
[lz4-custom-distance] contains the following command

```
MOREFLAGS='-DLZ4_DISTANCE_MAX=8000' make V=1 check
make V=1 -C programs lz4-wlib
make V=1 -C tests fullbench-wmalloc  # test LZ4_USER_MEMORY_FUNCTIONS
CC="c++ -Wno-deprecated" make V=1 -C tests fullbench-wmalloc  # stricter function signature check
```

Actually, there're 3+1 tests

(1) Test for Custom LZ4_DISTANCE_MAX.  6654c2c, #753, #755
(2) Test for dynamic link library.  3dd34df, #888
(3-1) Test for LZ4_USER_MEMORY_FUNCTIONS.  52646e8, #937, #946
(3-2) Same as (3-1), but compile it with c++.

After we'll stabilize CI tests, this test should be split into 3 individual parts for clarity.

[lz4-custom-distance] 025c3ce8f9/.github/workflows/ci.yml (L241-L255)
2021-05-31 10:57:16 +09:00
Takayuki Matsuoka
485907563f Disable "ASAN tests with fuzzer and frametest"
[lz4-asan-x64] contains the following command

```
sudo sysctl -w vm.mmap_min_addr=4096
CC=clang MOREFLAGS=-fsanitize=address make -C tests test-frametest test-fuzzer
```

[lz4-asan-x64] 025c3ce8f9/.github/workflows/ci.yml (L361-L376)
2021-05-31 10:56:38 +09:00
Takayuki Matsuoka
8704584f6c Disable "(Precise) frame and fuzzer test"
[lz4-frame] in ci.yml contains the following command

```
make -C tests test-frametest
```

[lz4-fuzzer] in ci.yml contains the following command

```
make -C tests test-fuzzer
```
2021-05-31 10:50:40 +09:00
Takayuki Matsuoka
a44ef30cd5 Disable "(Precise) benchmark test"
Disable "(Precise) benchmark test"

lz4-benchmark[1] in ci.yml contains the following command

```
make -C tests test-lz4 test-lz4c test-fullbench
```

[1] 025c3ce8f9/.github/workflows/ci.yml (L167-L189)
2021-05-31 10:47:59 +09:00
Takayuki Matsuoka
4392dc3261 Disable "(macOS) General Test"
lz4-platform-macos-latest[1] in ci.yml contains the following test command

```
make   # test library build
make test MOREFLAGS='-Werror -Wconversion -Wno-sign-conversion' | tee
```

[1] 025c3ce8f9/.github/workflows/ci.yml (L450)
2021-05-31 10:45:07 +09:00
Takayuki Matsuoka
025c3ce8f9 Enable c_standards as per #994 2021-05-31 10:04:50 +09:00
Takayuki Matsuoka
cccdc8fe21 Enable cxxtest as per #993 2021-05-31 10:03:28 +09:00
Yann Collet
bc8230aab7
Merge pull request #993 from t-mat/fix-enum-unsigned-cmp
Fix g++-4.4 warning
2021-05-30 10:25:21 -07:00
Yann Collet
1519312d24
Merge pull request #995 from t-mat/travis-remove-qemu
Remove QEMU test from .travis.yml
2021-05-30 10:24:52 -07:00
Yann Collet
31fb0bb4b8
Merge pull request #994 from t-mat/makefile-split-cstds
Split c_standards into multiple Makefile targets
2021-05-30 10:24:14 -07:00
Takayuki Matsuoka
243f6b5233 Improve CI script
## Added compilers

- gcc: 4.[4678], 5, 6, 11
- clang: 3.[56789], 4, 5, 12

## Known issue

- make -C tests test-lz4c32
  - Fails with all versions of clang.  See #991 for details.
- CFLAGS='-O3 -mx32' make -C tests test-lz4c32
  - Fails with all versions of clang
  - Fails with gcc-11
- `make cxxtest`
  - Disabled for now.  Will be enabled after #993.
- `make c_standards_c90`, `make c_standards_c11`
  - Disabled for now.  Will be enabled after #994.

## Difference with `.travis.yml`

The following tests are not included yet.

- name: Compile OSS-Fuzz targets
- name: tag build

The following tests won't be included due to lmitation of the CI environment.

- name: aarch64 real-hw tests
- name: PPC64LE real-hw tests
- name: IBM s390x real-hw tests

Except above, all other features in `.travis.yml` has been included in this change set.

The following post describes details.
2021-05-30 23:41:43 +09:00
Takayuki Matsuoka
bf140842d9 Remove QEMU test from .travis.yml
We have same test in GitHub Actions.
2021-05-30 18:39:33 +09:00
Yann Collet
e8a8fd6f0b
Merge pull request #992 from t-mat/fix-clang-warning-1
Fix -Wshorten-64-to-32 warning
2021-05-30 01:28:36 -07:00