Skip to content

LLVM with AMD backend fails to link binary object #6089

@ghost

Description

Describe the bug
LLVM compiler with AMD backend cannot link finally binary

To Reproduce
Please describe the steps to reproduce the behavior:

  1. Include code snippet as short as possible: N/A

  2. Specify the command which should be used to compile the program:

The final clang++ command for linking the binary that caused the failure was this:

/home/jaytong/sycl_workspace/llvm/build/bin/clang++ -v  -O3 -fsycl  -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx908   -Wall -Wno-unknown-pragmas -Wextra -stdlib=libstdc++ -fcolor-diagnostics -Qunused-arguments -O2 -g -DNDEBUG   CMakeFiles/ethminer.dir/main.cpp.o  -o ethminer   -L/home/jaytong/DPA_Projects/LIBS/json/1.9.5/lib/cmake/jsoncpp/../../../lib  -Wl,-rpath,/home/jaytong/DPA_Projects/LIBS/json/1.9.5/lib/cmake/jsoncpp/../../../lib:/home/jaytong/DPA_Projects/LIBS/boost/1.73.0/lib:/home/jaytong/DPA_Projects/LIBS/openssl/1.1.1f/lib: ../libethcore/libethcore.a ../libpoolprotocols/libpoolprotocols.a ../libdevcore/libdevcore.a libethminer-buildinfo.a /home/jaytong/DPA_Projects/LIBS/boost/1.73.0/lib/libboost_system.so.1.71.0 /home/jaytong/DPA_Projects/LIBS/boost/1.73.0/lib/libboost_thread.so.1.71.0 ../libapicore/libapicore.a -ljsoncpp /home/jaytong/DPA_Projects/LIBS/openssl/1.1.1f/lib/libssl.so /home/jaytong/DPA_Projects/LIBS/openssl/1.1.1f/lib/libcrypto.so ../libethcore/libethcore.a ../libethash-sycl/libethash-sycl.a ../libethcore/libethcore.a ../libethash-sycl/libethash-sycl.a /home/jaytong/DPA_Projects/LIBS/ethash/0.4.3/lib/libethash.a ../libhwmon/libhwmon.a -ldl ../libdevcore/libdevcore.a /home/jaytong/DPA_Projects/LIBS/boost/1.73.0/lib/libboost_system.so.1.71.0 -lpthread libethminer-buildinfo.a /home/jaytong/DPA_Projects/LIBS/boost/1.73.0/lib/libboost_filesystem.so.1.71.0

After specifying the -v in the clang++ command, the llvm-foreach reported an error after trying to do the following:

 "/home/jaytong/sycl_workspace/llvm/build/bin/llvm-foreach" --out-ext=out --in-file-list=/tmp/main-8dbbcf/main-gfx908.o --in-replace=/tmp/main-8dbbcf/main-gfx908.o --out-file-list=/tmp/main-f00a16/main-gfx908.out --out-replace=/tmp/main-f00a16/main-gfx908.out -- /home/jaytong/sycl_workspace/llvm/build/bin/clang-offload-bundler -unbundle -type=a -input=/home/jaytong/DPA_Projects/LIBS/json/1.9.5/lib/cmake/jsoncpp/../../../lib/libjsoncpp.a -targets=sycl-amdgcn-amd-amdhsa-gfx908 -output=/tmp/libbc-jsoncpp-amdgcn-gfx908-168cbe.a -allow-missing-bundles -hip-openmp-compatible
llvm-foreach: Couldn't find replace string for output in the command.
clang-15: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)

  1. Specify the comment which should be used to launch the program: N/A

  2. Indicate what is wrong and what was expected: It should link the binary

Environment (please complete the following information):

  • OS: Ubuntu 20.04.4

  • Target device and vendor: AMD MI100 gfx908

  • DPC++ version:
    clang version 15.0.0 (https://github.com/intel/llvm 9749efa845abce0cbdad531ce540b7d0804cd868) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/jaytong/sycl_workspace/llvm/build/bin

  • Dependencies version: ROCM 5.1.0 SDK

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockerBlocks important functionalitybugSomething isn't workinghelp wantedWe don't have ability to look into this at the moment, but contributions are welcomehipIssues related to execution on HIP backend.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions