Difference between revisions of "Ubuntu 16.04 LTS Toolchain"

From IGEP - ISEE Wiki

Jump to: navigation, search
(Install apps, libraries or dev packages)
(Install apps, libraries or dev packages)
 
(One intermediate revision by the same user not shown)
Line 19: Line 19:
  
 
==Install apps, libraries or dev packages==
 
==Install apps, libraries or dev packages==
To install a package of the non-default architecture just specify that architecture on the command line: <span id="line-100" class="anchor"></span><span id="line-101" class="anchor"></span><span id="line-102" class="anchor"></span>
+
To install a package of the non-default architecture just specify that architecture on the command line:
  
<pre><span id="line-1-8" class="anchor"></span>apt-get install package:architecture</pre>
+
<pre>apt-get install package:architecture</pre>
That package's dependencies will be installed automatically for the correct architectures (same-arch library deps, machine-arch for other deps) <span id="line-104" class="anchor"></span>e.g <span id="line-105" class="anchor"></span><span id="line-106" class="anchor"></span><span id="line-107" class="anchor"></span>
+
That package's dependencies will be installed automatically for the correct architectures (same-arch library deps, machine-arch for other deps) e.g
 +
 
 +
<pre>apt-get install links:armhf</pre>
 +
<pre>dpkg -i package_version_architecture.deb
 +
dpkg -r package:architecture</pre>
  
<pre><span id="line-1-9" class="anchor"></span>apt-get install links:armhf</pre>
 
<pre><span id="line-1-10" class="anchor"></span>dpkg -i package_version_architecture.deb
 
<span id="line-2-1" class="anchor"></span>dpkg -r package:architecture</pre>
 
 
===Installing cross-dependencies===
 
===Installing cross-dependencies===
 
To install build-dependencies of a package before cross-building:
 
To install build-dependencies of a package before cross-building:

Latest revision as of 23:19, 22 June 2019

Before start

  • Download and install Ubuntu 16.04 LTS

Install the Toolchain

Before use the toolchain you need download and install it on your machine, you can do it with this command:

$ sudo apt-get install gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf g++-arm-linux-gnueabi g++-arm-linux-gnueabihf libc6-armel-cross libc6-armhf-cross libc6-dev-armhf-cross libc6-dev-armel-cross crossbuild-essential-armel crossbuild-essential-armhf qemu qemu-user-static binfmt-support build-essential

Setup Multiarch

It's recommended use Multiarch for add the headers, libraries that you can need for build ARM applications or libraries.

Add ARM hard float arch:

$ dpkg --add-architecture armhf

Modify apt sources and include arch repos:

deb [arch=i386,amd64] http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted

Note: armel is not provided in ubuntu 16.04 if you needed we suggested use debian stretch.

Install apps, libraries or dev packages

To install a package of the non-default architecture just specify that architecture on the command line:

apt-get install package:architecture

That package's dependencies will be installed automatically for the correct architectures (same-arch library deps, machine-arch for other deps) e.g

apt-get install links:armhf
dpkg -i package_version_architecture.deb
dpkg -r package:architecture

Installing cross-dependencies

To install build-dependencies of a package before cross-building:

apt-get build-dep -a  

This only works when all the 'tools' packages depended-on are marked Multi-Arch: foreign, any depended-on libraries which are also needed on the BUILD machine, and -dev packages which are needed for both HOST and BUILD architectures are made co-installable ('Multi-Arch: same' with arch-qualified paths), and any exceptions to the default rules are marked package:any or package:native in the package source. This process is ongoing.

When it doesn't work you can often get the dependencies installed with a manual apt-get line: e.g instead of

apt-get build-dep -a armhf acl

, do

apt-get install autoconf automake debhelper gettext libtool libattr1-dev:armhf