I've just noticed sth very weird.
I have 2 different tasks in my nimble file. One builds the project with --opt:size and one with --opt:speed. The thing is the resulting binary with the first option is over 900KB, while with --opt:speed it get down to 600-sth(!). How is that possible?
Nim version: 1.0.3 [MacOSX: amd64] - Compiled at 2019-11-09 (git hash: 7ea60f78b5bd90bd34c5b15e1a80d23fd41c36a8)
command options for 'mini' build:
nim c --gcc.options.speed="-O4 -Ofast -flto -march=native -fno-strict-aliasing -ffast-math -ldl" --gcc.options.linker="-flto -ldl" --clang.options.speed="-O4 -Ofast -flto -march=native -fno-strict-aliasing -ffast-math -ldl" --clang.options.linker="-flto -ldl" -d:release -d:mini -d:danger --passL:parser.a --threads:on --hints:off --opt:speed --gc:regions --path:src -o:arturo -f --nimcache:_cache --embedsrc --checks:off --overflowChecks:on src/main.nim
command options for 'full' (speed) build:
nim c --gcc.options.speed="-O4 -Ofast -flto -march=native -fno-strict-aliasing -ffast-math -ldl" --gcc.options.linker="-flto -ldl" --clang.options.speed="-O4 -Ofast -flto -march=native -fno-strict-aliasing -ffast-math -ldl" --clang.options.linker="-flto -ldl" -d:release -d:danger --passL:parser.a --threads:on --hints:off --opt:speed --gc:regions --path:src -o:arturo -f --nimcache:_cache --embedsrc --checks:off --overflowChecks:on src/main.nim
Any ideas?
passing -O4 will impli -O3
It's either -O3 or -Os, you can't have both at the same time hence the conflict.
Now it seems like there might still be an issue but without reproducible example it's hard to investigate. You can check with bloaty (https://github.com/google/bloaty) to have an idea if it's just text symbols that are taking space or if it's actual code for example.