GCC Cross-Compiler: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
Geist (talk | contribs)
add information on how to cross compile GDB
Line 86: Line 86:


'''--with-sysroot''' tells binutils to enable sysroot support in the cross-compiler by pointing it to a default empty directory. By default, the linker refuses to use sysroots for no good technical reason, while gcc is able to handle both cases at runtime. This will be useful later on.
'''--with-sysroot''' tells binutils to enable sysroot support in the cross-compiler by pointing it to a default empty directory. By default, the linker refuses to use sysroots for no good technical reason, while gcc is able to handle both cases at runtime. This will be useful later on.

=== GDB ===

Tit may be worth noting that if you wish to use ```GDB```, and you are running on a different computer architecture than you OS (most common case is developing for ARM on x86_64 or x86_64 on ARM), you need to cross-compile GDB separately. While technically a part of Binutils, resides in a separate repository.

The protocol for building GDB to target a different architecture is very similar to that of regular Binutils:

<source lang="bash">
../gdb.x.y.z/configure --target=$TARGET --prefix="$PREFIX" --disable-werror
make all-gdb
make install-gdb
</source>

The ```--disable-nls``` and ```--with-sysroot`` options don't seem to have any effect.


=== GCC ===
=== GCC ===