Hi Abby, this has generally only been an issue for local testing when using RStudio, the error doesn’t occur during normal installation of the package.
For adding the compiler flags you mentioned, you need to edit the configure
script in your package which calls rstantools. I’ve got examples of this here: Pkgbuild::compile_dll() on previously working rstantools-based package fails with "file too big" error - #17 by andrjohns
If that doesn’t work for you, feel free to leave a link to your package source and I’ll debug locally