summaryrefslogtreecommitdiffstats
path: root/toolchain/toolchain-wrapper.c
diff options
context:
space:
mode:
authorVicente Olivert Riera <Vincent.Riera@imgtec.com>2017-06-28 16:17:11 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-07-16 16:45:22 +0200
commit9a0a0a976bc1094719556065ab5e982c6ca27563 (patch)
tree4cfa0f640d7a0e4e6642a4c603d5dd4f7d7bec48 /toolchain/toolchain-wrapper.c
parent2d8f3fc430fe4f16c570097cf3dc33aa78ccb702 (diff)
downloadbuildroot-9a0a0a976bc1094719556065ab5e982c6ca27563.tar.gz
buildroot-9a0a0a976bc1094719556065ab5e982c6ca27563.zip
arch/mips: add support for MIPS32 FP mode
MIPS32 support different FP modes (32,xx,64), so give the user the opportunity to choose between them. That will cause host-gcc to be built using the --with-fp-32=[32|xx|64] configure option. Also the -mfp[32|xx|64] gcc option will be added to TARGET_CFLAGS and to the toolchain wrapper. FP mode option shouldn't be used for soft-float, so we add logic in the toolchain wrapper if -msoft-float is among the arguments in order to not append the -fp[[32|xx|64] option, otherwise the compilation may fail. Information about FP modes here: - https://sourceware.org/binutils/docs/as/MIPS-Options.html - https://dmz-portal.imgtec.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking#5._Generating_modeless_code Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'toolchain/toolchain-wrapper.c')
-rw-r--r--toolchain/toolchain-wrapper.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
index 977d642487..dd77c11131 100644
--- a/toolchain/toolchain-wrapper.c
+++ b/toolchain/toolchain-wrapper.c
@@ -254,6 +254,20 @@ int main(int argc, char **argv)
*cur++ = "-mfloat-abi=" BR_FLOAT_ABI;
#endif
+#ifdef BR_FP32_MODE
+ /* add fp32 mode if soft-float is not args or hard-float overrides soft-float */
+ int add_fp32_mode = 1;
+ for (i = 1; i < argc; i++) {
+ if (!strcmp(argv[i], "-msoft-float"))
+ add_fp32_mode = 0;
+ else if (!strcmp(argv[i], "-mhard-float"))
+ add_fp32_mode = 1;
+ }
+
+ if (add_fp32_mode == 1)
+ *cur++ = "-mfp" BR_FP32_MODE;
+#endif
+
#if defined(BR_ARCH) || \
defined(BR_CPU)
/* Add our -march/cpu flags, but only if none of
OpenPOWER on IntegriCloud