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

    <tr>
        <th>Summary</th>
        <td>
            -fuse-ld causes "argument unused warning" which causes Linux Kernel kconfig to fail.
        </td>
    </tr>

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

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

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

<pre>
    Building the Linux Kernel with clang will cause kconfig to believe that `CONFIG_CC_HAVE_SHADOW_CALL_STACK` is not supported on aarch64.

This is because the Kconfig rule:

```
# Supported by clang >= 7.0
config CC_HAVE_SHADOW_CALL_STACK
 def_bool $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18)
```

Which is further decomposed into a command:

```
$CC -Werror $CLANG_FLAGS -fsanitize=shadow-call-stack -ffixed-x18 -c -x c /dev/null -o tmp.o
```

The kernel build will pass kconfig a fairly lengthy value for $CC but it happens to include:

```
-fuse-ld=lld
```

Since the kconfig command is only compiling the dummy source (-c), clang warns that 

```
clang-14: error: argument unused during compilation: '-fuse-ld=ldd' [-Werror,-Wunused-command-line-argument]
```

It appears clang sets -Wunused-command-line-argument by default.  gcc on the other hand, does not have an unused command line argument warning and so does not experience the issue.   Although we can work around this issue through the kernel makefiles, it is fair to consider whether this is really the correct behavior.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVc1u2zoTfRp6M5AhU_6JF1qoct0WCdpFgi9LgyJHIr9QpMAfO75Pf0FJbtKL2xQXMGQLHs6cM3POkHmvOoNYks0nsjksWAzSutIH5jRr-tAsGiuu5aeotFCmgyARHpSJr3CPzqCGiwoSuGamg4vSGjiLHuGFW9OqDoKFBrXCM0KQLADZ5vWP78dvX051ffpa_e_z6fFrdfjxfKqrh4fT41NV35NtDsqDsQF8HAbrAgqwBhhzXG7XS5IfSF5NzyepfAp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