[Driver] Fix duplicate -L after D150013
authorFangrui Song <i@maskray.me>
Sat, 8 Jul 2023 06:57:45 +0000 (23:57 -0700)
committerFangrui Song <i@maskray.me>
Sat, 8 Jul 2023 06:57:45 +0000 (23:57 -0700)
commit681cb54a54bb60dea9034b4b0b45ccc392875b9a
treef6a22d48fab6d27747464d4a8a7ffeefb3f15e31
parent62281227bf7ca48d0101e4c9d11f71600208c7df
[Driver] Fix duplicate -L after D150013

D150013 is to render -L for AMDGPU but updating tools::AddLinkerInputs is wrong
and causes many non-isCrossCompiling targets to have duplicate -L options
because they do `Args.AddAllArgs(CmdArgs, options::OPT_L);`.

Revert the change and add a `Args.AddAllArgs(CmdArgs, options::OPT_L);` instead.
clang/lib/Driver/ToolChains/AMDGPU.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp