Skip to content

Commit 39ac8b2

Browse files
authored
[clang][GNU] Pass -t through to the linker (#112106)
1 parent ab6ec7a commit 39ac8b2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
671671
}
672672
}
673673

674-
Args.AddAllArgs(CmdArgs, options::OPT_T);
674+
Args.addAllArgs(CmdArgs, {options::OPT_T, options::OPT_t});
675675

676676
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
677677
C.addCommand(std::make_unique<Command>(JA, *this,

clang/test/Driver/Xlinker-args.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/// -T is reordered to the last to make sure -L takes precedence.
1010
// RUN: %clang -target x86_64-pc-linux-gnu -### \
11-
// RUN: -e _start -T a.lds -Xlinker one -Xlinker --no-demangle \
11+
// RUN: -e _start -T a.lds -t -Xlinker one -Xlinker --no-demangle \
1212
// RUN: -Wl,two,--no-demangle,three -Xlinker four -z five -r %s 2> %t
1313
// RUN: FileCheck -check-prefix=LINUX < %t %s
1414

@@ -23,7 +23,7 @@
2323

2424
// DARWIN-NOT: --no-demangle
2525
// DARWIN: "one" "two" "three" "four" "-z" "five" "-r"
26-
// LINUX: "--no-demangle" "-e" "_start" "one" "two" "three" "four" "-z" "five" "-r" {{.*}} "-T" "a.lds"
26+
// LINUX: "--no-demangle" "-e" "_start" "one" "two" "three" "four" "-z" "five" "-r" {{.*}} "-T" "a.lds" "-t"
2727
// MINGW: "--no-demangle"
2828
// AIX: "-b" "one" "-b" "two"
2929

0 commit comments

Comments
 (0)