Our ARM toolchain:
CC := $(GCC_ARM_BASE)arm-none-eabi-gcc
LD := $(GCC_ARM_BASE)arm-none-eabi-gcc
OBJCPY := $(GCC_ARM_BASE)arm-none-eabi-objcopy
OBJDUMP := $(GCC_ARM_BASE)arm-none-eabi-objdump
SIZE := $(GCC_ARM_BASE)arm-none-eabi-size
AR := $(GCC_ARM_BASE)arm-none-eabi-gcc-ar
GDB := $(GCC_ARM_BASE)arm-none-eabi-gdb
OPENOCD := openocd
Our X86 toolchain:
CC := $(COMPILER)
LD := $(COMPILER)
OBJCPY := objcopy
OBJDUMP := objdump
SIZE := size
AR := ar
GDB := gdb
What's a Toolchain?
In software, a toolchain is a set of programming tools that is used to perform a complex software development task or to create a software product, which is typically another computer program or a set of related programs.
A simple software development toolchain may consist of:
- compiler and
- linker (which transform the source code into an executable program),
- libraries (which provide interfaces to the operating system),
- debugger (which is used to test and debug created programs).
Our Toolchain:
The GNU toolchain is a broad collection of programming tools produced by the GNU Project.
- GNU make: an automation tool for compilation and build
- GNU Compiler Collection (GCC): a suite of compilers for several programming languages
- GNU C Library (glibc): core C library including headers, libraries, and dynamic loader
- GNU Binutils: a suite of tools including linker, assembler and other tools
- GNU Bison: a parser generator, often used with the Flex lexical analyser
- GNU m4: an m4 macro processor
- GNU Debugger (GDB): a code debugging tool
- GNU build system (autotools): Autoconf, Automake and Libtool
Playing Around:
Resources:
Preprocessing:
This is where the macros expand, you can see the output of the preprocessing step, just run gcc with the -E option.
#define hello_val 123 #define RETURN_HELLO_VAL(some_arg) \ do { \ return some_arg; \ } while (0) int main(void) { RETURN_HELLO_VAL(hello_val); }
Running gcc hello.c -E
returns something like:
(base) ➜ temp git:(master) ✗ gcc -E hello.c # 1 "hello.c" # 1 "<built-in>" 1 # 1 "<built-in>" 3 # 362 "<built-in>" 3 # 1 "<command line>" 1 # 1 "<built-in>" 2 # 1 "hello.c" 2 int main(void) { do { return 123; } while (0); }
beautiful.