Skip to content

[CMake][MSVC] Wrap more Linker flags for ICX #16284

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
Dec 12, 2024

Conversation

Maetveis
Copy link
Contributor

@Maetveis Maetveis commented Dec 5, 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

This is a continuation of intel#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
@Maetveis Maetveis requested a review from a team as a code owner December 5, 2024 14:15
@Maetveis
Copy link
Contributor Author

Maetveis commented Dec 9, 2024

@intel/llvm-gatekeepers can you merge please?

@Maetveis
Copy link
Contributor Author

ping @intel/llvm-gatekeepers again, this should work now with me in the org.

@steffenlarsen steffenlarsen merged commit ede906c into intel:sycl Dec 12, 2024
15 checks passed
@steffenlarsen
Copy link
Contributor

Sorry this flew under the radar, @Maetveis!

Maetveis added a commit to Maetveis/llvm that referenced this pull request Jan 28, 2025
CMake's check_linker_flag does no split flags by spaces, so the current
call passes the single option `"/OPT:REF LINKER:/OPT:ICF"`
with a space in it to link.exe. (The first `LINKER:` prefix is parsed).
This was also broken before ede906c
([CMake][MSVC] Wrap more Linker flags for ICX (intel#16284)), where it would
pass `"/OPT:REF /OPT:ICF"` as a single option.

This results in the check failing and so the build does not ever enable
these flags, even though they would be supported if the check was correct.

Use comma as the separator as supported by the `LINKER:` syntax to fix it.
steffenlarsen pushed a commit that referenced this pull request Jan 29, 2025
CMake's check_linker_flag does no split flags by spaces, so the current
call passes the single option `"/OPT:REF LINKER:/OPT:ICF"` with a space
in it to link.exe. (The first `LINKER:` prefix is parsed). This was also
broken before ede906c ([CMake][MSVC]
Wrap more Linker flags for ICX (#16284)), where it would pass `"/OPT:REF
/OPT:ICF"` as a single option.

This results in the check failing and so the build does not ever enable
these flags, even though they would be supported if the check was
correct.

Use comma as the separator as supported by the `LINKER:` syntax to fix
it.
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.

3 participants