<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Inconsistent target strings"
   href="https://bugs.llvm.org/show_bug.cgi?id=39662">39662</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Inconsistent target strings
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>ELF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bztemail@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

This is not really a bug, but rather a very inconvinient and annoying little
thing (at least for me, and I think I'm not alone).

When I use clang, I use "--target=x86_64-elf" or "--target=aarch64-elf". I
would like to use the same arguments with lld, but it has "-m elf_x86_64" and
"-m aarch64elf". I think that it would be very nice to have the same target
strings for both the compiler and the linker.

I've checked the code, and I believe the only modification it needs is simply
adding those two strings to
<a href="https://github.com/llvm-mirror/lld/blob/master/ELF/Driver.cpp#L124">https://github.com/llvm-mirror/lld/blob/master/ELF/Driver.cpp#L124</a>
so that the StringSwitch would read:
.Cases("aarch64elf", "aarch64linux", "aarch64_elf64_le_vec", "aarch64-elf",
and
.Cases("elf_amd64", "elf_x86_64", "x86_64-elf", {ELF64LEKind, EM_X86_64})

If there're other parts that also need to be modified, I haven't found them.
But I admit I don't have much experience with the lld source yet.

I think many developers would welcome this small modification, as using unified
target strings for the two most common architectures would simplify their
lives. I don't use formats other than ELF, but I assume the same unification
would be nice for them too, if not done already.

Otherwise I'd like to say thanks for lld, it works great! I was able to replace
GNU ld with ld.lld, and I only had to find workarounds to the missing STARTUP()
linker script directive and the -nostartfiles argument (I usually work for bare
metal). It wasn't a big deal and that was all, so imho you have done a really
really amazing job! Keep up the good work!

Thanks,
bzt</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>