Skip to content
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

[HIPIFY][Windows][VS][build][failure] clang/Driver/Options.inc(66,1): error C2365: 'clang::driver::options::OPT_': redefinition; previous definition was 'enumerator' #1021

Closed
emankov opened this issue Sep 14, 2023 · 1 comment
Assignees
Labels
build Building issue/fix clang clang compiler related issue or change failure failure MSVS MS Visual Studio-related Windows Windows only

Comments

@emankov
Copy link
Collaborator

emankov commented Sep 14, 2023

Occurred only on Windows during building hipify-clang by Visual Studios 2022 (17.7.3) and 2019 (16.11.29) against ToT LLVM 18.0.0git.

@emankov emankov added clang clang compiler related issue or change build Building issue/fix MSVS MS Visual Studio-related Windows Windows only failure failure labels Sep 14, 2023
@emankov emankov self-assigned this Sep 14, 2023
emankov added a commit to emankov/HIPIFY that referenced this issue Sep 15, 2023
…occurred on VS 2022 with ToT clang 18.0.0git

[Synopsis]
+ Root cause is LLVM's change [Driver] Refactor to use llvm Option's new Visibility flags (SHA-1: 9478f661c26fbc22491218477917df5d8d73c51c)
+ But LLVM/clang itself is built correctly by VS 2022

[Solution]
+ Explicit setting of `UseStandardPreprocessor` (`/Zc:preprocessor`) eliminates the preprocessor's macro redefinition error

[ToDo]
+ Check hipify-clang builds by MSVS 2017 and 2019 against ToT LLVM (18.0.0git), LLVM 17.0.0-preview, and LLVM 16.0.x
emankov added a commit that referenced this issue Sep 15, 2023
[HIPIFY][#1021][build][MSVS][fix][partial] Fix for `error C2365` occurred on VS 2022 with ToT clang 18.0.0git
emankov added a commit to emankov/HIPIFY that referenced this issue Sep 16, 2023
…ror C2365` occurred on VS 2019 with ToT clang 18.0.0git

+ Widen the range of `MSVC_VERSION` from 1930 (initial version of VS 2022 17.0.0) to 1920 (initial version of VS 2019 16.0.0)
+ [Reason] Conforming preprocessor is needed for LLVM 18.0.0git on VS 2019 as well
+ [Details]
  https://learn.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview?view=msvc-170
  https://learn.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview?view=msvc-160
emankov added a commit that referenced this issue Sep 16, 2023
[HIPIFY][#1021][#1022][build][MSVS][fix][partial] Fix for `error C2365` occurred on VS 2019 with ToT clang 18.0.0git
@emankov
Copy link
Collaborator Author

emankov commented Oct 5, 2023

Fixed by #1022 and #1023.

@emankov emankov closed this as completed Oct 5, 2023
@emankov emankov changed the title [HIPIFY][Windows][VS2022][build][failure] clang/Driver/Options.inc(66,1): error C2365: 'clang::driver::options::OPT_': redefinition; previous definition was 'enumerator' [HIPIFY][Windows][VS][build][failure] clang/Driver/Options.inc(66,1): error C2365: 'clang::driver::options::OPT_': redefinition; previous definition was 'enumerator' Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Building issue/fix clang clang compiler related issue or change failure failure MSVS MS Visual Studio-related Windows Windows only
Projects
None yet
Development

No branches or pull requests

1 participant