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

    <tr>
        <th>Summary</th>
        <td>
            Duplicate output of "-r" argument when invoking the linker with Clang
        </td>
    </tr>

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

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

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

<pre>
    When requesting `-r` output multiple Clang drivers will output `-r` twice in the constructed commandline for the linker invocation. The cause looks to be that they explicitly add `options::OPT_r` within their `::Linker::ConstructJob()` function. The argument also has the option flag `LinkerInput` in `Options.td` so it is also added when `AddLinkerInputs()` is called. Only `-r` looks to be duplicated like this so there is no difference in linker behavior. 

Below is a list of drivers that I have seen the issue, I've not checked for more:
- darwin
- dragonfly
- freebsd
- openbsd
- ps4 and ps5
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxMU82O8ygQfBp8acUi2M7PwYd8M4o0q5VmDyPtcYVNY_cGgxdwsnn7T-DJJJfE_HR1UdUlQ6DBIras-cWa90IucXS-HTqPd-tc0Tl1b_8e0YLH_xYMkewAbMc3nu04uCXOS4RpMZFmg_BmpB1AebqiD3AjYx5XfkrijXoEshBHhN7ZEP3SR1TQu2mSVhmyCNr5fG7IXtAD2avrZSRnS_hKZXIJCMa5S4DooEOIo4yp4g74_2yop2juIJVKfd2cKgOrTqw6ff719U_mcaM4rizIp1vr8Z-54fr99iD3h-uYODBxTHV6sf2TifTDMqGNIE1wMMqQaa8dQRuZtVpBP-y8xIRANm1-rqzKqNJecEARKKw4UilUcEuqsx0_KfWCEJ5UKEAvjUFVwqc196fGr8qoJekhk8KGLkkpCqldHNFjgrAOFGmNHu1qzLfoHY7ySs6XwPg746f19xcad8tEwVCI4PSP3dmDDxjlFSEgrg5TCAsy8QYfTOyvCNZF6EfsL6iyy5PzmOTO4BtQ0t_I_qy8HJzV5v7Y0B6xC-qxdDPal-UcapBWwRyaQrWVOlZHWWC73fPDllei4sXYNpXiTV3pjgtdVbqR9a7WXB_rra707qAKagUXNRfb3XbP9_xYCo7bRnaNPOw7uVfIao6TJFMac51K54civ7E9CL7lhZEdmpDTJESf4sCq06oQEyIlzLepcNMtQ2A1TyKGJ1SkaLB9f3j2SI_TwITYJIjnyOX5SNG4pEy-xCWN9hrFYvGmHWOc8_SLMxPngeK4dGXvJibOqe_332b27l_sIxPn_J7AxDk_6XcAAAD__2cYXcU">