OK, here's my issue :
- I'm working on a super-complex project and speed & performance is crucial - with lots of bit twiddling and low-level stuff (you may ask me if there's anything specific you need to know)
- I'm using a Mac
- I'm compiling and linking it using clang++
Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
All the optimization flags I'm currently using is -O3
(which, honestly, gave me an unexpected boost; so I didn't look any further; however I've still noticed other programs using a variety of flags... so I feel a bit lost...).
Is there anything else I should consider? And if so, what?
EDIT : (tried using -O4
and I'm getting errors; any ideas why this might be happening?)
0 0x10be24280 __assert_rtn + 144
1 0x10be89659 ld::tool::HeaderAndLoadCommandsAtom<x86_64>::copyEntryPointLoadCommand(unsigned char*) const + 169
2 0x10be8853c ld::tool::HeaderAndLoadCommandsAtom<x86_64>::copyRawContent(unsigned char*) const + 1084
3 0x10be7da56 ld::tool::OutputFile::writeAtoms(ld::Internal&, unsigned char*) + 598
4 0x10be79c14 ld::tool::OutputFile::writeOutputFile(ld::Internal&) + 564
5 0x10be74963 ld::tool::OutputFile::write(ld::Internal&) + 147
6 0x10be248ef main + 1263
7 0x10be13234 start + 52
A linker snapshot was created at:
/tmp/myapp-2013-00-31-150316.ld-snapshot
ld: Assertion failed: (_mode == modeFinalAddress), function finalAddress, file /SourceCache/ld64/ld64-133.3/src/ld/ld.hpp, line 657.
clang: error: linker command failed with exit code 1 (use -v to see invocation)