fpic

Tells the compiler to generate position-independent code.

IDE Equivalent

Windows: None

Linux: Code Generation > Generate Position Independent Code

Mac OS: None

Architectures

IA-32 architecture, Intel® 64 architecture, IA-64 architecture

Syntax

Linux: -fpic
-fno-pic
Mac OS: None
Windows:  None

Arguments

None

Default

-fno-pic The compiler does not generate position-independent code.

Description

This option tells the compiler to generate position-independent code.

It specifies full symbol preemption. Global symbol definitions as well as global symbol references get default (that is, preemptable) visibility unless explicitly specified otherwise.

On systems using IA-32 architecture and Intel® 64 architecture, this option must be used when building shared objects.

This option can also be specified as -fPIC.

Alternate Options

None