Merge pull request #2922 from facebook/x32

x32 compatibility
dev
Yann Collet 2021-12-11 00:12:10 -08:00 committed by GitHub
commit 252ef866fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -37,6 +37,18 @@ jobs:
APT_PACKAGES="gcc-multilib" make apt-install
CFLAGS="-m32 -O1 -fstack-protector" make check V=1
check-x32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: make check on x32 ABI # https://en.wikipedia.org/wiki/X32_ABI
env:
CHECK_CONSTRAINED_MEM: true
run: |
sudo apt update
APT_PACKAGES="gcc-multilib" make apt-install
CFLAGS="-mx32 -O1 -fstack-protector" make check V=1
gcc-7-libzstd:
runs-on: ubuntu-latest
steps:

View File

@ -172,8 +172,9 @@ static size_t HUF_DecompressAsmArgs_init(HUF_DecompressAsmArgs* args, void* dst,
BYTE* const oend = (BYTE*)dst + dstSize;
/* We're assuming x86-64 BMI2 - assure that this is the case. */
assert(MEM_isLittleEndian() && !MEM_32bits());
/* The following condition is false on x32 platform,
* but HUF_asm is not compatible with this ABI */
if (!(MEM_isLittleEndian() && !MEM_32bits())) return 1;
/* strict minimum : jump table + 1 byte per stream */
if (srcSize < 10)