Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ The recommendations in Table 1 and Table 2 are primarily applicable to compiling
- supported both by the GCC and Clang / LLVM toolchains.
- cross-platform and supported on (at least) Intel and AMD 64-bit x86 architectures as well as the 64-bit version of the ARM architecture (AArch64).

Linker options covered by this guide are (unless otherwise noted) valid for GNU Linker (LD) provided as part of GNU Binary Utilities (binutils) and built off the GNU BFD (Binary File Descriptor) library. They may not be valid options for other linkers, such as binutils gold or the LLVM Linker (LLD).

[^compiler-flags-distro]: Voisin, Julien et al., [Default compiler hardening flags used to build packages for Linux distributions](https://github.com/jvoisin/compiler-flags-distro), GitHub jvoisin/compiler-flags-distro, 2025-02-14.

For historical reasons, the GCC compiler and Binutils upstream projects do not enable optimization or security hardening options by default. While some aspects of the default options can be changed when building GCC and Binutils from source, the defaults used in the toolchains shipped with GNU/Linux distributions vary. Distributions may also ship multiple versions of toolchains with different defaults. Consequently, developers need to pay attention to compiler and linker option flags, and manage them according to their need of optimization, level of warning and error detection, and security hardening of the project.
Expand Down