fpic

Determines whether the compiler generates position-independent code.

IDE Equivalent

Windows: None

Linux: Code Generation > Generate Position Independent Code

Mac OS X: None

Architectures

IA-32, Intel® 64, IA-64 architectures

Syntax

Linux and Mac OS X:

-fpic

-fno-pic

Windows:

None

Arguments

None

Default

-fno-pic or -fpic

On systems using IA-32 or Intel® 64 architecture, the compiler does not generate position-independent code. On systems using IA-64 architecture, the compiler generates position-independent code.

Description

This option determines whether the compiler generates position-independent code.

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

Option -fno-pic is only valid on systems using IA-32 or Intel® 64 architecture.

On systems using IA-32 or Intel® 64 architecture, -fpic must be used when building shared objects.

This option can also be specified as -fPIC.

Alternate Options

None