[clang] hipcc/ld.lld unable to link separable compilation when dynamic librar… (PR #169551)
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 27 06:00:15 PST 2025
yxsamliu wrote:
> # 🐧 Linux x64 Test Results
> * 84769 tests passed
> * 1119 tests skipped
> * 1 test failed
>
> ## Failed Tests
> (click on a test name to see its output)
>
> ### Clang
> Clang.Driver/hip-partial-link.hip
> ```
> Exit Code: 1
>
> Command Output (stdout):
> --
> # RUN: at line 3
> /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc -nogpulib -fgpu-rdc -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/Inputs /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.1.o
> # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc -nogpulib -fgpu-rdc -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/Inputs /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.1.o
> # .---command stderr------------
> # | clang: warning: argument unused during compilation: '-nohipwrapperinc' [-Wunused-command-line-argument]
> # `-----------------------------
> # RUN: at line 7
> /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -x hip --target=x86_64-unknown-linux-gnu -DLIB --no-offload-new-driver --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc -nogpulib -fgpu-rdc -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/Inputs /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.2.o
> # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -x hip --target=x86_64-unknown-linux-gnu -DLIB --no-offload-new-driver --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc -nogpulib -fgpu-rdc -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/Inputs /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.2.o
> # .---command stderr------------
> # | clang: warning: argument unused during compilation: '-nohipwrapperinc' [-Wunused-command-line-argument]
> # `-----------------------------
> # RUN: at line 11
> /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -x hip --target=x86_64-unknown-linux-gnu -DMAIN --no-offload-new-driver --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc -nogpulib -fgpu-rdc -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/Inputs /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.main.o
> # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -x hip --target=x86_64-unknown-linux-gnu -DMAIN --no-offload-new-driver --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc -nogpulib -fgpu-rdc -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/Inputs /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.main.o
> # .---command stderr------------
> # | clang: warning: argument unused during compilation: '-nohipwrapperinc' [-Wunused-command-line-argument]
> # `-----------------------------
> # RUN: at line 15
> llvm-nm /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.1.o | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=OBJ1 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # executed command: llvm-nm /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.1.o
> # note: command had no output on stdout or stderr
> # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=OBJ1 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # note: command had no output on stdout or stderr
> # RUN: at line 20
> llvm-nm /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.2.o | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=OBJ2 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # executed command: llvm-nm /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.2.o
> # note: command had no output on stdout or stderr
> # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=OBJ2 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # note: command had no output on stdout or stderr
> # RUN: at line 27
> /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver --hip-link -fgpu-rdc --offload-arch=gfx906 -r -fuse-ld=lld -nostdlib /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.1.o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.2.o -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.lib.o 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=LD-R /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver --hip-link -fgpu-rdc --offload-arch=gfx906 -r -fuse-ld=lld -nostdlib /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.1.o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.2.o -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.lib.o
> # note: command had no output on stdout or stderr
> # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=LD-R /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # note: command had no output on stdout or stderr
> # RUN: at line 41
> llvm-nm /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.lib.o | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=OBJ /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # executed command: llvm-nm /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.lib.o
> # note: command had no output on stdout or stderr
> # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=OBJ /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # note: command had no output on stdout or stderr
> # RUN: at line 49
> /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver --hip-link -fgpu-rdc --offload-arch=gfx906 -fuse-ld=lld -nostdlib -r /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.main.o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.lib.o -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.final.o 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=LINK-O /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver --hip-link -fgpu-rdc --offload-arch=gfx906 -fuse-ld=lld -nostdlib -r /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.main.o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.lib.o -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.final.o
> # note: command had no output on stdout or stderr
> # error: command failed with exit status: 1
> # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=LINK-O /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # .---command stderr------------
> # | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip:53:16: error: LINK-O-NOT: excluded string found in input
> # | // LINK-O-NOT: Found undefined HIP {{.*}}symbol
> # | ^
> # | <stdin>:11:1: note: found here
> # | Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_40d633bfc93cab51
> # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> # |
> # | Input file: <stdin>
> # | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Driver/hip-partial-link.hip
> # |
> # | -dump-input=help explains the following input dump.
> # |
> # | Input was:
> # | <<<<<<
> # | .
> # | .
> # | .
> # | 6: Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
> # | 7: Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/13
> # | 8: Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/13
> # | 9: Candidate multilib: .;@m64
> # | 10: Selected multilib: .;@m64
> # | 11: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_40d633bfc93cab51
> # | not:53 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match expected
> # | 12: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_823bf80253f53d10
> # | 13: "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-offload-bundler" -type=o -targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx906 -input=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.main.o -output=/tmp/lit-tmp-l2rx1v86/hip-partial-link-8b009e.o -output=/tmp/lit-tmp-l2rx1v86/hip-partial-link-gfx906-c1485c.o -unbundle -allow-missing-bundles -verbose
> # | 14: Uncompressed bundle.
> # | 15: "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-offload-bundler" -type=o -targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx906 -input=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Driver/Output/hip-partial-link.hip.tmp.lib.o -output=/tmp/lit-tmp-l2rx1v86/hip-partial-link-cfc65e.o -output=/tmp/lit-tmp-l2rx1v86/hip-partial-link-gfx906-9e8cd8.o -unbundle -allow-missing-bundles -verbose
> # | 16: Uncompressed bundle.
> # | .
> # | .
> # | .
> # | >>>>>>
> # `-----------------------------
> # error: command failed with exit status: 1
>
> --
> ```
>
> If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.
Is the failure related to this change?
https://github.com/llvm/llvm-project/pull/169551
More information about the cfe-commits
mailing list