| 7 | | = Building a cross-compiler = |
|---|
| 8 | | TODO... |
|---|
| | 7 | == Building a cross-compiling toolchain == |
|---|
| | 8 | Next, use crossdev to build a cross-compile toolchain for the OSWALD. This can be using the following command: |
|---|
| | 9 | |
|---|
| | 10 | {{{ |
|---|
| | 11 | sudo crossdev -t armv7a-softfloat-linux-gnueabi |
|---|
| | 12 | }}} |
|---|
| | 13 | |
|---|
| | 14 | By default, crossdev will use the latest stable versions of the toolchain packages. If this does not work, you should manually select which versions to use for the various toolchain packages -- use the help output from crossdev to figure out how to do this. |
|---|
| | 15 | |
|---|
| | 16 | == Cross-compiling with portage == |
|---|
| | 17 | If crossdev successfully built a cross-compile toolchain, it should be located in the /usr/armv7a-softfloat-linux-gnueabi directory. In order to use the cross-compiler it is easiest to use some wrapper scripts provided by the crossdev-wrappers package that setup the necessary environment variables. Therefore, install crossdev-wrappers and it should automatically initialize the armv7a-softfloat-linux-gnueabi cross-compile toolchain. |
|---|
| | 18 | |
|---|
| | 19 | Now you should be able to use either of the following commands |
|---|
| | 20 | |
|---|
| | 21 | {{{ |
|---|
| | 22 | emerge-wrapper --target armv7a-softfloat-linux-gnueabi <emerge options> |
|---|
| | 23 | }}} |
|---|
| | 24 | |
|---|
| | 25 | or |
|---|
| | 26 | |
|---|
| | 27 | {{{ |
|---|
| | 28 | emerge-armv7a-softfloat-linux-gnueabi |
|---|
| | 29 | }}} |
|---|
| | 30 | |
|---|
| | 31 | to cross-compile packages using portage. |
|---|
| | 32 | |
|---|
| | 33 | Also, the various compilers can be manually running using by prefixing the command with the CTARGET. For example, |
|---|
| | 34 | |
|---|
| | 35 | {{{ |
|---|
| | 36 | armv7a-softfloat-linux-gnueabi-gcc |
|---|
| | 37 | }}} |
|---|
| | 38 | |
|---|
| | 39 | should invoke the selected gcc compiler for the armv7a-softfloat-linux-gnueabi cross-compile toolchain. |