For future reference as well, this can also be resolved by adding:
PKG_CXXFLAGS += -Wa,-mbig-obj
To the package’s Makevars file. For packages using rstantools-based installation, this can be implemented by adding the following to the bottom of the package’s configure and configure.win scripts:
configure:
# Add configuration needed for big object files
echo "PKG_CXXFLAGS += -Wa,-mbig-obj" >> ./src/Makevars
configure.win:
# Add configuration needed for big object files
echo "PKG_CXXFLAGS += -Wa,-mbig-obj" >> ./src/Makevars.win