build(release): symbol flags that never change the machine code: no HIP-language flag, icpx -g1, AppleClang line tables, sha1 build id on SYCL

Measured by the packaging forks with a control built in the same directory (owner decision 2026-11-25, option a: the shipped binary is the symbol build, so it
must be the same code):
- HIP: -Xarch_host -g changed .text, .hip_fatbin and .rodata of the Linux HIP engine and the Windows clang one: removed in both branches of
  engine/cmake/strata_symbols.cmake (HIP-language files get no flag; the C++ files keep -g).
- icpx (SYCL): -Xarch_host -g1, line tables only, byte-equal.
- AppleClang (Metal): -gline-tables-only; tools/packaging/mac/build_engine.sh must show __text byte-equal against a build without it, else ship no DWARF there.
- nvcc host compiler: -Xcompiler -g stays, to be shown equal (.text and .nv_fatbin) by the same-directory control of each CUDA package.
- tools/packaging/build_sycl_linux.sh passes -Wl,--build-id=sha1 so the symbol file can be found by the build id.
This commit is contained in:
Niko1221 committed 2026-11-25 12:49:03 +01:00
1 parent 2aed34d4e6
commit a5bfe0369b
2 files changed
+14 -7

No files matched your search

+13 -6
View File
@@ -10,7 +10,8 @@
# MSVC: /Z7 (the information lives in the .obj files, so parallel cl.exe and nvcc runs never share a .pdb), and the
# linker's /DEBUG with /OPT:REF /OPT:ICF given again, because /DEBUG alone turns the default folding off
# (that WOULD change the code). /PDBALTPATH keeps the build folder out of the exe.
# others: -g (clang and gcc: host code only, `-Xarch_host` for the HIP and SYCL device passes).
# others: -g on gcc and clang C/C++ files and on nvcc's host compiler; icpx: -Xarch_host -g1; AppleClang: -gline-tables-only; HIP-language files: nothing (a flag there changed the
# code). Each is shown with a same-build-directory control (tools/packaging/keep_symbols.py check) by the release scripts' owners.
include_guard(GLOBAL)
option(STRATA_KEEP_SYMBOLS "compile host code with debug information so a symbol file can be kept per release build (same machine code)" OFF)
if(STRATA_KEEP_SYMBOLS)
@@ -19,14 +20,20 @@ if(STRATA_KEEP_SYMBOLS)
add_link_options("LINKER:/DEBUG" "LINKER:/OPT:REF" "LINKER:/OPT:ICF" "LINKER:/INCREMENTAL:NO" "LINKER:/PDBALTPATH:%_PDB%")
elseif(WIN32)
# clang for Windows (the ROCm HIP build, MSVC target): CodeView through -g, linked by lld-link
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:-g>" "$<$<COMPILE_LANGUAGE:HIP>:SHELL:-Xarch_host -g>")
# (HIP-language files get no flag: -Xarch_host -g changed .text, .hip_fatbin and .rodata of the Linux HIP build, measured with a same-directory control)
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:-g>")
add_link_options("LINKER:/DEBUG" "LINKER:/OPT:REF" "LINKER:/OPT:ICF" "LINKER:/INCREMENTAL:NO" "LINKER:/PDBALTPATH:%_PDB%")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM")
# icpx -fsycl: -g would reach the device compile too (and the AOT backend); the host pass only
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:SHELL:-Xarch_host -g>")
# icpx -fsycl: -g would reach the device compile too (and the AOT backend), and -Xarch_host -g changed the code: the host pass with line tables
# only (-g1) is byte-equal
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:SHELL:-Xarch_host -g1>")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
# clang -g changes instruction selection a little: line tables only (the Mac release script keeps it only if __text is byte-equal, tools/packaging/mac/build_engine.sh)
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX,OBJCXX>:-gline-tables-only>")
else()
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX,OBJCXX>:-g>" "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler -g>"
"$<$<COMPILE_LANGUAGE:HIP>:SHELL:-Xarch_host -g>")
# gcc and clang host code, nvcc's host compiler. No HIP-language flag (see above): a HIP file's host side gets no debug information, the
# C++ files of the engine do.
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX,OBJCXX>:-g>" "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler -g>")
endif()
message(STATUS "STRATA_KEEP_SYMBOLS: host debug information on (the code does not change)")
endif()
+1 -1
View File
@@ -48,7 +48,7 @@ override=${STRATA_GGML_DIR:-${LLAMA_CPP:-}}
[ -z "$override" ] || ggml="-DSTRATA_GGML_DIR=$override"
# shellcheck disable=SC2086
cmake -S engine/sycl -B "$build" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \
-DSTRATA_SYCL_PARITY=OFF -DSTRATA_SYCL_IQ_DECODE_FAST=${IQ_DECODE_FAST:-ON} ${aot:+"-DSTRATA_SYCL_AOT=$aot"} $ggml ${STRATA_CMAKE_EXTRA:-} $shape_cmake $sym_cmake # STRATA_CMAKE_EXTRA: e.g. -DSTRATA_GEOMETRY_FILE=/abs/path/geometry.hpp
-DSTRATA_SYCL_PARITY=OFF -DSTRATA_SYCL_IQ_DECODE_FAST=${IQ_DECODE_FAST:-ON} ${aot:+"-DSTRATA_SYCL_AOT=$aot"} "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--build-id=sha1" $ggml ${STRATA_CMAKE_EXTRA:-} $shape_cmake $sym_cmake # STRATA_CMAKE_EXTRA: e.g. -DSTRATA_GEOMETRY_FILE=/abs/path/geometry.hpp
cmake --build "$build" --target strata -j "$jobs"
ver=$(sed -n 's/^[[:space:]]*project([^)]*VERSION[[:space:]]*\([0-9][0-9.]*\).*/\1/p' engine/CMakeLists.txt | head -1)