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

Apply /bigobj to fix debug builds on windows #197

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nofishleft
Copy link

@nofishleft nofishleft commented Dec 24, 2024

CMAKE_BUILD_TYPE: Debug
CMake: 3.30.5

Windows + MSVC 17.0 + Debug error:

cppfront/source/cppfront.cpp: "fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj"

Windows + MinGW 11.0 w64 + Debug:

Appeared to hang, 10+ min and hadn't finished compiling.

Fix:

Adding the bigobj flag fixed the issues with both msvc and mingw.
Added the fix for clang-cl as well, but haven't tested it.

Sources:

Sources for MSVC error/flag:
Fatal Error C1128
/bigobj (Increase Number of Sections in .Obj file)

Sources for MinGW flag:
Mingw-w64: How to fix “File too big/too many sections”
GCC equivalent of MS's /bigobj

Sources for clang-cl flag:
How to add /bigobj switch to clang with ms code gen?

Sources for determining compiler used:
MSVC
MinGW
clang-cl

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.

2 participants