<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:i@maskray.me" title="Fangrui Song <i@maskray.me>"> <span class="fn">Fangrui Song</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Clang does not pass `-pie` to the linker when using `-fPIE`"
   href="https://bugs.llvm.org/show_bug.cgi?id=48109">bug 48109</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>i@maskray.me
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Clang does not pass `-pie` to the linker when using `-fPIE`"
   href="https://bugs.llvm.org/show_bug.cgi?id=48109#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Clang does not pass `-pie` to the linker when using `-fPIE`"
   href="https://bugs.llvm.org/show_bug.cgi?id=48109">bug 48109</a>
              from <span class="vcard"><a class="email" href="mailto:i@maskray.me" title="Fangrui Song <i@maskray.me>"> <span class="fn">Fangrui Song</span></a>
</span></b>
        <pre>This is invalid. -fPIE is a compilation option while -pie is a driver option
affecting linking. -fPIE does not imply -pie in GCC.

What you want is something similar to GCC's configure-time --enable-default-pie
(introduced in GCC 6:
<a href="https://gcc.gnu.org/git/?p=gcc.git&a=commit;h=428b381275bc95032274440f02d7719225de2c17">https://gcc.gnu.org/git/?p=gcc.git&a=commit;h=428b381275bc95032274440f02d7719225de2c17</a>)

Some folks had the same question
<a href="http://lists.llvm.org/pipermail/cfe-dev/2020-June/065684.html">http://lists.llvm.org/pipermail/cfe-dev/2020-June/065684.html</a> but no decision
is made whether we should do it (personally I do not favor the idea much as it
just made the default behavior different on different distributions where the
distros can just provide default CFLAGS/LDFLAGS).</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>