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

    <tr>
        <th>Summary</th>
        <td>
            build the executable file with --fsanitize=memtag failed 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    I used clang to compile programs with memtag sanitizer on Arm v8.9-a fvp with MTE hardware mechanism enabled.
Compiling and linking the target file failed, but the two steps of compiling and linking can generate the target file
`clang++-17 --target=aarch64-linux -march=armv8.5-a+memtag  -fsanitize=memtag-stack,memtag-heap 2.cpp -O0` failed with this output:
`clang++-17: error: unsupported option '-fsanitize=memtag*' for target 'aarch64-unknown-linux'`
But if I try to make middle object file instead of final executable file by the command `clang++-17 --target=aarch64-linux -march=armv8.5-a+memtag -fsanitize=memtag-stack,memtag-heap -c 2.cpp -O0`, and link it with `clang++-17 -o 2 2.o -fuse-ld=lld`.
the build process is successful.
Is there a problem with target checking in Clang, or I misused the memtag sanitizer option?

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVMuOszYUfhqzOQI5JpCwYJFLI82i6qYvYOwDuOML8mXyz__0lYGo6nQqddFVjH3i892OeQhqsog9aa6kuRc8xdn5_qey0T1tMTj52b9BCihBaG4niA6EM4vSCIt3k-cmwFPFGQyayCcI3KqofqIHZ-HiDXycq67kMH4sW92vv_8CM_fyyT2CQTFzq4IBtHzQKCtC74RebmsLZSfgVoJW9j2v44wQuZ8wwpgBjFxplITdYEhxO306CBGXAG7ccX69RHALE1r0POLXG7fmpKUrV8KuhF3LwwnKcisi9Z1zL-b2WGpl0w8oTf7M2958nKum5IRddyWgHF9ikPq-bZYhcvFO2G3_nJEvwCqxLFD-RklLd06bVHFWAVyKS4qkvvwLOFJfAL13Pi-SDWlZnI8owS1ROQuEnb4BQtiFsBOMzr_4E3Z6cUv23bqn3TgSdiIt3ZpfUwQ1whtE_5mTYPg7glFSagQ3_IFiN0bZEJHLbMKoLNeAP1CkmB3eCobPVXrhjMne_E-K_1fBS_E3zXOAXgkBFTftv4HkgAGrHJRjClhqSeq71pK0dA9tZjQkpWWeDIEhgAoQksjLMem96i1k6h6B57JBo9nN3mwQM4o1p8rCbQNwA-fhDYwK6xzmNv8cttVsUj-2JoXsa9nVHS-wP7Qdo-2p647F3I8DGxmtDycp6Pk4jLJh57plRz40vOY1L1TPKKvp-dBQ1tSHY9V0dXOmYqTsUJ873pAjRcOVrrT-MJXzU6FCSNi3x7ZjheYD6rC-JoxZfMJ6SBjLj4vv83_KIU2BHKlWIYa_bokqauw3_TLFr5FZRSq_sfg1MkXyup9jXEIeFvYg7DGpOKehEs4Q9sid9p9y8S6nlbDHii8Q9ljx_xkAAP__jI-sNA">