[PATCH] D19952: AMDGPU: Use lld as the linker again
Rafael EspĂndola via llvm-commits
llvm-commits at lists.llvm.org
Thu May 5 06:16:05 PDT 2016
lgtm
On 4 May 2016 at 22:15, Tom Stellard via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> tstellarAMD created this revision.
> tstellarAMD added reviewers: kzhuravl, arsenm.
> tstellarAMD added a subscriber: llvm-commits.
>
> Now that LLVM is emitting version 2 of the AMD code object, we can
> start using lld again for linking instead of our custom tool.
>
> http://reviews.llvm.org/D19952
>
> Files:
> lib/Driver/Tools.cpp
> lib/Driver/Tools.h
> test/Driver/amdgpu-toolchain.c
>
> Index: test/Driver/amdgpu-toolchain.c
> ===================================================================
> --- test/Driver/amdgpu-toolchain.c
> +++ test/Driver/amdgpu-toolchain.c
> @@ -1,3 +1,3 @@
> // RUN: %clang -### -target amdgcn--amdhsa -x assembler -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=AS_LINK %s
> // AS_LINK: clang{{.*}} "-cc1as"
> -// AS_LINK: amdphdrs{{.*}}
> +// AS_LINK: ld.lld{{.*}} "-shared"
> Index: lib/Driver/Tools.h
> ===================================================================
> --- lib/Driver/Tools.h
> +++ lib/Driver/Tools.h
> @@ -242,7 +242,7 @@
>
> class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
> public:
> - Linker(const ToolChain &TC) : GnuTool("amdgpu::Linker", "amdphdrs", TC) {}
> + Linker(const ToolChain &TC) : GnuTool("amdgpu::Linker", "ld.lld", TC) {}
> bool isLinkJob() const override { return true; }
> bool hasIntegratedCPP() const override { return false; }
> void ConstructJob(Compilation &C, const JobAction &JA,
> Index: lib/Driver/Tools.cpp
> ===================================================================
> --- lib/Driver/Tools.cpp
> +++ lib/Driver/Tools.cpp
> @@ -6776,6 +6776,8 @@
> std::string Linker = getToolChain().GetProgramPath(getShortName());
> ArgStringList CmdArgs;
> AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
> + CmdArgs.push_back("-shared");
> + CmdArgs.push_back("-o");
> CmdArgs.push_back(Output.getFilename());
> C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
> CmdArgs, Inputs));
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list