???? ??? - (5) GCC - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

???? ??? - (5) GCC

Description:

... IA-64 i.e. the – PowerPoint PPT presentation

Number of Views:65
Avg rating:3.0/5.0
Slides: 15
Provided by: KimC171
Category:
Tags: gcc | renesas

less

Transcript and Presenter's Notes

Title: ???? ??? - (5) GCC


1
???? ???- (5) GCC
  • Konkuk Univ.
  • Dept. of Electronics

Konkuk Univ. Dept. of Electronics
2
GCC
  • GCC(GNU C Compiler)
  • GCC(GNU Compiler Collection) C, C, Java,
    Fortran, Ada, Objective-C/C
  • GCC? ??? ???? 1987? GNU ????? ????? ????. GNU
    ????? ????? ??? ??? ? ??? ?? ????? ??? ?????.
  • ?? ???? ????, ???? ????? ???? ??? ??? ? ?? ???
    ??? ?? ? ??? ??
  • GCC 4.1 Alpha, ARM, Blackfin, H8/300,
    System/370, System/390, IA-32 (x86) and AMD64,
    IA-64 i.e. the "Itanium", Motorola 68000,
    Motorola 88000, MIPS, PA-RISC, PDP-11, PowerPC,
    SuperH, SPARC, VAX, Renesas R8C/M16C/M32C
    families, MorphoSys family
  • gcc ? ????? ????? ?? ????? ???

Konkuk Univ. Dept. of Electronics
3
C compile ??

.c .cc .C
.o
.s
???? (preprocessor)
???? (compiler)
???? (assembler)
?? (linker)
.s
.o
a.out
Konkuk Univ. Dept. of Electronics
4
C compile ?? cont.
  • C preprocessing (cpp) exgt define xx 100
  • C compile (cc1) output) filename.s // assembly
    code
  • Assemble (as) output) relocatable object file
  • Link (ld) output) relocatable object file or
    executable file

Konkuk Univ. Dept. of Electronics
5
C compile ?? cont.
  • ???(preprocessing)
  • define, include, if? ?? ??? ??? ??
  • ??? ??? ?? c ????? ??
  • ???(compile)
  • ?? ?? ?? ????? ?? ??? ???? ??? ??(.s)
  • ????? ???? ??? ???? ?? ?? ????? ???
  • ??? ???? ?? ??? ????? ?? ??? ???? ?? ??? ???

Konkuk Univ. Dept. of Electronics
6
C compile ?? cont.
  • ???(assemble)
  • ???? ??? ?? ??? ???? ??? ??(.o)
  • ???? ?? gas ????? ???
  • ????? ???(CPUOS)?? ??? ?? ?? ???? ?? ??
  • ??(linking)
  • ???? ??? ??? ?? ??? ??(.o)
  • ????? ??? ? ???? ???
  • ??? ?? ld ????? ??

Konkuk Univ. Dept. of Electronics
7
GCC file name
  • gcc ? C compiler ? ? ??? assembler ? ??????? ??.
  • gcc ? ??? ?? ???? ??? ? ??.
  • .c preprocessingC compilerassemblelink
  • .i C compiler assemblelink
  • .s preprocessingassemblelink
  • .S assemblelink

Konkuk Univ. Dept. of Electronics
8
GCC ??

Konkuk Univ. Dept. of Electronics
9
C preprocessing

Konkuk Univ. Dept. of Electronics
10
Make
  • make ??
  • Makefile? ???? ???? ???? ??? ???(????)? ???? ???
    ?? ????
  • ?? ??? ??? ??(??)? ???? ??? ???? ???? ?? ?? ??
  • ????? ?? ??? ?? ?? ??

Konkuk Univ. Dept. of Electronics
11
GCC options
  • -o OPTION
  • ??(output) ???? ??? ?????.
  • gcc -o hello hello.c hello.c?? ??? hello?? ?????
    ??
  • -E OPTION
  • Preprocessing ??? compile
  • -c OPTION
  • ???(compile) ??? ?? ?? ??
  • gcc -c hello.c hello.c ???? .c? ???? hello.o??
    ???? ??? ??
  • -I OPTION
  • include ???? ??? ?? ??? ???? ?? ??? ??
  • gcc -c source.c Iinclude -I? ???

Konkuk Univ. Dept. of Electronics
12
GCC options cont.
  • g OPTION
  • ???? ??????? ??? ??? ??
  • gcc g o hello hello.c
  • -O OPTION
  • ??? ???(optimization)
  • -O2? ?? ?? ???, -O -O1, -O0?? ?? ???? ?? ??,
    ??? -O1
  • -l OPTION
  • ?? ?????? ????? ??
  • -L OPTION
  • ? ?????? ?? ????? ??? ?? ?

Konkuk Univ. Dept. of Electronics
13
make Makefile
  • ?? ?? ??
  • ???? ?? ?? ? ??? ???.
  • ex) (CC) gcc
  • Test label? ????? foo.o, main.o ??? ?? ????? ?
  • foo.c, main.c? ??? ?? ??? ??
  • make clean? ???? ???? label

Makefile
Konkuk Univ. Dept. of Electronics
14
make Makefile cont.

main.c
execute make
foo.c
Konkuk Univ. Dept. of Electronics
Write a Comment
User Comments (0)
About PowerShow.com