Why do I need a Cross Compiler?: Difference between revisions

m
[unchecked revision][unchecked revision]
Line 42:
 
==== -lgcc ====
You disable the important [[libgcc]] library when you pass -nodefaultlibs (implied by -nostdlib). The compiler needs this library for many operations that it cannot do itself or that is more efficient to put into a shared function. You must pass this library at the end of the link line, after all the other object files and libraries, or the linker won't use it and you get strange linker errors. This is due to the classic static linking model where aan object filesfile from a static library is only pulled in if it is used by ana previous object file so far. Linking with [[libgcc]] must come after all the object files that might use it.
 
=== Options that you shouldn't pass to your Compiler ===
Anonymous user