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

Windows compiler builds broken with "number of sections exceeded object file format limit" #18785

Closed
ScottTodd opened this issue Oct 15, 2024 · 3 comments · Fixed by #18797
Closed
Assignees
Labels
bug 🐞 Something isn't working infrastructure Relating to build systems, CI, or testing platform/windows 🚪 Windows-specific build, execution, benchmarking, and deployment

Comments

@ScottTodd
Copy link
Member

ScottTodd commented Oct 15, 2024

What happened?

The nightly Windows compiler build at https://github.com/iree-org/iree/actions/workflows/ci_windows_x64_msvc.yml?query=branch%3Amain+event%3Aschedule has been failing for 2 weeks.

There were two issues, one of which is fixed:

  • https://github.com/iree-org/iree/actions/runs/11159458848/job/31017884277#step:7:6258

    FAILED: llvm-external-projects/stablehlo/stablehlo/transforms/CMakeFiles/obj.StablehloPasses.dir/ChloLegalizeToStablehlo.cpp.obj 
    C:\ProgramData\Chocolatey\bin\ccache C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -ID:\a\iree\iree\third_party\llvm-project\llvm\include -ID:\a\iree\iree\build-windows\llvm-project\include -ID:\a\iree\iree\third_party\llvm-project\mlir\include -ID:\a\iree\iree\third_party\stablehlo -ID:\a\iree\iree\build-windows\llvm-external-projects\stablehlo -ID:\a\iree\iree\third_party\llvm-project\lld\include -ID:\a\iree\iree\build-windows\llvm-project\tools\lld\include -external:I\..\mlir\include -external:ID:\a\iree\iree\build-windows\llvm-project\tools\mlir\include -external:W0 /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -wd4251 -wd4275 -w14062 -we4238 /Gw /Z7 /O2 /Ob1  -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Follvm-external-projects\stablehlo\stablehlo\transforms\CMakeFiles\obj.StablehloPasses.dir\ChloLegalizeToStablehlo.cpp.obj /Fdllvm-external-projects\stablehlo\stablehlo\transforms\CMakeFiles\obj.StablehloPasses.dir\ /FS -c D:\a\iree\iree\third_party\stablehlo\stablehlo\transforms\ChloLegalizeToStablehlo.cpp
    D:\a\iree\iree\third_party\stablehlo\stablehlo\transforms\ChloLegalizeToStablehlo.cpp(1324): error C2065: 'M_PI': undeclared identifier
    D:\a\iree\iree\third_party\stablehlo\stablehlo\transforms\ChloLegalizeToStablehlo.cpp(1324): error C2660: 'mlir::stablehlo::getConstantLike': function does not take 3 arguments
    D:\a\iree\iree\third_party\stablehlo\stablehlo/transforms/PassUtils.h(51): note: see declaration of 'mlir::stablehlo::getConstantLike'
    

    This was fixed upstream with openxla/stablehlo@d40285e .

  • https://github.com/iree-org/iree/actions/runs/11177542382/job/31073238335#step:7:6386

    FAILED: llvm-external-projects/stablehlo/stablehlo/dialect/CMakeFiles/obj.VhloOps.dir/VhloOps.cpp.obj 
    C:\ProgramData\Chocolatey\bin\ccache C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 -D_HAS_EXCEPTIONS=0 -D_USE_MATH_DEFINES -ID:\a\iree\iree\third_party\llvm-project\llvm\include -ID:\a\iree\iree\build-windows\llvm-project\include -ID:\a\iree\iree\third_party\llvm-project\mlir\include -ID:\a\iree\iree\third_party\stablehlo -ID:\a\iree\iree\build-windows\llvm-external-projects\stablehlo -ID:\a\iree\iree\third_party\llvm-project\lld\include -ID:\a\iree\iree\build-windows\llvm-project\tools\lld\include -external:I\..\mlir\include -external:ID:\a\iree\iree\build-windows\llvm-project\tools\mlir\include -external:W0 /DWIN32 /D_WINDOWS /EHsc /Z7 /O2 /Ob1  -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Follvm-external-projects\stablehlo\stablehlo\dialect\CMakeFiles\obj.VhloOps.dir\VhloOps.cpp.obj /Fdllvm-external-projects\stablehlo\stablehlo\dialect\CMakeFiles\obj.VhloOps.dir\ /FS -c D:\a\iree\iree\third_party\stablehlo\stablehlo\dialect\VhloOps.cpp
    cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
    cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
    D:\a\iree\iree\third_party\stablehlo\stablehlo\dialect\VhloOps.cpp : fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj
    

    This needs a fix or workaround.

