ELC-E - October crosstool-NG

Slides:



Advertisements
Similar presentations
Prashant Somashekar. What will we discuss? -Brief overview of a kernel -How a kernel fits into the hierarchy -Android versus Linux kernel -Building an.
Advertisements

lld The LLVM Linker Friday, April 13, 2012
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
1 Real-Time System Design Developing a Cross Compiler and libraries for a target system.
Author: Texas Instruments ®, Sitara™ ARM ® Processors Building Blocks for PRU Development Module 2 PRU Firmware Development This session covers how to.
1 THE ARCHITECTURE FOR THE DIGITAL WORLD TM THE ARCHITECTURE FOR THE DIGITAL WORLD Embedded Linux for ARM Architecture.
1 uClinux course Day 3 of 5 The uclinux toolchain, elf format and ripping a “hello world”
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Building a Cross Compiler, Assembler and Linker Designed by Prof. Peng-Sheng Chen.
Introduction Purpose This training course introduces the free GNU tools that can be used for debugging embedded system application software in the Renesas.
© 2008 Intel Corporation; made available under the EPL v1.0 | February 12, 2008 | Integrating a custom tool-chain in CDT.
CCA Port, Component & Application Build Skeleton Templates “A new script toolkit for generating CCA build skeletons” Torsten Wilde and James Kohl Oak Ridge.
1 Embedded Linux porting Speaker: Yi-Ji Jheng Date:
CIS*2450 Seminar I Makefiles Debugging/Design Approaches Exception Handling Library Revision Control Designed by: Terry Moreland Updated by: Tom Crabtree.
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
Programming Tools gcc make utility Open Source code Static and Shared Libraries gdb Memory debugging tools.
ICS – Software Engineering Group 1 Cross Compiling vxWorks on Linux EPICS Collaboration Meeting l May 2002 at BESSY, Germany May 2002 at BESSY,
Guideline: How to build AMSS source code? History: 01/02/ Make Draft 05/02/2010 – Release /02/2010 – Updated.
CMSBrownBag,05/29/2007 B.Mangano How to “use” CMSSW on own Linux Box and be happy In this context “use” means: - check-out pre-compiled CMSSW code - run.
 Overview › Requirements › Proof of Principal › Issues … › First Step – Wrap Altera NIOS2 GNU Tools › Next Step – Build RTEMS/NIOS GNU Tools › Future.
Porting Linux Linux onto the Puppeteer SA1110. The Puppeteer board –SA1110 CPU –SMSC LAN91C96I ethernet –8 Mb Flash Intel 28F320C3 Boot block flash –32.
MIPS Project -- Simics Yang Diyi Outline Introduction to Simics Simics Installation – Linux – Windows Guide to Labs – General idea Score Policy.
National Center for Supercomputing ApplicationsNational Computational Science Grid Packaging Technology Technical Talk University of Wisconsin Condor/GPT.
1 uClinux course Day 2 of 5 Using configuration tools and the tool chain.
LLVM Compiler Katie Dew. Lectures High-level overview of LLVM (Katie) Walkthrough of LLVM in context of our project (Jason) –Input requirements –Configuration.
Yannick Patois - Datagrid Software Repository Presentation - March, n° 1 Datagrid Software Repository Presentation CVS, packages and automatic.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 1.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
Blackfin buildroot development
From VME/RTEMS to Industrial PC/LinuxRT: A Migration Story Mitch D’Ewart May EPICS Collaboration Meeting May 2015.
The World Leader in High Performance Signal Processing Solutions Toolchain Basics.
The World Leader in High Performance Signal Processing Solutions How to Fix Bugs with Toolchain Jie Zhang.
Building programs LinuxChix-KE. What happens in your CPU? ● It executes a small set of instructions called "machine code" ● Each instruction is just a.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux system development.
1 Creative Innovation – Customer Satisfaction – Continual Quality Improvement Accessing and Building Asterisk SCF.
Cross-compiling With Gentoo Mike Frysinger Gentoo Developer February 25, 2006
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Scratchbox The Scratchbox.
(C) 2009 Yann E. MORIN1 Embedded Linux Conference / Europe - October 2009 Building our own toolchains for our embedded projects: Why, and how.
1 Buildroot. Building embedded Linux systems. Buildroot Developer Day.
Packaging Software for Debian Roberto C. Sánchez Ohio Linuxfest Saturday, September 29, 2007.
Golang bootstraping Living on the tip Jakub Čajka Presented by
Operating System Kernel Compilation
Software 12/1/2008.
Outline Installing Gem5 SPEC2006 for Gem5 Configuring Gem5.
Open-O Integration Project Introduction
Installation of the ALICE Software
CELF Embedded BOF - Ottawa - July 2008
Implementation of Embedded OS
Generator Services planning meeting
Computer System Laboratory
CDT Build/Run/Debug in Container
BIND 10 Packaging & Distribution
Embedded Linux Conference - April 2009
Uncompressed target filesystem size
Getting started in Eclipse
Operating System Kernel Compilation
Using Visual Studio and VS Code for Embedded C/C++ Development
AdaCore C/C++ Offering
Yes, we do those languages too.
Chapter 2: The Linux System Part 1
Software Installation
Ns-3 Training Session 4: Monday 3:30pm ns-3 Annual Meeting May 2014.
Download and Installation of code::blocks
Computer System Laboratory
Software Installation, release 4.0
Yes, we do those languages too.
Operating System Kernel Compilation
PyWBEM Python WBEM Client: Overview #2
Black All good PowerPoint starts with black..
Presentation transcript:

