[PATCH] D89573: [Driver] Incorporate -mfloat-abi in the computed triple on ARM
John Brawn via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 16 11:14:48 PDT 2020
john.brawn created this revision.
john.brawn added reviewers: efriedma, vhscampos, chill.
Herald added subscribers: dexonsmith, steven_wu, hiraditya, kristof.beyls.
Herald added a project: clang.
john.brawn requested review of this revision.
LLVM assumes that when it creates a call to a C library function it can use the C calling convention. On ARM the effective calling convention is determined from the target triple, however using -mfloat-abi=hard on ARM means that calls to (and definitions of) C library functions use the arm_aapcs_vfpcc calling convention which can result in a mismatch.
Fix this by incorporating -mfloat-abi into the target triple, similar to how -mbig-endian and -march/-mcpu are. This only works for EABI targets and not Android or iOS, but there the float abi is fixed.
Fixes PR45524.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D89573
Files:
clang/lib/Driver/ToolChain.cpp
clang/lib/Driver/ToolChains/Arch/ARM.cpp
clang/test/Driver/arm-float-abi-lto.c
clang/test/Driver/arm-triple.c
clang/test/Driver/windows-thumbv7em.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89573.298685.patch
Type: text/x-patch
Size: 7391 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201016/d157841a/attachment.bin>
More information about the cfe-commits
mailing list