Difference between revisions of "Gentoo: crossdev avr"
Lukas Dzunko (talk | contribs) (Created page with "== Cross compile ? == Cross compile is name of build process which produce machine code for different architecture. For example i am embed device developer and i am producing ...") |
Lukas Dzunko (talk | contribs) |
||
Line 9: | Line 9: | ||
=== required configuration === | === required configuration === | ||
crossdev is using onw local portage overlay to build target specific configuration. Following line is necessarily in /etc/make.conf. Of course you can use different location :) | crossdev is using onw local portage overlay to build target specific configuration. Following line is necessarily in /etc/make.conf. Of course you can use different location :) | ||
− | <pre>PORTDIR_OVERLAY="/opt/local/portage"<pre> | + | <pre>PORTDIR_OVERLAY="/opt/local/portage"</pre> |
If directory dont exist then create it | If directory dont exist then create it | ||
<pre>mkdir -p /opt/local/portage</pre> | <pre>mkdir -p /opt/local/portage</pre> | ||
Line 18: | Line 18: | ||
And you should see following: | And you should see following: | ||
<pre> | <pre> | ||
− | |||
* crossdev version: 20120721 | * crossdev version: 20120721 | ||
* Host Portage ARCH: amd64 | * Host Portage ARCH: amd64 | ||
Line 34: | Line 33: | ||
* PORTAGE_CONFIGROOT: | * PORTAGE_CONFIGROOT: | ||
* Portage flags: | * Portage flags: | ||
− | + | ||
− | |||
!!! WARNING - Cannot auto-configure CHOST avr | !!! WARNING - Cannot auto-configure CHOST avr | ||
!!! You should edit /usr/avr/etc/portage/make.conf | !!! You should edit /usr/avr/etc/portage/make.conf |
Revision as of 17:16, 3 August 2012
Contents
Cross compile ?
Cross compile is name of build process which produce machine code for different architecture. For example i am embed device developer and i am producing machine code for AVR platform on x86_64 workstation. Effectively i am doing cross compile on x86_64 to AVR target. I am writing source code in C language and partly in assembler.
Why sys-devel/crossdev ?
Because it is Gentoo specific tool to manage necessary software to perform cross compile (e.g. binutils, headers, libraries, and compiler). It is very simple to use so i save some of my time during installation of crossdev environment.
Installation of AVR target
sys-devel/crossdev
I recommend latest version of sys-devel/crossdev so first of all put this ebuild to package.keywords. This package don't have USE flags so it is enough to perform:
emerge crossdev
required configuration
crossdev is using onw local portage overlay to build target specific configuration. Following line is necessarily in /etc/make.conf. Of course you can use different location :)
PORTDIR_OVERLAY="/opt/local/portage"
If directory dont exist then create it
mkdir -p /opt/local/portage
! crossdev is using new layout of /etc/portage/package.* . If you don't migrated to this layout then you should to it now. New layout is expecting to /etc/portage/package.keywords/ (and all others) to be a directory and configuration is included in files inside of it. For example for AVR target you can find cross-avr there.
build of target specific code
Just invoke:
crossdev -t avr
And you should see following:
* crossdev version: 20120721 * Host Portage ARCH: amd64 * Target Portage ARCH: * * Target System: avr * Stage: 4 (C/C++ compiler) * ABIs: default * binutils: binutils-[latest] * gcc: gcc-[latest] * libc: avr-libc-[latest] * CROSSDEV_OVERLAY: /opt/local/portage * PORT_LOGDIR: /var/log/portage * PORTAGE_CONFIGROOT: * Portage flags: !!! WARNING - Cannot auto-configure CHOST avr !!! You should edit /usr/avr/etc/portage/make.conf !!! by hand to complete your configuration * Log: /var/log/portage/cross-avr-binutils.log * Emerging cross-binutils ...