Skip to content

Commit

Permalink
[AArch64] Pass -mabi option through to multilib (#110874)
Browse files Browse the repository at this point in the history
Pass the -mabi option through to multilib, so that it can be used for
library selection.
  • Loading branch information
ostannard authored Oct 4, 2024
1 parent 856774d commit 9e831d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/lib/Driver/ToolChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ static void getAArch64MultilibFlags(const Driver &D,
if (BranchProtectionArg) {
Result.push_back(BranchProtectionArg->getAsString(Args));
}

const Arg *ABIArg = Args.getLastArgNoClaim(options::OPT_mabi_EQ);
if (ABIArg) {
Result.push_back(ABIArg->getAsString(Args));
}
}

static void getARMMultilibFlags(const Driver &D,
Expand Down
5 changes: 5 additions & 0 deletions clang/test/Driver/print-multi-selection-flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
// CHECK-HARD: -mfloat-abi=hard
// CHECK-HARD: -mfpu=fpv5-d16

// RUN: %clang -print-multi-flags-experimental --target=aarch64-none-elf -mabi=aapcs | FileCheck --check-prefix=CHECK-ABI-AAPCS %s
// RUN: %clang -print-multi-flags-experimental --target=aarch64-none-elf -mabi=aapcs-soft | FileCheck --check-prefix=CHECK-ABI-AAPCS-SOFT %s
// CHECK-ABI-AAPCS: -mabi=aapcs
// CHECK-ABI-AAPCS-SOFT: -mabi=aapcs-soft

// RUN: %clang -print-multi-flags-experimental --target=arm-none-eabi -mfloat-abi=soft -march=armv8-m.main+nofp | FileCheck --check-prefix=CHECK-V8MMAIN-NOFP %s
// CHECK-V8MMAIN-NOFP: --target=thumbv8m.main-unknown-none-eabi
// CHECK-V8MMAIN-NOFP: -mfloat-abi=soft
Expand Down

0 comments on commit 9e831d5

Please sign in to comment.