SlideShare a Scribd company logo
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.

More Related Content

What's hot

IntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingIntelON 2021 Processor Benchmarking
IntelON 2021 Processor Benchmarking
Brendan Gregg
 
linux device driver
linux device driverlinux device driver
linux device driver
Rahul Batra
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
Wave Digitech
 
Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)
shimosawa
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
Thomas Petazzoni
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
shimosawa
 
What Can Compilers Do for Us?
What Can Compilers Do for Us?What Can Compilers Do for Us?
What Can Compilers Do for Us?
National Cheng Kung University
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
 
semaphore & mutex.pdf
semaphore & mutex.pdfsemaphore & mutex.pdf
semaphore & mutex.pdf
Adrian Huang
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernel
Adrian Huang
 
Memory Compaction in Linux Kernel.pdf
Memory Compaction in Linux Kernel.pdfMemory Compaction in Linux Kernel.pdf
Memory Compaction in Linux Kernel.pdf
Adrian Huang
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
Buland Singh
 
Share the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development BoardShare the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development Board
Jian-Hong Pan
 
GDB Rocks!
GDB Rocks!GDB Rocks!
GDB Rocks!
Kent Chen
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
Linaro
 
Linux shell
Linux shellLinux shell
Linux shell
Kenny (netman)
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
linuxlab_conf
 

What's hot (20)

IntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingIntelON 2021 Processor Benchmarking
IntelON 2021 Processor Benchmarking
 
linux device driver
linux device driverlinux device driver
linux device driver
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
What Can Compilers Do for Us?
What Can Compilers Do for Us?What Can Compilers Do for Us?
What Can Compilers Do for Us?
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
semaphore & mutex.pdf
semaphore & mutex.pdfsemaphore & mutex.pdf
semaphore & mutex.pdf
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernel
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
Memory Compaction in Linux Kernel.pdf
Memory Compaction in Linux Kernel.pdfMemory Compaction in Linux Kernel.pdf
Memory Compaction in Linux Kernel.pdf
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
 
Share the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development BoardShare the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development Board
 
GDB Rocks!
GDB Rocks!GDB Rocks!
GDB Rocks!
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
 
Linux shell
Linux shellLinux shell
Linux shell
 
Device tree
Device treeDevice tree
Device tree
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 

Similar to 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 Platform
SZ 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 nfv
videos
 
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 Linux
Linaro
 
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 Routers
Onur 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, compact
Alessandro Selli
 
Cross-compilation native sous android
Cross-compilation native sous androidCross-compilation native sous android
Cross-compilation native sous android
Thierry 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 Linux
Tushar B Kute
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene Pirogov
Pivorak 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
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
Morteza Nourelahi Alamdari
 
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
ScyllaDB
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
Alexei 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 Graphs
Brendan Gregg
 

Similar to 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
 

More from 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
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
Samsung Open Source Group
 
Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
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 USB
Samsung 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 Devices
Samsung 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 Beyond
Samsung 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 tutorial
Samsung Open Source Group
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
Samsung Open Source Group
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
Samsung 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 Strategy
Samsung Open Source Group
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
Samsung 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 Device
Samsung Open Source Group
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
Samsung Open Source Group
 
SOSCON 2016 JerryScript
SOSCON 2016 JerryScriptSOSCON 2016 JerryScript
SOSCON 2016 JerryScript
Samsung 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 IoTivity
Samsung Open Source Group
 
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
Samsung 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 Linux
Samsung 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/Linux
Samsung 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 Things
Samsung Open Source Group
 

More from 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
 

Recently uploaded

Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 

Recently uploaded (20)

Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 

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.