summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Behún <kabel@kernel.org>2022-08-18 20:01:58 +0200
committerSam James <sam@gentoo.org>2022-08-23 06:23:56 +0100
commite61ffcd622d34570b294e7f4a3e922bdc980cd65 (patch)
treebdbcca5c58654dd7409e4427d5c6f6bacf3bd13e
parentprofiles: Remove masks blocking mjo's packages (diff)
downloadgentoo-e61ffcd6.tar.gz
gentoo-e61ffcd6.tar.bz2
gentoo-e61ffcd6.zip
toolchain.eclass: build multilibs for ARM's A, R and M architecture profiles
For ARM targets, with USE=multilib and with CTARGET that does not imply any of --with-arch, --with-cpu, --with-mode or --with-float options to gcc's configuration (when arm_arch=arm), pass option --with-multilib-list=aprofile,rmprofile to gcc's configuration to make it build multilibs for A, R and M architecture profiles. This makes it possible to have one compiler capable of generating correct code (linking correct libgcc/CRT) for various ARM targets: from armv6 to armv7, for both soft float and half float, for various FPU types. Example of arm-none-eabi-gcc -print-libgcc-file-name output for various options: default: /usr/lib/gcc/arm-none-eabi/12.1.1/libgcc.a -mcpu=cortex-m0 /usr/lib/gcc/arm-none-eabi/12.1.1/thumb/v6-m/nofp/libgcc.a -march=armv7-m /usr/lib/gcc/arm-none-eabi/12.1.1/thumb/v7-m/nofp/libgcc.a -march=armv7-a /usr/lib/gcc/arm-none-eabi/12.1.1/thumb/v7-a/nofp/libgcc.a -march=armv7-a -mhard-float -mfpu=neon /usr/lib/gcc/arm-none-eabi/12.1.1/thumb/v7-a+simd/hard/libgcc.a -march=armv7-a -mhard-float -mfpu=vfp /usr/lib/gcc/arm-none-eabi/12.1.1/thumb/v7-a+fp/hard/libgcc.a Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--eclass/toolchain.eclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index ed473e0c626f..29076efc3f54 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1213,6 +1213,17 @@ toolchain_src_configure() {
armv7*) confgcc+=( --with-fpu=vfpv3-d16 ) ;;
esac
fi
+
+ # If multilib is used, make the compiler build multilibs
+ # for A or R and M architecture profiles. Do this only
+ # when no specific arch/mode/float is specified, e.g.
+ # for target arm-none-eabi, since doing this is
+ # incompatible with --with-arch/cpu/float/fpu.
+ if is_multilib && [[ ${arm_arch} == arm ]] && \
+ tc_version_is_at_least 7.1
+ then
+ confgcc+=( --with-multilib-list=aprofile,rmprofile )
+ fi
;;
mips)
# Add --with-abi flags to set default ABI