Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/lib/Driver/ToolChains/MSVC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-defaultlib:sycl-devicelib-host.lib");
}

if (C.getDriver().IsCLMode() && Args.hasArg(options::OPT_fsycl))
CmdArgs.push_back("-defaultlib::sycl-devicelib-host.lib");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are good, can we add a test to check as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @mdtoguchi
Test is added, could you review again?
Thanks very much.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason why this lib is being added to the link command line and not being added to the default directives of the generated host object via --dependent-lib=sycl-device-lib-host?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @mdtoguchi
Just checked the code, “dependent-lib=sycl-devicelib-host” is the right approach, I will update the patch.

Thanks very much.

for (const auto *A : Args.filtered(options::OPT_foffload_static_lib_EQ))
CmdArgs.push_back(
Args.MakeArgString(Twine("-defaultlib:") + A->getValue()));
Expand Down