Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Forum

  Home arrow Linux For Devices Articles arrow gcc/glibc cross toolchains for embedded development

gcc/glibc cross toolchains for embedded development
By Linux Devices

Rate This Article: Add This Article To:

Building a gcc / glibc cross-toolchain for use in embedded systems development used to be a scary prospect, requiring iron will, days if not weeks of effort, lots of Unix and Gnu lore, and sometimes willingness to take dodgy shortcuts. This is a problem not only for individual users, but also for the gcc project as a whole, since the gcc team

href="http://gcc.gnu.org/ml/gcc/2003-07/msg01325.html">relies on users to test upcoming releases of gcc, and the difficulty of building the toolchain for embedded targets restricted the number of people able to help with the testing.

At Ixia, I had been maintaining a toolchain by starting with a commercial free embedded linux toolchain, and overlaying it with newer versions compiled from scratch as needed to fix problems. This became harder to maintain as time went on.

This article discusses one possible approach to solving this problem.
Enhancing the community build script

After some months of frustration, it became clear we needed an easy way to build and test gcc/glibc cross-toolchains from scratch. Looking around, I realized that Bill Gatliff's crossgcc FAQ and build script, what most of the community used to build cross-compilers, was almost what I needed, so I rolled up my sleeves and:
  • made darn sure it worked properly for ppc and gcc-2.95

  • removed newlib support so I could focus on glibc more easily

  • updated it to handle gcc-3.2.x, gcc-3.3.x, and gcc-3.4.x, since I wasn't sure which of those I would need

  • enhanced it to automatically download the source tarballs and apply the minimal set of patches needed to successfully build

  • enhanced it to support all CPU types supported by glibc, since that was easy and was a good test of the script

  • added support for running the gcc and glibc regression test suites, since at Ixia we need regression tests for everything we ship

  • documented how to run dejagnu regression tests remotely, since that's how to test gcc on a small embedded platform, and the dejanu documentation is misleading and incomplete

  • documented how to set up a chroot jail that allows remote login, since a chroot jail is the easiest way to test alternate versions of glibc, and there weren't any good howto's on the subject

  • added support for building userspace (for now, just busybox) with the new toolchain (see --builduserspace option to all.sh) so you can test even if you don't have userspace apps compatible with the new toolchain

Results

I call my updated script and associated patches 'crosstool'. It's fairly easy to use and can be run unattended as part of an automatic build process, and should go a long way towards making it easier for the average developer to get started with gcc cross-compilers and help test new releases of gcc.

The gcc-3.3.1/glibc-2.3.2 toolchains it generates for ppc405 and ppc750 pass nearly all gcc, glibc, and binutils regression tests.

The gcc-3.3.1/glibc-2.3.2 toolchain it generates for sh4 fails a noticable number of the glibc tests, but is far enough along that you can try it, if you're willing to look into the problems.

The gcc-3.4-20030813 snapshot toolchains for these processors fail with several internal compiler errors building the regression tests, which is not suprising given that gcc-3.4 is still in stage 2.


Downloads



About the author
Dan Kegel is a software engineer currently helping develop network test equipment at Ixia. He has been programming since 1978, and mentoring intern programmers since 1994. He served on the JSR-51 committee which helped add nonblocking I/O and file locking to the Java platform. His web site "The C10K Problem" is well-known among a small circle of internet server programmers, and his essay "The Case for Linux in Universities" has been translated into Spanish, Hindi, and Telugu. He maintains lalugs.org as a service to the Los Angeles Linux community. He thanks his wife Liz Fuller for her support and patience during his periodic save-the-world quests, Ixia for supporting this work, Bill Gatliff for the original script, and Kaz Kojima and Daniel Jacobowitz for supplying patches on the spot to solve various problems.



Last Change 26 Aug 2003. The latest copy of this document can be found at kegel.com/crosstool. Copyright © 2003 Dan Kegel, with portions copyright by Ixia, 2003. All rights reserved. Reproduced by LinuxDevices.com with permission of the author. Crosstool is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.




Discuss gcc/glibc cross toolchains for embedded development
 
>>> Be the FIRST to comment on this article!
 
 
 
>>> More Linux For Devices Articles Articles          >>> More By Linux Devices
 



FUEL Database on MontaVista Linux
Whether building a mobile handset, a car navigation system, a package tracking device, or a home entertainment console, developers need capable software systems, including an operating system, development tools, and supporting libraries, to gain maximum benefit from their hardware platform and to meet aggressive time-to-market goals.

