[clang] [llvm] [HLSL][SPIRV] Add support for -g to generate NonSemantic Debug Info (PR #187051)

Diego Novillo via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 08:17:10 PDT 2026


dnovillo wrote:

> @dnovillo Sorry for the delay, here are the repro steps
> 
> ```
> git clone https://github.com/llvm/llvm-project.git
> cd llvm-project
> git revert --no-commit 09951fd4757ef3b2f37500b52ecdf74ffd46ee50
> mkdir build
> cd build
> wget https://github.com/oneapi-src/level-zero/releases/download/v1.28.2/level-zero_1.28.2+u22.04_amd64.deb -O l0.deb
> wget https://github.com/oneapi-src/level-zero/releases/download/v1.28.2/level-zero-devel_1.28.2+u22.04_amd64.deb -O l0-sdk.deb
> dpkg-deb -x l0.deb level_zero
> dpkg-deb -x l0-sdk.deb level_zero
> export PATH=$PATH:`pwd`/level_zero/usr/lib/x86_64-linux-gnu:`pwd`/level_zero/usr/include
> cmake -GNinja ../llvm -DLLVM_RUNTIME_TARGETS='default;spirv64-intel' -DRUNTIMES_spirv64-intel_LLVM_ENABLE_RUNTIMES=openmp -DLLVM_TARGETS_TO_BUILD="X86;SPIRV" -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="openmp;offload" -DCMAKE_BUILD_TYPE=Release -DLIBOMPTARGET_PLUGINS_TO_BUILD=level_zero 
> ninja
> ln -s `readlink -f ./lib/spirv64-intel/libomptarget-spirv.bc` lib/
> ln -s `readlink -f ./runtimes/runtimes-bins/openmp/runtime/src/libomp.so` lib/
> bin/clang -fopenmp -fopenmp-targets=spirv64-intel ../offload/test/offloading/info.c -g
> ```
> 
> I used a fresh Ubuntu 24.04 Docker with only some basic compilation deps installed, so the above steps should work on a Debian/Ubuntu based system. Let me know if you have any issues.

Thanks. These instructions gave me a local reproducer. I'll debug and post a fix.

Question for future work in this area. The instructions above seem pretty convoluted. Is this the only way I have to test openmp? How can I make it so `ctest` works with these?

https://github.com/llvm/llvm-project/pull/187051


More information about the llvm-commits mailing list