Skip to content

Commit faa44cf

Browse files
committed
Squashed 'lz4/' content from commit fdf2ef580
git-subtree-dir: lz4 git-subtree-split: fdf2ef5809ca875c454510610764d9125ef2ebbd
0 parents  commit faa44cf

File tree

155 files changed

+32570
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+32570
-0
lines changed

.circleci/config.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# This configuration was automatically generated from a CircleCI 1.0 config.
2+
# It should include any build commands you had along with commands that CircleCI
3+
# inferred from your project structure. We strongly recommend you read all the
4+
# comments in this file to understand the structure of CircleCI 2.0, as the idiom
5+
# for configuration has changed substantially in 2.0 to allow arbitrary jobs rather
6+
# than the prescribed lifecycle of 1.0. In general, we recommend using this generated
7+
# configuration as a reference rather than using it in production, though in most
8+
# cases it should duplicate the execution of your original 1.0 config.
9+
version: 2
10+
jobs:
11+
build:
12+
working_directory: ~/lz4/lz4
13+
# Parallelism is broken in this file : it just plays the same tests twice.
14+
# The script will have to be modified to support parallelism properly
15+
# In the meantime, set it to 1.
16+
parallelism: 1
17+
shell: /bin/bash --login
18+
# CircleCI 2.0 does not support environment variables that refer to each other the same way as 1.0 did.
19+
# If any of these refer to each other, rewrite them so that they don't or see https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables .
20+
environment:
21+
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
22+
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
23+
# In CircleCI 1.0 we used a pre-configured image with a large number of languages and other packages.
24+
# In CircleCI 2.0 you can now specify your own image, or use one of our pre-configured images.
25+
# The following configuration line tells CircleCI to use the specified docker image as the runtime environment for you job.
26+
# We have selected a pre-built image that mirrors the build environment we use on
27+
# the 1.0 platform, but we recommend you choose an image more tailored to the needs
28+
# of each job. For more information on choosing an image (or alternatively using a
29+
# VM instead of a container) see https://circleci.com/docs/2.0/executor-types/
30+
# To see the list of pre-built images that CircleCI provides for most common languages see
31+
# https://circleci.com/docs/2.0/circleci-images/
32+
docker:
33+
- image: fbopensource/lz4-circleci-primary:0.0.4
34+
steps:
35+
# Machine Setup
36+
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
37+
# The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
38+
- checkout
39+
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
40+
# In many cases you can simplify this from what is generated here.
41+
# 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
42+
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
43+
# Test
44+
# This would typically be a build job when using workflows, possibly combined with build
45+
# This is based on your 1.0 configuration file or project settings
46+
- run: CFLAGS= make clangtest && make clean
47+
- run: g++ -v; make gpptest && make clean
48+
- run: gcc -v; g++ -v; make ctocpptest && make clean
49+
- run: gcc-5 -v; CC=gcc-5 CFLAGS="-O2 -Werror" make check && make clean
50+
- run: gcc-5 -v; CC=gcc-5 CFLAGS="-O2 -m32 -Werror" CPPFLAGS=-I/usr/include/x86_64-linux-gnu make check && make clean
51+
- run: gcc-6 -v; CC=gcc-6 MOREFLAGS="-O2 -Werror" make check && make clean
52+
- run: make cmake && make clean
53+
- run: make -C tests test-lz4
54+
- run: make -C tests test-lz4c
55+
- run: make -C tests test-frametest
56+
- run: make -C tests test-fuzzer && make clean
57+
- run: make -C lib all && make clean
58+
- run: pyenv global 3.4.4; make versionsTest MOREFLAGS=-I/usr/include/x86_64-linux-gnu && make clean
59+
- run: make travis-install && make clean
60+
- run: gcc -v; CFLAGS="-O2 -m32 -Werror" CPPFLAGS=-I/usr/include/x86_64-linux-gnu make check && make clean
61+
- run: clang -v; make staticAnalyze && make clean
62+
- run: make platformTest CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static && make clean
63+
- run: make platformTest CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS=-m64 && make clean
64+
- run: make platformTest CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static && make clean
65+
- run: make platformTest CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static && make clean
66+
# Teardown
67+
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
68+
# Save test results
69+
- store_test_results:
70+
path: /tmp/circleci-test-results
71+
# Save artifacts
72+
- store_artifacts:
73+
path: /tmp/circleci-artifacts
74+
- store_artifacts:
75+
path: /tmp/circleci-test-results
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM circleci/buildpack-deps:bionic
2+
3+
RUN sudo apt-get -y -qq update
4+
RUN sudo apt-get -y install software-properties-common
5+
RUN sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
6+
RUN sudo apt-get -y install cmake
7+
RUN sudo apt-get -y install qemu-system-ppc qemu-user-static qemu-system-arm
8+
RUN sudo apt-get -y install libc6-dev-armel-cross libc6-dev-arm64-cross libc6-dev-i386
9+
RUN sudo apt-get -y install clang clang-tools
10+
RUN sudo apt-get -y install gcc-5 gcc-5-multilib gcc-6
11+
RUN sudo apt-get -y install valgrind
12+
RUN sudo apt-get -y install gcc-multilib-powerpc-linux-gnu gcc-powerpc-linux-gnu gcc-arm-linux-gnueabi gcc-aarch64-linux-gnu

