<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/150147>150147</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Clang][Driver] riscv64-elf target does not recognise -pie link time argument
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mintsuki
      </td>
    </tr>
</table>

<pre>
    As per title, trying to link an executable using the `clang` driver, using a `riscv64-elf` target, results in the following warning:
```
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
```

The `-pie` flag (and other possibly necessary flags for PIE linkage) are not passed to the linker.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxcUk2vmzAQ_DXmsiIy5iPJgUPy0ki99VCpZ2Mv4D5jI6-d1_z7ypC2T5WQOOzMeGd2JJGZHGLP2itrb4VMcfahX4yLlN5NMXj97C8EKwaIJlpk4g1ieBo3QfRgjXsH6QB_oUpRDhYh0TabEVjHlZVuYh0HHcwDQybvc5mnwZB6dE2JdsyYKMOEMWMCUrKRwLhNaPTW-o9M-5DBGTex-sL4hXX89fHL_lB9-YQAGaa0oIuQXCLUoFPIGsovq7EyGu8yioljuRpk4gisvZY_dnCp_LJIp0trHJZ_lFh7--9dxi_fd6ubSMdhtHICJk7SafBxxgCrJzKDfYJDhUQyPDcQwegDfPv6ZUtRTsjEGWRAcD7CKimvHP0WQAZgOBS6r_W5PssC--rY1qLmouuKuZfVKMexUnXDVTWO5-401LpGHJU4iVrzwvSCi5YfRc25aER30KpRWp06rSt-1tWJNRwXaezB2sdy8GEqDFHCvmp51RwLKwe0tJVEiD1rIXJfQp8J5ZAmYg23hiL9k9gKk0lvG6O9sfZ624vQ3uDT9V-nB-2RNvsBlZ-cIYQc616zaBb8e9MiBdvPMa6UuyDuTNwnE-c0HJRfmLjnHV6_cg3-J6rIxH3zREzcX7YevfgdAAD__xQa-oI">