SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
Cross-compiling Linux Kernels on
x86_64: A tutorial on How to Get
Started

Shuah Khan
Senior Linux Kernel Developer – Open Source Group
Samsung Research America (Silicon Valley)
shuah.kh@samsung.com
Agenda
●

Cross-compile value proposition

●

Preparing the system for cross-compiler installation

●

Cross-compiler installation steps

●

Demo – install arm and arm64

●

Compiling on architectures

●

Demo – compile arm and arm64

●

Automating cross-compile testing

●

Upstream cross-compile testing activity

●

References and Package repositories

●

Q&A
Cross-compile value proposition
●

●

●

●

●

30+ architectures supported (several sub-archs)
Native compile testing requires wide range of test
systems – not practical
Ability to cross-compile non-natively on an widely
available architecture helps detect compile errors
Coupled with emulation environments (e.g: qemu) testing
on non-native architectures becomes easier
Setting up cross-compile environment is the first and
necessary step
arch/
alpha
frv
microblaze

arc
h8300
arm

s390

hexagon
arm64

unicore32

mn10300

avr32

sh
openrisc

m32r
blackfin

sparc

m68k

tile
powerpc

metag

xtensa
x86

parisc

c6x

x86_64

score

ia64

cris

um

mips
Cross-compiler packages
●

Ubuntu arm packages (12.10 or later)
–
–

●

gcc-arm-linux-gnueabi
gcc-arm-linux-gnueabihf

Ubuntu arm64 packages (13.04 or later) – use arm64
repo for older Ubuntu releases.
–

●

gcc-4.7-aarch64-linux-gnu

Ubuntu keeps adding support for compilers. Search
Ubuntu repository for packages.
Cross-compiler packages
●

Embedded Debian Project is a good resource for alpha,
mips, mipsel, powerpc, sh, and sparc cross-compilers.
–

gcc-4.7-alpha-linux-gnu

–

gcc-4.7-mips-linux-gnu

–

gcc-4.7-mipsel-linux-gnu

–

gcc-4.7-powerpc-linux-gnu

–

gcc-4.7-sh4-linux-gnu

–

gcc-4.7-sparc-linux-gnu
Cross-compiler packages
●

Fedora repo and Fedora Epel Repo are a good sources for several
cross-compilers and binutils rpms
–

blackfin

–

binutils-bfin-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm
● gcc-bfin-linux-gnu-4.7.1-0.1.20120606.fc17.x86_64.rpm
c6x
●

●
●

–

binutils-c6x-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm
gcc-c6x-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm

tile
●
●

binutils-tile-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm
gcc-tile-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm
Preparing the system for
cross-compiler installation
●

Choose an x86-64 system

●

Install Ubuntu 12.10 or later.
–

Ubuntu 13.04 Install
Install common packages
sudo apt-get install build-essential

sudo apt-get install binutils-multiarch

sudo apt-get install ncurses-dev

sudo apt-get install alien

Note: ncurses-dev is required to run menuconfig and alien to generate .deb from .rpm
Configure apt for arm64 repo
(Ubuntu 12.10)
wget -O - http://people.debian.org/~wookey/bootstrap/bootstrap-archive.key | sudo apt-key add

sudo apt-add-repository 'deb http://people.debian.org/~wookey/bootstrap/ubunturepo/ quantal-bootstrap main'

sudo apt-get update
Configure apt for emdebian repo

sudo apt-get install emdebian-archive-keyring

Create /etc/apt/sources.list.d/emdebian.list file with the following line:
deb http://www.emdebian.org/debian/ sid main
Download rpms from fedora repo
●

blackfin rpms:
–
–

●

binutils-bfin-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm
gcc-bfin-linux-gnu-4.7.1-0.1.20120606.fc17.x86_64.rpm

c6x rpms:
–
–

●

binutils-c6x-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm
gcc-c6x-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm

tile rpms
–

binutils-tile-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm

–

gcc-tile-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm

–

Note: gcc-tile-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm is
what you want. The older version is missing feedback.h, tilegx needs.
Convert rpms to .deb
sudo alien -d binutils-bfin-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm
sudo alien -d gcc-bfin-linux-gnu-4.7.1-0.1.20120606.fc17.x86_64.rpm

