CMPSC 311 Test 2 Build Processing Flashcards

1
Q

semantics, machines

A

Why do we build programs: to turn program —– from human-readable text into something —- understand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

compilers, interpretors

A

why use language —- instead of ——-? It depends

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

compiling, linking, gcc, Id

A

there are two phases of building a program, — and —–

—– is used to build the program

—- can be used to link the program (or gcc)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

gcc [options]

A

You will run a command to compile: ——————-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

-c

A

—– tells the compiler to just generate object files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

-Wall

A

—- tells the compiler to show all warnings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

-g

A

—– tells the compiler to generate debug information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

-o

A

— —— write output to a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

gcc hello.c -c -Wall -g -o hello.c

A

compiling hello.c syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

gcc [options]

A

command to link sytnax: ——-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

-l

A

—– link with a library

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

-g

A

tells the compiler to generate debug information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

-o

A

write output to files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

gcc hello.o goodbye.o -g -lmyexample -o hello

A

linking program syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

library

A

A —— is a collection of related code and functions that are linked against a C program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

exports, symbols

A

the library —- ——-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

unresolved symbols

A

Your program object code has ——– ——

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

linker, program

A

the —- pulls chunks of the library. containing those symbols and places them into the ———

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

resolved

A

the program is done linking when all the pieces are —–

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

static

A

It is called —— linking because this is done at link time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

statically linked, archive, linker, code

A

A —– —– library produces object code that is inserted into program at link time.

You are building an —- of the library which the —- uses to search for and transfer —- into your program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

ar rcs lib .a

A

static library syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

lib???.a

A

library naming: with very few exceptions all static libraries are named ———

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

name, file

A

You link against the —– of the library, not against the name of the —- in which the library exists

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

R

A

—- replace existing code with the objects passed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

C

A

—- create the library if needed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

S

A

—– create an index for relocatable code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

dynamic library

A

A —– —- is a collection of related code and functions that are —- at runtime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

exports, symbols

A

The library —– —–

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

unresolved symbols

A

Your program object code has —– ——

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

loader

A

the —- pulls chunks of the library containing those symbols and places them in the process

32
Q

started, execution

A

The symbols are resolved when the process is —— or later during ——-

33
Q

any time

A

it is called dynamic library, because it can be done at —– —–

34
Q

execution, loadable, launch

A

a dynamically linked library produces object code that is inserted into program at —— time.

You are building a —- version of the library which the loader uses to —— the application

35
Q

gcc -shared -o libmyexample.so a.o b.o c.o d.o

A

dynamic library syntax

36
Q

position-independent code (PIC)

A

Important: all object files to be placed in library must have been compiled to —— ——- ——

37
Q

predefined, memory, jumps, execution

A

PIC is not dependent on any being located at any —– location in ——

eg, uses relative —–, so does not matter where it is loaded at —– time

38
Q

.so

A

Naming dynamic library with PIC is same as before?? only with —– extension ???? CHECK SLIDE 11

39
Q

gcc a.c -fpic -c -Wall -g -o a.o

A

dynamic library PIC syntax

40
Q

preprocessor, compile

A

The ——– processes input source code files for commands that setup the —— environment specific to that execution

41
Q

#

A

The programmer uses —- directives to indicate what he wants that program to do. Like in —include.

there are more…

42
Q

include

A

the —- directive tells the compiler to include data from some other data file

43
Q

include “foo.h”

A

——- ——: this tells the compiler to look in the local (used for application programming)

44
Q

include

A

——- —- : tells the compiler to look at the default directories and any provided by the command line

45
Q

gcc -I, <>

A

the —— —- option:

tells the compiler to look in a specific director for include files (that are using the approach)

generally speaking, systems programming uses the —- approach to have better control over what is being included from where

46
Q

define

A

the ——- directive allows the user to create a definition symbol that gets search/replaced throughout

47
Q

constant, arrays

A

The #define is commonly used to define a constant that might be changed in the future eg the size of —–

48
Q

undef

A

the —– directive undoes binding

49
Q

define

A

—— can also be used to create simple functions called macros

50
Q

macros, overheads

A

—— are not called as normal functions, but are replaced during preprocessing

thus no function call —— such as stack operations

51
Q

if, #ifdef, #ifndef

A

You can conditionally compile parts of a program, using the —–, —–, and —– directives

52
Q

make

A

the — utility is a utility for binding complex systems/program

53
Q

out of date, dependencies, project files

A

the make utility:

figure out which parts of system are —– —- —-

figure out what the —— are between objects

issue command to create the intermediate and final —— ——

54
Q

make

A

Note: being a good systems programmer requires mastering the —– utility

55
Q

Makefile

A

Each system you want to build has one (or more) files defining how to build, called the ——

56
Q

build, way, relate

A

a Makefile defines the things to —–, the —- to build them, and the way they —–

57
Q

Target

A

Makefile:

—- a thing to build

58
Q

Prerequisites

A

Makefile:

—– things that the target depends on

59
Q

dependencies

A

Makefile:

—– between files eg a.o depends on a.c

60
Q

variables

A

Makefile:

—– dat that defines elements of interest to the build

61
Q

rules

A

Makefile:

—- are statements of targets, prerequisites and commands

62
Q

rule

A

Also known as production, a —- defines how a particular item is built.

63
Q

target: preq1, preq2, preq3..
command1
command2

(NOTE: commands must be tabbed over)

A

rule syntax

64
Q

target, prereq(1|2|3), commands

A

rule syntax:

  • — is the thing to be built
  • —- are things needed to make the target
  • — are the UNIX commands to run to make target
65
Q

commands, target, prerequisites

A

Makefile rules:

Key idea: run the —- to build the —- when any of the noted —– are out of date

66
Q

make

A

To run make, just type —- at the UNIX prompt.

67
Q

Makefile, targets, dependency graph

A

running make:

It will open the —- and build any — that are out of date. thus it will look at the ——- —–.

68
Q

variables

A

Makefile —- allow you to replace some repetitive (and changing text) with others

69
Q

CC=gcc
LINK=gcc
CFLAGS=-c -Wall -I

A

some standard Makefile variables include

70
Q

special

A

Make supports a range of —– variables that are used while evaluating each rule (called built-ins)

71
Q

$@, $^, $

A

three of the most popular make built-ins

  • — is the current rule target
  • — is the prerequisite list
  • — is the first prerequisite
72
Q

builds

A

Built-ins are used to make —— cleaner

73
Q

suffix rule

A

A —- —- defines a default way to generate a target from a type of prerequisites.

74
Q

dependency,

A

suffix rule: You only need to define the —- and not the commands for those files.

75
Q

types, productions

A

Defining suffix rule:

Step 1: define the file —– to be in suffix rules

Step 2: define the default ——-

76
Q

builds

A

You will begin to develop a set of patterns for makefiles that you will use repeatedly over time on the different (and increasingly complex) builds. We will explore the use of these over the course of this semester.