Skip to content

Commit

Permalink
[clang][LTO] Passing vec-extabi to the Backend on AIX
Browse files Browse the repository at this point in the history
This patch passes on the `vec-extabi` mabi option on AIX.

Reviewed By: w2yehia

Differential Revision: https://reviews.llvm.org/D136874
  • Loading branch information
qiongsiwu committed Oct 28, 2022
1 parent b999ac1 commit fd448bb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clang/lib/Driver/ToolChains/CommonArgs.cpp
Expand Up @@ -599,6 +599,10 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
options::OPT_gno_strict_dwarf, true))
CmdArgs.push_back(
Args.MakeArgString(Twine(PluginOptPrefix) + "-strict-dwarf=true"));

if (Args.getLastArg(options::OPT_mabi_EQ_vec_extabi))
CmdArgs.push_back(
Args.MakeArgString(Twine(PluginOptPrefix) + "-vec-extabi"));
}

bool UseSeparateSections =
Expand Down
10 changes: 10 additions & 0 deletions clang/test/Driver/lto-aix.c
Expand Up @@ -27,6 +27,16 @@
// O2: "-bplugin_opt:-O2"
// O3: "-bplugin_opt:-O3"
//
// vec-extabi option
// RUN: %clang --target=powerpc-ibm-aix --sysroot %S/Inputs/aix_ppc_tree %s \
// RUN: -fuse-ld=ld -flto -mabi=vec-extabi -### 2>&1 \
// RUN: | FileCheck --check-prefix=VECEXTABI %s
// RUN: %clang --target=powerpc-ibm-aix --sysroot %S/Inputs/aix_ppc_tree %s \
// RUN: -fuse-ld=ld -flto -### 2>&1 | FileCheck --check-prefix=NOVECEXTABI %s
//
// VECEXTABI: "-bplugin_opt:-vec-extabi"
// NOVECEXTABI-NOT: "-bplugin_opt:-vec-extabi"
//
// Test debugging options
// RUN: %clang --target=powerpc-ibm-aix -### %s -flto -fuse-ld=ld -gdbx 2>&1 \
// RUN: | FileCheck -check-prefix=DBX %s
Expand Down

0 comments on commit fd448bb

Please sign in to comment.