sudo alien -d binutils-c6x-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm
sudo alien -d gcc-c6x-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm
sudo alien -d binutils-tile-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm
sudo alien -d gcc-tile-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm

You will see warnings about missing keys e.g: below which you can safely ignore.
warning: gcc-tile-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm:
Header V3 RSA/SHA256 Signature, key ID 1aca3465: NOKEY
Resulting .debs
➔

binutils-bfin-linux-gnu_2.23.51.0.3-2_amd64.deb

➔

binutils-c6x-linux-gnu_2.23.51.0.3-2_amd64.deb

➔

binutils-tile-linux-gnu_2.23.51.0.3-2_amd64.deb

➔

gcc-bfin-linux-gnu_4.7.1-1.1_amd64.deb

➔

gcc-c6x-linux-gnu_4.7.2-3_amd64.deb

➔

gcc-tile-linux-gnu_4.7.2-3_amd64.deb
Install cross-compilers
alpha
sudo apt-get install --install-recommends gcc-4.7-alpha-linux-gnu
sudo ln -s /usr/bin/alpha-linux-gnu-gcc-4.7 /usr/bin/alpha-linux-gnu-gcc
arm
sudo apt-get install gcc-arm-linux-gnueabi
arm64
sudo apt-get install --install-recommends gcc-4.7-aarch64-linux-gnu
sudo ln -s /usr/bin/aarch64-linux-gnu-gcc-4.7 /usr/bin/aarch64-linux-gnu-gcc
mips
sudo apt-get install --install-recommends gcc-4.7-mips-linux-gnu
sudo ln -s /usr/bin/mips-linux-gnu-gcc-4.7 /usr/bin/mips-linux-gnu-gcc
mipsel
sudo apt-get install --install-recommends gcc-4.7-mipsel-linux-gnu
sudo ln -s /usr/bin/mipsel-linux-gnu-gcc-4.7 /usr/bin/mipsel-linux-gnu-gcc
Install cross-compilers
powerpc
sudo apt-get install --install-recommends gcc-4.7-powerpc-linux-gnu
sudo ln -s /usr/bin/powerpc-linux-gnu-gcc-4.7 /usr/bin/powerpc-linux-gnu-gcc
sh
sudo apt-get install --install-recommends gcc-4.7-sh4-linux-gnu
sudo ln -s /usr/bin/sh4-linux-gnu-gcc-4.7 /usr/bin/sh4-linux-gnu-gcc
arm64
sudo apt-get install --install-recommends gcc-4.7-aarch64-linux-gnu
sudo ln -s /usr/bin/aarch64-linux-gnu-gcc-4.7 /usr/bin/aarch64-linux-gnu-gcc
sparc
sudo apt-get install --install-recommends gcc-4.7-sparc-linux-gnu
sudo ln -s /usr/bin/sparc-linux-gnu-gcc-4.7 /usr/bin/sparc-linux-gnu-gcc
Note: Creating link to *arch*-linux-gnu-gcc is necessary as the
CROSS_COMPILE directive
to find the compilers.
Install cross-compilers from .debs
blackfin
sudo dpkg -i binutils-bfin-linux-gnu_2.23.51.0.3-2_amd64.deb
sudo dpkg -i gcc-bfin-linux-gnu_4.7.1-1.1_amd64.deb

c6x
sudo dpkg -i binutils-c6x-linux-gnu_2.23.51.0.3-2_amd64.deb
sudo dpkg -i gcc-c6x-linux-gnu_4.7.2-3_amd64.deb

tile
sudo dpkg -i binutils-tile-linux-gnu_2.23.51.0.3-2_amd64.deb
sudo dpkg -i gcc-tile-linux-gnu_4.7.2-3_amd64.deb
arch/compile
alpha
frv
microblaze

arc
h8300
arm

s390

hexagon
arm64

unicore32

mn10300

avr32

sh
openrisc

m32r
blackfin

sparc

m68k

tile
powerpc

metag

xtensa
x86

parisc

c6x

x86_64

score

ia64

cris

um

mips
Building from sources
●

Mauro Chehab's build_cross script
–

downloads compiler sources for a specified arch from
gnu repo, builds and installs.

–

Usage: build_cross arm

–

