# pie

Determines whether the compiler generates position-independent code that will be linked into an executable.

## Syntax

Linux: | -pie -no-pie

macOS: | -pie -no-pie

Windows: | None

## Arguments

None

## Default

varies | On Linux* and on macOS versions less than 10.7, the default is -no-pie. On macOS 10.7 or greater, the default is -pie.

## Description

This option determines whether the compiler generates position-independent code that will be linked into an executable. To enable generation of position-independent code that will be linked into an executable, specify -pie.

To disable generation of position-independent code that will be linked into an executable, specify -no-pie.

## IDE Equivalent

None

## Alternate Options

None

Parent topic: Linking or Linker Options

## See Also

fpic compiler option