Skip to content

Add -mbig-obj flag for windows debug builds - #223

Merged
gaborcsardi merged 4 commits into
r-lib:mainfrom
andrjohns:mbig-obj-win
Nov 4, 2026
Merged

gaborcsardi merged 4 commits into
r-lib:mainfrom
andrjohns:mbig-obj-win

Conversation

@andrjohns

Copy link
Copy Markdown
Contributor

A long-standing gripe for windows devs of stan-based R packages is the too many sections error when using devtools::load_all(), caused by compiling packages with debug symbols and no optimisation.

Traditionally, we've just advised users to add the -Wa,-mbig-obj flag to their Makevars when developing, but the queries are still raised and there can be confusion about when to remove the flag.

Adding the flag in pkgbuild directly would be a big help (both for user experience and reducing queries!)

Thanks!

@gaborcsardi

Copy link
Copy Markdown
Member

Thanks! Does this work on aarch64 Windows? Does it work with older compiler versions as well?

@gaborcsardi

Copy link
Copy Markdown
Member

I think we cannot use this on aarch64 windows (but FIXME), but it seems to work for all R versions we allow (R >= 3.5).

@gaborcsardi
gaborcsardi merged commit b6ead40 into r-lib:main Nov 4, 2026
28 of 29 checks passed
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