Skip to content

Commit c783aec

Browse files
committed
Enable ASM language for zstd huf_decompress_amd64.S
Without enable_language(ASM) in CMakeLists, CMake silently drops the .S file from the build tree. On x86-64 Linux and macOS the C side of libzstd still references the symbols exported by the assembly file (HUF_decompress4X1_usingDTable_internal_fast_asm_loop and its 4X2 sibling), so the final link fails with "Undefined symbols for architecture x86_64" whenever the host matches ARCH_AMD64 AND NOT WIN32. Linux x86-64 shows the same failure once the build actually reaches the link step. ARM64 and Windows are unaffected because they skip the .S file and set ZSTD_DISABLE_ASM=1, routing everything through the C fallback. The asmlib subdirectory's enable_language(ASM_NASM) is separate -- NASM is Intel-syntax and only handles Agner Fog's .asm files.
1 parent de85c22 commit c783aec

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

core/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(questdb)
33

4+
# Required for zstd's huf_decompress_amd64.S to be assembled. Without this,
5+
# CMake silently drops the .S file from the build and the link fails at
6+
# _HUF_decompress4X1_usingDTable_internal_fast_asm_loop etc. (The asmlib
7+
# subdirectory enables ASM_NASM separately for Agner Fog's .asm files.)
8+
enable_language(ASM)
9+
410
include(ExternalProject)
511

612
set(CMAKE_CXX_STANDARD 17)

0 commit comments

Comments
 (0)