Skip to content

Commit

Permalink
Revert "[AIX] Pass the -b option to linker on AIX"
Browse files Browse the repository at this point in the history
This reverts commit 1099544.
  • Loading branch information
anjankumar-g-k committed Jul 29, 2021
1 parent 0871954 commit 7645cdc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
4 changes: 1 addition & 3 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -815,9 +815,7 @@ def autocomplete : Joined<["--"], "autocomplete=">;
def bind__at__load : Flag<["-"], "bind_at_load">;
def bundle__loader : Separate<["-"], "bundle_loader">;
def bundle : Flag<["-"], "bundle">;
def b : JoinedOrSeparate<["-"], "b">, Flags<[LinkerInput, RenderAsInput]>,
HelpText<"Pass -b <arg> to the linker on AIX (only).">, MetaVarName<"<arg>">,
Group<Link_Group>;
def b : JoinedOrSeparate<["-"], "b">, Flags<[Unsupported]>;
def cl_opt_disable : Flag<["-"], "cl-opt-disable">, Group<opencl_Group>, Flags<[CC1Option]>,
HelpText<"OpenCL only. This option disables all optimizations. By default optimizations are enabled.">;
def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">, Group<opencl_Group>, Flags<[CC1Option]>,
Expand Down
10 changes: 0 additions & 10 deletions clang/lib/Driver/ToolChains/CommonArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,6 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs,
// Otherwise, this is a linker input argument.
const Arg &A = II.getInputArg();

if (A.getOption().matches(options::OPT_b)) {
const llvm::Triple &T = TC.getTriple();
if (!T.isOSAIX()) {
TC.getDriver().Diag(diag::err_drv_unsupported_opt_for_target)
<< A.getAsString(Args);
}
// Pass -b prefix for AIX linker.
A.claim();
A.render(Args, CmdArgs);
}
// Handle reserved library options.
if (A.getOption().matches(options::OPT_Z_reserved_lib_stdcxx))
TC.AddCXXStdlibLibArgs(Args, CmdArgs);
Expand Down
12 changes: 1 addition & 11 deletions clang/test/Driver/Xlinker-args.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,10 @@
// RUN: -e _start -T a.lds -Xlinker one -Xlinker --no-demangle \
// RUN: -Wl,two,--no-demangle,three -Xlinker four -z five -r %s 2> %t
// RUN: FileCheck -check-prefix=LINUX < %t %s

// RUN: %clang -target powerpc-unknown-aix -### \
// RUN: -b one %s 2> %t
// RUN: FileCheck -check-prefix=AIX < %t %s

// RUN: %clang -target powerpc-unknown-linux -### \
// RUN: -b one %s 2> %t
// RUN: FileCheck -check-prefix=NOT-AIX < %t %s

//
// DARWIN-NOT: --no-demangle
// DARWIN: "one" "two" "three" "four" "-z" "five" "-r"
// LINUX: "--no-demangle" "-e" "_start" "one" "two" "three" "four" "-z" "five" "-r" {{.*}} "-T" "a.lds"
// AIX: "-b" "one"
// NOT-AIX: error: unsupported option '-b one'

// Check that we forward '-Xlinker' and '-Wl,' on Windows.
// RUN: %clang -target i686-pc-win32 -fuse-ld=link -### \
Expand Down

0 comments on commit 7645cdc

Please sign in to comment.