<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - add support for building positions independent executables by default"
href="http://llvm.org/bugs/show_bug.cgi?id=22102">22102</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>add support for building positions independent executables by default
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Driver
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>danielmicay@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>It's currently not possible to enable PIE (full ASLR) across the board without
either patching the compiler or wrapping it behind a script. Other hardening
flags can simply be set via CFLAGS/LDFLAGS as most build systems respect them.
The -fPIE switch needs to be passed when -f{no}-{pic,pie,PIC} is not and -pie
needs to be passed for linking executables but not libraries along with some
other exceptions. The list in the pending GCC patch is likely enough for Clang
too:
<a href="https://gcc.gnu.org/ml/gcc-patches/2014-07/msg02231.html">https://gcc.gnu.org/ml/gcc-patches/2014-07/msg02231.html</a>
Recent improvements to gcc/binutils (PIE copy relocs) means that PIE has ~0%
overhead in most cases on x86_64 rather than ~1-5%, although this may not be
implemented in LLVM yet. The main blocker to distributions taking advantage of
it is simply making it easy to turn on.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>