Hadrian passes -rtsopts when building libraries
Hadrian shows many warnings of the form
Warning: -rtsopts and -with-rtsopts have no effect with -shared.
Call hs_init_ghc() from your main() function to set these options.
while building ghc.
I believe this is because of the line
, not (nonHsMainPackage pkg) ? arg "-rtsopts"
in hadrian/src/Settings/Builders/Ghc.hs