Steps to reproduce your issue

Build the IREE compiler on Windows. I can reproduce what the CI sees on my local machine.

What component(s) does this issue relate to?

Compiler

Version information

Ignoring the first failure on nightly run id 52 (which should be fixed), the diff between run id 52 and 53 is 718b4fd...79e979f . Something in there introduced the second failure.

Additional context

No response

@ScottTodd ScottTodd added bug 🐞 Something isn't working infrastructure Relating to build systems, CI, or testing platform/windows 🚪 Windows-specific build, execution, benchmarking, and deployment labels Oct 15, 2024
@ScottTodd ScottTodd self-assigned this Oct 15, 2024
@benvanik
Copy link
Collaborator

c7a9af7 ? (unless we just hit a global max with our own new code)
we could try compiling stablehlo on its own to see if it fails

@ScottTodd
Copy link
Member Author

Build passed at f39884d, the commit just prior to c7a9af7. Checking that next.

@ScottTodd
Copy link
Member Author

Failed at c7a9af7

So something in here: iree-org/stablehlo@1855c9b...d40285e

GleasonK pushed a commit to openxla/stablehlo that referenced this issue Oct 16, 2024
This fixes downstream build errors tracked at
iree-org/iree#18785.

Sample error message when building on Windows with MSVC:
```
FAILED: llvm-external-projects/stablehlo/stablehlo/dialect/CMakeFiles/obj.VhloOps.dir/VhloOps.cpp.obj
C:\ProgramData\Chocolatey\bin\ccache C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 -D_HAS_EXCEPTIONS=0 -D_USE_MATH_DEFINES -ID:\a\iree\iree\third_party\llvm-project\llvm\include -ID:\a\iree\iree\build-windows\llvm-project\include -ID:\a\iree\iree\third_party\llvm-project\mlir\include -ID:\a\iree\iree\third_party\stablehlo -ID:\a\iree\iree\build-windows\llvm-external-projects\stablehlo -ID:\a\iree\iree\third_party\llvm-project\lld\include -ID:\a\iree\iree\build-windows\llvm-project\tools\lld\include -external:I\..\mlir\include -external:ID:\a\iree\iree\build-windows\llvm-project\tools\mlir\include -external:W0 /DWIN32 /D_WINDOWS /EHsc /Z7 /O2 /Ob1  -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Follvm-external-projects\stablehlo\stablehlo\dialect\CMakeFiles\obj.VhloOps.dir\VhloOps.cpp.obj /Fdllvm-external-projects\stablehlo\stablehlo\dialect\CMakeFiles\obj.VhloOps.dir\ /FS -c D:\a\iree\iree\third_party\stablehlo\stablehlo\dialect\VhloOps.cpp
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
D:\a\iree\iree\third_party\stablehlo\stablehlo\dialect\VhloOps.cpp : fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj
```

I think our downstream Windows builds worked with
#2573 but they do not work with
#2575, without this change.
Hooray for compiler options whack-a-mole.
ScottTodd added a commit that referenced this issue Oct 16, 2024
Fixes #18785.

Alternative to #18794 (clean
roll-up, includes other commits... hopefully nothing else broke).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working infrastructure Relating to build systems, CI, or testing platform/windows 🚪 Windows-specific build, execution, benchmarking, and deployment
Projects
None yet
2 participants