diff --git a/engine/cmake/strata_symbols.cmake b/engine/cmake/strata_symbols.cmake index e31ef7c1f6..303982f863 100644 --- a/engine/cmake/strata_symbols.cmake +++ b/engine/cmake/strata_symbols.cmake @@ -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("$<$:-g>" "$<$: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("$<$:-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("$<$: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("$<$: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("$<$:-gline-tables-only>") else() - add_compile_options("$<$:-g>" "$<$:SHELL:-Xcompiler -g>" - "$<$: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("$<$:-g>" "$<$:SHELL:-Xcompiler -g>") endif() message(STATUS "STRATA_KEEP_SYMBOLS: host debug information on (the code does not change)") endif() diff --git a/tools/packaging/build_sycl_linux.sh b/tools/packaging/build_sycl_linux.sh index f19e673b96..b6013467ef 100644 --- a/tools/packaging/build_sycl_linux.sh +++ b/tools/packaging/build_sycl_linux.sh @@ -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)