Skip to content

Commit 7d388ae

Browse files
committed
Revert "[Clang] Correctly forward --cuda-path to the nvlink wrapper (#100170)"
This reverts commit 7e1fcf5.
1 parent 055e431 commit 7d388ae

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

clang/lib/Driver/ToolChains/Cuda.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,6 @@ void NVPTX::Linker::ConstructJob(Compilation &C, const JobAction &JA,
609609
CmdArgs.push_back(Args.MakeArgString(
610610
"--pxtas-path=" + Args.getLastArgValue(options::OPT_ptxas_path_EQ)));
611611

612-
if (Args.hasArg(options::OPT_cuda_path_EQ))
613-
CmdArgs.push_back(Args.MakeArgString(
614-
"--cuda-path=" + Args.getLastArgValue(options::OPT_cuda_path_EQ)));
615-
616612
// Add paths specified in LIBRARY_PATH environment variable as -L options.
617613
addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH");
618614

clang/test/Driver/linker-wrapper-passes.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// Check various clang-linker-wrapper pass options after -offload-opt.
22

3+
// REQUIRES: llvm-plugins, llvm-examples
4+
// REQUIRES: x86-registered-target
5+
// REQUIRES: amdgpu-registered-target
6+
37
// Setup.
48
// RUN: mkdir -p %t
59
// RUN: %clang -cc1 -emit-llvm-bc -o %t/host-x86_64-unknown-linux-gnu.bc \
@@ -19,14 +23,14 @@
1923
// RUN: %t/host-x86_64-unknown-linux-gnu.s
2024

2125
// Check plugin, -passes, and no remarks.
22-
// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
26+
// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
2327
// RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
2428
// RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
2529
// RUN: --offload-opt=-passes="function(goodbye),module(inline)" 2>&1 | \
2630
// RUN: FileCheck -match-full-lines -check-prefixes=OUT %s
2731

2832
// Check plugin, -p, and remarks.
29-
// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
33+
// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
3034
// RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
3135
// RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
3236
// RUN: --offload-opt=-p="function(goodbye),module(inline)" \
@@ -39,7 +43,7 @@
3943
// RUN: -check-prefixes=YML %s
4044

4145
// Check handling of bad plugin.
42-
// RUN: not clang-linker-wrapper --dry-run \
46+
// RUN: not clang-linker-wrapper \
4347
// RUN: --offload-opt=-load-pass-plugin=%t/nonexistent.so 2>&1 | \
4448
// RUN: FileCheck -match-full-lines -check-prefixes=BAD-PLUGIN %s
4549

clang/test/Driver/nvlink-wrapper.c

-7
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,3 @@ int baz() { return y + x; }
6363
// RUN: -arch sm_52 -o a.out 2>&1 | FileCheck %s --check-prefix=LTO
6464
// LTO: ptxas{{.*}} -m64 -c [[PTX:.+]].s -O3 -arch sm_52 -o [[CUBIN:.+]].cubin
6565
// LTO: nvlink{{.*}} -arch sm_52 -o a.out [[CUBIN]].cubin {{.*}}-u-{{.*}}.cubin {{.*}}-y-{{.*}}.cubin
66-
67-
//
68-
// Check that we don't forward some arguments.
69-
//
70-
// RUN: clang-nvlink-wrapper --dry-run %t.o %t-u.o %t-y.a \
71-
// RUN: -arch sm_52 --cuda-path/opt/cuda -o a.out 2>&1 | FileCheck %s --check-prefix=PATH
72-
// PATH-NOT: --cuda-path=/opt/cuda

clang/tools/clang-nvlink-wrapper/NVLinkOpts.td

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def verbose : Flag<["-"], "v">, HelpText<"Print verbose information">;
1212
def version : Flag<["--"], "version">,
1313
HelpText<"Display the version number and exit">;
1414

15-
def cuda_path_EQ : Joined<["--"], "cuda-path=">, Flags<[WrapperOnlyOption]>,
15+
def cuda_path_EQ : Joined<["--"], "cuda-path=">,
1616
MetaVarName<"<dir>">, HelpText<"Set the system CUDA path">;
17-
def ptxas_path_EQ : Joined<["--"], "ptxas-path=">, Flags<[WrapperOnlyOption]>,
17+
def ptxas_path_EQ : Joined<["--"], "ptxas-path=">,
1818
MetaVarName<"<dir>">, HelpText<"Set the 'ptxas' path">;
1919

2020
def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,

0 commit comments

Comments
 (0)