Skip to content

Commit b38a8e0

Browse files
committed
[SYCL][Driver] Suppress device code link warnings from llvm-link
Driver reports following warnings each time we link `fat` object and `non-fat` object files. warning: Linking two modules of different data layouts: '/tmp/main-8fa6e0.o' is '' whereas 'llvm-link' is 'e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024' The reason is that driver "unbundles" all objects files including "non-fat" ones to get device code. Unbundler provides an empty file as device code of "non-fat" object file, which is linked with the device code unbundled from the "fat" objects. `llvm-link` emits warnings if data layout string of input LLVM modules doesn't match. This is common case when we link host-only static library to a SYCL application (e.g. Khronos SYCL CTS). This warning has no value for the compiler users, but might be very annoying. While we are working on good solution to this problem, let's suppress `llvm-link` warnings. Signed-off-by: Alexey Bader <alexey.bader@intel.com>
1 parent 0de6d9a commit b38a8e0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ const char *SYCL::Linker::constructLLVMLinkCommand(Compilation &C,
9090
CmdArgs.push_back(OutputFileName);
9191
} else
9292
CmdArgs.push_back(Output.getFilename());
93+
// TODO: temporary workaround for a problem with warnings reported by
94+
// llvm-link when driver links LLVM modules with empty modules
95+
CmdArgs.push_back("--suppress-warnings");
9396
SmallString<128> ExecPath(C.getDriver().Dir);
9497
llvm::sys::path::append(ExecPath, "llvm-link");
9598
const char *Exec = C.getArgs().MakeArgString(ExecPath);

0 commit comments

Comments
 (0)