Runs on fedora
Demo arm and arm64 install
Compilation Tips
●

●

●

If make ARCH=arch defconfig fails on an arch, pick a
config to test from arch/*/configs
Some architectures don't support defconfig in
cross-compile mode. e.g: powerpc.
In some cases, you might see errors in LD phase, and
please keep in mind these are just compile tests.
Cross-compiling
alpha
make distclean
make ARCH=alpha defconfig
ARCH=alpha CROSS_COMPILE=alpha-linux-gnu- make all
arm
make distclean
make ARCH=arm defconfig
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make all
arm64 (3.7 and later)
make distclean
make ARCH=arm64 defconfig
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make all
blackfin
make distclean
make ARCH=blackfin defconfig
ARCH=blackfin CROSS_COMPILE=bfin-linux-gnu- make all
Cross-compiling
c6x (3.4 and later)
make distclean
make ARCH=c6x defconfig
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make all
mips
make distclean
make ARCH=mips defconfig
ARCH=mips CROSS_COMPILE=mips-linux-gnu- make all
mipsel
make distclean
make ARCH=mips defconfig
ARCH=mips CROSS_COMPILE=mipsel-linux-gnu- make all
powerpc
make distclean
cp arch/powerpc/configs/wii_defconfig .config
ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- make all
Cross-compiling
sh
make distclean
make ARCH=sh defconfig
ARCH=sh CROSS_COMPILE=sh4-linux-gnu- make all

sparc
make distclean
make ARCH=sparc defconfig
ARCH=sparc CROSS_COMPILE=sparc-linux-gnu- make all

tile
make distclean
make ARCH=tile defconfig
ARCH=tile CROSS_COMPILE=tile-linux-gnu- make all
Demo arm and arm64 compilation
Automating cross-compile testing
●

●

●

Script – cross_compile.sh automates builds for the
compilers mentioned in this talk
ktest – crosstests.conf
Buildbot – tool for automating software builds. It can be
configured to checkout Linux kernel sources from git
repos and build.
Upstream Cross-compile testing
activity
●

Linux Kernel stable queue builds project
–

Guenter Rock keeps adding new compilers each
week.

–

Configs: allmodconfig, defconfig, configs with mmu
and without (nommu) where applicable.

–

qemu test results on selected architectures.
References and Package
repositories
●

ARMv8 Debian and Ubuntu bootstrap repositories

●

Embedded Debian Project

●

Fedora Repo

●

Fedora Epel Repo

●

Kernel.org - crosstool

●

Ubuntu 13.04 Install

●

Buildbot

●

Linux Kernel stable queue builds project

●

Ktest
Q&A
Thank you.

Shuah Khan
Senior Open Source Developer – Open Source Group
Samsung Research America (Silicon Valley)
shuah.kh@samsung.com
Summary
●

Cross-compiling Linux Kernels on x86_64: A tutorial on How to Get
Started

●

Agenda

●

Cross-compile value proposition

●

arch/

●

Cross-compiler packages

●

Cross-compiler packages

●

Cross-compiler packages

●

Preparing the system for cross-compiler installation

●

Install common packages

●

Configure apt for arm64 repo (Ubuntu 12.10)

●

Configure apt for emdebian repo

●

Download rpms from fedora repo

●

Convert rpms to .deb

●

Resulting .debs

●

Install cross-compilers

●

Install cross-compilers

●

Install cross-compilers from .debs

●

arch/compile

●

Building from sources

●

Compilation Tips

●

Cross-compiling

●

Cross-compiling

●

Cross-compiling

●

Automating cross-compile testing

●

Upstream Cross-compile testing activity

●

References and Package repositories

●

Thank you.

Más contenido relacionado

La actualidad más candente

How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)Sławomir Zborowski
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux SystemJian-Hong Pan
 
用十分鐘 向jserv學習作業系統設計
用十分鐘  向jserv學習作業系統設計用十分鐘  向jserv學習作業系統設計
用十分鐘 向jserv學習作業系統設計鍾誠 陳鍾誠
 
ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!Mr. Vengineer
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingTushar B Kute
 
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-VRISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-VScyllaDB
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File SystemAdrian Huang
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...Anne Nicolas
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013Wave Digitech
 
QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation Jiann-Fuh Liaw
 

La actualidad más candente (20)

How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)
 
Learn C Programming Language by Using GDB
Learn C Programming Language by Using GDBLearn C Programming Language by Using GDB
Learn C Programming Language by Using GDB
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux System
 
用十分鐘 向jserv學習作業系統設計
用十分鐘  向jserv學習作業系統設計用十分鐘  向jserv學習作業系統設計
用十分鐘 向jserv學習作業系統設計
 
ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-VRISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File System
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
 
The Internals of "Hello World" Program
The Internals of "Hello World" ProgramThe Internals of "Hello World" Program
The Internals of "Hello World" Program
 
Linux : PSCI
Linux : PSCILinux : PSCI
Linux : PSCI
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Ixgbe internals
Ixgbe internalsIxgbe internals
Ixgbe internals
 
GCC RTL and Machine Description
GCC RTL and Machine DescriptionGCC RTL and Machine Description
GCC RTL and Machine Description
 
QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation
 

Similar a Tutorial: Cross-compiling Linux Kernels on x86_64

Embedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformEmbedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformSZ Lin
 
3. configuring a compute node for nfv
3. configuring a compute node for nfv3. configuring a compute node for nfv
3. configuring a compute node for nfvvideos
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...Docker, Inc.
 
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...Christy Norman
 
LCU14 209- LLVM Linux
LCU14 209- LLVM LinuxLCU14 209- LLVM Linux
LCU14 209- LLVM LinuxLinaro
 
Realtime autonomous car for studying and ROS2 cross compiling
Realtime autonomous car for studying and ROS2 cross compilingRealtime autonomous car for studying and ROS2 cross compiling
Realtime autonomous car for studying and ROS2 cross compiling聖文 鄭
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Developing MIPS Exploits to Hack Routers
Developing MIPS Exploits to Hack RoutersDeveloping MIPS Exploits to Hack Routers
Developing MIPS Exploits to Hack RoutersOnur Alanbel
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactAlessandro Selli
 
Cross-compilation native sous android
Cross-compilation native sous androidCross-compilation native sous android
Cross-compilation native sous androidThierry Gayet
 
Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Levente Kurusa
 
Part 04 Creating a System Call in Linux
Part 04 Creating a System Call in LinuxPart 04 Creating a System Call in Linux
Part 04 Creating a System Call in LinuxTushar B Kute
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovPivorak MeetUp
 
Summit 16: OPNFV on ARM - Hardware Freedom of Choice Has Arrived!
Summit 16: OPNFV on ARM - Hardware Freedom of Choice Has Arrived!Summit 16: OPNFV on ARM - Hardware Freedom of Choice Has Arrived!
Summit 16: OPNFV on ARM - Hardware Freedom of Choice Has Arrived!OPNFV
 
Scylla Summit 2022: ScyllaDB Rust Driver: One Driver to Rule Them All
Scylla Summit 2022: ScyllaDB Rust Driver: One Driver to Rule Them AllScylla Summit 2022: ScyllaDB Rust Driver: One Driver to Rule Them All
Scylla Summit 2022: ScyllaDB Rust Driver: One Driver to Rule Them AllScyllaDB
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machineAlexei Starovoitov
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsBrendan Gregg
 

Similar a Tutorial: Cross-compiling Linux Kernels on x86_64 (20)

Embedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformEmbedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 Platform
 
3. configuring a compute node for nfv
3. configuring a compute node for nfv3. configuring a compute node for nfv
3. configuring a compute node for nfv
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
 
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
 
LCU14 209- LLVM Linux
LCU14 209- LLVM LinuxLCU14 209- LLVM Linux
LCU14 209- LLVM Linux
 
Realtime autonomous car for studying and ROS2 cross compiling
Realtime autonomous car for studying and ROS2 cross compilingRealtime autonomous car for studying and ROS2 cross compiling
Realtime autonomous car for studying and ROS2 cross compiling
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Developing MIPS Exploits to Hack Routers
Developing MIPS Exploits to Hack RoutersDeveloping MIPS Exploits to Hack Routers
Developing MIPS Exploits to Hack Routers
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compact
 
Cross-compilation native sous android
Cross-compilation native sous androidCross-compilation native sous android
Cross-compilation native sous android
 
005 skyeye
005 skyeye005 skyeye
005 skyeye
 
Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!
 
Part 04 Creating a System Call in Linux
Part 04 Creating a System Call in LinuxPart 04 Creating a System Call in Linux
Part 04 Creating a System Call in Linux
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene Pirogov
 
Summit 16: OPNFV on ARM - Hardware Freedom of Choice Has Arrived!
Summit 16: OPNFV on ARM - Hardware Freedom of Choice Has Arrived!Summit 16: OPNFV on ARM - Hardware Freedom of Choice Has Arrived!
Summit 16: OPNFV on ARM - Hardware Freedom of Choice Has Arrived!
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 
Scylla Summit 2022: ScyllaDB Rust Driver: One Driver to Rule Them All
Scylla Summit 2022: ScyllaDB Rust Driver: One Driver to Rule Them AllScylla Summit 2022: ScyllaDB Rust Driver: One Driver to Rule Them All
Scylla Summit 2022: ScyllaDB Rust Driver: One Driver to Rule Them All
 
Rhce ppt
Rhce pptRhce ppt
Rhce ppt
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame Graphs
 

Más de Samsung Open Source Group

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)Samsung Open Source Group
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBSamsung Open Source Group
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesSamsung Open Source Group
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondSamsung Open Source Group
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialSamsung Open Source Group
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategySamsung Open Source Group
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilitySamsung Open Source Group
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...Samsung Open Source Group
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceSamsung Open Source Group
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivitySamsung Open Source Group
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxSamsung Open Source Group
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxSamsung Open Source Group
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsSamsung Open Source Group
 

Más de Samsung Open Source Group (20)

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
 
Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and Beyond
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate Strategy
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
 
SOSCON 2016 JerryScript
SOSCON 2016 JerryScriptSOSCON 2016 JerryScript
SOSCON 2016 JerryScript
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
 
Run Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT NetworkRun Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT Network
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
 

Último

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Último (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Tutorial: Cross-compiling Linux Kernels on x86_64

  • 1. Cross-compiling Linux Kernels on x86_64: A tutorial on How to Get Started Shuah Khan Senior Linux Kernel Developer – Open Source Group Samsung Research America (Silicon Valley) shuah.kh@samsung.com
  • 2. Agenda ● Cross-compile value proposition ● Preparing the system for cross-compiler installation ● Cross-compiler installation steps ● Demo – install arm and arm64 ● Compiling on architectures ● Demo – compile arm and arm64 ● Automating cross-compile testing ● Upstream cross-compile testing activity ● References and Package repositories ● Q&A
  • 3. Cross-compile value proposition ● ● ● ● ● 30+ architectures supported (several sub-archs) Native compile testing requires wide range of test systems – not practical Ability to cross-compile non-natively on an widely available architecture helps detect compile errors Coupled with emulation environments (e.g: qemu) testing on non-native architectures becomes easier Setting up cross-compile environment is the first and necessary step
  • 5. Cross-compiler packages ● Ubuntu arm packages (12.10 or later) – – ● gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf Ubuntu arm64 packages (13.04 or later) – use arm64 repo for older Ubuntu releases. – ● gcc-4.7-aarch64-linux-gnu Ubuntu keeps adding support for compilers. Search Ubuntu repository for packages.
  • 6. Cross-compiler packages ● Embedded Debian Project is a good resource for alpha, mips, mipsel, powerpc, sh, and sparc cross-compilers. – gcc-4.7-alpha-linux-gnu – gcc-4.7-mips-linux-gnu – gcc-4.7-mipsel-linux-gnu – gcc-4.7-powerpc-linux-gnu – gcc-4.7-sh4-linux-gnu – gcc-4.7-sparc-linux-gnu
  • 7. Cross-compiler packages ● Fedora repo and Fedora Epel Repo are a good sources for several cross-compilers and binutils rpms – blackfin – binutils-bfin-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm ● gcc-bfin-linux-gnu-4.7.1-0.1.20120606.fc17.x86_64.rpm c6x ● ● ● – binutils-c6x-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm gcc-c6x-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm tile ● ● binutils-tile-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm gcc-tile-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm
  • 8. Preparing the system for cross-compiler installation ● Choose an x86-64 system ● Install Ubuntu 12.10 or later. – Ubuntu 13.04 Install
  • 9. Install common packages sudo apt-get install build-essential sudo apt-get install binutils-multiarch sudo apt-get install ncurses-dev sudo apt-get install alien Note: ncurses-dev is required to run menuconfig and alien to generate .deb from .rpm
  • 10. Configure apt for arm64 repo (Ubuntu 12.10) wget -O - http://people.debian.org/~wookey/bootstrap/bootstrap-archive.key | sudo apt-key add sudo apt-add-repository 'deb http://people.debian.org/~wookey/bootstrap/ubunturepo/ quantal-bootstrap main' sudo apt-get update
  • 11. Configure apt for emdebian repo sudo apt-get install emdebian-archive-keyring Create /etc/apt/sources.list.d/emdebian.list file with the following line: deb http://www.emdebian.org/debian/ sid main
  • 12. Download rpms from fedora repo ● blackfin rpms: – – ● binutils-bfin-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm gcc-bfin-linux-gnu-4.7.1-0.1.20120606.fc17.x86_64.rpm c6x rpms: – – ● binutils-c6x-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm gcc-c6x-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm tile rpms – binutils-tile-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm – gcc-tile-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm – Note: gcc-tile-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm is what you want. The older version is missing feedback.h, tilegx needs.
  • 13. Convert rpms to .deb sudo alien -d binutils-bfin-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm sudo alien -d gcc-bfin-linux-gnu-4.7.1-0.1.20120606.fc17.x86_64.rpm sudo alien -d binutils-c6x-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm sudo alien -d gcc-c6x-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm sudo alien -d binutils-tile-linux-gnu-2.23.51.0.3-1.fc17.x86_64.rpm sudo alien -d gcc-tile-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm You will see warnings about missing keys e.g: below which you can safely ignore. warning: gcc-tile-linux-gnu-4.7.2-2.aa.20121114svn.fc17.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 1aca3465: NOKEY
  • 15. Install cross-compilers alpha sudo apt-get install --install-recommends gcc-4.7-alpha-linux-gnu sudo ln -s /usr/bin/alpha-linux-gnu-gcc-4.7 /usr/bin/alpha-linux-gnu-gcc arm sudo apt-get install gcc-arm-linux-gnueabi arm64 sudo apt-get install --install-recommends gcc-4.7-aarch64-linux-gnu sudo ln -s /usr/bin/aarch64-linux-gnu-gcc-4.7 /usr/bin/aarch64-linux-gnu-gcc mips sudo apt-get install --install-recommends gcc-4.7-mips-linux-gnu sudo ln -s /usr/bin/mips-linux-gnu-gcc-4.7 /usr/bin/mips-linux-gnu-gcc mipsel sudo apt-get install --install-recommends gcc-4.7-mipsel-linux-gnu sudo ln -s /usr/bin/mipsel-linux-gnu-gcc-4.7 /usr/bin/mipsel-linux-gnu-gcc
  • 16. Install cross-compilers powerpc sudo apt-get install --install-recommends gcc-4.7-powerpc-linux-gnu sudo ln -s /usr/bin/powerpc-linux-gnu-gcc-4.7 /usr/bin/powerpc-linux-gnu-gcc sh sudo apt-get install --install-recommends gcc-4.7-sh4-linux-gnu sudo ln -s /usr/bin/sh4-linux-gnu-gcc-4.7 /usr/bin/sh4-linux-gnu-gcc arm64 sudo apt-get install --install-recommends gcc-4.7-aarch64-linux-gnu sudo ln -s /usr/bin/aarch64-linux-gnu-gcc-4.7 /usr/bin/aarch64-linux-gnu-gcc sparc sudo apt-get install --install-recommends gcc-4.7-sparc-linux-gnu sudo ln -s /usr/bin/sparc-linux-gnu-gcc-4.7 /usr/bin/sparc-linux-gnu-gcc Note: Creating link to *arch*-linux-gnu-gcc is necessary as the CROSS_COMPILE directive to find the compilers.
  • 17. Install cross-compilers from .debs blackfin sudo dpkg -i binutils-bfin-linux-gnu_2.23.51.0.3-2_amd64.deb sudo dpkg -i gcc-bfin-linux-gnu_4.7.1-1.1_amd64.deb c6x sudo dpkg -i binutils-c6x-linux-gnu_2.23.51.0.3-2_amd64.deb sudo dpkg -i gcc-c6x-linux-gnu_4.7.2-3_amd64.deb tile sudo dpkg -i binutils-tile-linux-gnu_2.23.51.0.3-2_amd64.deb sudo dpkg -i gcc-tile-linux-gnu_4.7.2-3_amd64.deb
  • 19. Building from sources ● Mauro Chehab's build_cross script – downloads compiler sources for a specified arch from gnu repo, builds and installs. – Usage: build_cross arm – Runs on fedora
  • 20. Demo arm and arm64 install
  • 21. Compilation Tips ● ● ● If make ARCH=arch defconfig fails on an arch, pick a config to test from arch/*/configs Some architectures don't support defconfig in cross-compile mode. e.g: powerpc. In some cases, you might see errors in LD phase, and please keep in mind these are just compile tests.
  • 22. Cross-compiling alpha make distclean make ARCH=alpha defconfig ARCH=alpha CROSS_COMPILE=alpha-linux-gnu- make all arm make distclean make ARCH=arm defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make all arm64 (3.7 and later) make distclean make ARCH=arm64 defconfig ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make all blackfin make distclean make ARCH=blackfin defconfig ARCH=blackfin CROSS_COMPILE=bfin-linux-gnu- make all
  • 23. Cross-compiling c6x (3.4 and later) make distclean make ARCH=c6x defconfig ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make all mips make distclean make ARCH=mips defconfig ARCH=mips CROSS_COMPILE=mips-linux-gnu- make all mipsel make distclean make ARCH=mips defconfig ARCH=mips CROSS_COMPILE=mipsel-linux-gnu- make all powerpc make distclean cp arch/powerpc/configs/wii_defconfig .config ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- make all
  • 24. Cross-compiling sh make distclean make ARCH=sh defconfig ARCH=sh CROSS_COMPILE=sh4-linux-gnu- make all sparc make distclean make ARCH=sparc defconfig ARCH=sparc CROSS_COMPILE=sparc-linux-gnu- make all tile make distclean make ARCH=tile defconfig ARCH=tile CROSS_COMPILE=tile-linux-gnu- make all
  • 25. Demo arm and arm64 compilation
  • 26. Automating cross-compile testing ● ● ● Script – cross_compile.sh automates builds for the compilers mentioned in this talk ktest – crosstests.conf Buildbot – tool for automating software builds. It can be configured to checkout Linux kernel sources from git repos and build.
  • 27. Upstream Cross-compile testing activity ● Linux Kernel stable queue builds project – Guenter Rock keeps adding new compilers each week. – Configs: allmodconfig, defconfig, configs with mmu and without (nommu) where applicable. – qemu test results on selected architectures.
  • 28.
  • 29.
  • 30.
  • 31. References and Package repositories ● ARMv8 Debian and Ubuntu bootstrap repositories ● Embedded Debian Project ● Fedora Repo ● Fedora Epel Repo ● Kernel.org - crosstool ● Ubuntu 13.04 Install ● Buildbot ● Linux Kernel stable queue builds project ● Ktest
  • 32. Q&A
  • 33. Thank you. Shuah Khan Senior Open Source Developer – Open Source Group Samsung Research America (Silicon Valley) shuah.kh@samsung.com
  • 34. Summary ● Cross-compiling Linux Kernels on x86_64: A tutorial on How to Get Started ● Agenda ● Cross-compile value proposition ● arch/ ● Cross-compiler packages ● Cross-compiler packages ● Cross-compiler packages ● Preparing the system for cross-compiler installation ● Install common packages ● Configure apt for arm64 repo (Ubuntu 12.10) ● Configure apt for emdebian repo ● Download rpms from fedora repo ● Convert rpms to .deb ● Resulting .debs ● Install cross-compilers ● Install cross-compilers ● Install cross-compilers from .debs ● arch/compile ● Building from sources ● Compilation Tips ● Cross-compiling ● Cross-compiling ● Cross-compiling ● Automating cross-compile testing ● Upstream Cross-compile testing activity ● References and Package repositories ● Thank you.