Closed ms178 closed 7 months ago
Looks like the repro command, taken from the PKGBUILD.txt
file is:
export CC="clang -m32"
export CXX="clang++ -m32"
cmake -S build/cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_STANDARD=23 \
-DCMAKE_CXX_STANDARD=23 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib32 \
-DZSTD_ZLIB_SUPPORT=ON \
-DZSTD_LZMA_SUPPORT=ON \
-DZSTD_LZ4_SUPPORT=ON \
-DZSTD_BUILD_CONTRIB=ON \
-DZSTD_BUILD_STATIC=OFF \
-DZSTD_BUILD_TESTS=OFF \
-DZSTD_PROGRAMS_LINK_SHARED=ON
cmake --build build
Its strange because we have 32-bit builds in our CI that are working. I'm traveling and don't have easy access to an intel machine that can do a 32-bit build. But I'll see if someone else can repro.
Zstd includes an optimized assembly Huffman decoder on x86_64, so building zstd not only invokes a C compiler (which you are telling to build in 32-bit mode) but also invokes an assembler (which you aren't).
I can repro your issue with your invocation, and can confirm it's fixed if you instead:
export CFLAGS="-m32"
export CXXFLAGS="-m32"
export ASMFLAGS="-m32"
It's curious that you say this worked in 1.5.5, since the asm decoder has existed for a while and I'm not aware of anything having changed here between those releases.
Thanks, Felix! Indeed, that fixes the observed failure. It is still puzzling why I didn't hit the same issue on 1.5.5 earlier. CachyOS upstream doesn't seem to hit this either, according to their PKGBUILD at https://github.com/CachyOS/CachyOS-PKGBUILDS/blob/master/zstd/lib32-zstd/PKGBUILD, they do not specify export ASMFLAGS="-m32"
there but use GCC to compile the package.
Describe the bug Zstd 1.5.6 shows the following build failure on the 32-bit x86 version with both GCC 13.2.1 and LLVM/Clang-19 (shown below). As Zstd 1.5.5 builds just fine, I suspect a regression in 1.5.6.
Desktop (please complete the following information):