ELC-E - October 2010 - crosstool-NG A (cross-)toolchain generator Yann E. MORIN yann.morin.1998@anciens.enib.fr http://ymorin.is-a-geek.org/ To the attendance : if you can read this, then something is wrong! ;-) 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG History 2006-11-09 : cleanup-pass proposal 2007-02-08 : cleanup-pass ended in rewrite 2007-04-10 : first public release : 0.0.1 2008-01-16 : first stable release : 1.0.0 2009-07-01 : Mercurial repository -> starting with original crosstool -> add uClibc ---> not added upstream ---> port patch forward heavy-duty . -> cleanup proposal ---> existing patches ---> deemed to complex -> rewrite ---> as proof of concept of new feats ---> as a test-bed to push back 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 1.8.0 1.9.0 2008-05-04 2008-07-20 2008-11-25 2009-04-26 2009-10-04 2010-01-31 2010-04-30 2010-08-01 2010-10-31 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG Purpose Build toolchains Only build toolchains Goals -> toolchain not belong to system builders ---> think large devs teams ---> no need to build one toolchain each ---> many targets == many toolchains . -> Easy to use Easy to maintain Easy to enhance Act as a tutorial 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG Make it easy to use : standard behavior Standard package ./configure make make install Toolchain configuration menuconfig samples Toolchain build step by step simplified log -> do not confuse configuration ---> package ---> toolchain 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG [INFO ] ============================================================= [INFO ] Installing shared core C compiler [EXTRA] Configuring shared core C compiler [EXTRA] Building shared core C compiler [EXTRA] Installing shared core C compiler [INFO ] Installing shared core C compiler: done in 109.49s (at 06:43) [INFO ] Installing C library [EXTRA] Copying sources to build dir [EXTRA] Applying configuration [EXTRA] Building C library [EXTRA] Installing C library [INFO ] Installing C library: done in 39.96s (at 07:23) [INFO ] Installing final compiler [EXTRA] Configuring final compiler [EXTRA] Building final compiler [EXTRA] Installing final compiler [INFO ] Installing final compiler: done in 144.12s (at 09:48) [INFO ] Cleaning-up the toolchain's directory [INFO ] Stripping all toolchain executables [EXTRA] Installing the populate helper [EXTRA] Installing a cross-ldd helper [EXTRA] Creating toolchain aliases [EXTRA] Removing access to the build system tools [EXTRA] Removing installed documentation [INFO ] Cleaning-up the toolchain's directory: done in 1.88s (at 09:49) [INFO ] Build completed at 20101023.172433 [INFO ] (elapsed: 9:49.65) [INFO ] Finishing installation (may take a few seconds)... 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG Easy to maintain & enhance : modular design Isolated components One config file One build script One patchset API Generic: get, extract and patch Component-specific C library: headers & start-files, full Compiler: bootstrap 1 & 2, final Alternatives Architectures C libraries Kernels ... Maintain, enhance -> basically same thing ---> maintain == fix existing stuff ---> enhance == add new stuff . Know what breaks, where it breaks Know where to add new stuff API -> env vars --> arch name, endianness, bitness... -> hooks ---> helpers for generic hooks ---> Automatic inclusion to menuconfig 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG ARCH description config file config/arch/arm.in # ARM specific configuration file config ARCH_arm select ARCH_SUPPORTS_32 select ARCH_DEFAULT_32 select ARCH_SUPPORTS_BOTH_MMU select ARCH_DEFAULT_HAS_MMU select ARCH_SUPPORTS_BOTH_ENDIAN select ARCH_DEFAULT_LE select ARCH_SUPPORT_ARCH select ARCH_SUPPORT_CPU select ARCH_SUPPORT_TUNE select ARCH_SUPPORT_FPU help The ARM architecture, as defined by: http://www.arm.com/ # ARM specific configuration file choice bool prompt "Default instruction set mode" default ARCH_ARM_MODE_ARM config ARCH_ARM_MODE_ARM prompt "arm" help Defaults to emitting instructions in the ARM mode. config ARCH_ARM_MODE_THUMB prompt "thumb (EXPERIMENTAL)" depends on EXPERIMENTAL Defaults to emitting instructions in the THUMB mode. endchoice config ARCH_ARM_MODE string default "arm" if ARCH_ARM_MODE_ARM default "thumb" if ARCH_ARM_MODE_THUMB config ARCH_ARM_INTERWORKING prompt "Use Thumb-interworking" default n config ARCH_ARM_EABI prompt "Use EABI" default y Set up the toolchain so that it generates EABI-compliant binaries. config ARCH_ARM_ABI_OK depends on ! ARCH_ARM_EABI select ARCH_SUPPORT_ABI ARCH-specific options config file config/arch/arm.in.2 # Compute ARM-specific values CT_DoArchTupleValues() { # The architecture part of the tuple: CT_TARGET_ARCH="${CT_ARCH}${target_endian_eb}" # The system part of the tuple: case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in *glibc,y) CT_TARGET_SYS=gnueabi;; uClibc,y) CT_TARGET_SYS=uclibcgnueabi;; *,y) CT_TARGET_SYS=eabi;; esac # Set the default instruction set mode case "${CT_ARCH_ARM_MODE}" in arm) ;; thumb) CT_ARCH_CC_CORE_EXTRA_CONFIG="--with-mode=thumb" CT_ARCH_CC_EXTRA_CONFIG="--with-mode=thumb" # CT_ARCH_TARGET_CFLAGS="-mthumb" ;; if [ "${CT_ARCH_ARM_INTERWORKING}" = "y" ]; then CT_ARCH_TARGET_CFLAGS+=" -mthumb-interwork" fi } ARCH settings script scripts/build/arch/arm.sh Same goes for all components . Maybe build procedure is complex, but adding to crosstool-NG is easy! 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG Goodies Companion libraries gmp, mpfr, ppl, CLooG/ppl, mpc, libelf Companion tools auto-stuff et al. Debug tools gdb ltrace, strace dmalloc, D.U.M.A Pre-configured sample toolchains gmp, mpfr ---> mandatory, gcc >= 4.3, all frontends ---> mandatory, all gcc, fortran frontend . mpc ---> mandatory, gcc >= 4.5, all frontends ppl, cloog ---> optional, gcc >= 4.4, Graphite libelf ---> optional, gcc >= 4.5, LTO auto-stuff ---> either disapear, or make mandatory gdb ---> cross, native & gdbserver, all static or shared 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG Toolchain types Different systems involved build system that builds the toolchain host system that runs the toolchain target system the toolchain generates code for Native build == host == target  Cross build == host != target  Cross-native build != host == target  Canadian build != host != target  build, host, target _SYSTEMS_ !!! . Define _sytem_ 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG Steps : 23 libc_check_config kernel_headers gmp mpfr ppl cloog mpc libelf binutils elf2flt sstrip cc_core_pass_1 libc_headers libc_start_files cc_core_pass_2 libc cc libc_finish libelf_target binutils_target debug test_suite finish 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG Pros Your choice of components versions Optimised for your processor Known patchset (if any) Same sources for all targets Upstream fixes easy to apply Reproducible Fits your build-system 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG Status : what's already in? 11 Archs 5 C libraries 2 binary utilities 2 kernels 1 compiler patchset required by many components to build controversy Arch: ---> alpha, arm, avr32, blackfin, ia64, ---> m68k, mips, ppc, s390, sh, x86 . C libs: ---> newlib, uClibc, eglibc, glibc, mingw ---> none ! binutils: ---> binutils, elf2flt Kernels: ---> linux, mingw32 ---> bare-metal ! Compiler: ---> gcc 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG Future : short- and long-term plans Add latest component versions gcc, Linux, C libraries... Consolidate backend-mode currently used by buildroot Consolidate canadian-crosses needed before cross-native, and native Look at LLVM / Clang see how it all fits together multi-lib mingw32 & cygwin build, host & target ... 2010-10-28 (C) 2010 Yann E. MORIN

ELC-E - October 2010 - crosstool-NG Thank you! Yann E. MORIN yann.morin.1998@anciens.enib.fr http://ymorin.is-a-geek.org/ License for this paper: Creative Commons BY-SA 3.0 Source for this paper: http://ymorin.is-a-geek.org/publis/ELC-E/2010 2010-10-28 (C) 2010 Yann E. MORIN