130 likes | 146 Views
Throughout your career, the systems you target will evolve rapidly, making tool specifications crucial. The interface between Compilers, Libraries, and Operating Systems can be confusing, but each plays a vital role in code generation. Selecting a compiler involves various criteria, including the target environment, standards, tool range, library support, and output formats. Features like inline linkage and support for full processor families are also important. GCC, developed by Richard Stallman and the Free Software Foundation, offers a comprehensive suite of development tools, including compilers for various languages and useful utilities. Compiling code using assembler in GCC involves specific commands for different processors, enabling efficient code generation and optimization.
E N D
Why do you need to select a CDE? • Through out your career the target systems will change rapidly • Both the h/w and s/w • The specification of the tools will be more important • For example, small fast code may be essential • The requirements of the tools will be very specific • Specialist tools will be required.
What will you be selecting? • There can be confusion over both the role and interface between Compilers, Libraries and Operating Systems • It is possible to do without either a library and an operating system! Compiler Operating System Library Implements calls Adds functionality Does the calls Calls functions getchar,
Compilers, Libraries and OSs • The Compiler generates code • However code need linking and loading • The library provides functionality and interfaces to OS • Libraries have to interface to OS • The operating system actually implements the calls and permits the execution of code
Selecting a compiler #1 • The are a number of criteria for selecting a compiler • Target environment • Can impose a choice • Standards • Lots of them and confusing • Tools • A range of tools are very important • Library support • Documentation • Output format(s)
Selecting a compiler #2 • There are a number of criteria that can be used • Mature compiler • Portable • Widely used/known • Runs on same/compatible hardware • Variety of OS/RTOS interfaces • Supports a number of languages • Open source/open standard
Selecting a compiler #3 • Special features for xdevelopment • Inline and assembler linkage • Output of assembler code • Can turn off features • i.e. optimisation • Supports full processor family • Sophisticated linking • Good linker language supported
GCC • Long standing compiler development • Developed an editor emacs, compiler suite gcc and UNIX-like OS Hurd. Plus many other tools and utilities. • emacs and gcc have been the most successful and central to many developments – BSD, Linux • Developed by Richard Stallman and the Free Software Foundation
The GCC suite • The development tools are made up of • gcc , a set of compilers for C, C++, Ada, Java • The gnu linker, ld and assembler, as • Binutils, a collection of useful code development tools • ar, nm, objcopy, objdump, ranlib, size, strings, strip, addr2line
Using assembler in gcc • Compiling the code with • M68k-unknown-coff-gcc –m68000 –S asm.c • Creates…….
Using assembler in gcc • Compiling with • M68k-unknown-gcc –m68000 –S –O3 –fomit-frame-pointer • Creates…