.gitattributes

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Set the default behavior
2+
* text eol=lf
3+
4+
# Explicitly declare source files
5+
*.c text eol=lf
6+
*.h text eol=lf
7+
8+
# Denote files that should not be modified.
9+
*.odt binary
10+
*.png binary
11+
12+
# Visual Studio
13+
*.sln text eol=crlf
14+
*.vcxproj* text eol=crlf
15+
*.vcproj* text eol=crlf
16+
*.suo binary
17+
*.rc text eol=crlf
18+
19+
# Windows
20+
*.bat text eol=crlf
21+
*.cmd text eol=crlf

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Object files
2+
*.o
3+
*.ko
4+
5+
# Libraries
6+
*.lib
7+
*.a
8+
9+
# Shared objects (inc. Windows DLLs)
10+
*.dll
11+
*.so
12+
*.so.*
13+
*.dylib
14+
*.dSYM # apple
15+
16+
# Executables
17+
*.exe
18+
*.out
19+
*.app
20+
lz4
21+
22+
# IDE / editors files
23+
.clang_complete
24+
_codelite/
25+
_codelite_lz4/
26+
bin/
27+
*.zip
28+
29+
# Mac
30+
.DS_Store
31+
*.dSYM
32+
33+
# Windows / Msys
34+
nul
35+
ld.exe*
36+
37+
# test files
38+
*.lz4

