Skip to content

Commit

Permalink
Squashed 'third_party/brotli/' changes from 3af18990f5..e61745a6b7
Browse files Browse the repository at this point in the history
e61745a6b7 Re-release
db361a0bb9 Re-add python bindings to sources tarball
d518e55ba7 Update README.md
d052918255 Fix build files (youtube#829)
665e81dc9b New version: 1.0.8 (youtube#827)
223d80cfbe Update (youtube#826)
0c5603e07b Fix output parameter type for _BitScanReverse (youtube#819)
e8155d67b0 CMake: change default ("") build type to Release (youtube#818)
fc823290a7 Mute strerror/strcpy warnings is MSVC build. (youtube#815)
5519352661 Add workaround for lying feof. (youtube#814)
d2ea198232 Update platform.h (youtube#813)
31754d4ffc Add runtime linker path to pkg-config files (youtube#740)
8f093f5e84 .gitignore: Ignore .obj files (youtube#805)
f0db711f46 Filter sources for the tarball. (youtube#808)
7f740f1308 Update (youtube#807)
f83aa5169e Update bazel to 2.2 + update config (youtube#798)
924b2b2b9d Move TZCNT and BSR intrinsics to platform.h, add MSVC versions (youtube#636)
0503d8b766 Added go.mod file to go/cbrotli directory (youtube#754)
f503cb709c Add HAVE_LOG2 build macro (youtube#783)
36ac0feaf9 Adding CIFuzz (youtube#797)
666c3280cc Make types of variable match (youtube#796)
4b5771bee7 Add missing "const" to a couple of kConstants (youtube#780)
c435f06675 Add vcpkg installation instructions (youtube#776)
5c3a9a937b Fix license in setup.py (youtube#769)
afc4a74273 Add oss-fuzz fuzzing status badge to README (youtube#767)
35ef5c554d Disable PIC in EMCC mode. (youtube#768)
ca21dac8e5 Add an option to avoid building shared libraries. (youtube#766)
3d1767186d Fix include for EMCC build (youtube#765)
f1124c8524 More careful sanitizer detection (youtube#764)
c8b37e8fd1 Update (youtube#762)
40f0fdcdc1 Explicitly mark tests/testdata/* as binary. (youtube#761)
78e7bbc3c3 Update (youtube#753)
4b2b2d4f83 Update (youtube#749)
9cd01c0437 Update WORKSPACE files. (youtube#742)
8109882ecf Fix youtube#741
5805f99a53 Ensure decompression consumes all input (youtube#730)
d0ffe60b87 Verbose CLI + start pulling "Shared-Brotli" (youtube#722)
d6d98957ca Ramp up version to 1.0.7
a1e44975a7 Fix youtube#698
a799e34c7f Remove dependency to full JDK. This should speedup clean builds. (youtube#719)
7a153ebb09 make/build: ensure NEON is enabled and tested (youtube#718)
ce8951c3e9 Fix `<arm_neon.h>` inclusion guard. (youtube#717)
f7cbc97c96 Fix typo / minor formatting (youtube#716)
cc7a74f15f decode: fix NEON inclusion (youtube#714)
c94c6f805c tools/brotli: improve window size autodetect (youtube#710)
9402ac5c08 decode: faster huffman code loading on 32-bit Arm (youtube#703)
67f059eaf5 Cross compilation support (youtube#709)
6eba239a5b Fix auto detect of bundled mode (youtube#704)
2216a0dd63 Update (youtube#706)
d4cd6cdf1c platform: fix unaligned 64-bit accesses on AArch32 (youtube#702)
8a073bd9e2 Revert "platform: fix unaligned 64-bit accesses on AArch32 (youtube#699)" (youtube#701)
6d027d1648 platform: fix unaligned 64-bit accesses on AArch32 (youtube#699)
fc4d345968 Fix missing header files (youtube#695)
b601fe817b Ramp up version to 1.0.5
ee2a5e1540 Update go_library to use standard importpath (youtube#690)
eb12ec04eb Update (youtube#688)
7505290ef9 Convert fuzzer to C99. (youtube#686)
ff05c35166 Add VS2017 release Appveyor build (youtube#685)
09cd3e877f Update
8544ae858d Update (youtube#680)
1e7ea1d8e6 Inverse bazel project/workspace tree (youtube#677)
29dc2cce90 Update golang and JS Bazel plugins to latest stable versions. (youtube#676)
f9b8c02673 Add RISC-V 64-bit (riscv64) platform configuration (youtube#669)
48a25b3fa4 Fix youtube#671 (youtube#672)
a4581c158e Add tools to download and transform static dictionary data. (youtube#670)
f5ed35d065 Update (youtube#664)
f94cd51b5c appveyor: fix issue self-upgradig pip to v10 (youtube#663)
6000396155 Remove unprefixed macros from public headers (youtube#662)
68db5c0272 Update (youtube#660)
c6333e1e79 Fix MSVC compilation (youtube#657)
0f3c84e745 Update (youtube#656)
515fc62313 Tell CMake to not check for a C++ compiler (youtube#653)
2c03482569 Fix "memory leak" in python tests (youtube#652)
a238f5bac9 Update README.md (youtube#646)
631fe194a1 Update (youtube#651)
533843e354 Update (youtube#643)
35e69fc7cf New feature: "Large Window Brotli" (youtube#640)

git-subtree-dir: third_party/brotli
git-subtree-split: e61745a6b7add50d380cfd7d3883dd6c62fc2c71
  • Loading branch information
sherryzy committed May 16, 2023
1 parent d6148ac commit f9b239c
Show file tree
Hide file tree
Showing 193 changed files with 12,831 additions and 5,497 deletions.
54 changes: 54 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
tests/testdata/* binary

# Exclude everything
**/** export-ignore

# Add top-level files
bootstrap !export-ignore
BUILD !export-ignore
CMakeLists.txt !export-ignore
compiler_config_setting.bzl !export-ignore
configure !export-ignore
configure-cmake !export-ignore
configure.ac !export-ignore
CONTRIBUTING.md !export-ignore
LICENSE !export-ignore
Makefile !export-ignore
Makefile.am !export-ignore
MANIFEST.in !export-ignore
premake5.lua !export-ignore
README !export-ignore
README.md !export-ignore
setup.py !export-ignore
setup.cfg !export-ignore
WORKSPACE !export-ignore

# Add sources
c !export-ignore
c/** !export-ignore
c/common/dictionary.bin* export-ignore
c/fuzz export-ignore

# Add man pages
docs !export-ignore
docs/** !export-ignore
docs/brotli-comparison-study-2015-09-22.pdf export-ignore

# Add python bindings + tests
python !export-ignore
python/** !export-ignore

# Add more build files.
scripts !export-ignore
scripts/sources.lst !export-ignore
scripts/libbrotli*.pc.in !export-ignore

# Add testdata
tests !export-ignore
tests/*.sh !export-ignore
tests/*.cmake !export-ignore
tests/testdata !export-ignore
tests/testdata/empty !export-ignore
tests/testdata/empty.compressed !export-ignore
tests/testdata/ukkonooa !export-ignore
tests/testdata/ukkonooa.compressed !export-ignore
23 changes: 23 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CIFuzz
on: [pull_request]
jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'brotli'
dry-run: false
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'brotli'
fuzz-seconds: 600
dry-run: false
- name: Upload Crash
uses: actions/upload-artifact@v1
if: failure()
with:
name: artifacts
path: ./out/artifacts
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# C
*.o
*.obj
bin/
buildfiles/
**/obj/
dist/
**/bazel-*

# Python
__pycache__/
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "research/esaxx"]
path = research/esaxx
url = https://github.com/hillbig/esaxx
[submodule "research/libdivsufsort"]
path = research/libdivsufsort
url = https://github.com/y-256/libdivsufsort.git
63 changes: 42 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,27 @@ matrix:
## Test that fuzzer is compiling / working.
###
- os: linux
env: BUILD_SYSTEM=fuzz C_COMPILER=clang-5.0 CXX_COMPILER=clang++-5.0 ASAN_OPTIONS=detect_leaks=0
env: BUILD_SYSTEM=fuzz C_COMPILER=clang-7 CXX_COMPILER=clang++-7 ASAN_OPTIONS=detect_leaks=0
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
- llvm-toolchain-xenial-7
packages:
- clang-5.0
- clang-7

###
## clang on Linux
###
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=clang-5.0 CXX_COMPILER=clang++-5.0
env: BUILD_SYSTEM=cmake C_COMPILER=clang-7 CXX_COMPILER=clang++-7
addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
- llvm-toolchain-xenial-7
- ubuntu-toolchain-r-test
packages:
- clang-5.0
- clang-7
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=clang-3.5 CXX_COMPILER=clang++-3.5
addons:
Expand All @@ -76,10 +76,25 @@ matrix:
- clang-3.5

###
## PGI Community Edition on Linux
## testing arm via qemu on Linux
###
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=pgcc CXX_COMPILER=pgc++
env: BUILD_SYSTEM=cmake C_COMPILER=arm-linux-gnueabihf-gcc CXX_COMPILER=arm-linux-gnueabihf-g++ CFLAGS="-march=armv7-a -mfloat-abi=hard -mfpu=neon"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- qemu
- gcc-arm-linux-gnueabihf
- libc6-dev-armhf-cross

###
## PGI Community Edition on Linux
###
# Installer is currently broken
#- os: linux
# env: BUILD_SYSTEM=cmake C_COMPILER=pgcc CXX_COMPILER=pgc++

###
## Python 2.7 and 3.6 builds on Linux
Expand Down Expand Up @@ -115,10 +130,11 @@ matrix:
## We'll just test 4.4 and the most recent version.
###
- os: osx
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-6 CXX_COMPILER=g++-6
env: BUILD_SYSTEM=cmake C_COMPILER=gcc CXX_COMPILER=g++
- os: osx
osx_image: beta-xcode6.2
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.4 CXX_COMPILER=g++-4.4
env: BUILD_SYSTEM=cmake C_COMPILER=gcc-4.9 CXX_COMPILER=g++-4.9
- os: osx
env: BUILD_SYSTEM=cmake

###
## Python 2.7 OS X build (using the system /usr/bin/python)
Expand All @@ -130,40 +146,44 @@ matrix:
## Sanitizers
###
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=clang-5.0 CXX_COMPILER=clang++-5.0 SANITIZER=address ASAN_OPTIONS=detect_leaks=0
env: BUILD_SYSTEM=cmake C_COMPILER=clang-7 CXX_COMPILER=clang++-7 SANITIZER=address ASAN_OPTIONS=detect_leaks=0
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
- llvm-toolchain-xenial-7
packages:
- clang-5.0
- clang-7
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=clang-5.0 CXX_COMPILER=clang++-5.0 SANITIZER=thread
env: BUILD_SYSTEM=cmake C_COMPILER=clang-7 CXX_COMPILER=clang++-7 SANITIZER=thread
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
- llvm-toolchain-xenial-7
packages:
- clang-5.0
- clang-7
- os: linux
env: BUILD_SYSTEM=cmake C_COMPILER=clang-5.0 CXX_COMPILER=clang++-5.0 SANITIZER=undefined CFLAGS="-fno-sanitize-recover=undefined,integer"
env: BUILD_SYSTEM=cmake C_COMPILER=clang-7 CXX_COMPILER=clang++-7 SANITIZER=undefined CFLAGS="-fno-sanitize-recover=undefined,integer"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
- llvm-toolchain-xenial-7
packages:
- clang-5.0
- clang-7

- os: linux
env: BUILD_SYSTEM=maven
jdk:
# maven + jdk11 + javadoc == trouble
- openjdk10
language: java

- os: linux
sudo: required
language: java
jdk: oraclejdk9
env: BUILD_SYSTEM=bazel
addons:
apt:
Expand All @@ -172,11 +192,12 @@ matrix:
key_url: "https://storage.googleapis.com/bazel-apt/doc/apt-key.pub.gpg"
- ubuntu-toolchain-r-test
packages:
- oracle-java8-installer
- bazel

- os: osx
env: BUILD_SYSTEM=bazel
osx_image: xcode11.3
language: java

before_install:
###
Expand Down
120 changes: 20 additions & 100 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ licenses(["notice"]) # MIT

exports_files(["LICENSE"])

# >>> JNI headers

config_setting(
name = "darwin",
values = {"cpu": "darwin"},
Expand Down Expand Up @@ -41,51 +39,26 @@ config_setting(
visibility = ["//visibility:public"],
)

genrule(
name = "copy_link_jni_header",
srcs = ["@openjdk_linux//:jni_h"],
outs = ["jni/jni.h"],
cmd = "cp -f $< $@",
)

genrule(
name = "copy_link_jni_md_header",
srcs = select({
":darwin": ["@openjdk_macos//:jni_md_h"],
":darwin_x86_64": ["@openjdk_macos//:jni_md_h"],
":windows_msys": ["@openjdk_win//:jni_md_h"],
":windows_msvc": ["@openjdk_win//:jni_md_h"],
":windows": ["@openjdk_win//:jni_md_h"],
"//conditions:default": ["@openjdk_linux//:jni_md_h"],
}),
outs = ["jni/jni_md.h"],
cmd = "cp -f $< $@",
)

cc_library(
name = "jni_inc",
hdrs = [
":jni/jni.h",
":jni/jni_md.h",
load(":compiler_config_setting.bzl", "create_msvc_config")

create_msvc_config()

STRICT_C_OPTIONS = select({
":msvc": [],
"//conditions:default": [
"--pedantic-errors",
"-Wall",
"-Wconversion",
"-Werror",
"-Wextra",
"-Wlong-long",
"-Wmissing-declarations",
"-Wmissing-prototypes",
"-Wno-strict-aliasing",
"-Wshadow",
"-Wsign-compare",
],
includes = ["jni"],
)

# <<< JNI headers

STRICT_C_OPTIONS = [
"--pedantic-errors",
"-Wall",
"-Wconversion",
"-Werror",
"-Wextra",
"-Wlong-long",
"-Wmissing-declarations",
"-Wmissing-prototypes",
"-Wno-strict-aliasing",
"-Wshadow",
"-Wsign-compare",
]
})

filegroup(
name = "public_headers",
Expand Down Expand Up @@ -126,7 +99,7 @@ cc_library(
name = "brotli_inc",
hdrs = [":public_headers"],
copts = STRICT_C_OPTIONS,
includes = ["c/include"],
strip_include_prefix = "c/include",
)

cc_library(
Expand Down Expand Up @@ -165,60 +138,7 @@ cc_binary(
],
)

########################################################
# WARNING: do not (transitively) depend on this target!
########################################################
cc_binary(
name = "brotli_jni.dll",
srcs = [
":common_headers",
":common_sources",
":dec_headers",
":dec_sources",
":enc_headers",
":enc_sources",
"//java/org/brotli/wrapper/common:jni_src",
"//java/org/brotli/wrapper/dec:jni_src",
"//java/org/brotli/wrapper/enc:jni_src",
],
deps = [
":brotli_inc",
":jni_inc",
],
linkshared = 1,
)

########################################################
# WARNING: do not (transitively) depend on this target!
########################################################
cc_binary(
name = "brotli_jni_no_dictionary_data.dll",
srcs = [
":common_headers",
":common_sources",
":dec_headers",
":dec_sources",
":enc_headers",
":enc_sources",
"//java/org/brotli/wrapper/common:jni_src",
"//java/org/brotli/wrapper/dec:jni_src",
"//java/org/brotli/wrapper/enc:jni_src",
],
defines = [
"BROTLI_EXTERNAL_DICTIONARY_DATA=",
],
deps = [
":brotli_inc",
":jni_inc",
],
linkshared = 1,
)

filegroup(
name = "dictionary",
srcs = ["c/common/dictionary.bin"],
)

load("@io_bazel_rules_go//go:def.bzl", "go_prefix")

go_prefix("github.com/google/brotli")
Loading

0 comments on commit f9b239c

Please sign in to comment.