diff --git a/conf/distro/include/sane-toolchain-eglibc.inc b/conf/distro/include/sane-toolchain-eglibc.inc index 006f1d6..4c5f44f 100644 --- a/conf/distro/include/sane-toolchain-eglibc.inc +++ b/conf/distro/include/sane-toolchain-eglibc.inc @@ -3,10 +3,6 @@ # eglibc: # [23:00] oxo: glibc (any version) on sparc does not like (repeat me) "-Os" -TARGET_OS = "linux${@['','-gnueabi'][bb.data.getVar('TARGET_ARCH',d,1) in ['arm', 'armeb'] and bb.data.getVar('MACHINE',d) not in ['collie','h3600', 'h3800', 'simpad', 'htcwallaby']]}" - -TARGET_OS_powerpc = "linux${@['','-gnuspe'][bb.data.getVar('TARGET_ARCH',d,1) in ['ppc', 'powerpc'] and bb.data.getVar('MACHINE',d) in ['calamari', 'tqm8540']]}" - FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os" FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1" FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2" diff --git a/conf/distro/include/sane-toolchain-glibc.inc b/conf/distro/include/sane-toolchain-glibc.inc index f3da7c3..f029c6f 100644 --- a/conf/distro/include/sane-toolchain-glibc.inc +++ b/conf/distro/include/sane-toolchain-glibc.inc @@ -2,8 +2,6 @@ # glibc: -TARGET_OS = "linux${@['','-gnueabi'][bb.data.getVar('TARGET_ARCH',d,1) in ['arm', 'armeb'] and bb.data.getVar('MACHINE',d) not in ['collie','h3600', 'h3800', 'simpad', 'htcwallaby']]}" - #mess with compiler flags to use -Os instead of -O2 #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info # perl has some problems, see http://bugs.openembedded.net/show_bug.cgi?id=1616 diff --git a/conf/distro/include/sane-toolchain-uclibc.inc b/conf/distro/include/sane-toolchain-uclibc.inc index 04935fe..3069820 100644 --- a/conf/distro/include/sane-toolchain-uclibc.inc +++ b/conf/distro/include/sane-toolchain-uclibc.inc @@ -15,9 +15,6 @@ USE_NLS_glib-2.0 = "yes" USE_NLS_glib-2.0-native = "yes" USE_NLS_gcc-cross = "no" -TARGET_OS_UC = "linux${@['-uclibc','-uclibcgnueabi'][bb.data.getVar('TARGET_ARCH',d,1) in ['arm', 'armeb'] and bb.data.getVar('MACHINE',d) not in ['collie','h3600', 'h3800', 'simpad', 'htcwallaby']]}" -TARGET_OS = "${@['${TARGET_OS_UC}', 'uclinux-uclibc'][bb.data.getVar('TARGET_ARCH',d) in ['bfin']]}" - #mess with compiler flags to use -Os instead of -O2 #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os" diff --git a/conf/distro/include/sane-toolchain.inc b/conf/distro/include/sane-toolchain.inc index cebe77b..ac4c657 100644 --- a/conf/distro/include/sane-toolchain.inc +++ b/conf/distro/include/sane-toolchain.inc @@ -137,6 +137,38 @@ 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("TARGET_ARCH", d, 1) in [ 'arm', 'armeb' ]: + if bb.data.getVar('MACHINE',d) in ['collie','h3600', 'h3800', 'simpad', 'htcwallaby']: + return "oabi" + return "eabi" + else: + return "" + +def compute_os_portion_of_target_triplet (d): + import bb + if bb.data.getVar('TARGET_ARCH',d,1) in ['bfin']: + os_suffix = "uclinux" + else: + os_suffix = "linux" + + arm_abi = detect_arm_abi(d) + if bb.data.getVar("LIBC", d, 1) == "uclibc": + libc_suffix = "uclibc" + else: + libc_suffix = "gnu" + + if arm_abi == "eabi": + abi_suffix = "eabi" + if bb.data.getVar('TARGET_ARCH',d,1) in ['ppc', 'powerpc'] and \ + bb.data.getVar('MACHINE',d) in ['calamari', 'tqm8540'] and \ + bb.data.getVar('DISTRO_FEATURES',d) in ['spe']: + abi_suffix = "spe" + target_os = "%s-%s%s" % (os_suffix, libc_suffix, abi_suffix) + return target_os + # 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