Skip to content

[opencl-aot][sycl][CMake][MSVC]: Wrap Linker flags for ICX #15756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

Maetveis
Copy link
Contributor

From CMake 3.25+ linker options need to be wrapped for ICX on Windows. Use the LINKER: prefix, which expands to the correct option for ICX, and for the empty string for MSVC or clang-cl.

See also LLVM RFC: https://discourse.llvm.org/t/rfc-cmake-linker-flags-need-wl-equivalent-for-intel-c-icx-on-windows/82446

Fixes: #15755

From CMake 3.25+ linker options need to be wrapped for ICX on Windows.
Use the `LINKER:` prefix, which expands to the correct option for ICX,
and for the empty string for MSVC or clang-cl.

See also LLVM RFC: https://discourse.llvm.org/t/rfc-cmake-linker-flags-need-wl-equivalent-for-intel-c-icx-on-windows/82446

Fixes: intel#15755
@Maetveis Maetveis requested review from a team as code owners October 18, 2024 14:25
Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Maetveis
Copy link
Contributor Author

@intel/dpcpp-tools-reviewers

@Maetveis
Copy link
Contributor Author

@intel/llvm-gatekeepers please merge.

@sarnex sarnex merged commit 71a0980 into intel:sycl Oct 23, 2024
13 checks passed
@Maetveis Maetveis deleted the wrap-icx-linker-flags branch December 5, 2024 12:54
steffenlarsen pushed a commit that referenced this pull request Dec 12, 2024
This is a continuation of #15756 unfortunately I missed some flags in
that patch because icx does not warn about options starting with `/O` or
`/D` (they are understood as optimization and macro defining flags).

I documented the approach of finding these unwrapped flags as a GH gist
here: https://gist.github.com/Maetveis/00567488f0d6ff74095d91ed306fafc5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unescaped linker flags when building with the Intel C++ Compiler on Windows and CMake > 3.25
4 participants