summaryrefslogtreecommitdiff
path: root/conf/distro/include/sane-toolchain.inc
diff options
context:
space:
mode:
Diffstat (limited to 'conf/distro/include/sane-toolchain.inc')
-rw-r--r--conf/distro/include/sane-toolchain.inc70
1 files changed, 64 insertions, 6 deletions
diff --git a/conf/distro/include/sane-toolchain.inc b/conf/distro/include/sane-toolchain.inc
index dff4b9f081..65cb7763d1 100644
--- a/conf/distro/include/sane-toolchain.inc
+++ b/conf/distro/include/sane-toolchain.inc
@@ -11,8 +11,10 @@ PREFERRED_BINUTILS ?= "2.18"
# Prefer glibc 2.6 and uclibc 0.9.30, these have had the most testing.
PREFERRED_VERSION_glibc ?= "2.6.1"
PREFERRED_VERSION_glibc-initial ?= "2.6.1"
-PREFERRED_VERSION_uclibc ?= "0.9.30"
-PREFERRED_VERSION_uclibc-initial ?= "0.9.30"
+PREFERRED_VERSION_eglibc ?= "2.10"
+PREFERRED_VERSION_eglibc-initial ?= "2.10"
+PREFERRED_VERSION_uclibc ?= "0.9.30.1"
+PREFERRED_VERSION_uclibc-initial ?= "0.9.30.1"
# Some systems need a special gcc version
PREFERRED_GCC_VERSION_486sx ?= "4.3.2"
@@ -24,7 +26,7 @@ PREFERRED_GCC_VERSION_xilinx-ml403 ?= "4.1.1"
PREFERRED_GCC_VERSION_xilinx-ml403 ?= "4.1.1"
# This is unrelated to the kernel version, but userspace apps (e.g. HAL) require a recent version to build against
-PREFERRED_VERSION_linux-libc-headers = "2.6.23"
+PREFERRED_VERSION_linux-libc-headers ?= "2.6.23"
# Uncomment this if want need to build an armv7a kernel with CSL toolchain (<2.6.27 don't boot with mainline gcc)
#KERNEL_CCSUFFIX_armv7a= "-4.2.1+csl-arm-2007q3-53"
@@ -63,16 +65,21 @@ PREFERRED_PROVIDER_linux-libc-headers = "linux-libc-headers"
# Branding
TARGET_VENDOR = "-oe"
+# Add FEED_ARCH to the overrides list so that we can override the
+# ARM_INSTRUCTION_SET like below
+
+OVERRIDES .= ":${FEED_ARCH}"
+
# ARM920T and up can use thumb mode to decrease binary size at the expense of speed
# (the complete story is a bit more nuanced due to cache starvation)
# Minimal turns on thumb for armv4t machine according to this RFC:
# http://lists.linuxtogo.org/pipermail/angstrom-distro-devel/2008-October/002714.html
# We can't set ARM_INSTRUCTION_SET_<override> directly since that will un-overridable in recipes like gcc
-PREFERRED_ARM_INSTRUCTION_SET ?= "arm"
PREFERRED_ARM_INSTRUCTION_SET_armv4t = "thumb"
PREFERRED_ARM_INSTRUCTION_SET_armv5te = "thumb"
PREFERRED_ARM_INSTRUCTION_SET_armv5teb = "thumb"
+PREFERRED_ARM_INSTRUCTION_SET ?= "arm"
ARM_INSTRUCTION_SET = "${PREFERRED_ARM_INSTRUCTION_SET}"
# "arm" "thumb"
# The instruction set the compiler should use when generating application
@@ -115,7 +122,7 @@ TARGET_CC_ARCH_pn-cairo_armv5te = "-march=armv4t"
#############################################################################
# Can be "glibc", "eglibc" or "uclibc"
-LIBC ?= "glibc"
+LIBC ?= "eglibc"
require conf/distro/include/${LIBC}.inc
PSTAGE_EXTRAPATH = "${LIBC}"
require conf/distro/include/sane-toolchain-${LIBC}.inc
@@ -134,7 +141,58 @@ ENABLE_BINARY_LOCALE_GENERATION_armv7a = "0"
#qemu has taken a dislike to armeb as well
ENABLE_BINARY_LOCALE_GENERATION_armeb = "0"
+def detect_arm_abi (d):
+ import bb
+ if bb.data.getVar('DISTRO_FEATURES',d) is None:
+ if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'arm', 'armeb' ]:
+ return "oabi"
+ else:
+ return ""
+ if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'arm', 'armeb' ]:
+ if 'eabi' in bb.data.getVar('DISTRO_FEATURES',d).split():
+ return "eabi"
+ return "oabi"
+ return ""
+
+def compute_os_portion_of_target_triplet (d):
+ import bb
+ arm_eabi_supporting_arches = "armv6 armv6-novfp \
+ armv5te iwmmxt armv7a armv7 armv6 armv5teb armv5te armv4t"
+ ppc_spe_supporting_arches = "ppce500v2 ppce500"
+
+ if bb.data.getVar("LIBC", d, 1) == "uclibc":
+ libc_suffix = "uclibc"
+ else:
+ libc_suffix = "gnu"
+
+ if bb.data.getVar('TARGET_ARCH',d,1) in ['bfin']:
+ if libc_suffix == "gnu":
+ bb.fatal("bfin is not supported on glibc/eglibc. Please choose uclibc")
+ else:
+ os_suffix = "uclinux"
+ else:
+ os_suffix = "linux"
+ bparch = bb.data.getVar('BASE_PACKAGE_ARCH', d,1)
+
+ if bb.data.getVar('DISTRO_FEATURES',d,1) is not None and \
+ bparch is not None:
+ if 'eabi' in bb.data.getVar('DISTRO_FEATURES',d,1).split() and \
+ bb.data.getVar('TARGET_ARCH', d, 1) in [ 'arm', 'armeb' ]:
+ if bparch not in arm_eabi_supporting_arches.split():
+ bb.fatal("DISTRO requested EABI but selected machine does not support EABI")
+ abi_suffix = ""
+ else:
+ abi_suffix = "eabi"
+ elif bparch in ppc_spe_supporting_arches.split():
+ abi_suffix = "spe"
+ else:
+ abi_suffix = ""
+ else:
+ bb.note("DISTRO_FEATURES is not set abi suffix not set")
+ abi_suffix = ""
+ return os_suffix + "-" + libc_suffix + abi_suffix
# This is needed to get a correct PACKAGE_ARCH for packages that have PACKAGE_ARCH = ${MACHINE_ARCH}
-ARM_ABI ?= "${@['','oabi'][bb.data.getVar('MACHINE',d) in ['collie','h3600', 'h3800', 'simpad', 'htcwallaby']]}"
+ARM_ABI = "${@detect_arm_abi(d)}"
+TARGET_OS = "${@compute_os_portion_of_target_triplet(d)}"
include conf/distro/include/sane-toolchain-${ARM_ABI}.inc