mail us  |  mail this page

contact us
training  | 
tech stuff  | 

GCC - Compiling and Linking

This section tells you what options to use from the millions that GCC provides (sometimes choice is a daunting prospect):

Health Warning: Mostly under Construction

one day real soon..

Compiler options

We use 4 compiler strings

Optimized by Size


Optimized by Time


Not Optimization


Debugging

In the case of problems or unexpected results we use an assembler output to see what the compiler is doing. Typically this uses an unoptimized compilation but sometimes you need to see EXACTLY what the compiler is doing. These compiler guys are supper smart and 'hoist' code all over the place to get the best results - an optimzed assembler listing can be very confusing - but that's why you are a programmer 'cos you like confusing stuff!


Notes:

  1. We use C only in development and have no particular axe to grind so we use the current (3.0.4) language default of 'gnu89' (ISO C89 standard plus some gnu extensions). If your stuff won't compile you may have to play around with the -x options.
  2. The -traditional flag means Kerrigan & Richie so if your code was built after reading their great book you may have to use his option.
Option Function
-g Include debugging information for GDB - it does no harm to include this always.
-mcpu=860 This includes the 850, 855T and all their variants.
-S Stop when an assembly listing has been created - but do not run the assembler.
-fverbose-asm Create an annotated assembly listing.
-c Stop when there is an object file (do C -> assembler, then run assembler) but do not link.
-o (Little letter O) defines the destination file.
-fno-hosted Assume no library functions.
-Os Optimize for speed.
-O3 Maximum optimisation almost no chance of de-bugging sensibly.
-O Mimimum optimisation - you stand a chance of de-bugging sensibly.
-O0 (Letter 0 with number 0)No optimisation.


Problems, comments, suggestions, corrections (including broken links) or something to add? Please take the time from a busy life to 'mail us' (at top of screen), the webmaster (below) or info-support at zytrax. You will have a warm inner glow for the rest of the day.

Tech Stuff

RSS Feed Icon

If you are happy it's OK - but your browser is giving a less than optimal experience on our site. You could, at no charge, upgrade to a W3C standards compliant browser such as Firefox

zytrax.com web



Standards

General

ISO (International)
ANSI (US)
DIN (Germany)
ETSI (EU)
BSI (UK)
AFNOR (France)

Telecom

TIA (US)
EIA (US)
ITU (International)
IEEE (US)
ETSI (EU)
OFTEL (UK)

Internet

IETF
IETF-RFCs
IANA
ICANN
W3C

Electronics

JEDEC
EIA (US)

Site

CSS Technology SPF Record Conformant Domain
Copyright © 1994 - 2024 ZyTrax, Inc.
All rights reserved. Legal and Privacy
site by zytrax
hosted by javapipe.com
web-master at zytrax
Page modified: January 20 2022.