use -O2 for libraries and stage2 compiler by default