.travis.yml

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
language: c
2+
3+
matrix:
4+
fast_finish: true
5+
include:
6+
# OS X Mavericks
7+
- name: (macOS) General Test
8+
os: osx
9+
compiler: clang
10+
script:
11+
- make # test library build
12+
- make clean
13+
- make -C tests test-lz4 MOREFLAGS='-Werror -Wconversion -Wno-sign-conversion' | tee # test scenario where `stdout` is not the console
14+
- make clean
15+
- CFLAGS=-m32 make -C tests test-lz4-contentSize
16+
17+
# Container-based 12.04 LTS Server Edition 64 bit (doesn't support 32-bit includes)
18+
- name: (Precise) benchmark test
19+
dist: precise
20+
script:
21+
- make -C tests test-lz4 test-lz4c test-fullbench
22+
23+
- name: (Precise) frame and fuzzer test
24+
dist: precise
25+
install:
26+
- sudo sysctl -w vm.mmap_min_addr=4096
27+
script:
28+
- make -C tests test-frametest test-fuzzer
29+
30+
- name: ASAN tests with fuzzer and frametest
31+
install:
32+
- sudo sysctl -w vm.mmap_min_addr=4096
33+
script:
34+
- CC=clang MOREFLAGS=-fsanitize=address make -C tests test-frametest test-fuzzer
35+
36+
- name: Custom LZ4_DISTANCE_MAX
37+
script:
38+
- MOREFLAGS=-DLZ4_DISTANCE_MAX=8000 make check
39+
40+
- name: (Precise) g++ and clang CMake test
41+
dist: precise
42+
script:
43+
- make gpptest
44+
- make clean
45+
- make examples
46+
- make clean cmake
47+
- make clean travis-install
48+
- make clean clangtest
49+
50+
51+
# 14.04 LTS Server Edition 64 bit
52+
- name: (Trusty) i386 gcc test
53+
dist: trusty
54+
addons:
55+
apt:
56+
packages:
57+
- libc6-dev-i386
58+
- gcc-multilib
59+
script:
60+
- make -C tests test MOREFLAGS=-mx32
61+
62+
# presume clang >= v3.9.0
63+
- name: (Trusty) USan test
64+
dist: trusty
65+
compiler: clang
66+
script:
67+
- make usan MOREFLAGS=-Wcomma -Werror
68+
69+
- name: (Trusty) valgrind test
70+
dist: trusty
71+
install:
72+
- sudo apt-get install -qq valgrind
73+
script:
74+
- make c_standards
75+
- make -C tests test-lz4 test-mem
76+
77+
- name: (Trusty) c-to-c++ test
78+
dist: trusty
79+
script:
80+
- make ctocpptest
81+
82+
- name: (Trusty) i386 benchmark + version test
83+
dist: trusty
84+
install:
85+
- sudo apt-get install -qq python3 libc6-dev-i386 gcc-multilib
86+
script:
87+
- make -C tests test-lz4c32 test-fullbench32 versionsTest
88+
89+
- name: (Trusty) i386 frame + fuzzer test
90+
dist: trusty
91+
install:
92+
- sudo apt-get install -qq libc6-dev-i386 gcc-multilib
93+
- sudo sysctl -w vm.mmap_min_addr=4096
94+
script:
95+
- make -C tests test-frametest32 test-fuzzer32
96+
97+
- name: (Trusty) gcc-6 standard C compilation
98+
dist: trusty
99+
addons:
100+
apt:
101+
sources:
102+
- ubuntu-toolchain-r-test
103+
packages:
104+
- gcc-6
105+
env:
106+
- CC=gcc-6
107+
script:
108+
- make c_standards
109+
- make -C tests test-lz4 MOREFLAGS=-Werror
110+
111+
- name: (Trusty) arm + aarch64 compilation
112+
dist: trusty
113+
install:
114+
- sudo apt-get install -qq
115+
qemu-system-arm
116+
qemu-user-static
117+
gcc-arm-linux-gnueabi
118+
libc6-dev-armel-cross
119+
gcc-aarch64-linux-gnu
120+
libc6-dev-arm64-cross
121+
script:
122+
- make platformTest CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static
123+
- make platformTest CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static
124+
125+
- name: (Xenial) gcc-5 compilation
126+
dist: xenial
127+
install:
128+
- sudo apt-get install -qq libc6-dev-i386 gcc-multilib
129+
script:
130+
- make -C tests test-lz4 clean test-lz4c32 MOREFLAGS=-Werror
131+
132+
- name: (Trusty) clang-3.8 compilation
133+
dist: trusty
134+
addons:
135+
apt:
136+
sources:
137+
- ubuntu-toolchain-r-test
138+
- llvm-toolchain-precise-3.8
139+
packages:
140+
- clang-3.8
141+
script:
142+
- make -C tests test-lz4 CC=clang-3.8
143+
144+
- name: (Trusty) PowerPC + PPC64 compilation
145+
dist: trusty
146+
install:
147+
- sudo apt-get install -qq qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu
148+
script:
149+
- make platformTest CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static
150+
- make platformTest CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS=-m64
151+
152+
- name: (Trusty) scan-build + cppcheck
153+
dist: trusty
154+
compiler: clang
155+
install:
156+
- sudo apt-get install -qq cppcheck
157+
script:
158+
- make staticAnalyze
159+
- make cppcheck
160+
161+
- name: (Trusty) gcc-4.4 compilation
162+
dist: trusty
163+
addons:
164+
apt:
165+
sources:
166+
- ubuntu-toolchain-r-test
167+
packages:
168+
- libc6-dev-i386
169+
- gcc-multilib
170+
- gcc-4.4
171+
script:
172+
- make clean all CC=gcc-4.4 MOREFLAGS=-Werror
173+
- make clean
174+
- CFLAGS=-fPIC LDFLAGS='-pie -fPIE -D_FORTIFY_SOURCE=2' make -C programs
175+
176+
# tag-specific test
177+
- name: tag build
178+
if: tag =~ ^v[0-9]\.[0-9]
179+
os: linux
180+
script:
181+
- make -C tests checkTag
182+
- tests/checkTag "$TRAVIS_BRANCH"
183+
184+
- name: (Xenial) Meson + clang build
185+
#env: ALLOW_FAILURES=true
186+
dist: xenial
187+
language: cpp
188+
compiler: clang
189+
install:
190+
- sudo apt-get install -qq python3 tree
191+
- |
192+
travis_retry curl -o ~/ninja.zip -L 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip' &&
193+
unzip ~/ninja.zip -d ~/.local/bin
194+
- |
195+
travis_retry curl -o ~/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' &&
196+
python3 ~/get-pip.py --user &&
197+
pip3 install --user meson
198+
script:
199+
- |
200+
meson setup \
201+
--buildtype=debug \
202+
-Db_lundef=false \
203+
-Dauto_features=enabled \
204+
-Ddefault_library=both \
205+
-Dbin_programs=true \
206+
-Dbin_contrib=true \
207+
-Dbin_tests=true \
208+
-Dbin_examples=true \
209+
contrib/meson build
210+
- pushd build
211+
- DESTDIR=./staging ninja install
212+
- tree ./staging
213+
214+
# oss-fuzz compilation test
215+
- name: Compile OSS-Fuzz targets
216+
script:
217+
- ./ossfuzz/travisoss.sh
218+
219+
allow_failures:
220+
- env: ALLOW_FAILURES=true

INSTALL

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Installation
2+
=============
3+
4+
```
5+
make
6+
make install # this command may require root access
7+
```
8+
9+
LZ4's `Makefile` supports standard [Makefile conventions],
10+
including [staged installs], [redirection], or [command redefinition].
11+
It is compatible with parallel builds (`-j#`).
12+
13+
[Makefile conventions]: https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
14+
[staged installs]: https://www.gnu.org/prep/standards/html_node/DESTDIR.html
15+
[redirection]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
16+
[command redefinition]: https://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html

LICENSE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
This repository uses 2 different licenses :
2+
- all files in the `lib` directory use a BSD 2-Clause license
3+
- all other files use a GPLv2 license, unless explicitly stated otherwise
4+
5+
Relevant license is reminded at the top of each source file,
6+
and with presence of COPYING or LICENSE file in associated directories.
7+
8+
This model is selected to emphasize that
9+
files in the `lib` directory are designed to be included into 3rd party applications,
10+
while all other files, in `programs`, `tests` or `examples`,
11+
receive more limited attention and support for such scenario.

0 commit comments

Comments
 (0)