2007-09-14 21:17:59 +00:00
|
|
|
# Compute ARM-specific values
|
|
|
|
|
2008-10-23 13:00:45 +00:00
|
|
|
CT_DoArchTupleValues() {
|
2007-09-14 21:17:59 +00:00
|
|
|
# The architecture part of the tuple:
|
2013-12-30 22:28:18 +00:00
|
|
|
case "${CT_ARCH_BITNESS}" in
|
|
|
|
32)
|
|
|
|
CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_SUFFIX:-${target_endian_eb}}"
|
|
|
|
;;
|
|
|
|
64)
|
|
|
|
# ARM 64 (aka AArch64) is special
|
|
|
|
[ "${CT_ARCH_BE}" = "y" ] && target_endian_eb="_be"
|
|
|
|
CT_TARGET_ARCH="aarch64${CT_ARCH_SUFFIX:-${target_endian_eb}}"
|
|
|
|
;;
|
|
|
|
esac
|
2007-09-14 21:17:59 +00:00
|
|
|
|
2007-09-14 21:31:00 +00:00
|
|
|
# The system part of the tuple:
|
|
|
|
case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in
|
2017-07-07 19:38:32 +00:00
|
|
|
glibc,y) CT_TARGET_SYS=gnueabi;;
|
2022-01-05 08:37:45 +00:00
|
|
|
uClibc-ng,y)CT_TARGET_SYS=uclibc${CT_LIBC_UCLIBC_USE_GNU_SUFFIX:+gnu}eabi;;
|
2014-08-01 02:01:46 +00:00
|
|
|
musl,y) CT_TARGET_SYS=musleabi;;
|
2009-10-21 20:51:39 +00:00
|
|
|
*,y) CT_TARGET_SYS=eabi;;
|
2007-09-14 21:31:00 +00:00
|
|
|
esac
|
2009-10-26 08:10:38 +00:00
|
|
|
|
2011-07-17 14:54:50 +00:00
|
|
|
# Set the default instruction set mode
|
2009-10-26 08:10:38 +00:00
|
|
|
case "${CT_ARCH_ARM_MODE}" in
|
|
|
|
arm) ;;
|
|
|
|
thumb)
|
|
|
|
CT_ARCH_CC_CORE_EXTRA_CONFIG="--with-mode=thumb"
|
|
|
|
CT_ARCH_CC_EXTRA_CONFIG="--with-mode=thumb"
|
|
|
|
;;
|
|
|
|
esac
|
2009-10-26 22:11:10 +00:00
|
|
|
|
|
|
|
if [ "${CT_ARCH_ARM_INTERWORKING}" = "y" ]; then
|
|
|
|
CT_ARCH_TARGET_CFLAGS+=" -mthumb-interwork"
|
|
|
|
fi
|
2013-01-09 23:11:17 +00:00
|
|
|
|
|
|
|
if [ "${CT_ARCH_ARM_TUPLE_USE_EABIHF}" = "y" ]; then
|
|
|
|
CT_TARGET_SYS="${CT_TARGET_SYS}hf"
|
|
|
|
fi
|
2016-04-05 21:47:20 +00:00
|
|
|
|
|
|
|
# If building multilib, zero out any WITH_*/*_CFLAG - GCC on ARM does not allow
|
|
|
|
# any of them with multilib.
|
|
|
|
if [ "${CT_MULTILIB}" = "y" ]; then
|
|
|
|
CT_ARCH_WITH_ARCH=
|
|
|
|
CT_ARCH_WITH_ABI=
|
|
|
|
CT_ARCH_WITH_CPU=
|
|
|
|
CT_ARCH_WITH_TUNE=
|
|
|
|
CT_ARCH_WITH_FPU=
|
|
|
|
CT_ARCH_WITH_FLOAT=
|
|
|
|
CT_ARCH_ARCH_CFLAG=
|
|
|
|
CT_ARCH_ABI_CFLAG=
|
|
|
|
CT_ARCH_CPU_CFLAG=
|
|
|
|
CT_ARCH_TUNE_CFLAG=
|
|
|
|
CT_ARCH_FPU_CFLAG=
|
|
|
|
CT_ARCH_FLOAT_CFLAG=
|
|
|
|
fi
|
2007-09-14 21:17:59 +00:00
|
|
|
}
|
2016-04-04 15:25:07 +00:00
|
|
|
|
|
|
|
CT_DoArchUClibcConfig() {
|
|
|
|
local cfg="${1}"
|
|
|
|
|
2017-02-03 07:37:57 +00:00
|
|
|
if [ "${CT_ARCH_BITNESS}" = 64 ]; then
|
|
|
|
CT_DoArchUClibcSelectArch "${cfg}" "aarch64"
|
2016-04-04 15:25:07 +00:00
|
|
|
else
|
2017-02-03 07:37:57 +00:00
|
|
|
CT_DoArchUClibcSelectArch "${cfg}" "arm"
|
|
|
|
case "${CT_ARCH_ARM_MODE}" in
|
|
|
|
arm)
|
|
|
|
CT_KconfigDisableOption "COMPILE_IN_THUMB_MODE" "${cfg}"
|
|
|
|
;;
|
|
|
|
thumb)
|
|
|
|
CT_KconfigEnableOption "COMPILE_IN_THUMB_MODE" "${cfg}"
|
2020-11-01 08:17:50 +00:00
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_CONTEXT_FUNCS" "${cfg}"
|
2017-02-03 07:37:57 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
# FIXME: CONFIG_ARM_OABI does not exist in neither uClibc/uClibc-ng
|
|
|
|
# FIXME: CONFIG_ARM_EABI does not seem to affect anything in either of them, too
|
|
|
|
# (both check the compiler's built-in define, __ARM_EABI__ instead) except for
|
|
|
|
# a check for match between toolchain configuration and uClibc-ng in
|
|
|
|
# uClibc_arch_features.h
|
|
|
|
if [ "${CT_ARCH_ARM_EABI}" = "y" ]; then
|
|
|
|
CT_KconfigDisableOption "CONFIG_ARM_OABI" "${cfg}"
|
|
|
|
CT_KconfigEnableOption "CONFIG_ARM_EABI" "${cfg}"
|
|
|
|
else
|
|
|
|
CT_KconfigDisableOption "CONFIG_ARM_EABI" "${cfg}"
|
|
|
|
CT_KconfigEnableOption "CONFIG_ARM_OABI" "${cfg}"
|
|
|
|
fi
|
2016-04-04 15:25:07 +00:00
|
|
|
fi
|
|
|
|
}
|
2016-04-05 21:47:20 +00:00
|
|
|
|
|
|
|
CT_DoArchUClibcCflags() {
|
|
|
|
local cfg="${1}"
|
|
|
|
local cflags="${2}"
|
|
|
|
local f
|
|
|
|
|
|
|
|
for f in ${cflags}; do
|
|
|
|
case "${f}" in
|
|
|
|
-mthumb)
|
|
|
|
CT_KconfigEnableOption "COMPILE_IN_THUMB_MODE" "${cfg}"
|
2018-06-05 23:38:30 +00:00
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_CONTEXT_FUNCS" "${cfg}"
|
2016-04-05 21:47:20 +00:00
|
|
|
;;
|
|
|
|
-marm)
|
|
|
|
CT_KconfigDisableOption "COMPILE_IN_THUMB_MODE" "${cfg}"
|
|
|
|
;;
|
|
|
|
-mlittle-endian)
|
|
|
|
CT_KconfigDisableOption "ARCH_BIG_ENDIAN" "${cfg}"
|
|
|
|
CT_KconfigDisableOption "ARCH_WANTS_BIG_ENDIAN" "${cfg}"
|
|
|
|
CT_KconfigEnableOption "ARCH_LITTLE_ENDIAN" "${cfg}"
|
|
|
|
CT_KconfigEnableOption "ARCH_WANTS_LITTLE_ENDIAN" "${cfg}"
|
|
|
|
;;
|
|
|
|
-mbig-endian)
|
|
|
|
CT_KconfigEnableOption "ARCH_BIG_ENDIAN" "${cfg}"
|
|
|
|
CT_KconfigEnableOption "ARCH_WANTS_BIG_ENDIAN" "${cfg}"
|
|
|
|
CT_KconfigDisableOption "ARCH_LITTLE_ENDIAN" "${cfg}"
|
|
|
|
CT_KconfigDisableOption "ARCH_WANTS_LITTLE_ENDIAN" "${cfg}"
|
|
|
|
;;
|
|
|
|
-mhard-float|-mfloat-abi=hard|-mfloat-abi=softfp)
|
|
|
|
CT_KconfigEnableOption "UCLIBC_HAS_FPU" "${cfg}"
|
|
|
|
;;
|
|
|
|
-msoft-float|-mfloat-abi=soft)
|
|
|
|
CT_KconfigDisableOption "UCLIBC_HAS_FPU" "${cfg}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|