Skip to content

Files

Latest commit

40cc12a · Mar 26, 2019

History

History

gcc

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 7, 2015
Aug 7, 2015
Feb 8, 2019
Jan 11, 2019
Jun 12, 2015
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jun 3, 2015
Jan 11, 2019
Jun 27, 2015
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jul 6, 2015
Jul 6, 2015
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Oct 31, 2016
Mar 26, 2019
Jul 3, 2016
Jun 11, 2015
Jan 11, 2019
May 19, 2015
Oct 31, 2016
Jun 11, 2015
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
Aug 7, 2015
May 19, 2015
Jan 11, 2019
Jan 11, 2019
Jan 11, 2019
May 18, 2016

GCC

Cheat on the GNU Compile Collection (GCC) language extensions and command line utilities.

  1. Introduction
    1. Compilation steps
    2. Invocation
    3. Spec files
    4. GCC as library
  2. Extensions
    1. Types
      1. Empty struct
      2. Zero length array
      3. 128-bit int
      4. Complex integer
      5. __auto_type
    2. Language
      1. Literals
      2. Identifiers
      3. Nested functions
      4. typeof
      5. Case range
      6. Array range initializer
      7. Local label
      8. Statment expression
    3. Attribute
      1. Variable
        1. weak
        2. Vector extensions
      2. Function
        1. sentinel
    4. asm
      1. asm.md
      2. asm.c
    5. Built-in functions
      1. alloca()
      2. __atomic_fetch_add
      3. __builtin_expect
      4. __builtin_constant_p
      5. __builtin_prefetch
      6. __builtin_return_address
  3. cpp
    1. cpp invocation
    2. cpp
  4. Internals
    1. Build
      1. Cross compiler
    2. Compilation passes
    3. Source tree
    4. libgcc

WIP

  1. IDE
  2. Spec files

Scope

This will only cover C specifics. Generic ELF manipulation tools like ld (which can work across any language) are not included.

Cross compile

Cross compiling means to compile a program for a different OS or architecture than the one the compiler is running.

GCC cannot cross compile for windows from Linux (TODO check).

This can be done with MinGW (TODO how).

Infamous error messages

Error messages that are difficult to interpret for newbs:

  • struct has incomplete type = struct undefined. You forgot to include some header.