Patchwork [3/3] Add the Sourcery G++ Lite 2011.03 external toolchain for ARM

login
register
mail settings
Submitter Ken Werner
Date Dec. 14, 2011, 10:58 p.m.
Message ID <1323903512-7344-4-git-send-email-ken.werner@linaro.org>
Download mbox | patch
Permalink /patch/16941/
State New
Headers show

Comments

Ken Werner - Dec. 14, 2011, 10:58 p.m.
This adds initial support for using the Sourcery G++ Lite 2011.03 for
ARM GNU/Linux as an external toolchain.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
---
 .../include/tcmode-external-csl-arm-2011.03.inc    |   33 +++++
 .../meta/external-csl-toolchain_arm-2011.03.bb     |  137 ++++++++++++++++++++
 2 files changed, 170 insertions(+), 0 deletions(-)
 create mode 100644 meta/conf/distro/include/tcmode-external-csl-arm-2011.03.inc
 create mode 100644 meta/recipes-core/meta/external-csl-toolchain_arm-2011.03.bb

Patch

diff --git a/meta/conf/distro/include/tcmode-external-csl-arm-2011.03.inc b/meta/conf/distro/include/tcmode-external-csl-arm-2011.03.inc
new file mode 100644
index 0000000..9958034
--- /dev/null
+++ b/meta/conf/distro/include/tcmode-external-csl-arm-2011.03.inc
@@ -0,0 +1,33 @@ 
+#
+# Configuration to use an external CSL arm-2011.03 toolchain (ARM GNUEABI).
+#
+
+TARGET_VENDOR = "-none"
+
+EXTERNAL_TOOLCHAIN = "/usr/local/csl/arm-2011.03"
+
+PATH =. "${EXTERNAL_TOOLCHAIN}/bin:"
+
+PREFERRED_PROVIDER_linux-libc-headers = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-intermediate = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/libc = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/libintl = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/libiconv = "external-csl-toolchain"
+PREFERRED_PROVIDER_glibc-thread-db = "external-csl-toolchain"
+PREFERRED_PROVIDER_glibc = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/linux-libc-headers = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "external-csl-toolchain"
+PREFERRED_PROVIDER_libgcc = "external-csl-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "external-csl-toolchain"
+
+PREFERRED_VERSION_external-csl-toolchain = "arm-2011.03"
+
+TARGET_CPPFLAGS_prepend = "-isystem${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/include "
+TARGET_LDFLAGS_prepend = "-L${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/lib -Wl,-rpath-link,${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/lib "
+
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}"
diff --git a/meta/recipes-core/meta/external-csl-toolchain_arm-2011.03.bb b/meta/recipes-core/meta/external-csl-toolchain_arm-2011.03.bb
new file mode 100644
index 0000000..b982255
--- /dev/null
+++ b/meta/recipes-core/meta/external-csl-toolchain_arm-2011.03.bb
@@ -0,0 +1,137 @@ 
+# License applies to this recipe code, not the toolchain itself
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${EXTERNAL_TOOLCHAIN}/share/doc/arm-arm-none-linux-gnueabi/LICENSE.txt;md5=405379e879c6c5934ff23d52201f2855"
+PROVIDES = "libgcc \
+    linux-libc-headers \
+    virtual/${TARGET_PREFIX}gcc \
+    virtual/${TARGET_PREFIX}g++ \
+    virtual/${TARGET_PREFIX}gcc-initial \
+    virtual/${TARGET_PREFIX}gcc-intermediate \
+    virtual/${TARGET_PREFIX}binutils \
+    virtual/${TARGET_PREFIX}libc-for-gcc \
+    virtual/${TARGET_PREFIX}libc-initial \
+    virtual/libc \
+    virtual/libintl \
+    virtual/libiconv \
+    glibc-thread-db \
+    virtual/linux-libc-headers \
+    virtual/${TARGET_PREFIX}compilerlibs"
+PR = "r0"
+
+SRC_URI = "file://SUPPORTED"
+
+inherit libc-common
+inherit libc-package
+
+do_install() {
+    echo "EXTERNAL_TOOLCHAIN is ${EXTERNAL_TOOLCHAIN}"
+    install -d ${D}${sysconfdir}
+    install -d ${D}${base_sbindir}
+    install -d ${D}${base_libdir}
+    install -d ${D}${bindir}
+    install -d ${D}${sbindir}
+    install -d ${D}${libdir}
+    install -d ${D}${libexecdir}
+    install -d ${D}${datadir}
+    install -d ${D}${includedir}
+    cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/etc/*  ${D}${sysconfdir}
+    cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/sbin/* ${D}${base_sbindir}
+    cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/lib/*  ${D}${base_libdir}
+    cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/usr/bin/*  ${D}${bindir}
+    cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/usr/sbin/*  ${D}${sbindir}
+    cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/usr/lib/*  ${D}${libdir}
+    cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/usr/libexec/*  ${D}${libexecdir}
+    cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/usr/share/*  ${D}${datadir}
+    cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/usr/include/*  ${D}${includedir}
+    sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libc.so
+    sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libpthread.so
+}
+
+PACKAGES_DYNAMIC = "glibc-gconv-*"
+PACKAGES += "libgcc \
+    libgcc-dev \
+    libstdc++ \
+    libstdc++-dev \
+    linux-libc-headers"
+
+RPROVIDES = "glibc-utils \
+    libsegfault \
+    glibc-thread-db \
+    glibc \
+    linux-libc-headers-dev"
+
+FILES_libgcc = "${base_libdir}/libgcc_s.so.1"
+FILES_libgcc-dev = "${base_libdir}/libgcc_s.so"
+FILES_libstdc++ = "${libdir}/libstdc++.so.*"
+FILES_libstdc++-dev = "${includedir}/c++/4.2.3 \
+    ${libdir}/libstdc++.so \
+    ${libdir}/libstdc++.la \
+    ${libdir}/libstdc++.a \
+    ${libdir}/libsupc++.la \
+    ${libdir}/libsupc++.a"
+FILES_linux-libc-headers = "${includedir}/asm* \
+    ${includedir}/linux \
+    ${includedir}/mtd \
+    ${includedir}/rdma \
+    ${includedir}/scsi \
+    ${includedir}/sound \
+    ${includedir}/video"
+FILES_${PN}-dbg += "${libdir}/bin/.debug \
+    ${libdir}/gconv/.debug \
+    ${libexecdir}/getconf/.debug"
+FILES_${PN} += "${libdir}/bin \
+    ${libdir}/locale \
+    ${libdir}/gconv/gconv-modules \
+    ${datadir}/zoneinfo \
+    ${base_libdir}/libcrypt*.so.* \
+    ${base_libdir}/libcrypt-*.so \
+    ${base_libdir}/libc.so.* \
+    ${base_libdir}/libc-*.so \
+    ${base_libdir}/libm*.so.* \
+    ${base_libdir}/libm-*.so \
+    ${base_libdir}/ld*.so.* \
+    ${base_libdir}/ld-*.so \
+    ${base_libdir}/libpthread*.so.* \
+    ${base_libdir}/libpthread-*.so \
+    ${base_libdir}/libresolv*.so.* \
+    ${base_libdir}/libresolv-*.so \
+    ${base_libdir}/librt*.so.* \
+    ${base_libdir}/librt-*.so \
+    ${base_libdir}/libutil*.so.* \
+    ${base_libdir}/libutil-*.so \
+    ${base_libdir}/libnsl*.so.* \
+    ${base_libdir}/libnsl-*.so \
+    ${base_libdir}/libnss_files*.so.* \
+    ${base_libdir}/libnss_files-*.so \
+    ${base_libdir}/libnss_compat*.so.* \
+    ${base_libdir}/libnss_compat-*.so \
+    ${base_libdir}/libnss_dns*.so.* \
+    ${base_libdir}/libnss_dns-*.so \
+    ${base_libdir}/libnss_nis*.so.* \
+    ${base_libdir}/libnss_nisplus-*.so \
+    ${base_libdir}/libnss_nisplus*.so.* \
+    ${base_libdir}/libnss_nis-*.so \
+    ${base_libdir}/libnss_hesiod*.so.* \
+    ${base_libdir}/libnss_hesiod-*.so \
+    ${base_libdir}/libdl*.so.* \
+    ${base_libdir}/libdl-*.so \
+    ${base_libdir}/libanl*.so.* \
+    ${base_libdir}/libanl-*.so \
+    ${base_libdir}/libBrokenLocale*.so.* \
+    ${base_libdir}/libBrokenLocale-*.so \
+    ${base_libdir}/libcidn*.so.* \
+    ${base_libdir}/libcidn-*.so \
+    ${base_libdir}/libthread_db*.so.* \
+    ${base_libdir}/libthread_db-*.so \
+    ${base_libdir}/libmemusage.so \
+    ${base_libdir}/libSegFault.so \
+    ${base_libdir}/libpcprofile.so"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+# Prevent the do_pre_configure task of libc-package.bbclass from running
+do_pre_configure() {
+    :
+}
+
+GLIBC_INTERNAL_USE_BINARY_LOCALE = "disable"