diff options
Diffstat (limited to 'toolchain')
24 files changed, 601 insertions, 62 deletions
diff --git a/toolchain/Config.in.2 b/toolchain/Config.in.2 index e9fe8521c..5df04e01b 100644 --- a/toolchain/Config.in.2 +++ b/toolchain/Config.in.2 @@ -27,12 +27,13 @@ config BR2_INET_RPC built with RPC support then enable this option. config BR2_ENABLE_LOCALE - bool "Enable locale/gettext/i18n support?" + bool "Enable toolchain locale/i18n support?" + select BR2_USE_WCHAR help If you are building your own toolchain and you want to - enable locale/gettext/i18n support then enable this option. + enable locale/i18n support then enable this option. If you have an external binary toolchain that has been - built with locale/gettext/i18n support then enable this option. + built with locale/i18n support then enable this option. config BR2_ENABLE_LOCALE_PREGENERATED bool "Use pregenerated locale data?" @@ -46,7 +47,6 @@ config BR2_ENABLE_LOCALE_PREGENERATED config BR2_ENABLE_LOCALE_PURGE bool "Purge unwanted locales" - depends on BR2_ENABLE_LOCALE help Explicitly specify what locales to install on target. If N then all locales supported by packages are installed. diff --git a/toolchain/binutils/binutils.mk b/toolchain/binutils/binutils.mk index 66f393efd..bcfbe7451 100644 --- a/toolchain/binutils/binutils.mk +++ b/toolchain/binutils/binutils.mk @@ -55,6 +55,11 @@ BINUTILS_SITE:=$(VENDOR_SITE) BINUTILS_PATCH_DIR:=toolchain/binutils/ext_source/$(VENDOR_PATCH_DIR)/$(BINUTILS_OFFICIAL_VERSION) endif +ifneq ($(filter xtensa%,$(ARCH)),) +include target/xtensa/patch.in +BINUTILS_PATCH_EXTRA:=$(call XTENSA_PATCH,binutils,$(BINUTILS_PATCH_DIR),. ..) +endif + BINUTILS_SOURCE:=binutils-$(BINUTILS_OFFICIAL_VERSION).tar.bz2 BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_OFFICIAL_VERSION) BINUTILS_CAT:=$(BZCAT) @@ -76,7 +81,7 @@ $(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE) binutils-patched: $(BINUTILS_DIR)/.patched $(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked # Apply appropriate binutils patches. - toolchain/patch-kernel.sh $(BINUTILS_DIR) $(BINUTILS_PATCH_DIR) \*.patch + toolchain/patch-kernel.sh $(BINUTILS_DIR) $(BINUTILS_PATCH_DIR) \*.patch $(BINUTILS_PATCH_EXTRA) touch $@ $(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk index b904775f4..d441a9252 100644 --- a/toolchain/external-toolchain/ext-tool.mk +++ b/toolchain/external-toolchain/ext-tool.mk @@ -1,24 +1,52 @@ # -# copy_toolchain_lib_root +# This file implements the support for external toolchains, i.e +# toolchains that have not been produced by Buildroot itself and that +# are already available on the system on which Buildroot runs. # -# $1: source -# $2: destination -# $3: strip (y|n) default is to strip +# The basic principle is the following +# +# 1. Perform some checks on the conformity between the toolchain +# configuration described in the Buildroot menuconfig system, and the +# real configuration of the external toolchain. This is for example +# important to make sure that the Buildroot configuration system +# knows whether the toolchain supports RPC, IPv6, locales, large +# files, etc. Unfortunately, these things cannot be detected +# automatically, since the value of these options (such as +# BR2_INET_RPC) are needed at configuration time because these +# options are used as dependencies for other options. And at +# configuration time, we are not able to retrieve the external +# toolchain configuration. +# +# 2. Copy the libraries needed at runtime to the target directory, +# $(TARGET_DIR). Obviously, things such as the C library, the dynamic +# loader and a few other utility libraries are needed if dynamic +# applications are to be executed on the target system. +# +# 3. Copy the libraries and headers to the staging directory. This +# will allow all further calls to gcc to be made using --sysroot +# $(STAGING_DIR), which greatly simplifies the compilation of the +# packages when using external toolchains. So in the end, only the +# cross-compiler binaries remains external, all libraries and headers +# are imported into the Buildroot tree. + +# +# Copy a toolchain library and its symbolic links from the sysroot +# directory to the target directory. Also optionaly strips the +# library. +# +# $1: sysroot directory +# $2: library name +# $3: destination directory +# $4: strip (y|n), default is to strip # copy_toolchain_lib_root = \ - LIB="$(strip $1)"; \ - DST="$(strip $2)"; \ - STRIP="$(strip $3)"; \ - \ - LIB_DIR=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,$${LIB}\$$,,"`; \ - \ - if test -z "$${LIB_DIR}"; then \ - echo "copy_toolchain_lib_root: lib=$${LIB} not found"; \ - exit -1; \ - fi; \ + SYSROOT_DIR="$(strip $1)"; \ + LIB="$(strip $2)"; \ + DST="$(strip $3)"; \ + STRIP="$(strip $4)"; \ \ - LIB="$(strip $1)"; \ - for FILE in `find $${LIB_DIR} -maxdepth 1 -type l -name "$${LIB}*"`; do \ + LIB_DIR="$${SYSROOT_DIR}/lib" ; \ + for FILE in `find $${LIB_DIR} -maxdepth 1 -name "$${LIB}.*"`; do \ LIB=`basename $${FILE}`; \ while test \! -z "$${LIB}"; do \ rm -fr $(TARGET_DIR)$${DST}/$${LIB}; \ @@ -43,44 +71,62 @@ copy_toolchain_lib_root = \ \ echo -n +# +# Copy the full external toolchain sysroot directory to the staging +# dir +# +# $1: sysroot directory +# copy_toolchain_sysroot = \ - SYSROOT_DIR=`$(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--with-sysroot" | cut -f2 -d=`; \ - if [ -n "$${SYSROOT_DIR}" ]; then cp -a $${SYSROOT_DIR}/* $(STAGING_DIR)/ ; \ - find $(STAGING_DIR) -type d | xargs chmod 755; fi + SYSROOT_DIR="$(strip $1)"; \ + cp -a $${SYSROOT_DIR}/* $(STAGING_DIR)/ ; \ + find $(STAGING_DIR) -type d | xargs chmod 755 -ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y) -EXTERNAL_LIBC=libc.so.0 -EXTERNAL_LIBS=ld-uClibc.so.0 libcrypt.so.0 libdl.so.0 libgcc_s.so libm.so.0 libnsl.so.0 libpthread.so.0 libresolv.so.0 librt.so.0 libutil.so.0 -else -EXTERNAL_LIBC=libc.so.6 -EXTERNAL_LIBS=ld-linux.so.3 libcrypt.so.1 libdl.so.2 libgcc_s.so.1 libm.so.6 libnsl.so.1 libpthread.so.0 libresolv.so.2 librt.so.1 libutil.so.1 libnss_files.so.2 -endif - -check_clibrary = \ - if ! test -f `$(TARGET_CC) -print-file-name=$(EXTERNAL_LIBC)` ; then \ - echo "Incorrect selection of the C library"; \ - exit -1; \ - fi - -# 1: Buildroot option name -# 2: message +# +# Check the availability of a particular glibc feature. We assume that +# all Buildroot toolchain options are supported by glibc, so we just +# check that they are enabled. +# +# $1: Buildroot option name +# $2: feature description +# check_glibc_feature = \ if [ x$($(1)) != x"y" ] ; then \ echo "$(2) available in C library, please enable $(1)" ; \ exit 1 ; \ fi +# +# Check the correctness of a glibc external toolchain configuration. +# 1. Check that the C library selected in Buildroot matches the one +# of the external toolchain +# 2. Check that all the C library-related features are enabled in the +# config, since glibc always supports all of them +# +# $1: sysroot directory +# check_glibc = \ + SYSROOT_DIR="$(strip $1)"; \ + if ! test -f $${SYSROOT_DIR}/lib/ld-linux.so.* ; then \ + echo "Incorrect selection of the C library"; \ + exit -1; \ + fi; \ $(call check_glibc_feature,BR2_LARGEFILE,Large file support) ;\ $(call check_glibc_feature,BR2_INET_IPV6,IPv6 support) ;\ $(call check_glibc_feature,BR2_INET_RPC,RPC support) ;\ $(call check_glibc_feature,BR2_ENABLE_LOCALE,Locale support) ;\ $(call check_glibc_feature,BR2_USE_WCHAR,Wide char support) -# 1: uClibc macro name -# 2: Buildroot option name -# 3: uClibc config file -# 4: message +# +# Check the conformity of Buildroot configuration with regard to the +# uClibc configuration of the external toolchain, for a particular +# feature. +# +# $1: uClibc macro name +# $2: Buildroot option name +# $3: uClibc config file +# $4: feature description +# check_uclibc_feature = \ IS_IN_LIBC=`grep -q "\#define $(1) 1" $(3) && echo y` ; \ if [ x$($(2)) != x"y" -a x$${IS_IN_LIBC} == x"y" ] ; then \ @@ -92,8 +138,22 @@ check_uclibc_feature = \ exit 1 ; \ fi +# +# Check the correctness of a uclibc external toolchain configuration +# 1. Check that the C library selected in Buildroot matches the one +# of the external toolchain +# 2. Check that the features enabled in the Buildroot configuration +# match the features available in the uClibc of the external +# toolchain +# +# $1: sysroot directory +# check_uclibc = \ - SYSROOT_DIR=`$(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--with-sysroot" | cut -f2 -d=`; \ + SYSROOT_DIR="$(strip $1)"; \ + if ! test -f $${SYSROOT_DIR}/lib/ld-uClibc.so.* ; then \ + echo "Incorrect selection of the C library"; \ + exit -1; \ + fi; \ UCLIBC_CONFIG_FILE=$${SYSROOT_DIR}/usr/include/bits/uClibc_config.h ; \ $(call check_uclibc_feature,__UCLIBC_HAS_LFS__,BR2_LARGEFILE,$${UCLIBC_CONFIG_FILE},Large file support) ;\ $(call check_uclibc_feature,__UCLIBC_HAS_IPV6__,BR2_INET_IPV6,$${UCLIBC_CONFIG_FILE},IPv6 support) ;\ @@ -101,21 +161,70 @@ check_uclibc = \ $(call check_uclibc_feature,__UCLIBC_HAS_LOCALE__,BR2_ENABLE_LOCALE,$${UCLIBC_CONFIG_FILE},Locale support) ;\ $(call check_uclibc_feature,__UCLIBC_HAS_WCHAR__,BR2_USE_WCHAR,$${UCLIBC_CONFIG_FILE},Wide char support) ;\ -uclibc: dependencies $(TARGET_DIR)/lib/$(EXTERNAL_LIBC) +# +# Check that the Buildroot configuration of the ABI matches the +# configuration of the external toolchain. +# +check_arm_abi = \ + EXT_TOOLCHAIN_TARGET=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Target | cut -f2 -d ' ') ; \ + if echo $${EXT_TOOLCHAIN_TARGET} | grep -q 'eabi$$' ; then \ + EXT_TOOLCHAIN_ABI="eabi" ; \ + else \ + EXT_TOOLCHAIN_ABI="oabi" ; \ + fi ; \ + if [ x$(BR2_ARM_OABI) == x"y" -a $${EXT_TOOLCHAIN_ABI} == "eabi" ] ; then \ + echo "Incorrect ABI setting" ; \ + exit 1 ; \ + fi ; \ + if [ x$(BR2_ARM_EABI) == x"y" -a $${EXT_TOOLCHAIN_ABI} == "oabi" ] ; then \ + echo "Incorrect ABI setting" ; \ + exit 1 ; \ + fi ; \ + +# +# Check that the cross-compiler given in the configuration exists +# +check_cross_compiler_exists = \ + if ! test -x $(TARGET_CC) ; then \ + echo "Cannot find cross-compiler $(TARGET_CC)" ; \ + exit 1 ; \ + fi ; \ + +uclibc: dependencies $(STAMP_DIR)/ext-toolchain-installed -$(TARGET_DIR)/lib/$(EXTERNAL_LIBC): +EXTERNAL_LIBS=libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libpthread.so libresolv.so librt.so libutil.so +ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y) +EXTERNAL_LIBS+=ld-uClibc.so +else +EXTERNAL_LIBS+=ld-linux.so libnss_files.so +endif + +ifeq ($(BR2_INSTALL_LIBSTDCPP),y) +EXTERNAL_LIBS+=libstdc++.so +endif + +SYSROOT_DIR=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--with-sysroot" | cut -f2 -d=) + +$(STAMP_DIR)/ext-toolchain-installed: @echo "Checking external toolchain settings" - @$(call check_clibrary) + $(Q)$(call check_cross_compiler_exists) +ifeq ($(strip $(SYSROOT_DIR)),) + @echo "External toolchain doesn't support --sysroot. Cannot use." + exit 1 +endif +ifeq ($(BR2_arm),y) + $(Q)$(call check_arm_abi) +endif ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y) - @$(call check_uclibc) + $(Q)$(call check_uclibc,$(SYSROOT_DIR)) else - @$(call check_glibc) + $(Q)$(call check_glibc,$(SYSROOT_DIR)) endif mkdir -p $(TARGET_DIR)/lib @echo "Copy external toolchain libraries to target..." - @$(call copy_toolchain_lib_root, $(EXTERNAL_LIBC), /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP)) - @for libs in $(EXTERNAL_LIBS); do \ - $(call copy_toolchain_lib_root, $$libs, /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \ + $(Q)for libs in $(EXTERNAL_LIBS); do \ + $(call copy_toolchain_lib_root,$(SYSROOT_DIR),$$libs,/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \ done @echo "Copy external toolchain sysroot to staging..." - @$(call copy_toolchain_sysroot) + $(Q)$(call copy_toolchain_sysroot,$(SYSROOT_DIR)) + @touch $@ diff --git a/toolchain/gcc/4.4.0/100-uclibc-conf.patch b/toolchain/gcc/4.4.1/100-uclibc-conf.patch index cca8c8229..cca8c8229 100644 --- a/toolchain/gcc/4.4.0/100-uclibc-conf.patch +++ b/toolchain/gcc/4.4.1/100-uclibc-conf.patch diff --git a/toolchain/gcc/4.4.0/301-missing-execinfo_h.patch b/toolchain/gcc/4.4.1/301-missing-execinfo_h.patch index 0e2092f3f..0e2092f3f 100644 --- a/toolchain/gcc/4.4.0/301-missing-execinfo_h.patch +++ b/toolchain/gcc/4.4.1/301-missing-execinfo_h.patch diff --git a/toolchain/gcc/4.4.0/302-c99-snprintf.patch b/toolchain/gcc/4.4.1/302-c99-snprintf.patch index ba51a0e1d..ba51a0e1d 100644 --- a/toolchain/gcc/4.4.0/302-c99-snprintf.patch +++ b/toolchain/gcc/4.4.1/302-c99-snprintf.patch diff --git a/toolchain/gcc/4.4.0/305-libmudflap-susv3-legacy.patch b/toolchain/gcc/4.4.1/305-libmudflap-susv3-legacy.patch index 374b1f865..374b1f865 100644 --- a/toolchain/gcc/4.4.0/305-libmudflap-susv3-legacy.patch +++ b/toolchain/gcc/4.4.1/305-libmudflap-susv3-legacy.patch diff --git a/toolchain/gcc/4.4.0/810-arm-softfloat-libgcc.patch b/toolchain/gcc/4.4.1/810-arm-softfloat-libgcc.patch index e6a30a3f0..e6a30a3f0 100644 --- a/toolchain/gcc/4.4.0/810-arm-softfloat-libgcc.patch +++ b/toolchain/gcc/4.4.1/810-arm-softfloat-libgcc.patch diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in index 9aba2f7d3..76e7f78db 100644 --- a/toolchain/gcc/Config.in +++ b/toolchain/gcc/Config.in @@ -105,7 +105,7 @@ config BR2_GCC_VERSION default "4.3.1" if BR2_GCC_VERSION_4_3_1 default "4.3.2" if BR2_GCC_VERSION_4_3_2 default "4.3.3" if BR2_GCC_VERSION_4_3_3 - default "4.4.0" if BR2_GCC_VERSION_4_4_X + default "4.4.1" if BR2_GCC_VERSION_4_4_X default "4.3" if BR2_GCC_VERSION_4_3 config BR2_TOOLCHAIN_SYSROOT diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk index 5770081b3..e9249c1c5 100644 --- a/toolchain/gcc/gcc-uclibc-4.x.mk +++ b/toolchain/gcc/gcc-uclibc-4.x.mk @@ -50,6 +50,11 @@ endif # Snapshot patch endif # Not a snapshot endif # BR2_TOOLCHAIN_BUILDROOT +ifneq ($(filter xtensa%,$(ARCH)),) +include target/xtensa/patch.in +GCC_PATCH_EXTRA:=$(call XTENSA_PATCH,gcc,$(GCC_PATCH_DIR),. ..) +endif + GCC_SOURCE:=gcc-$(GCC_OFFICIAL_VERSION).tar.bz2 GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_OFFICIAL_VERSION) GCC_CAT:=$(BZCAT) @@ -164,7 +169,7 @@ $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE) gcc-patched: $(GCC_DIR)/.patched $(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked # Apply any files named gcc-*.patch from the source directory to gcc - toolchain/patch-kernel.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch + toolchain/patch-kernel.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch $(GCC_PATCH_EXTRA) # Note: The soft float situation has improved considerably with gcc 3.4.x. # We can dispense with the custom spec files, as well as libfloat for the arm case. diff --git a/toolchain/gdb/gdb.mk b/toolchain/gdb/gdb.mk index ba8a1f273..29c4c9c0b 100644 --- a/toolchain/gdb/gdb.mk +++ b/toolchain/gdb/gdb.mk @@ -19,6 +19,11 @@ GDB_SITE:=$(BR2_GNU_MIRROR)/gdb GDB_PATCH_DIR:=toolchain/gdb/$(GDB_OFFICIAL_VERSION) endif +ifneq ($(filter xtensa%,$(ARCH)),) +include target/xtensa/patch.in +GDB_PATCH_EXTRA:=$(call XTENSA_PATCH,gdb,$(GDB_PATCH_DIR),. ..) +endif + GDB_DIR:=$(TOOL_BUILD_DIR)/gdb-$(GDB_OFFICIAL_VERSION) $(DL_DIR)/$(GDB_SOURCE): @@ -33,7 +38,7 @@ ifeq ($(GDB_VERSION),snapshot) tar jtf $(DL_DIR)/$(GDB_SOURCE) | head -1 | cut -d"/" -f1) ln -sf $(TOOL_BUILD_DIR)/$(shell tar jtf $(DL_DIR)/$(GDB_SOURCE) | head -1 | cut -d"/" -f1) $(GDB_DIR) endif - toolchain/patch-kernel.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch + toolchain/patch-kernel.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch $(GDB_PATCH_EXTRA) $(CONFIG_UPDATE) $(@D) touch $@ diff --git a/toolchain/kernel-headers/Config.in b/toolchain/kernel-headers/Config.in index 13acecc94..689c85dd5 100644 --- a/toolchain/kernel-headers/Config.in +++ b/toolchain/kernel-headers/Config.in @@ -49,9 +49,9 @@ config BR2_KERNEL_HEADERS_RT config BR2_DEFAULT_KERNEL_HEADERS string default "2.6.26.8" if BR2_KERNEL_HEADERS_2_6_26 - default "2.6.27.26" if BR2_KERNEL_HEADERS_2_6_27 + default "2.6.27.28" if BR2_KERNEL_HEADERS_2_6_27 default "2.6.28.10" if BR2_KERNEL_HEADERS_2_6_28 default "2.6.29.6" if BR2_KERNEL_HEADERS_2_6_29 - default "2.6.30.1" if BR2_KERNEL_HEADERS_2_6_30 + default "2.6.30.3" if BR2_KERNEL_HEADERS_2_6_30 default "2.6" if BR2_KERNEL_HEADERS_SNAP diff --git a/toolchain/patch-kernel.sh b/toolchain/patch-kernel.sh index e2e89486d..76cb9f753 100755 --- a/toolchain/patch-kernel.sh +++ b/toolchain/patch-kernel.sh @@ -21,7 +21,14 @@ if [ ! -d "${patchdir}" ] ; then fi for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do - case "$i" in + apply="patch -p1 -E -d" + uncomp_parm="" + if [ -d "${patchdir}/$i" ] ; then + type="directory overlay" + uncomp="tar cf - --exclude=.svn --no-anchored -C" + uncomp_parm="." + apply="tar xvf - -C" + else case "$i" in *.gz) type="gzip"; uncomp="gunzip -dc"; ;; *.bz) @@ -32,13 +39,17 @@ for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do type="zip"; uncomp="unzip -d"; ;; *.Z) type="compress"; uncomp="uncompress -c"; ;; + *.tgz) + type="tar gzip"; uncomp="gunzip -dc"; apply="tar xvf - -C"; ;; + *.tar) + type="tar"; uncomp="cat"; apply="tar xvf - -C"; ;; *) type="plaintext"; uncomp="cat"; ;; - esac + esac fi echo "" echo "Applying ${i} using ${type}: " echo ${i} | cat >> ${targetdir}/.applied_patches_list - ${uncomp} ${patchdir}/${i} | patch -p1 -E -d ${targetdir} + ${uncomp} ${patchdir}/${i} ${uncomp_parm} | ${apply} ${targetdir} if [ $? != 0 ] ; then echo "Patch failed! Please fix $i!" exit 1 diff --git a/toolchain/uClibc/uClibc-0.9.30-unifdef-getline.patch b/toolchain/uClibc/uClibc-0.9.30-unifdef-getline.patch new file mode 100644 index 000000000..eb8888470 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30-unifdef-getline.patch @@ -0,0 +1,29 @@ +--- uClibc-0.9.30.1.orig/extra/scripts/unifdef.c ++++ uClibc-0.9.30.1/extra/scripts/unifdef.c +@@ -206,7 +206,7 @@ static void done(void); + static void error(const char *); + static int findsym(const char *); + static void flushline(bool); +-static Linetype getline(void); ++static Linetype get_line(void); + static Linetype ifeval(const char **); + static void ignoreoff(void); + static void ignoreon(void); +@@ -512,7 +512,7 @@ process(void) + + for (;;) { + linenum++; +- lineval = getline(); ++ lineval = get_line(); + trans_table[ifstate[depth]][lineval](); + debug("process %s -> %s depth %d", + linetype_name[lineval], +@@ -526,7 +526,7 @@ process(void) + * help from skipcomment(). + */ + static Linetype +-getline(void) ++get_line(void) + { + const char *cp; + int cursym; diff --git a/toolchain/uClibc/uClibc-0.9.30-xtensa-000p-fix-procfs.patch b/toolchain/uClibc/uClibc-0.9.30-xtensa-000p-fix-procfs.patch new file mode 100644 index 000000000..8e62d205f --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30-xtensa-000p-fix-procfs.patch @@ -0,0 +1,24 @@ +--- uClibc-0.9.29-orig/libc/sysdeps/linux/xtensa/sys/procfs.h 2007-11-16 23:21:00.000000000 -0800 ++++ uClibc-0.9.29/libc/sysdeps/linux/xtensa/sys/procfs.h 2007-11-16 23:26:59.000000000 -0800 +@@ -32,19 +32,11 @@ + #include <sys/time.h> + #include <sys/types.h> + #include <sys/user.h> ++#include <asm/elf.h> + + __BEGIN_DECLS + +-/* Type for a general-purpose register. */ +-typedef unsigned long elf_greg_t; +- +-#define ELF_NGREG 128 +-typedef elf_greg_t elf_gregset_t[ELF_NGREG]; +- +-/* Register set for the floating-point registers. */ +-#define ELF_NFPREG 18 +-typedef unsigned long elf_fpreg_t; +-typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; ++/* Note: we get elf_gregset_t and elf_fpregset_t from <asm/elf.h>. */ + + /* Signal info. */ + struct elf_siginfo diff --git a/toolchain/uClibc/uClibc-0.9.30-xtensa-005-sigcontext.patch b/toolchain/uClibc/uClibc-0.9.30-xtensa-005-sigcontext.patch new file mode 100644 index 000000000..7d7d684b1 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30-xtensa-005-sigcontext.patch @@ -0,0 +1,45 @@ +diff -u /dev/null uClibc-0.9.30/libc/sysdeps/linux/xtensa/bits/sigcontext.h +--- /dev/null ++++ uClibc-0.9.30/libc/sysdeps/linux/xtensa/bits/sigcontext.h +@@ -0,0 +1,41 @@ ++/* Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street - Fifth Floor, ++ Boston, MA 02110-1301, USA. */ ++ ++#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H ++# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." ++#endif ++ ++#ifndef _BITS_SIGCONTEXT_H ++#define _BITS_SIGCONTEXT_H 1 ++ ++struct sigcontext ++{ ++ unsigned long sc_pc; ++ unsigned long sc_ps; ++ unsigned long sc_lbeg; ++ unsigned long sc_lend; ++ unsigned long sc_lcount; ++ unsigned long sc_sar; ++ unsigned long sc_acclo; ++ unsigned long sc_acchi; ++ void *sc_xtregs; ++ unsigned long sc_a[16]; ++}; ++ ++#endif /* _BITS_SIGCONTEXT_H */ ++ diff --git a/toolchain/uClibc/uClibc-0.9.30-xtensa-009-testandset.patch b/toolchain/uClibc/uClibc-0.9.30-xtensa-009-testandset.patch new file mode 100644 index 000000000..f0e4eb272 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30-xtensa-009-testandset.patch @@ -0,0 +1,59 @@ +--- uClibc-0.9.29/libpthread/linuxthreads.old/sysdeps/xtensa/pt-machine.h.orig 2008-09-12 09:51:50.000000000 -0700 ++++ uClibc-0.9.29/libpthread/linuxthreads.old/sysdeps/xtensa/pt-machine.h 2008-10-04 12:14:57.000000000 -0700 +@@ -26,19 +26,51 @@ + #include <asm/unistd.h> + + #ifndef PT_EI +-# define PT_EI __extern_always_inline ++# define PT_EI extern inline __attribute__ ((gnu_inline)) + #endif + +-/* Memory barrier. */ + #define MEMORY_BARRIER() __asm__ ("memw" : : : "memory") ++#define HAS_COMPARE_AND_SWAP ++ ++extern long int testandset (int *spinlock); ++extern int __compare_and_swap (long int *p, long int oldval, long int newval); + + /* Spinlock implementation; required. */ + PT_EI long int + testandset (int *spinlock) + { +- int unused = 0; +- return INTERNAL_SYSCALL (xtensa, , 4, SYS_XTENSA_ATOMIC_SET, +- spinlock, 1, unused); ++ unsigned long tmp; ++ __asm__ volatile ( ++" movi %0, 0 \n" ++" wsr %0, SCOMPARE1 \n" ++" movi %0, 1 \n" ++" s32c1i %0, %1, 0 \n" ++ : "=&a" (tmp) ++ : "a" (spinlock) ++ : "memory" ++ ); ++ return tmp; ++} ++ ++PT_EI int ++__compare_and_swap (long int *p, long int oldval, long int newval) ++{ ++ unsigned long tmp; ++ unsigned long value; ++ __asm__ volatile ( ++"1: l32i %0, %2, 0 \n" ++" bne %0, %4, 2f \n" ++" wsr %0, SCOMPARE1 \n" ++" mov %1, %0 \n" ++" mov %0, %3 \n" ++" s32c1i %0, %2, 0 \n" ++" bne %1, %0, 1b \n" ++"2: \n" ++ : "=&a" (tmp), "=&a" (value) ++ : "a" (p), "a" (newval), "a" (oldval) ++ : "memory" ); ++ ++ return tmp == oldval; + } + + /* Get some notion of the current stack. Need not be exactly the top diff --git a/toolchain/uClibc/uClibc-0.9.30-xtensa-010-sigaction.c.patch b/toolchain/uClibc/uClibc-0.9.30-xtensa-010-sigaction.c.patch new file mode 100644 index 000000000..5717c2582 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30-xtensa-010-sigaction.c.patch @@ -0,0 +1,11 @@ +--- a/libc/sysdeps/linux/xtensa/sigaction.c 2008-09-23 21:11:02.000000000 -0700 ++++ b/libc/sysdeps/linux/xtensa/sigaction.c 2008-09-23 21:12:31.000000000 -0700 +@@ -17,6 +17,8 @@ + + #define SA_RESTORER 0x04000000 + ++extern __typeof(sigaction) __libc_sigaction; ++ + extern void __default_sa_restorer (void); + + libc_hidden_proto(memcpy) diff --git a/toolchain/uClibc/uClibc-0.9.30-xtensa-011-sysdep.h.patch b/toolchain/uClibc/uClibc-0.9.30-xtensa-011-sysdep.h.patch new file mode 100644 index 000000000..692b0a722 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30-xtensa-011-sysdep.h.patch @@ -0,0 +1,19 @@ +--- a/libc/sysdeps/linux/xtensa/sysdep.h 2008-09-23 21:17:42.000000000 -0700 ++++ b/libc/sysdeps/linux/xtensa/sysdep.h 2008-09-23 21:17:59.000000000 -0700 +@@ -114,15 +114,7 @@ + + #define ret_ERRVAL retw + +-#if RTLD_PRIVATE_ERRNO +-# define SYSCALL_ERROR_HANDLER \ +-0: movi a4, rtld_errno; \ +- neg a2, a2; \ +- s32i a2, a4, 0; \ +- movi a2, -1; \ +- j .Lpseudo_end; +- +-#elif defined _LIBC_REENTRANT ++#if defined _LIBC_REENTRANT + + # if USE___THREAD + # ifndef NOT_IN_libc diff --git a/toolchain/uClibc/uClibc-0.9.30-xtensa-012-fnmatch_old.c.patch b/toolchain/uClibc/uClibc-0.9.30-xtensa-012-fnmatch_old.c.patch new file mode 100644 index 000000000..66cb1f609 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30-xtensa-012-fnmatch_old.c.patch @@ -0,0 +1,11 @@ +--- a/libc/misc/fnmatch/fnmatch_old.c 2008-09-23 21:23:13.000000000 -0700 ++++ b/libc/misc/fnmatch/fnmatch_old.c 2008-09-23 21:23:33.000000000 -0700 +@@ -15,7 +15,7 @@ + not, write to the Free Software Foundation, Inc., 675 Mass Ave, + Cambridge, MA 02139, USA. */ + +-#if HAVE_CONFIG_H ++#ifdef HAVE_CONFIG_H + # include <config.h> + #endif + diff --git a/toolchain/uClibc/uClibc-0.9.30-xtensa-013-atomic.h.patch b/toolchain/uClibc/uClibc-0.9.30-xtensa-013-atomic.h.patch new file mode 100644 index 000000000..fd2037111 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30-xtensa-013-atomic.h.patch @@ -0,0 +1,165 @@ +--- /dev/null 2008-09-18 06:50:54.356228028 -0700 ++++ uClibc-0.9.29/libc/sysdeps/linux/xtensa/bits/atomic.h 2008-10-04 11:40:21.000000000 -0700 +@@ -0,0 +1,162 @@ ++/* ++ * Copyright (C) 2008 Tensilica, Inc. ++ * Contributed by Joe Taylor <joe@tensilica.com> 2008 ++ * ++ * This file is subject to the terms and conditions of the GNU Lesser General ++ * Public License. See the file "COPYING.LIB" in the main directory of this ++ * archive for more details. ++ */ ++ ++#ifndef _XTENSA_BITS_ATOMIC_H ++#define _XTENSA_BITS_ATOMIC_H 1 ++ ++/* Xtensa has only a 32-bit form of a store-conditional instruction, ++ so just stub out the rest. */ ++ ++/* Atomically store NEWVAL in *MEM if *MEM is equal to OLDVAL. ++ Return the old *MEM value. */ ++ ++#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ ++ ({__typeof__(*(mem)) __tmp, __value; \ ++ __asm__ __volatile__( \ ++ "1: l32i %1, %2, 0 \n" \ ++ " bne %1, %4, 2f \n" \ ++ " wsr %1, SCOMPARE1 \n" \ ++ " mov %0, %1 \n" \ ++ " mov %1, %3 \n" \ ++ " s32c1i %1, %2, 0 \n" \ ++ " bne %0, %1, 1b \n" \ ++ "2: \n" \ ++ : "=&a" (__value), "=&a" (__tmp) \ ++ : "a" (mem), "a" (newval), "a" (oldval) \ ++ : "memory" ); \ ++ __tmp; \ ++ }) ++ ++/* Atomically store NEWVAL in *MEM if *MEM is equal to OLDVAL. ++ Return zero if *MEM was changed or non-zero if no exchange happened. */ ++ ++#define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \ ++ ({__typeof__(*(mem)) __tmp, __value; \ ++ __asm__ __volatile__( \ ++ "1: l32i %0, %2, 0 \n" \ ++ " sub %1, %4, %0 \n" \ ++ " bnez %1, 2f \n" \ ++ " wsr %0, SCOMPARE1 \n" \ ++ " mov %1, %3 \n" \ ++ " s32c1i %1, %2, 0 \n" \ ++ " bne %0, %1, 1b \n" \ ++ " movi %1, 0 \n" \ ++ "2: \n" \ ++ : "=&a" (__value), "=&a" (__tmp) \ ++ : "a" (mem), "a" (newval), "a" (oldval) \ ++ : "memory" ); \ ++ __tmp != 0; \ ++ }) ++ ++/* Store NEWVALUE in *MEM and return the old value. */ ++ ++#define __arch_exchange_32_acq(mem, newval) \ ++ ({__typeof__(*(mem)) __tmp, __value; \ ++ __asm__ __volatile__( \ ++ "1: l32i %0, %2, 0 \n" \ ++ " wsr %0, SCOMPARE1 \n" \ ++ " mov %1, %3 \n" \ ++ " s32c1i %1, %2, 0 \n" \ ++ " bne %0, %1, 1b \n" \ ++ : "=&a" (__value), "=&a" (__tmp) \ ++ : "a" (mem), "a" (newval) \ ++ : "memory" ); \ ++ __tmp; \ ++ }) ++ ++/* Add VALUE to *MEM and return the old value of *MEM. */ ++ ++#define __arch_atomic_exchange_and_add_32(mem, value) \ ++ ({__typeof__(*(mem)) __tmp, __value; \ ++ __asm__ __volatile__( \ ++ "1: l32i %0, %2, 0 \n" \ ++ " wsr %0, SCOMPARE1 \n" \ ++ " add %1, %0, %3 \n" \ ++ " s32c1i %1, %2, 0 \n" \ ++ " bne %0, %1, 1b \n" \ ++ : "=&a" (__value), "=&a" (__tmp) \ ++ : "a" (mem), "a" (value) \ ++ : "memory" ); \ ++ __tmp; \ ++ }) ++ ++/* Subtract VALUE from *MEM and return the old value of *MEM. */ ++ ++#define __arch_atomic_exchange_and_sub_32(mem, value) \ ++ ({__typeof__(*(mem)) __tmp, __value; \ ++ __asm__ __volatile__( \ ++ "1: l32i %0, %2, 0 \n" \ ++ " wsr %0, SCOMPARE1 \n" \ ++ " sub %1, %0, %3 \n" \ ++ " s32c1i %1, %2, 0 \n" \ ++ " bne %0, %1, 1b \n" \ ++ : "=&a" (__value), "=&a" (__tmp) \ ++ : "a" (mem), "a" (value) \ ++ : "memory" ); \ ++ __tmp; \ ++ }) ++ ++/* Decrement *MEM if it is > 0, and return the old value. */ ++ ++#define __arch_atomic_decrement_if_positive_32(mem) \ ++ ({__typeof__(*(mem)) __tmp, __value; \ ++ __asm__ __volatile__( \ ++ "1: l32i %0, %2, 0 \n" \ ++ " blti %0, 1, 2f \n" \ ++ " wsr %0, SCOMPARE1 \n" \ ++ " addi %1, %0, -1 \n" \ ++ " s32c1i %1, %2, 0 \n" \ ++ " bne %0, %1, 1b \n" \ ++ "2: \n" \ ++ : "=&a" (__value), "=&a" (__tmp) \ ++ : "a" (mem) \ ++ : "memory" ); \ ++ __tmp; \ ++ }) ++ ++ ++/* These are the preferred public interfaces: */ ++ ++#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ ++ ({ \ ++ if (sizeof (*mem) != 4) \ ++ abort(); \ ++ __arch_compare_and_exchange_val_32_acq(mem, newval, oldval); \ ++ }) ++ ++#define atomic_exchange_acq(mem, newval) \ ++ ({ \ ++ if (sizeof(*(mem)) != 4) \ ++ abort(); \ ++ __arch_exchange_32_acq(mem, newval); \ ++ }) ++ ++#define atomic_exchange_and_add(mem, newval) \ ++ ({ \ ++ if (sizeof(*(mem)) != 4) \ ++ abort(); \ ++ __arch_atomic_exchange_and_add_32(mem, newval); \ ++ }) ++ ++#define atomic_exchange_and_sub(mem, newval) \ ++ ({ \ ++ if (sizeof(*(mem)) != 4) \ ++ abort(); \ ++ __arch_atomic_exchange_and_sub_32(mem, newval); \ ++ }) ++ ++#define atomic_decrement_if_positive(mem) \ ++ ({ \ ++ if (sizeof(*(mem)) != 4) \ ++ abort(); \ ++ __arch_atomic_decrement_if_positive_32(mem); \ ++ }) ++ ++#endif /* _XTENSA_BITS_ATOMIC_H */ ++ diff --git a/toolchain/uClibc/uClibc-0.9.30-xtensa-014-setjump.S.patch b/toolchain/uClibc/uClibc-0.9.30-xtensa-014-setjump.S.patch new file mode 100644 index 000000000..720b44b58 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30-xtensa-014-setjump.S.patch @@ -0,0 +1,11 @@ +--- uClibc-0.9.30/libc/sysdeps/linux/xtensa/setjmp.S.orig 2009-05-01 16:57:16.195893000 -0700 ++++ uClibc-0.9.30/libc/sysdeps/linux/xtensa/setjmp.S 2009-05-01 16:58:03.885160000 -0700 +@@ -86,7 +86,7 @@ ENTRY (__sigsetjmp) + /* Copy 0-8 words from the register overflow area. */ + extui a3, a0, 30, 2 + blti a3, 2, .Lendsj +- l32i a7, a1, 4 ++ l32i a7, a5, 4 + slli a4, a3, 4 + sub a5, a7, a4 + addi a6, a2, 16 diff --git a/toolchain/uClibc/uClibc-0.9.30.1-unifdef-getline.patch b/toolchain/uClibc/uClibc-0.9.30.1-unifdef-getline.patch new file mode 100644 index 000000000..eb8888470 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30.1-unifdef-getline.patch @@ -0,0 +1,29 @@ +--- uClibc-0.9.30.1.orig/extra/scripts/unifdef.c ++++ uClibc-0.9.30.1/extra/scripts/unifdef.c +@@ -206,7 +206,7 @@ static void done(void); + static void error(const char *); + static int findsym(const char *); + static void flushline(bool); +-static Linetype getline(void); ++static Linetype get_line(void); + static Linetype ifeval(const char **); + static void ignoreoff(void); + static void ignoreon(void); +@@ -512,7 +512,7 @@ process(void) + + for (;;) { + linenum++; +- lineval = getline(); ++ lineval = get_line(); + trans_table[ifstate[depth]][lineval](); + debug("process %s -> %s depth %d", + linetype_name[lineval], +@@ -526,7 +526,7 @@ process(void) + * help from skipcomment(). + */ + static Linetype +-getline(void) ++get_line(void) + { + const char *cp; + int cursym; diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk index b39b9399b..80d7d9861 100644 --- a/toolchain/uClibc/uclibc.mk +++ b/toolchain/uClibc/uclibc.mk @@ -52,6 +52,7 @@ UCLIBC_TARGET_ARCH:=$(shell $(SHELL) -c "echo $(ARCH) | sed \ -e 's/mipsel.*/mips/' \ -e 's/cris.*/cris/' \ -e 's/nios2.*/nios2/' \ + -e 's/xtensa.*/xtensa/' \ ") # just handle the ones that can be big or little UCLIBC_TARGET_ENDIAN:=$(shell $(SHELL) -c "echo $(ARCH) | sed \ |