[compiler-rt] [ctx_profile] Integration test (PR #92456)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Sat May 18 08:42:17 PDT 2024


mtrofin wrote:

> This test fails for me, at least when doing a standalone build:
> 
> ```
> FAIL: CtxProfile-x86_64-linux :: TestCases/generate-context.cpp (2185 of 7045)
> ******************** TEST 'CtxProfile-x86_64-linux :: TestCases/generate-context.cpp' FAILED ********************
> Exit Code: 1
> 
> Command Output (stderr):
> --
> RUN: at line 4: mkdir -p /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/test/ctx_profile/X8
> 6_64LinuxConfig/TestCases/Output/generate-context.cpp.tmp_include
> + mkdir -p /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/test/ctx_profile/X86_64LinuxConfig/TestCases/Output/generate-context.cpp.tmp_include
> RUN: at line 5: cp /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/llvm/include/llvm/ProfileData/CtxInstrContextNode.h /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/test/ctx_profile/X86_64LinuxConfig/TestCases/Output/generate-context.cpp.tmp_include/
> + cp /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/llvm/include/llvm/ProfileData/CtxInstrContextNode.h /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/test/ctx_profile/X86_64LinuxConfig/TestCases/Output/generate-context.cpp.tmp_include/
> RUN: at line 8: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/lib/llvm/19/bin/clang  --driver-mode=g++ -ldl -lpthread /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt/test/ctx_profile/TestCases/generate-context.cpp -lclang_rt.ctx_profile -I/var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/test/ctx_profile/X86_64LinuxConfig/TestCases/Output/generate-context.cpp.tmp_include -O2 -o /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/test/ctx_profile/X86_64LinuxConfig/TestCases/Output/generate-context.cpp.tmp.bin -mllvm -profile-context-root=theRoot
> + /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/lib/llvm/19/bin/clang --driver-mode=g++ -ldl -lpthread /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt/test/ctx_profile/TestCases/generate-context.cpp -lclang_rt.ctx_profile -I/var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/test/ctx_profile/X86_64LinuxConfig/TestCases/Output/generate-context.cpp.tmp_include -O2 -o /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/test/ctx_profile/X86_64LinuxConfig/TestCases/Output/generate-context.cpp.tmp.bin -mllvm -profile-context-root=theRoot
> x86_64-pc-linux-gnu-ld: error: unable to find library -lclang_rt.ctx_profile
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> --
> 
> ********************
> ```
> 
> The library's at:
> 
> ```
> /var/tmp/portage/sys-libs/compiler-rt-sanitizers-19.0.0_pre20240518/work/compiler-rt_build/lib/clang/19/lib/linux/libclang_rt.ctx_profile-x86_64.a
> ```
> 
> So I guess it's missing the suffix and/or `-L`?

Can you give more context - is this on a bot, or can you give me the cmake invocation - for example, if I do `cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../llvm -DLLVM_ENABLE_PROJECTS="clang;compiler-rt"`, then `ninja check-ctx_profile`, the test passes fine and the library is under `$MY_BUILD_DIR/lib/clang/19/lib/x86_64-unknown-linux-gnu/libclang_rt.ctx_profile.a` - so no suffix. I'm trying to understand what would make it have a suffix, basically.

Thanks!

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


More information about the llvm-commits mailing list