This revision was automatically updated to reflect the committed changes. Closed by commit rG027aeec7da67: [Clang] Respect `-L` options when compiling directly for AMDGPU (authored by jhuber6).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150013/new/ https://reviews.llvm.org/D150013 Files: clang/lib/Driver/ToolChains/CommonArgs.cpp clang/test/Driver/amdgpu-toolchain.c Index: clang/test/Driver/amdgpu-toolchain.c =================================================================== --- clang/test/Driver/amdgpu-toolchain.c +++ clang/test/Driver/amdgpu-toolchain.c @@ -11,6 +11,6 @@ // DWARF_VER: "-dwarf-version=5" // RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx906 -nogpulib \ -// RUN: -flto -fconvergent-functions %s 2>&1 | FileCheck -check-prefix=LTO %s +// RUN: -L. -flto -fconvergent-functions %s 2>&1 | FileCheck -check-prefix=LTO %s // LTO: clang{{.*}} "-flto=full"{{.*}}"-fconvergent-functions" -// LTO: ld.lld{{.*}}-plugin-opt=mcpu=gfx906 +// LTO: ld.lld{{.*}}"-L."{{.*}}"-plugin-opt=mcpu=gfx906" Index: clang/lib/Driver/ToolChains/CommonArgs.cpp =================================================================== --- clang/lib/Driver/ToolChains/CommonArgs.cpp +++ clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -232,9 +232,11 @@ Args.AddAllArgValues(CmdArgs, options::OPT_Zlinker_input); // LIBRARY_PATH are included before user inputs and only supported on native - // toolchains. + // toolchains. Otherwise only add the '-L' arguments requested by the user. if (!TC.isCrossCompiling()) addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH"); + else + Args.AddAllArgs(CmdArgs, options::OPT_L); for (const auto &II : Inputs) { // If the current tool chain refers to an OpenMP offloading host, we
Index: clang/test/Driver/amdgpu-toolchain.c =================================================================== --- clang/test/Driver/amdgpu-toolchain.c +++ clang/test/Driver/amdgpu-toolchain.c @@ -11,6 +11,6 @@ // DWARF_VER: "-dwarf-version=5" // RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx906 -nogpulib \ -// RUN: -flto -fconvergent-functions %s 2>&1 | FileCheck -check-prefix=LTO %s +// RUN: -L. -flto -fconvergent-functions %s 2>&1 | FileCheck -check-prefix=LTO %s // LTO: clang{{.*}} "-flto=full"{{.*}}"-fconvergent-functions" -// LTO: ld.lld{{.*}}-plugin-opt=mcpu=gfx906 +// LTO: ld.lld{{.*}}"-L."{{.*}}"-plugin-opt=mcpu=gfx906" Index: clang/lib/Driver/ToolChains/CommonArgs.cpp =================================================================== --- clang/lib/Driver/ToolChains/CommonArgs.cpp +++ clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -232,9 +232,11 @@ Args.AddAllArgValues(CmdArgs, options::OPT_Zlinker_input); // LIBRARY_PATH are included before user inputs and only supported on native - // toolchains. + // toolchains. Otherwise only add the '-L' arguments requested by the user. if (!TC.isCrossCompiling()) addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH"); + else + Args.AddAllArgs(CmdArgs, options::OPT_L); for (const auto &II : Inputs) { // If the current tool chain refers to an OpenMP offloading host, we
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits