[Documentation] [TitleIndex] [WordIndex

User Defined Toolchains

Custom toolchain configurations can be made using rostoolchain with the create argument. It will fire a battery of questions at you - these are explained in more detail below.

Once done, rostoolchain saves the module in your user-defined library.

Config Questions

Toolchain Family: this is a trivial string that is used to help uniquely identify your toolchain in eros' toolchain library - it has no other purpose when cross-compiling. Examples include generic, ubuntu, crossdev, code_sourcery.

Toolchain Tuple: this is the tuple used to describe your toolchain. It is usually a set of 4 words separated by dashes, e.g. arm-samsung-linux-gnueabi. The typical meanings for the words in the tuple are cpu-vendor-platform-clib. If using gnu gcc/g++, this will have to exactly match your the prefix to your gcc. For example, if your crossed gcc is arm-samsung-linux-gnueabi-gcc, then your tuple is arm-samsung-linux-gnueabi.

Toolchain Sysroot: this is the directory under which your toolchain can expect to find all of its headers and libraries. i.e. you should be able to find lib/, usr/includeusr/lib` under here with libpthread.so in the lib folder. Embedded toolchains are flagrantly non-standard as where these folders lie though, e.g. for fedora's cross compilers its something like

/usr/armv5tel-redhat-linux-gnueabi/sys-root

for code sourcery's (installed via eros):

/usr/${arm-none-linux-gnueabi}/libc

Basically, track down where the pthread library is and remove the lib from the path. If you're not sure, you can get your crossed gcc to give you a pointer by running with the -print-search-dirs argument. For example,

> i686-pc-linux-gnu-gcc -print-search-dirs
install: /usr/lib/gcc/i686-pc-linux-gnu/4.4.2/
programs: =/usr/libexec/gcc/i686-pc-linux-gnu/4.4.2/:/usr/libexec/gcc/i686-pc-linux-gnu/4.4.2/:/usr/libexec/gcc/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/:/usr/lib/gcc/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../i686-pc-linux-gnu/bin/i686-pc-linux-gnu/4.4.2/:/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../i686-pc-linux-gnu/bin/
libraries: =/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/:/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../i686-pc-linux-gnu/lib/i686-pc-linux-gnu/4.4.2/:/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../i686-pc-linux-gnu/lib/:/usr/i686-pc-linux-gnu/lib/i686-pc-linux-gnu/4.4.2/:/usr/i686-pc-linux-gnu/lib/:/usr/i686-pc-linux-gnu/usr/lib/i686-pc-linux-gnu/4.4.2/:/usr/i686-pc-linux-gnu/usr/lib/

The last pathname gives you a good clue as to where it expects to find its user libraries. Just remove the usr/lib component and you have a good candidate for your sysroot. You can verify it by cd'ing to that folder and checking that the appropriate pthreads library is there. Use the file command to get information about that library's build (e.g. to check that it is an ARM library, not an i686 library).

Toolchain Install Prefix: : this is where you want headers and libraries for toolchain bridge packages to be installed. Typically this is just ${TOOLCHAIN_SYSROOT}/usr, however be aware that some toolchains will only search lib and not usr/lib for libraries.


2022-05-28 12:34