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

llvm compilation error on windows, duplicated command line option #42555

Closed
VFLashM opened this issue Jun 9, 2017 · 2 comments · Fixed by #82937
Closed

llvm compilation error on windows, duplicated command line option #42555

VFLashM opened this issue Jun 9, 2017 · 2 comments · Fixed by #82937
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. O-windows Operating system: Windows O-windows-msvc Toolchain: MSVC, Operating system: Windows

Comments

@VFLashM
Copy link
Contributor

VFLashM commented Jun 9, 2017

It's likely not a problem of rust itself, but should be noted anyway.

I get a bunch of errors when trying to compile stage1 on msvc-x64.

Example:

"C:\Programming\rust\build\x86_64-pc-windows-msvc\llvm\build\utils\FileCheck\FileCheck.vcxproj" (default target) (4)
 ->
(ResourceCompile target) ->
  RC : fatal error RC1106: invalid option: -ologo [C:\Programming\rust\build\x86_64-pc-windows-msvc\llvm\build\utils
\FileCheck\FileCheck.vcxproj]

It happens because resource compiler gets two /nologo flags for some reason.

Example from build log:

InitializeBuildStatus:
  Touching "FileCheck.dir\Release\FileCheck.tlog\unsuccessfulbuild".
CustomBuild:
  All outputs are up-to-date.
ClCompile:
  All outputs are up-to-date.
ResourceCompile:
  C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\rc.exe /D RC_VERSION_FIELD_1=4 /D RC_VERSION_FIELD_2=0
   /D RC_VERSION_FIELD_3=1 /D RC_VERSION_FIELD_4=0 /D "RC_FILE_VERSION=\\\"4.0.1\\\"" /D "RC_INTERNAL_NAME=\\\"FileC
  heck\\\"" /D "RC_PRODUCT_NAME=\\\"LLVM\\\"" /D "RC_PRODUCT_VERSION=\\\"4.0.1\\\"" /D WIN32 /D _HAS_EXCEPTIONS=0 /D
   GTEST_HAS_RTTI=0 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_SECURE_NO_WARNINGS /D _CRT_NONSTDC_NO_DEPRECATE /D _CRT_NONS
  TDC_NO_WARNINGS /D _SCL_SECURE_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /D UNICODE /D _UNICODE /D __STDC_CONSTANT_M
  ACROS /D __STDC_FORMAT_MACROS /D __STDC_LIMIT_MACROS /D "CMAKE_INTDIR=\\\"Release\\\"" /D _UNICODE /D UNICODE /l"0
  x0409" /I"C:\Programming\rust\build\x86_64-pc-windows-msvc\llvm\build\utils\FileCheck" /IC:\Programming\rust\src\l
  lvm\utils\FileCheck /I"C:\Programming\rust\build\x86_64-pc-windows-msvc\llvm\build\include" /IC:\Programming\rust\
  src\llvm\include /nologo /fo"FileCheck.dir\Release\windows_version_resource.res"  /nologo C:\Programming\rust\src\
  llvm\resources\windows_version_resource.rc
RC : fatal error RC1106: invalid option: -ologo [C:\Programming\rust\build\x86_64-pc-windows-msvc\llvm\build\utils\F
ileCheck\FileCheck.vcxproj]

It seems that one of these /nologo flags comes from build\x86_64-pc-windows-msvc\llvm\build\lib\cmake\llvm\AddLLVM.cmake (copied from src\llvm\cmake\modules\AddLLVM.cmake?).

I guess that the other one is automatically added by msbuild because of <SuppressStartupBanner>true</SuppressStartupBanner> option.

That option, in turn, controlled by CMAKE_VERBOSE_MAKEFILE which is false by default.

Removing /nologo from AddLLVM.cmake and running cmake manually helps.

@VFLashM
Copy link
Contributor Author

VFLashM commented Jun 9, 2017

Versions:
cmake: 3.9.0-rc2
msvs: vs 2017
windows sdk: 10.0.15063.0
rust: 76242ae

@sanxiyn sanxiyn added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-windows Operating system: Windows labels Jun 9, 2017
@retep998 retep998 added the O-windows-msvc Toolchain: MSVC, Operating system: Windows label Jun 9, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 27, 2017
@alkis
Copy link
Contributor

alkis commented Oct 16, 2017

This was fixed in cmake 3.9.0 onwards: https://gitlab.kitware.com/cmake/cmake/issues/16991.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 9, 2021
…_readme, r=Mark-Simulacrum

Update README.md to use the correct cmake version number

LLVM requires at least cmake 3.13.4 and cmake is only required to build
LLVM.

https://www.llvm.org/docs/CMake.html

Also closes rust-lang#42555
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 9, 2021
…_readme, r=Mark-Simulacrum

Update README.md to use the correct cmake version number

LLVM requires at least cmake 3.13.4 and cmake is only required to build
LLVM.

https://www.llvm.org/docs/CMake.html

Also closes rust-lang#42555
JohnTitor added a commit to JohnTitor/rust that referenced this issue Mar 9, 2021
…_readme, r=Mark-Simulacrum

Update README.md to use the correct cmake version number

LLVM requires at least cmake 3.13.4 and cmake is only required to build
LLVM.

https://www.llvm.org/docs/CMake.html

Also closes rust-lang#42555
@bors bors closed this as completed in 52d9792 Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. O-windows Operating system: Windows O-windows-msvc Toolchain: MSVC, Operating system: Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants