[clang] [Clang][SYCL] Introduce clang-sycl-linker to link SYCL offloading device code (Part 1 of many) (PR #112245)

LLVM Continuous Integration via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 08:14:08 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `polly-x86_64-linux-shared-plugin` running on `polly-x86_64-gce2` while building `clang` at step 5 "build".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/118/builds/2728

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 5 (build) failure: 'ninja' (failure)
...
[3563/4239] Building CXX object tools/clang/tools/clang-offload-bundler/CMakeFiles/clang-offload-bundler.dir/ClangOffloadBundler.cpp.o
[3564/4239] Linking CXX executable bin/clang-offload-packager
[3565/4239] Building Opts.inc...
[3566/4239] Building CXX object tools/clang/tools/clang-scan-deps/CMakeFiles/clang-scan-deps.dir/clang-scan-deps-driver.cpp.o
[3567/4239] Linking CXX executable bin/clang-offload-bundler
[3568/4239] Building SYCLLinkOpts.inc...
[3569/4239] Building CXX object tools/clang/tools/clang-import-test/CMakeFiles/clang-import-test.dir/clang-import-test.cpp.o
[3570/4239] Linking CXX executable bin/clang-import-test
[3571/4239] Building CXX object tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o
[3572/4239] Linking CXX executable bin/clang-sycl-linker
FAILED: bin/clang-sycl-linker 
: && /usr/bin/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG -fuse-ld=lld -Wl,--color-diagnostics     -Wl,--gc-sections tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o -o bin/clang-sycl-linker  -Wl,-rpath,"\$ORIGIN/../lib:/home/worker/buildbot-workers/polly-x86_64-gce2/rundir/llvm.obj/lib:"  lib/libLLVMX86CodeGen.so.20.0git  lib/libLLVMX86AsmParser.so.20.0git  lib/libLLVMX86Desc.so.20.0git  lib/libLLVMX86Disassembler.so.20.0git  lib/libLLVMX86Info.so.20.0git  lib/libLLVMNVPTXCodeGen.so.20.0git  lib/libLLVMNVPTXDesc.so.20.0git  lib/libLLVMNVPTXInfo.so.20.0git  lib/libLLVMOption.so.20.0git  lib/libclangBasic.so.20.0git  -Wl,-rpath-link,/home/worker/buildbot-workers/polly-x86_64-gce2/rundir/llvm.obj/lib && :
ld.lld: error: undefined symbol: vtable for llvm::support::detail::format_adapter
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(llvm::support::detail::provider_format_adapter<llvm::StringRef&>::~provider_format_adapter())
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(llvm::support::detail::provider_format_adapter<int>::~provider_format_adapter())
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(llvm::support::detail::provider_format_adapter<llvm::SmallString<128u>&>::~provider_format_adapter())
>>> referenced 3 more times
>>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)

ld.lld: error: undefined symbol: llvm::SmallVectorBase<unsigned long>::grow_pod(void*, unsigned long, unsigned long)
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(llvm::SmallVectorImpl<char>::operator=(llvm::SmallVectorImpl<char>&&) (.isra.0))
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(llvm::SmallVectorImpl<char>::operator=(llvm::SmallVectorImpl<char> const&) (.isra.0))
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(void llvm::SmallVectorImpl<char>::append<char const*, void>(char const*, char const*))
>>> referenced 2 more times

ld.lld: error: undefined symbol: llvm::getAsUnsignedInteger(llvm::StringRef, unsigned int, unsigned long long&)
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(llvm::support::detail::provider_format_adapter<llvm::StringRef&>::format(llvm::raw_ostream&, llvm::StringRef))
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(llvm::support::detail::provider_format_adapter<llvm::SmallString<128u>&>::format(llvm::raw_ostream&, llvm::StringRef))

ld.lld: error: undefined symbol: llvm::raw_ostream::write(char const*, unsigned long)
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(llvm::support::detail::provider_format_adapter<llvm::StringRef&>::format(llvm::raw_ostream&, llvm::StringRef))
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(llvm::support::detail::provider_format_adapter<llvm::SmallString<128u>&>::format(llvm::raw_ostream&, llvm::StringRef))
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:(llvm::raw_ostream::operator<<(char const*))
>>> referenced 3 more times

ld.lld: error: undefined symbol: llvm::sys::fs::getMainExecutable[abi:cxx11](char const*, void*)
>>> referenced by ClangSYCLLinker.cpp
>>>               tools/clang/tools/clang-sycl-linker/CMakeFiles/clang-sycl-linker.dir/ClangSYCLLinker.cpp.o:((anonymous namespace)::getMainExecutable(char const*))

```

</details>

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


More information about the cfe-commits mailing list