The Definitive Guide to GCC / Edition 1

The Definitive Guide to GCC / Edition 1

4.5 2
by Kurt Wall, William von Hagen

ISBN-10: 1590591097

ISBN-13: 9781590591093

Pub. Date: 01/13/2004

Publisher: Apress

The Definitive Guide to GCC is a comprehensive tutorial and guide to usingGCC, the GNU Compiler Collection. GCC is quite simply the most-used and most powerful tool for programmers on the planet. GCC has long been available for most major hardware and operating system platforms and is often the preferred compiler for those platforms. As a general-purpose


The Definitive Guide to GCC is a comprehensive tutorial and guide to usingGCC, the GNU Compiler Collection. GCC is quite simply the most-used and most powerful tool for programmers on the planet. GCC has long been available for most major hardware and operating system platforms and is often the preferred compiler for those platforms. As a general-purpose compiler, GCC produces higher quality, faster performing executable code with fewer bugs than equivalent offerings supplied by hardware and software vendors. GCC, along with GNU Emacs, the Linux operating system, the Apache web server, the Sendmail mail server, and the BIND DNS server, is one of the showpieces of the free software world and proof that sometimes you can get a free lunch.

In The Definitive Guide to GCC, authors William von Hagen and Kurt Wall teach you how to build, install, customize, use, and troubleshoot GCC 3.2. This guide goes beyond just command-line invocations to show you how to use GCC to improve the quality of your code (with debugging, code profiling, and test code coverage), and how to integrate other GNU development tools, such as libtool, automake, and autoconf, into your GCC-based development projects.

Product Details

Publication date:
Edition description:
1st Corrected ed. 2004. Corr. 2nd printing 2004
Product dimensions:
7.00(w) x 9.25(h) x 0.93(d)

Table of Contents

About the Authorsxi
About the Technical Reviewerxii
Introducing GCC and The Definitive Guide to GCCxv
Chapter 1Building GCC1
Why Build GCC from Source?1
What Is New in GCC 3?24
Chapter 2Installing GCC on DOS and Windows Platforms39
Installing Cygwin39
Installing DJGPP47
Chapter 3Basic GCC Usage59
General Options59
Controlling GCC's Output62
Compiling C Dialects69
Using GCC with C++74
Controlling the Preprocessor77
Modifying the Directory Search Path78
Controlling the Linker82
Passing Options to the Assembler86
Enabling and Disabling Warning Messages86
Adding Debugging Information94
Chapter 4Advanced GCC Usage101
Customizing GCC Using Environment Variables101
Customizing GCC with Spec Files and Spec Strings103
GCC's C and Extensions108
Chapter 5Optimizing Code with GCC135
A Whirlwind Tour of Compiler Optimization Theory135
Processor-Independent Optimizations138
Processor-Specific Optimizations145
Chapter 6Performing Code Analysis with GCC147
Test Coverage Using GCC and gcov148
Chapter 7Using Autoconf and Automake187
Unix Software Configuration, Autoconf, and Automake187
Installing and Configuring Autoconf and Automake191
Configuring Software with Autoconf and Automake200
Running configure Scripts218
Chapter 8Using Libtool221
Introduction to Libraries221
What Is Libtool?226
Downloading and Installing Libtool228
Using Libtool232
Troubleshooting Libtool Problems243
Getting More Information About Libtool244
Chapter 9Troubleshooting GCC245
Coping with Known Bugs and Misfeatures245
Resolving Common Problems247
Resolving Build and Installation Problems262
Chapter 10Using GCC's Online Help265
What Is GNU Info?265
Getting Started, or Instructions for the Impatient267
The Beginner's Guide to Using GNU Info269
Stupid Info Tricks279
Chapter 11GCC Command-Line Options283
Alphabetical List of GCC Options284
Alphabetical List of GCC Assembler Options336
Alphabetical List of GCC Linker Options336
Alphabetical List of GCC Preprocessor Options338
GCC Option Reference344
Chapter 12Additional GCC Resources347
Usenet Resources for GCC347
Mailing Lists for GCC352
World Wide Web Resources for GCC358
Publications About GCC and Related Topics359
Appendix ABuilding and Installing Glibc363
What Is in Glibc?363
Alternatives to Glibc365
Why Build Glibc from Source?367
Previewing the Build Process374
Recommended Tools for Building Glibc376
Downloading and Installing Source Code379
Configuring the Source Code385
Compiling Glibc388
Testing the Build390
Installing Glibc390
Getting More Information About Glibc400
Appendix BMachine and Processor-Specific Options for GCC403
Alpha Options405
Alpha/VMS Options411
AMD x86-64 Options412
AMD29K Options413
ARC Options415
ARM Options416
AVR Options422
Clipper Options424
Convex Options424
CRIS Options425
D30V Options428
H8/300 Options429
HP/PA (PA/RISC) Options430
i386 and AMD x86-64 Options432
IA-64 Options438
Intel 960 Options440
M32R Options442
M680x0 Options443
M68hc1x Options447
M88K Options447
MCore Options451
MIPS Options452
MMIX Options460
MN10200 Options461
MN10300 Options462
NS32K Options462
PDP-11 Options464
PowerPC (PPC) Options466
RS/6000 Options478
RT Options478
S/390 and zSeries Options479
SH Options480
SPARC Options482
System V Options487
TMS320C3x/C4x Options488
V850 Options491
VAX Options492
Xstormy16 Options492
Xtensa Options492

Customer Reviews

Average Review:

Write a Review

and post it to your social network


Most Helpful Customer Reviews

See all customer reviews >

The Definitive Guide to GCC 4.5 out of 5 based on 0 ratings. 2 reviews.
Guest More than 1 year ago
This book earns the coveted 5th star for it's clear and consise discusion on how to get automake and friends built. Better than the entire contents of the Automake and Autonconf book for someone not alread familiar with getting them set up. Good explanaation of GCC and updates from the 'GCC: The Complete Reference' to cover V 3.x
Guest More than 1 year ago
To some of us, gcc is an old friend. It has been around since the 80s. Predating linux, and from a time when free open source code was something weird. Gcc is a collection of compilers, and if you have a linux machine, gcc appears on it by default. But if gcc is free, why do you need this book? Well, the authors discovered a curious omission in the computing marketplace. There does not seem to be any other book in print, devoted to gcc. Other programming books, if they refer to gcc, do so only briefly. You might then ask, 'can't I just use the accompanying documentation?' Yes, but that documentation is geared towards the experienced gcc user. It is terse at the best of times, and portions can be opaque. Wall and Hagen point out that this lack of understandable documentation often turns users off gcc. They end up never using many of the powerful features added to it by experienced designers over the years. You should exploit their efforts, via this book. It explains at length the innumerable compiler options that most users never try. After reading this book, you do not have to shy away by using simple Makefiles. You can get enough understanding to actually build more powerful Makefiles; that use more fully gcc's potential. The book also treats affiliated programs. Like gcov for doing test coverage analysis. Or libtool, to make libraries. The heft of the book also answers a possible objection to the authors' efforts. That is, is there really enough to discuss to warrant an entire book? Indeed there is. Between the detailed discussion and a plentitude of examples, you might gain some appreciation of why the standard gcc documentation has been fleshed out here.