diff options
author | Guillem Jover <guillem@debian.org> | 2016-10-21 00:18:55 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2016-11-06 03:07:14 +0100 |
commit | 1852648603b1cc26ee4ce95a5173032445af4eb1 (patch) | |
tree | 2619659fca93e4083f0ea25262ee4d8e15c35269 /man/dpkg-buildflags.man | |
parent | 53392da21859b4df51cb19b6c880f2f06135eca7 (diff) | |
download | dpkg-1852648603b1cc26ee4ce95a5173032445af4eb1.tar.gz |
Dpkg::Vendor::Debian: Handle PIE enabled by default in gcc
Add support for compiler built-in features, so that we do not set
them when enabled and set negated flags when disabled.
We use gcc spec files to set these flags so that we avoid any conflict
with other incompatible flags that would make the build fail.
Closes: #835149
Based-on-patch-by: Bálint Réczey <balint@balintreczey.hu>
Diffstat (limited to 'man/dpkg-buildflags.man')
-rw-r--r-- | man/dpkg-buildflags.man | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/man/dpkg-buildflags.man b/man/dpkg-buildflags.man index 225f41478..a070cefaf 100644 --- a/man/dpkg-buildflags.man +++ b/man/dpkg-buildflags.man @@ -147,7 +147,7 @@ For example: .IP .nf Feature: pie - Enabled: no + Enabled: yes Feature: stackprotector Enabled: yes @@ -347,10 +347,19 @@ above). The option cannot become enabled if \fBrelro\fP is not enabled. . .TP .B pie -This setting (disabled by default) adds \fB\-fPIE\fP to \fBCFLAGS\fP, -\fBCXXFLAGS\fP, \fBOBJCFLAGS\fP, \fBOBJCXXFLAGS\fP, \fBGCJFLAGS\fP, -\fBFFLAGS\fP and \fBFCFLAGS\fP, -and \fB\-fPIE \-pie\fP to \fBLDFLAGS\fP. Position Independent +This setting (enabled and injected by default by gcc on the amd64, +arm64, armel, armhf, i386, mips, mipsel, mips64el, ppc64el and s390x +architectures, since dpkg 1.18.11) adds the required options if needed +to enable or disable PIE. When enabled and injected by gcc, +adds nothing. When enabled and not injected by gcc, adds \fB\-fPIE\fP +to \fBCFLAGS\fP, \fBCXXFLAGS\fP, \fBOBJCFLAGS\fP, \fBOBJCXXFLAGS\fP, +\fBGCJFLAGS\fP, \fBFFLAGS\fP and \fBFCFLAGS\fP, and \fB\-fPIE \-pie\fP +to \fBLDFLAGS\fP. When disabled and injected by gcc, adds \fB\-fno\-PIE\fP +to \fBCFLAGS\fP, \fBCXXFLAGS\fP, \fBOBJCFLAGS\fP, \fBOBJCXXFLAGS\fP, +\fBGCJFLAGS\fP, \fBFFLAGS\fP and \fBFCFLAGS\fP, and +\fB\-no\-pie\fP to \fBLDFLAGS\fP. + +Position Independent Executable are needed to take advantage of Address Space Layout Randomization, supported by some kernel versions. While ASLR can already be enforced for data areas in the stack and heap (brk and mmap), the code |