Breaking New Ground: The Evolution of Linux Clustering
With a platform comprising a complete Linux distribution, enhanced for clustering, and tailored for HPC, Penguin Computing¿s Scyld Software provides the building blocks for organizations from enterprises to workgroups to deploy, manage, and maintain Linux clusters, regardless of their size.

Data Monitoring with NightStar LX
Unlike ordinary debuggers, NightStar LX doesn¿t leave you stranded in the dark. It¿s more than just a debugger, it¿s a whole suite of integrated diagnostic tools designed for time-critical Linux applications to reduce test time, increase productivity and lower costs. You can debug, monitor, analyze and tune with minimal intrusion, so you see real execution behavior. And that¿s positively illuminating.

Virtualizing Service Provider Networks with Vyatta
This paper highlights Vyatta's unique ability to virtualize networking functions using Vyatta's secure routing software in service provider environments.

High Availability Messaging Solution Using AXIGEN, Heartbeat and DRBD
This white paper discusses a high-availability messaging solution relying on the AXIGEN Mail Server, Heartbeat and DRBD. Solution architecture and implementation, as well as benefits of using AXIGEN for this setup are all presented in detail.

Understanding the Financial Benefits of Open Source
Will open source pay off? Open source is becoming standard within enterprises, often because of cost savings. Find out how much of a financial impact it can have on your organization. Get this methodology and calculator now, compliments of JBoss.

Embedded Hardware and OS Technology Empower PC-Based Platforms
The modern embedded computer is the jack of all trades appearing in many forms.

Data Management for Real-Time Distributed Systems
This paper provides an overview of the network-centric computing model, data distribution services, and distributed data management. It then describes how the SkyBoard integration and synchronization service, coupled with an implementation of the OMG¿s Data Distribution Service (DDS) standard, can be used to create an efficient data distribution, storage, and retrieval system.

7 Advantages of D2D Backup
For decades, tape has been the backup medium of choice. But, now, disk-to-disk (D2D) backup is gaining in favor. Learn why you should make the move in this whitepaper.

Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
PLATINUM SPONSORS

 
 

 
 

 
 

GOLD SPONSORS


(Become a sponsor)

(Become a sponsor)

ADVERTISEMENT
(Advertise here)

Check out the latest Linux powered...

Mobile phones!

MIDs, UMPCs
& tablets

Mobile devices

Other cool
gadgets

Resource Library

• Unix, Linux Uptime and Reliability Increase: Patch Management Woes Plague Windows Yankee Group survey finds IBM AIX Unix is highest in ...
• Scalable, Fault-Tolerant NAS for Oracle - The Next Generation For several years NAS has been evolving as a storage ...
• Managing Software Intellectual Property in an Open Source World This whitepaper draws on the experiences of the Black Duck ...
• Open Source Security Myths Dispelled Is it risky to trust mission-critical infrastructure to open source ...
• Bringing IT Operations Management to Open Source & Beyond Download this IDC analyst report to learn how open source ...


BREAKING NEWS

• NAS system houses 2.5-inch drives for up to 6TB
• Atom SBC boasts special low-power mode
• Android leaps to rugged handheld, and more phones
• Simulator runs Android apps on Ubuntu
• Fanless industrial PC taps Atom
• Router platform runs OpenWRT Linux
• Feature-packed UMPC survives four-foot drops
• UMPC pioneer gives up the ghost
• Biodegradable, solar-powered netbook runs Linux
• Hypervisor rev'd for higher reliability
• Eurotech spins Atom development kits
• Home media server to demo on Intel Atom platform
• Atom boards feature fanless DC operation
• Low-cost pluggable NAS adds Linux support
• Taiwan open source conference sets agenda


Most popular stories -- past 90 days:
• Linux boots in 2.97 seconds
• Tiniest Linux system, yet?
• Linux powers "cloud" gaming console
• Report: T-Mobile sells out first 1.5 million G1s
• Open set-top box ships
• E17 adapted to Linux devices, demo'd on Treo650
• Android debuts
• First ALP Linux smartphone?
• Cortex-A8 gaming handheld runs Linux
• Ubuntu announces ARM port


DesktopLinux headlines:
• Simulator runs Android apps on Ubuntu
• Hypervisor rev'd for higher reliability
• Pluggable NAS now supports Linux desktops
• Moblin v2 beta targets netbooks
• Linux-ready netbook touted as "Student rugged"
• USB display technology heading for Linux
• Ubuntu One takes baby step to the cloud
• Game over for Linux netbooks?
• Linux Foundation relaunches Linux web site
• Dell spins lower-cost netbook


Also visit our sister site:


Sign up for LinuxForDevices.com's...

news feed


Or, follow us on Twitter...