Browse Source

data: Do not enable PIE when linking static programs

It seems like at least glibc does not support statically linked PIE
programs, and produces random junk. Disable globally for now, if
there's a desire to enable static PIE binaries, which is known to
work on some architectures (such as musl-based ones) we can add
specialized specs files in the future.

Closes: #843714
Proposed-by: Szabolcs Nagy <nsz@port70.net>
Guillem Jover 4 years ago
parent
commit
39545fbc74
2 changed files with 5 additions and 1 deletions
  1. 1 1
      data/pie-link.specs
  2. 4 0
      debian/changelog

+ 1 - 1
data/pie-link.specs

@@ -1,2 +1,2 @@
 *self_spec:
-+ %{!shared:%{!r:%{!fno-PIE:%{!no-pie:-fPIE -pie}}}}
++ %{!static:%{!shared:%{!r:%{!fno-PIE:%{!no-pie:-fPIE -pie}}}}}

+ 4 - 0
debian/changelog

@@ -1,6 +1,10 @@
 dpkg (1.18.15) UNRELEASED; urgency=medium
 
   [ Guillem Jover ]
+  * Improve PIE flags support:
+    - Do not enable PIE when linking static programs. glibc-based systems
+      do not support this combination and produce very bogus output.
+      Proposed by Szabolcs Nagy <nsz@port70.net>. Closes: #843714
   * Test suite:
     - Mark partially documented POD modules as TAP TODO.