OS Specific Toolchain: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
Max (talk | contribs)
Add information on how to enable dynamic linking
Line 307: Line 307:


Note that the trailing slash is important as the raw crt*.o names are appended without first adding a slash.
Note that the trailing slash is important as the raw crt*.o names are appended without first adding a slash.


=== Dynamic linking ===
If you want to support dynamic linking with your toolchain, you need to...
* Pass the <tt>"--enable-shared"</tt> flag to the <tt>./configure</tt> scripts of both binutils and gcc
* Set <tt>LINK_SPEC</tt> in your "gcc/config/myos.h" so the gcc driver will pass the correct flags to the linker:

<source lang="C">
#undef LINK_SPEC
#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!shared: %{!static: %{rdynamic:-export-dynamic}}}"
</source>


=== Linker Options ===
=== Linker Options ===