mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
Incorrect compressed output from Android build #287
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mhsmith on GitHub (Aug 25, 2019).
I'm trying to make a Python build of Brotli for Chaquopy on Android (https://github.com/chaquo/chaquopy/issues/137). The build process itself is no problem (I'm using the 1.0.7 sdist ZIP from PyPI), but the resulting package doesn't work correctly.
With the official Linux build from PyPI:
With my own Android build:
Notice that the invalid output is the same at the beginning and end, but the middle section is both different and shorter. I get the same output on both x86 and arm64-v8a.
Can anyone suggest what might be going on here?
@mhsmith commented on GitHub (Aug 25, 2019):
I should mention, I'm using the Crystax NDK with a relatively old compiler (GCC 4.9.3).
@mhsmith commented on GitHub (Aug 27, 2019):
I eventually tracked this down to
BROTLI_RESTRICT. With that macro disabled, compression worked correctly on all ABIs.However, decompression still gave the same error on arm64-v8a until I added
BROTLI_BUILD_NO_RBIT. My test device was a Nexus 5X (Qualcomm Snapdragon 808, 2x Cortex-A57, 4x Cortex-A53), but I suspect the compiler is at fault here.This compiler version is no longer supported on Android, and I'll be moving off it myself as soon as possible. So there's no need to take any further action on this, unless you want to.
@eustas commented on GitHub (Aug 27, 2019):
Thanks for the investigation.
Still makes sense to:
restrict- this might mean that something is marked wrong, i.e. two areas could intersectrbitworks well if compiler thinks it should@jinfeihan57 commented on GitHub (Nov 14, 2019):
GCC 4.8 is not working .
The compiler version is too low, try a newer version.
GCC 5.4 is OK.
or try a cross compiler。
@mhsmith commented on GitHub (Jan 31, 2020):
I tried building brotli 1.0.7 using the Google NDK r18 (Clang version 7.0.2), and it produces the correct output on all ABIs, without needing any of the above changes. So I think that confirms it was the Crystax NDK that was at fault.
@eustas commented on GitHub (Jul 2, 2020):
@mhsmith thanks for investigating.