summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/Config.in45
-rw-r--r--toolchain/Makefile13
-rw-r--r--toolchain/binutils/Makefile10
-rw-r--r--toolchain/eglibc/Makefile21
-rw-r--r--toolchain/eglibc/Makefile.inc2
-rw-r--r--toolchain/eglibc/patches/eglibc-cross.patch2
-rw-r--r--toolchain/gcc/Makefile49
-rw-r--r--toolchain/gcc/patches/cflags.patch253
-rw-r--r--toolchain/gdb/Makefile1
-rw-r--r--toolchain/glibc/Makefile13
-rw-r--r--toolchain/glibc/Makefile.inc3
-rw-r--r--toolchain/glibc/patches/i686_define_bug.patch38
-rw-r--r--toolchain/glibc/patches/tz.patch135
-rw-r--r--toolchain/kernel-headers/Makefile5
-rw-r--r--toolchain/kernel-headers/patches/2.6.36/aufs2.patch240
-rw-r--r--toolchain/kernel-headers/patches/2.6.37/aufs2.patch240
-rw-r--r--toolchain/kernel-headers/patches/2.6.37/cleankernel.patch11
-rw-r--r--toolchain/kernel-headers/patches/2.6.37/etrax-header.patch75
-rw-r--r--toolchain/kernel-headers/patches/2.6.37/linux-gcc-check.patch18
-rw-r--r--toolchain/kernel-headers/patches/2.6.37/microperl.patch24
-rw-r--r--toolchain/libelf/Makefile31
-rw-r--r--toolchain/libelf/Makefile.inc8
-rw-r--r--toolchain/uClibc/Makefile19
23 files changed, 1210 insertions, 46 deletions
diff --git a/toolchain/Config.in b/toolchain/Config.in
new file mode 100644
index 000000000..e86e9656f
--- /dev/null
+++ b/toolchain/Config.in
@@ -0,0 +1,45 @@
+menu "Toolchain settings"
+
+config ADK_TOOLCHAIN_GDB
+ prompt "Enable building of the GNU debugger"
+ boolean
+ default y
+
+config ADK_TOOLCHAIN_GCC_CXX
+ prompt "Enable building of G++ (C++ language support in GCC)"
+ boolean
+ default y
+
+config ADK_TOOLCHAIN_GCC_JAVA
+ prompt "Enable building of GCJ (Java language support in GCC)"
+ boolean
+ default n
+
+config ADK_TOOLCHAIN_GCC_OBJC
+ prompt "Enable building of Objective C compiler"
+ boolean
+ default n
+
+config ADK_TOOLCHAIN_GCC_SSP
+ prompt "Enable Stack Smashing Protection in GCC"
+ boolean
+ default n
+
+config ADK_TOOLCHAIN_GCC_USE_SSP
+ prompt "Use SSP for all packages"
+ boolean
+ depends on ADK_TOOLCHAIN_GCC_SSP
+ default n
+
+config ADK_TOOLCHAIN_GCC_LTO
+ prompt "Enable Link Time Optimization in GCC"
+ boolean
+ default n
+
+config ADK_TOOLCHAIN_GCC_USE_LTO
+ prompt "Use Link Time Optimization for all packages"
+ boolean
+ depends on ADK_TOOLCHAIN_GCC_LTO
+ default n
+
+endmenu
diff --git a/toolchain/Makefile b/toolchain/Makefile
index 1e36c6b5f..e3c04a85a 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -3,7 +3,7 @@
#
# Steps to build toolchains
# 1) build and install binutils
-# 2) build and install mpfr, mpc and gmp
+# 2) build and install mpfr, mpc, libelf and gmp
# 3) build and install gcc c compiler
# 4) install kernel-headers
# 5) install libc headers
@@ -13,7 +13,7 @@
include $(TOPDIR)/rules.mk
-TARGETS:=binutils gmp mpfr mpc gcc
+TARGETS:=binutils gmp mpfr mpc libelf gcc
ifeq ($(ADK_TARGET_LIB_GLIBC),y)
TARGETS+=glibc-ports glibc
LIBC:=glibc
@@ -26,7 +26,9 @@ ifeq ($(ADK_TARGET_LIB_UCLIBC),y)
TARGETS+=uClibc
LIBC:=uClibc
endif
+ifeq ($(ADK_TOOLCHAIN_GDB),y)
TARGETS+=gdb
+endif
DOWNLOAD:=kernel-headers-download $(patsubst %,%-download,$(TARGETS))
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
@@ -36,7 +38,7 @@ install: $(TARGETS_INSTALL)
clean: $(TARGETS_CLEAN)
download: $(DOWNLOAD)
-gcc-prepare: binutils-install gmp-install mpfr-install mpc-install
+gcc-prepare: binutils-install gmp-install mpfr-install mpc-install libelf-install
ifeq ($(ADK_TARGET_LIB_GLIBC),y)
$(LIBC)-prepare: gcc-prepare kernel-headers-prepare glibc-ports-prepare
else
@@ -52,14 +54,11 @@ $(STAGING_HOST_DIR):
@mkdir -p $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)
@ln -sf ../lib $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/lib
-$(TOOLCHAIN_BUILD_DIR):
- @mkdir -p $(TOOLCHAIN_BUILD_DIR)
-
%-download:
$(TRACE) toolchain/$(patsubst %-download,%,$@)/download
$(MAKE) -C $(patsubst %-download,%,$@) fetch
-%-prepare: $(STAGING_HOST_DIR) $(TOOLCHAIN_BUILD_DIR)
+%-prepare: $(STAGING_HOST_DIR)
$(TRACE) toolchain/$(patsubst %-prepare,%,$@)/prepare
@if test x"$(patsubst %-prepare,%,$@)" = x"$(LIBC)"; then \
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare \
diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index 33f03c7fb..cc8c1b26a 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -6,6 +6,12 @@ include Makefile.inc
include ../rules.mk
include ${TOPDIR}/mk/buildhlp.mk
+ifeq ($(ADK_TOOLCHAIN_GCC_SSP),y)
+CONFOPTS+= --enable-libssp
+else
+CONFOPTS+= --disable-libssp
+endif
+
ifeq ($(ADK_LINUX_64),y)
CONFOPTS+= --enable-64-bit-bfd
endif
@@ -22,14 +28,12 @@ $(WRKBUILD)/.configured:
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
- --disable-nls \
- --with-sysroot=$(TOOLCHAIN_SYSROOT) \
--with-sysroot=$(STAGING_TARGET_DIR) \
--disable-multilib \
--disable-dependency-tracking \
--disable-libtool-lock \
+ --disable-nls \
--disable-werror \
- --disable-libssp \
${CONFOPTS} \
);
touch $@
diff --git a/toolchain/eglibc/Makefile b/toolchain/eglibc/Makefile
index a4d54bb69..c5f2a5653 100644
--- a/toolchain/eglibc/Makefile
+++ b/toolchain/eglibc/Makefile
@@ -4,7 +4,6 @@
include $(TOPDIR)/rules.mk
include ../rules.mk
include Makefile.inc
-
include ${TOPDIR}/mk/buildhlp.mk
ifneq ($(ADK_DEBUG),)
@@ -51,8 +50,8 @@ $(WRKBUILD)/.headers_configure:
(cd $(EGLIBC_BUILD_DIR_INITIAL); \
${EGLIBC_ENV} \
$(WRKBUILD)/libc/configure \
- --prefix=$(TOOLCHAIN_SYSROOT)/usr \
- --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
+ --prefix=$(STAGING_TARGET_DIR)/usr \
+ --with-headers=$(STAGING_TARGET_DIR)/usr/include \
${EGLIBC_CONFOPTS} \
);
touch $@
@@ -62,9 +61,15 @@ $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
PATH='${TARGET_PATH}' \
$(MAKE) install-headers install-bootstrap-headers=yes \
);
- touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h
+ touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
touch $@
+ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+EGLIBC_ENV+= libc_cv_ssp=yes
+else
+EGLIBC_ENV+= libc_cv_ssp=no
+endif
+
$(WRKBUILD)/.configured:
mkdir -p $(EGLIBC_BUILD_DIR_FINAL)
$(CP) ${TOPDIR}/toolchain/eglibc/eglibc.config \
@@ -79,12 +84,16 @@ $(WRKBUILD)/.configured:
);
touch $@
-$(WRKBUILD)/.compiled:
+$(EGLIBC_BUILD_DIR_FINAL)/libc.so:
+$(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL) all
touch $@
-$(WRKBUILD)/.installed:
+$(WRKBUILD)/.installed: $(EGLIBC_BUILD_DIR_FINAL)/libc.so
${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_TARGET_DIR) install
+ ${INSTALL_DATA} ${WRKBUILD}/libc/posix/gai.conf ${STAGING_TARGET_DIR}/etc/
+ ${INSTALL_DATA} ${WRKBUILD}/libc/nscd/nscd.conf ${STAGING_TARGET_DIR}/etc/
+ ${INSTALL_DATA} ${WRKBUILD}/libc/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc/
touch $@
include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/eglibc/Makefile.inc b/toolchain/eglibc/Makefile.inc
index 51fefa6d5..42e80e858 100644
--- a/toolchain/eglibc/Makefile.inc
+++ b/toolchain/eglibc/Makefile.inc
@@ -3,6 +3,6 @@
PKG_NAME:= eglibc
PKG_VERSION:= 2.12.1
-PKG_RELEASE:= 1
+PKG_RELEASE:= 2
PKG_MD5SUM:= 3668505801160785c2961df0a7ec192e
PKG_SITES:= http://openadk.org/distfiles/
diff --git a/toolchain/eglibc/patches/eglibc-cross.patch b/toolchain/eglibc/patches/eglibc-cross.patch
index 384a5c16b..6a7fb9e51 100644
--- a/toolchain/eglibc/patches/eglibc-cross.patch
+++ b/toolchain/eglibc/patches/eglibc-cross.patch
@@ -1,3 +1,5 @@
+* NOTE: This will still use a hardcoded “gcc” instead of HOSTCC
+
diff -Nur eglibc-2.12.orig/libc/sunrpc/proto.h eglibc-2.12/libc/sunrpc/proto.h
--- eglibc-2.12.orig/libc/sunrpc/proto.h 2010-09-28 19:14:26.000000000 +0200
+++ eglibc-2.12/libc/sunrpc/proto.h 2010-09-29 14:05:15.000000000 +0200
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
index 7e806c68c..b1ce84f98 100644
--- a/toolchain/gcc/Makefile
+++ b/toolchain/gcc/Makefile
@@ -11,6 +11,7 @@ GCC_CONFOPTS= --prefix=$(STAGING_HOST_DIR) \
--target=$(REAL_GNU_TARGET_NAME) \
--with-gmp=$(STAGING_HOST_DIR) \
--with-mpfr=$(STAGING_HOST_DIR) \
+ --with-libelf=$(STAGING_HOST_DIR) \
--disable-__cxa_atexit \
--with-gnu-ld \
--disable-libmudflap \
@@ -19,7 +20,6 @@ GCC_CONFOPTS= --prefix=$(STAGING_HOST_DIR) \
--disable-decimal-float \
--disable-multilib \
--disable-sjlj-exceptions \
- --disable-libssp \
--disable-libstdcxx-pch \
--disable-ppl-version-check \
--disable-cloog-version-check \
@@ -27,6 +27,18 @@ GCC_CONFOPTS= --prefix=$(STAGING_HOST_DIR) \
--without-cloog \
--disable-nls
+ifeq ($(ADK_TOOLCHAIN_GCC_SSP),y)
+GCC_CONFOPTS+= --enable-libssp
+else
+GCC_CONFOPTS+= --disable-libssp
+endif
+
+ifeq ($(ADK_TOOLCHAIN_GCC_LTO),y)
+GCC_CONFOPTS+= --enable-lto
+else
+GCC_CONFOPTS+= --disable-lto
+endif
+
ifeq ($(ARCH),cris)
GCC_CONFOPTS+= --disable-tls
else
@@ -55,6 +67,17 @@ ifeq (${ADK_MAKE_PARALLEL},y)
GCC_MAKEOPTS+= -j${ADK_MAKE_JOBS}
endif
+LANGUAGES:=c
+ifeq ($(ADK_TOOLCHAIN_GCC_CXX),y)
+LANGUAGES:=${LANGUAGES},c++
+endif
+ifeq ($(ADK_TOOLCHAIN_GCC_JAVA),y)
+LANGUAGES:=${LANGUAGES},java
+endif
+ifeq ($(ADK_TOOLCHAIN_GCC_ADA),y)
+LANGUAGES:=${LANGUAGES},ada
+endif
+
include ${TOPDIR}/mk/buildhlp.mk
GCC_BUILD_DIR_MINIMAL:= $(WRKBUILD)-minimal
@@ -63,7 +86,12 @@ GCC_BUILD_DIR_FINAL:= $(WRKBUILD)-final
$(GCC_BUILD_DIR_MINIMAL)/.configured:
mkdir -p $(GCC_BUILD_DIR_MINIMAL)
- (cd $(GCC_BUILD_DIR_MINIMAL); rm -f config.cache; \
+ # these symlinks are very important, do not remove
+ rm -rf $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
+ ln -sf ${STAGING_TARGET_DIR}/include $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
+ rm -rf ${STAGING_HOST_DIR}/$(REAL_GNU_TARGET_NAME)/lib
+ ln -sf ${STAGING_TARGET_DIR}/lib $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/lib
+ (cd $(GCC_BUILD_DIR_MINIMAL); \
PATH='$(TARGET_PATH)' \
$(WRKBUILD)/configure \
${GCC_CONFOPTS} \
@@ -85,12 +113,8 @@ $(WRKBUILD)/.headers: $(GCC_BUILD_DIR_MINIMAL)/.compiled
touch $@
$(GCC_BUILD_DIR_INITIAL)/.configured:
- rm -rf $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
- ln -sf ${STAGING_TARGET_DIR}/include $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
- rm -rf ${STAGING_HOST_DIR}/$(REAL_GNU_TARGET_NAME)/lib
- ln -sf ${STAGING_TARGET_DIR}/lib $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/lib
mkdir -p $(GCC_BUILD_DIR_INITIAL)
- (cd $(GCC_BUILD_DIR_INITIAL); rm -f config.cache; \
+ (cd $(GCC_BUILD_DIR_INITIAL); \
PATH='$(TARGET_PATH)' \
$(WRKBUILD)/configure \
${GCC_CONFOPTS} \
@@ -98,7 +122,7 @@ $(GCC_BUILD_DIR_INITIAL)/.configured:
--disable-shared \
--disable-threads \
--with-newlib \
- --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ --with-sysroot=$(STAGING_TARGET_DIR) \
);
touch $@
@@ -115,12 +139,12 @@ $(WRKBUILD)/.configured: $(GCC_BUILD_DIR_INITIAL)/.compiled
$(GCC_BUILD_DIR_FINAL)/.configured:
mkdir -p $(GCC_BUILD_DIR_FINAL)
- (cd $(GCC_BUILD_DIR_FINAL); rm -f config.cache; \
+ (cd $(GCC_BUILD_DIR_FINAL); \
PATH='$(TARGET_PATH)' \
$(WRKBUILD)/configure \
${GCC_CONFOPTS} \
- --enable-languages=c,c++ \
- --with-sysroot=$(STAGING_TARGET_DIR) \
+ --enable-languages=$(LANGUAGES) \
+ --with-sysroot='$${prefix}/${STAGING_HOST2TARGET}' \
--with-slibdir=$(STAGING_TARGET_DIR)/lib \
--enable-shared \
);
@@ -133,9 +157,6 @@ $(WRKBUILD)/.compiled: $(GCC_BUILD_DIR_FINAL)/.configured
$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
PATH='$(TARGET_PATH)' $(MAKE) -C $(GCC_BUILD_DIR_FINAL) install
- # workaround if you cross-compile binutils
- @-rm $(STAGING_TARGET_DIR)/lib/libiberty.a
- @-rm $(STAGING_TARGET_DIR)/usr/lib/libiberty.a
# Set up the symlinks to enable lying about target name.
set -e; \
(cd $(STAGING_HOST_DIR); \
diff --git a/toolchain/gcc/patches/cflags.patch b/toolchain/gcc/patches/cflags.patch
new file mode 100644
index 000000000..0d5815a54
--- /dev/null
+++ b/toolchain/gcc/patches/cflags.patch
@@ -0,0 +1,253 @@
+
+ This patch brings over a few features from MirBSD:
+ * -fhonour-copts
+ If this option is not given, it's warned (depending
+ on environment variables). This is to catch errors
+ of misbuilt packages which override CFLAGS themselves.
+ * -Werror-maybe-reset
+ Has the effect of -Wno-error if GCC_NO_WERROR is
+ set and not '0', a no-operation otherwise. This is
+ to be able to use -Werror in "make" but prevent
+ GNU autoconf generated configure scripts from
+ freaking out.
+ * Make -fno-strict-aliasing and -fno-delete-null-pointer-checks
+ the default for -O2/-Os, because they trigger gcc bugs
+ and can delete code with security implications.
+
+ This patch was authored by Thorsten Glaser <tg at mirbsd.de>
+ with copyright assignment to the FSF in effect.
+
+--- a/gcc/c-opts.c
++++ b/gcc/c-opts.c
+@@ -105,6 +105,9 @@
+ /* Number of deferred options scanned for -include. */
+ static size_t include_cursor;
+
++/* Check if a port honours COPTS. */
++static int honour_copts = 0;
++
+ static void set_Wimplicit (int);
+ static void handle_OPT_d (const char *);
+ static void set_std_cxx98 (int);
+@@ -454,6 +457,9 @@
+ enable_warning_as_error ("implicit-function-declaration", value, CL_C | CL_ObjC);
+ break;
+
++ case OPT_Werror_maybe_reset:
++ break;
++
+ case OPT_Wformat:
+ set_Wformat (value);
+ break;
+@@ -690,6 +701,12 @@
+ flag_exceptions = value;
+ break;
+
++ case OPT_fhonour_copts:
++ if (c_language == clk_c) {
++ honour_copts++;
++ }
++ break;
++
+ case OPT_fimplement_inlines:
+ flag_implement_inlines = value;
+ break;
+@@ -1209,6 +1226,47 @@
+ return false;
+ }
+
++ if (c_language == clk_c) {
++ char *ev = getenv ("GCC_HONOUR_COPTS");
++ int evv;
++ if (ev == NULL)
++ evv = -1;
++ else if ((*ev == '0') || (*ev == '\0'))
++ evv = 0;
++ else if (*ev == '1')
++ evv = 1;
++ else if (*ev == '2')
++ evv = 2;
++ else if (*ev == 's')
++ evv = -1;
++ else {
++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */
++ }
++ if (evv == 1) {
++ if (honour_copts == 0) {
++ error ("someone does not honour COPTS at all in lenient mode");
++ return false;
++ } else if (honour_copts != 1) {
++ warning (0, "someone does not honour COPTS correctly, passed %d times",
++ honour_copts);
++ }
++ } else if (evv == 2) {
++ if (honour_copts == 0) {
++ error ("someone does not honour COPTS at all in strict mode");
++ return false;
++ } else if (honour_copts != 1) {
++ error ("someone does not honour COPTS correctly, passed %d times",
++ honour_copts);
++ return false;
++ }
++ } else if (evv == 0) {
++ if (honour_copts != 1)
++ inform (0, "someone does not honour COPTS correctly, passed %d times",
++ honour_copts);
++ }
++ }
++
+ return true;
+ }
+
+--- a/gcc/c.opt
++++ b/gcc/c.opt
+@@ -215,6 +215,10 @@
+ C ObjC RejectNegative Warning
+ This switch is deprecated; use -Werror=implicit-function-declaration instead
+
++Werror-maybe-reset
++C ObjC C++ ObjC++
++; Documented in common.opt
++
+ Wfloat-equal
+ C ObjC C++ ObjC++ Var(warn_float_equal) Warning
+ Warn if testing floating point numbers for equality
+@@ -609,6 +613,9 @@
+ fhonor-std
+ C++ ObjC++
+
++fhonour-copts
++C ObjC C++ ObjC++ RejectNegative
++
+ fhosted
+ C ObjC
+ Assume normal C execution environment
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -102,6 +102,10 @@
+ Common Joined
+ Treat specified warning as error
+
++Werror-maybe-reset
++Common
++If environment variable GCC_NO_WERROR is set, act as -Wno-error
++
+ Wextra
+ Common Warning
+ Print extra (possibly unwanted) warnings
+@@ -573,6 +577,9 @@
+ Common Report Var(flag_guess_branch_prob) Optimization
+ Enable guessing of branch probabilities
+
++fhonour-copts
++Common RejectNegative
++
+ ; Nonzero means ignore `#ident' directives. 0 means handle them.
+ ; Generate position-independent code for executables if possible
+ ; On SVR4 targets, it also controls whether or not to emit a
+--- a/gcc/opts.c
++++ b/gcc/opts.c
+@@ -896,8 +896,6 @@
+ flag_schedule_insns_after_reload = opt2;
+ #endif
+ flag_regmove = opt2;
+- flag_strict_aliasing = opt2;
+- flag_strict_overflow = opt2;
+ flag_reorder_blocks = opt2;
+ flag_reorder_functions = opt2;
+ flag_tree_vrp = opt2;
+@@ -922,6 +919,8 @@
+
+ /* -O3 optimizations. */
+ opt3 = (optimize >= 3);
++ flag_strict_aliasing = opt3;
++ flag_strict_overflow = opt3;
+ flag_predictive_commoning = opt3;
+ flag_inline_functions = opt3;
+ flag_unswitch_loops = opt3;
+@@ -1601,6 +1601,17 @@
+ enable_warning_as_error (arg, value, lang_mask);
+ break;
+
++ case OPT_Werror_maybe_reset:
++ {
++ char *ev = getenv ("GCC_NO_WERROR");
++ if ((ev != NULL) && (*ev != '0'))
++ warnings_are_errors = 0;
++ }
++ break;
++
++ case OPT_fhonour_copts:
++ break;
++
+ case OPT_Wlarger_than_:
+ /* This form corresponds to -Wlarger-than-.
+ Kept for backward compatibility.
+--- a/gcc/doc/cppopts.texi
++++ b/gcc/doc/cppopts.texi
+@@ -164,6 +164,11 @@
+ Make all warnings into hard errors. Source code which triggers warnings
+ will be rejected.
+
++ at item -Werror-maybe-reset
++ at opindex Werror-maybe-reset
++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
++variable is set to anything other than 0 or empty.
++
+ @item -Wsystem-headers
+ @opindex Wsystem-headers
+ Issue warnings for code in system headers. These are normally unhelpful
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -234,7 +234,7 @@
+ -Wconversion -Wcoverage-mismatch -Wno-deprecated @gol
+ -Wno-deprecated-declarations -Wdisabled-optimization @gol
+ -Wno-div-by-zero -Wempty-body -Wenum-compare -Wno-endif-labels @gol
+--Werror -Werror=* @gol
++-Werror -Werror=* -Werror-maybe-reset @gol
+ -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
+ -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
+ -Wformat-security -Wformat-y2k @gol
+@@ -4161,6 +4161,22 @@
+ @option{-Wall} and by @option{-pedantic}, which can be disabled with
+ @option{-Wno-pointer-sign}.
+
++ at item -Werror-maybe-reset
++ at opindex Werror-maybe-reset
++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
++variable is set to anything other than 0 or empty.
++
++ at item -fhonour-copts
++ at opindex fhonour-copts
++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
++given at least once, and warn if it is given more than once.
++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
++given exactly once.
++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
++is not given exactly once.
++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
++This flag and environment variable only affect the C language.
++
+ @item -Wstack-protector
+ @opindex Wstack-protector
+ @opindex Wno-stack-protector
+@@ -5699,7 +5715,7 @@
+ second branch or a point immediately following it, depending on whether
+ the condition is known to be true or false.
+
+-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
++Enabled at levels @option{-O3}.
+
+ @item -fsplit-wide-types
+ @opindex fsplit-wide-types
+--- a/gcc/java/jvspec.c
++++ b/gcc/java/jvspec.c
+@@ -670,6 +670,7 @@
+ class name. Append dummy `.c' that can be stripped by set_input so %b
+ is correct. */
+ set_input (concat (main_class_name, "main.c", NULL));
++ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */
+ err = do_spec (jvgenmain_spec);
+ if (err == 0)
+ {
diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
index bf7c7d457..2025746cf 100644
--- a/toolchain/gdb/Makefile
+++ b/toolchain/gdb/Makefile
@@ -4,7 +4,6 @@
include $(TOPDIR)/rules.mk
include ../rules.mk
include Makefile.inc
-
include ${TOPDIR}/mk/buildhlp.mk
ifeq (${ADK_MAKE_PARALLEL},y)
diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile
index 4d39e2b27..d492b9837 100644
--- a/toolchain/glibc/Makefile
+++ b/toolchain/glibc/Makefile
@@ -17,6 +17,7 @@ ifeq ($(ADK_TARGET_NO_FPU),y)
GLIBC_CONFOPTS+= --without-fp
endif
+GLIBC_MAKEOPTS+= cross-compiling=yes
ifeq (${ADK_MAKE_PARALLEL},y)
GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j${ADK_MAKE_JOBS}"
endif
@@ -31,21 +32,19 @@ $(WRKBUILD)/.headers_configure:
(cd $(GLIBC_BUILD_DIR_INITIAL); \
${GLIBC_ENV} \
$(WRKBUILD)/configure \
- --prefix=$(TOOLCHAIN_SYSROOT)/usr \
- --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ --prefix=$(STAGING_TARGET_DIR)/usr \
+ --with-sysroot=$(STAGING_TARGET_DIR) \
${GLIBC_CONFOPTS} \
);
touch $@
$(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
- mkdir -p $(TOOLCHAIN_SYSROOT)/usr/lib
(cd $(GLIBC_BUILD_DIR_INITIAL); \
${GLIBC_ENV} \
$(MAKE) ${GLIBC_MAKEOPTS} \
- cross-compiling=yes \
install-headers \
);
- touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h
+ touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
touch $@
$(WRKBUILD)/.configured:
@@ -67,6 +66,10 @@ $(WRKBUILD)/.compiled:
$(WRKBUILD)/.installed:
${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) \
install_root=$(STAGING_TARGET_DIR) install
+ mkdir -p ${STAGING_TARGET_DIR}/etc
+ ${INSTALL_DATA} ${WRKBUILD}/posix/gai.conf ${STAGING_TARGET_DIR}/etc/
+ ${INSTALL_DATA} ${WRKBUILD}/nscd/nscd.conf ${STAGING_TARGET_DIR}/etc/
+ ${INSTALL_DATA} ${WRKBUILD}/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc/
touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
touch $(WRKBUILD)/.installed
diff --git a/toolchain/glibc/Makefile.inc b/toolchain/glibc/Makefile.inc
index ff4753465..79ba89cc2 100644
--- a/toolchain/glibc/Makefile.inc
+++ b/toolchain/glibc/Makefile.inc
@@ -9,7 +9,7 @@ PKG_SITES:= ${MASTER_SITE_GNU:=glibc/}
GLIBC_PORTS_VERSION:= 2.12
GLIBC_CONFOPTS:= --build=$(GNU_HOST_NAME) \
--host=$(REAL_GNU_TARGET_NAME) \
- --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
+ --with-headers=$(STAGING_TARGET_DIR)/usr/include \
--disable-nls \
--disable-sanity-checks \
--disable-nls \
@@ -32,3 +32,4 @@ GLIBC_ENV:= PATH='${TARGET_PATH}' \
libc_cv_c_cleanup=yes \
libc_cv_gnu99_inline=yes \
libc_cv_sparc64_tls=yes \
+ libc_cv_slibdir="/lib" \
diff --git a/toolchain/glibc/patches/i686_define_bug.patch b/toolchain/glibc/patches/i686_define_bug.patch
new file mode 100644
index 000000000..0414fecc9
--- /dev/null
+++ b/toolchain/glibc/patches/i686_define_bug.patch
@@ -0,0 +1,38 @@
+ Fix for compiling glibc with -march=i686 specified.
+ The patch below found at: http://permalink.gmane.org/gmane.linux.lfs.devel/9758,
+ a nice discussion (with a comment of the glibc maintainer) can be found here:
+ http://old.nabble.com/-RFC-PATCH--glibc-doesn%27t-build-with-%22gcc--march%3Di686%22-td17442608.html
+
+ To me, this simply shows once more how fucked up things can be. E.g. the (related) bug report here:
+ http://bugs.gentoo.org/show_bug.cgi?id=201815. There are lots of duplicates to it, many people are
+ affected, one can find really elaborate reports. And the responsible gentoo developers are too
+ elite to even point to the actual patch fixing the issue.
+diff -Naur glibc-2.11.1-orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c
+--- glibc-2.11.1-orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 20:10:20.000000000 +0000
++++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c 2010-04-17 02:24:02.000000000 +0100
+@@ -45,6 +45,11 @@
+ /* Embed an #include to pull in the alignment and .end directives. */
+ asm ("\n#include \"defs.h\"");
+
++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
++asm ("\n#undef __i686");
++asm ("\n#define __i686 __i686");
++asm ("\n#endif");
++
+ /* The initial common code ends here. */
+ asm ("\n/*@HEADER_ENDS*/");
+
+diff -Naur glibc-2.11.1-orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h
+--- glibc-2.11.1-orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 20:10:20.000000000 +0000
++++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-04-17 02:24:02.000000000 +0100
+@@ -29,6 +29,10 @@
+ #include <dl-sysdep.h>
+ #include <tls.h>
+
++#if defined __i686 && defined __ASSEMBLER__
++#undef __i686
++#define __i686 __i686
++#endif
+
+ /* For Linux we can use the system call table in the header file
+ /usr/include/asm/unistd.h
diff --git a/toolchain/glibc/patches/tz.patch b/toolchain/glibc/patches/tz.patch
new file mode 100644
index 000000000..990458aa4
--- /dev/null
+++ b/toolchain/glibc/patches/tz.patch
@@ -0,0 +1,135 @@
+--- glibc-2.12.1/timezone/Makefile 2010-07-27 13:34:39.000000000 +0200
++++ glibc-2.12.1.orig/timezone/Makefile 2011-01-10 15:20:02.576150764 +0100
+@@ -69,13 +69,10 @@
+ $(addprefix $(inst_zonedir)/, \
+ $(posixrules-file)))
+
+-ifeq ($(cross-compiling),no)
+-# Don't try to install the zoneinfo files since we can't run zic.
+ install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
+ $(zonenames:%=posix/%) \
+ $(zonenames:%=right/%)) \
+ $(installed-localtime-file) $(installed-posixrules-file)
+-endif
+
+ ifeq ($(have-ksh),yes)
+ install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
+@@ -106,18 +103,35 @@
+ echo '$$(addprefix $$(inst_zonedir)/,$$($*-zones)): \' ;\
+ echo '$$(foreach t,$$(tzbases),$$(addprefix $$(inst_zonedir)/,$$($$t-zones)))' ;\
+ fi ;\
+- echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/right/,$$($*-zones)): \' ;\
+- echo '$< $$(objpfx)zic leapseconds yearistype' ;\
+- echo ' $$(tzcompile)' ;\
+- echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/posix/,$$($*-zones)): \' ;\
+- echo '$< $$(objpfx)zic /dev/null yearistype' ;\
+- echo ' $$(tzcompile)' ;\
+- echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/,$$($*-zones)): \' ;\
+- echo '$< $$(objpfx)zic $$(leapseconds) yearistype' ;\
+- echo ' $$(tzcompile)' ;\
++ echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/right/,$$($*-zones)): \' ;) > $@.new
++
++ifeq (no,$(cross-compiling))
++ (echo '$< $$(objpfx)zic leapseconds yearistype' ;) >> $@.new
++else
++ (echo '$< $$(objpfx)cross-zic leapseconds yearistype' ;) >> $@.new
++endif
++
++ (echo ' $$(tzcompile)' ;\
++ echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/posix/,$$($*-zones)): \' ;) >> $@.new
++
++ifeq (no,$(cross-compiling))
++ (echo '$< $$(objpfx)zic /dev/null yearistype' ;) >> $@.new
++else
++ (echo '$< $$(objpfx)cross-zic /dev/null yearistype' ;) >> $@.new
++endif
++
++ (echo ' $$(tzcompile)' ;\
++ echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/,$$($*-zones)): \' ;) >> $@.new
++
++ifeq (no,$(cross-compiling))
++ (echo '$< $$(objpfx)zic $$(leapseconds) yearistype' ;) >> $@.new
++else
++ (echo '$< $$(objpfx)cross-zic $$(leapseconds) yearistype' ;) >> $@.new
++endif
++
++ (echo ' $$(tzcompile)' ;\
+ echo 'endif' ;\
+- echo 'zonenames := $$(zonenames) $$($*-zones)' ;\
+- ) > $@.new
++ echo 'zonenames := $$(zonenames) $$($*-zones)' ;) >> $@.new
+ mv $@.new $@
+
+ .PHONY: echo-zonenames
+@@ -128,7 +142,11 @@
+ # We have to use `-d $(inst_zonedir)' to explictly tell zic where to
+ # place the output files although $(zonedir) is compiled in. But the
+ # user might have set $(install_root) on the command line of `make install'.
++ifeq (no,$(cross-compiling))
+ zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
++else
++zic-cmd = $(objpfx)cross-zic -d $(inst_zonedir)
++endif
+ tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
+ -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
+
+@@ -158,8 +176,17 @@
+ $(zic-cmd) -p $(posixrules)
+ endif
+
++zic-objs = zic.o ialloc.o scheck.o
++
++$(objpfx)zic: $(addprefix $(objpfx), $(zic-objs))
++
++$(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
++ gcc $< -c $(OUTPUT_OPTION) \
++ $(filter-out -DHAVE_GETTEXT,$(CFLAGS-$*.c)) \
++ $(CPPFLAGS-$*) -DCROSS_ZIC $(compile-mkdep-flags)
+
+-$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
++$(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
++ gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@
+
+ tz-cflags = -DTZDIR='"$(zonedir)"' \
+ -DTZDEFAULT='"$(localtime-file)"' \
+@@ -176,10 +203,17 @@
+ # Don't add leapseconds here since test-tz made checks that work only without
+ # leapseconds.
+ testdata = $(objpfx)testdata
++ifeq (no,$(cross-compiling))
+ define build-testdata
+ GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
+ $(built-program-cmd) -d $(testdata) -y ./yearistype $<
+ endef
++else
++define build-testdata
++LANGUAGE=C LC_ALL=C \
++ $(objpfx)cross-zic -d $(testdata) -y ./yearistype $<
++endef
++endif
+
+ $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
+ $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
+@@ -192,7 +226,11 @@
+ tst-timezone-ENV = TZDIR=$(testdata)
+
+ # Note this must come second in the deps list for $(built-program-cmd) to work.
++ifeq (no,$(cross-compiling))
+ zic-deps = $(objpfx)zic $(leapseconds) yearistype
++else
++zic-deps = $(objpfx)cross-zic $(objpfx)zic $(leapseconds) yearistype
++endif
+
+ $(testdata)/America/New_York: northamerica $(zic-deps)
+ $(build-testdata)
+@@ -214,7 +252,9 @@
+
+ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
+ sed -e 's%@KSH@%$(KSH)%g' \
+- -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new
++ -e 's%@TZDIR@%$(zonedir)%g' \
++ -e 's%@PKGVERSION@%$(PKGVERSION)%g' \
++ -e 's%@REPORT_BUGS_TO@%$(REPORT_BUGS_TO)%g' < $< > $@.new
+ chmod 555 $@.new
+ mv -f $@.new $@
+
diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile
index 45160fab1..81c2b6593 100644
--- a/toolchain/kernel-headers/Makefile
+++ b/toolchain/kernel-headers/Makefile
@@ -11,9 +11,6 @@ $(WRKBUILD)/.headers:
INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)/usr \
headers_install
$(MAKE) -C $(WRKBUILD) HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \
- INSTALL_HDR_PATH=$(TOOLCHAIN_SYSROOT)/usr \
- headers_install
- $(MAKE) -C $(WRKBUILD) HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \
INSTALL_HDR_PATH=$(LINUX_HEADER_DIR) \
headers_install
# cryptodev.h from ocf-linux-20080917
@@ -22,10 +19,8 @@ $(WRKBUILD)/.headers:
ifeq ($(ARCH),cris)
ifeq ($(CPU_ARCH),crisv32)
cd $(STAGING_TARGET_DIR)/usr/include && ln -sf arch-v32/arch arch
- cd $(TOOLCHAIN_SYSROOT)/usr/include && ln -sf arch-v32/arch arch
else
cd $(STAGING_TARGET_DIR)/usr/include && ln -sf arch-v10/arch arch
- cd $(TOOLCHAIN_SYSROOT)/usr/include && ln -sf arch-v10/arch arch
endif
endif
touch $@
diff --git a/toolchain/kernel-headers/patches/2.6.36/aufs2.patch b/toolchain/kernel-headers/patches/2.6.36/aufs2.patch
new file mode 100644
index 000000000..eafbe6814
--- /dev/null
+++ b/toolchain/kernel-headers/patches/2.6.36/aufs2.patch
@@ -0,0 +1,240 @@
+diff -Nur linux-2.6.36.orig/include/linux/Kbuild linux-2.6.36/include/linux/Kbuild
+--- linux-2.6.36.orig/include/linux/Kbuild 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/include/linux/Kbuild 2011-01-10 19:52:38.000000000 +0100
+@@ -60,6 +60,7 @@
+ header-y += atmsap.h
+ header-y += atmsvc.h
+ header-y += audit.h
++header-y += aufs_type.h
+ header-y += auto_fs.h
+ header-y += auto_fs4.h
+ header-y += auxvec.h
+diff -Nur linux-2.6.36.orig/include/linux/aufs_type.h linux-2.6.36/include/linux/aufs_type.h
+--- linux-2.6.36.orig/include/linux/aufs_type.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.36/include/linux/aufs_type.h 2011-01-10 19:54:22.000000000 +0100
+@@ -0,0 +1,197 @@
++/*
++ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ *
++ * This program, aufs is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program 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 General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++#ifndef __AUFS_TYPE_H__
++#define __AUFS_TYPE_H__
++
++#include <linux/ioctl.h>
++#include <linux/kernel.h>
++#include <linux/limits.h>
++#include <linux/types.h>
++
++#define AUFS_VERSION "2.1-standalone.tree-36-20110110"
++
++/* todo? move this to linux-2.6.19/include/magic.h */
++#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
++
++/* ---------------------------------------------------------------------- */
++
++#ifdef CONFIG_AUFS_BRANCH_MAX_127
++typedef __s8 aufs_bindex_t;
++#define AUFS_BRANCH_MAX 127
++#else
++typedef __s16 aufs_bindex_t;
++#ifdef CONFIG_AUFS_BRANCH_MAX_511
++#define AUFS_BRANCH_MAX 511
++#elif defined(CONFIG_AUFS_BRANCH_MAX_1023)
++#define AUFS_BRANCH_MAX 1023
++#elif defined(CONFIG_AUFS_BRANCH_MAX_32767)
++#define AUFS_BRANCH_MAX 32767
++#endif
++#endif
++
++#ifdef __KERNEL__
++#ifndef AUFS_BRANCH_MAX
++#error unknown CONFIG_AUFS_BRANCH_MAX value
++#endif
++#endif /* __KERNEL__ */
++
++/* ---------------------------------------------------------------------- */
++
++#define AUFS_NAME "aufs"
++#define AUFS_FSTYPE AUFS_NAME
++
++#define AUFS_ROOT_INO 2
++#define AUFS_FIRST_INO 11
++
++#define AUFS_WH_PFX ".wh."
++#define AUFS_WH_PFX_LEN ((int)sizeof(AUFS_WH_PFX) - 1)
++#define AUFS_WH_TMP_LEN 4
++/* a limit for rmdir/rename a dir */
++#define AUFS_MAX_NAMELEN (NAME_MAX \
++ - AUFS_WH_PFX_LEN * 2 /* doubly whiteouted */\
++ - 1 /* dot */\
++ - AUFS_WH_TMP_LEN) /* hex */
++#define AUFS_XINO_FNAME "." AUFS_NAME ".xino"
++#define AUFS_XINO_DEFPATH "/tmp/" AUFS_XINO_FNAME
++#define AUFS_XINO_TRUNC_INIT 64 /* blocks */
++#define AUFS_XINO_TRUNC_STEP 4 /* blocks */
++#define AUFS_DIRWH_DEF 3
++#define AUFS_RDCACHE_DEF 10 /* seconds */
++#define AUFS_RDCACHE_MAX 3600 /* seconds */
++#define AUFS_RDBLK_DEF 512 /* bytes */
++#define AUFS_RDHASH_DEF 32
++#define AUFS_WKQ_NAME AUFS_NAME "d"
++#define AUFS_WKQ_PRE_NAME AUFS_WKQ_NAME "_pre"
++#define AUFS_MFS_DEF_SEC 30 /* seconds */
++#define AUFS_MFS_MAX_SEC 3600 /* seconds */
++#define AUFS_PLINK_WARN 100 /* number of plinks */
++
++/* pseudo-link maintenace under /proc */
++#define AUFS_PLINK_MAINT_NAME "plink_maint"
++#define AUFS_PLINK_MAINT_DIR "fs/" AUFS_NAME
++#define AUFS_PLINK_MAINT_PATH AUFS_PLINK_MAINT_DIR "/" AUFS_PLINK_MAINT_NAME
++
++#define AUFS_DIROPQ_NAME AUFS_WH_PFX ".opq" /* whiteouted doubly */
++#define AUFS_WH_DIROPQ AUFS_WH_PFX AUFS_DIROPQ_NAME
++
++#define AUFS_BASE_NAME AUFS_WH_PFX AUFS_NAME
++#define AUFS_PLINKDIR_NAME AUFS_WH_PFX "plnk"
++#define AUFS_ORPHDIR_NAME AUFS_WH_PFX "orph"
++
++/* doubly whiteouted */
++#define AUFS_WH_BASE AUFS_WH_PFX AUFS_BASE_NAME
++#define AUFS_WH_PLINKDIR AUFS_WH_PFX AUFS_PLINKDIR_NAME
++#define AUFS_WH_ORPHDIR AUFS_WH_PFX AUFS_ORPHDIR_NAME
++
++/* branch permission */
++#define AUFS_BRPERM_RW "rw"
++#define AUFS_BRPERM_RO "ro"
++#define AUFS_BRPERM_RR "rr"
++#define AUFS_BRPERM_WH "wh"
++#define AUFS_BRPERM_NLWH "nolwh"
++#define AUFS_BRPERM_ROWH AUFS_BRPERM_RO "+" AUFS_BRPERM_WH
++#define AUFS_BRPERM_RRWH AUFS_BRPERM_RR "+" AUFS_BRPERM_WH
++#define AUFS_BRPERM_RWNLWH AUFS_BRPERM_RW "+" AUFS_BRPERM_NLWH
++
++/* ---------------------------------------------------------------------- */
++
++/* ioctl */
++enum {
++ /* readdir in userspace */
++ AuCtl_RDU,
++ AuCtl_RDU_INO,
++
++ /* pathconf wrapper */
++ AuCtl_WBR_FD
++};
++
++/* borrowed from linux/include/linux/kernel.h */
++#ifndef ALIGN
++#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a)-1)
++#define __ALIGN_MASK(x, mask) (((x)+(mask))&~(mask))
++#endif
++
++/* borrowed from linux/include/linux/compiler-gcc3.h */
++#ifndef __aligned
++#define __aligned(x) __attribute__((aligned(x)))
++#define __packed __attribute__((packed))
++#endif
++
++struct au_rdu_cookie {
++ __u64 h_pos;
++ __s16 bindex;
++ __u8 flags;
++ __u8 pad;
++ __u32 generation;
++} __aligned(8);
++
++struct au_rdu_ent {
++ __u64 ino;
++ __s16 bindex;
++ __u8 type;
++ __u8 nlen;
++ __u8 wh;
++ char name[0];
++} __aligned(8);
++
++static inline int au_rdu_len(int nlen)
++{
++ /* include the terminating NULL */
++ return ALIGN(sizeof(struct au_rdu_ent) + nlen + 1,
++ sizeof(__u64));
++}
++
++union au_rdu_ent_ul {
++ struct au_rdu_ent __user *e;
++ __u64 ul;
++};
++
++enum {
++ AufsCtlRduV_SZ,
++ AufsCtlRduV_End
++};
++
++struct aufs_rdu {
++ /* input */
++ union {
++ __u64 sz; /* AuCtl_RDU */
++ __u64 nent; /* AuCtl_RDU_INO */
++ };
++ union au_rdu_ent_ul ent;
++ __u16 verify[AufsCtlRduV_End];
++
++ /* input/output */
++ __u32 blk;
++
++ /* output */
++ union au_rdu_ent_ul tail;
++ /* number of entries which were added in a single call */
++ __u64 rent;
++ __u8 full;
++ __u8 shwh;
++
++ struct au_rdu_cookie cookie;
++} __aligned(8);
++
++#define AuCtlType 'A'
++#define AUFS_CTL_RDU _IOWR(AuCtlType, AuCtl_RDU, struct aufs_rdu)
++#define AUFS_CTL_RDU_INO _IOWR(AuCtlType, AuCtl_RDU_INO, struct aufs_rdu)
++#define AUFS_CTL_WBR_FD _IO(AuCtlType, AuCtl_WBR_FD)
++
++#endif /* __AUFS_TYPE_H__ */
+diff -Nur linux-2.6.36.orig/include/linux/namei.h linux-2.6.36/include/linux/namei.h
+--- linux-2.6.36.orig/include/linux/namei.h 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/include/linux/namei.h 2011-01-10 19:52:38.000000000 +0100
+@@ -73,6 +73,9 @@
+ extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
+ int (*open)(struct inode *, struct file *));
+
++extern struct dentry *lookup_hash(struct nameidata *nd);
++extern int __lookup_one_len(const char *name, struct qstr *this,
++ struct dentry *base, int len);
+ extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
+
+ extern int follow_down(struct path *);
+diff -Nur linux-2.6.36.orig/include/linux/splice.h linux-2.6.36/include/linux/splice.h
+--- linux-2.6.36.orig/include/linux/splice.h 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/include/linux/splice.h 2011-01-10 19:52:38.000000000 +0100
+@@ -89,4 +89,10 @@
+ extern void splice_shrink_spd(struct pipe_inode_info *,
+ struct splice_pipe_desc *);
+
++extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
++ loff_t *ppos, size_t len, unsigned int flags);
++extern long do_splice_to(struct file *in, loff_t *ppos,
++ struct pipe_inode_info *pipe, size_t len,
++ unsigned int flags);
++
+ #endif
+
diff --git a/toolchain/kernel-headers/patches/2.6.37/aufs2.patch b/toolchain/kernel-headers/patches/2.6.37/aufs2.patch
new file mode 100644
index 000000000..eafbe6814
--- /dev/null
+++ b/toolchain/kernel-headers/patches/2.6.37/aufs2.patch
@@ -0,0 +1,240 @@
+diff -Nur linux-2.6.36.orig/include/linux/Kbuild linux-2.6.36/include/linux/Kbuild
+--- linux-2.6.36.orig/include/linux/Kbuild 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/include/linux/Kbuild 2011-01-10 19:52:38.000000000 +0100
+@@ -60,6 +60,7 @@
+ header-y += atmsap.h
+ header-y += atmsvc.h
+ header-y += audit.h
++header-y += aufs_type.h
+ header-y += auto_fs.h
+ header-y += auto_fs4.h
+ header-y += auxvec.h
+diff -Nur linux-2.6.36.orig/include/linux/aufs_type.h linux-2.6.36/include/linux/aufs_type.h
+--- linux-2.6.36.orig/include/linux/aufs_type.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.36/include/linux/aufs_type.h 2011-01-10 19:54:22.000000000 +0100
+@@ -0,0 +1,197 @@
++/*
++ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ *
++ * This program, aufs is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program 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 General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++#ifndef __AUFS_TYPE_H__
++#define __AUFS_TYPE_H__
++
++#include <linux/ioctl.h>
++#include <linux/kernel.h>
++#include <linux/limits.h>
++#include <linux/types.h>
++
++#define AUFS_VERSION "2.1-standalone.tree-36-20110110"
++
++/* todo? move this to linux-2.6.19/include/magic.h */
++#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
++
++/* ---------------------------------------------------------------------- */
++
++#ifdef CONFIG_AUFS_BRANCH_MAX_127
++typedef __s8 aufs_bindex_t;
++#define AUFS_BRANCH_MAX 127
++#else
++typedef __s16 aufs_bindex_t;
++#ifdef CONFIG_AUFS_BRANCH_MAX_511
++#define AUFS_BRANCH_MAX 511
++#elif defined(CONFIG_AUFS_BRANCH_MAX_1023)
++#define AUFS_BRANCH_MAX 1023
++#elif defined(CONFIG_AUFS_BRANCH_MAX_32767)
++#define AUFS_BRANCH_MAX 32767
++#endif
++#endif
++
++#ifdef __KERNEL__
++#ifndef AUFS_BRANCH_MAX
++#error unknown CONFIG_AUFS_BRANCH_MAX value
++#endif
++#endif /* __KERNEL__ */
++
++/* ---------------------------------------------------------------------- */
++
++#define AUFS_NAME "aufs"
++#define AUFS_FSTYPE AUFS_NAME
++
++#define AUFS_ROOT_INO 2
++#define AUFS_FIRST_INO 11
++
++#define AUFS_WH_PFX ".wh."
++#define AUFS_WH_PFX_LEN ((int)sizeof(AUFS_WH_PFX) - 1)
++#define AUFS_WH_TMP_LEN 4
++/* a limit for rmdir/rename a dir */
++#define AUFS_MAX_NAMELEN (NAME_MAX \
++ - AUFS_WH_PFX_LEN * 2 /* doubly whiteouted */\
++ - 1 /* dot */\
++ - AUFS_WH_TMP_LEN) /* hex */
++#define AUFS_XINO_FNAME "." AUFS_NAME ".xino"
++#define AUFS_XINO_DEFPATH "/tmp/" AUFS_XINO_FNAME
++#define AUFS_XINO_TRUNC_INIT 64 /* blocks */
++#define AUFS_XINO_TRUNC_STEP 4 /* blocks */
++#define AUFS_DIRWH_DEF 3
++#define AUFS_RDCACHE_DEF 10 /* seconds */
++#define AUFS_RDCACHE_MAX 3600 /* seconds */
++#define AUFS_RDBLK_DEF 512 /* bytes */
++#define AUFS_RDHASH_DEF 32
++#define AUFS_WKQ_NAME AUFS_NAME "d"
++#define AUFS_WKQ_PRE_NAME AUFS_WKQ_NAME "_pre"
++#define AUFS_MFS_DEF_SEC 30 /* seconds */
++#define AUFS_MFS_MAX_SEC 3600 /* seconds */
++#define AUFS_PLINK_WARN 100 /* number of plinks */
++
++/* pseudo-link maintenace under /proc */
++#define AUFS_PLINK_MAINT_NAME "plink_maint"
++#define AUFS_PLINK_MAINT_DIR "fs/" AUFS_NAME
++#define AUFS_PLINK_MAINT_PATH AUFS_PLINK_MAINT_DIR "/" AUFS_PLINK_MAINT_NAME
++
++#define AUFS_DIROPQ_NAME AUFS_WH_PFX ".opq" /* whiteouted doubly */
++#define AUFS_WH_DIROPQ AUFS_WH_PFX AUFS_DIROPQ_NAME
++
++#define AUFS_BASE_NAME AUFS_WH_PFX AUFS_NAME
++#define AUFS_PLINKDIR_NAME AUFS_WH_PFX "plnk"
++#define AUFS_ORPHDIR_NAME AUFS_WH_PFX "orph"
++
++/* doubly whiteouted */
++#define AUFS_WH_BASE AUFS_WH_PFX AUFS_BASE_NAME
++#define AUFS_WH_PLINKDIR AUFS_WH_PFX AUFS_PLINKDIR_NAME
++#define AUFS_WH_ORPHDIR AUFS_WH_PFX AUFS_ORPHDIR_NAME
++
++/* branch permission */
++#define AUFS_BRPERM_RW "rw"
++#define AUFS_BRPERM_RO "ro"
++#define AUFS_BRPERM_RR "rr"
++#define AUFS_BRPERM_WH "wh"
++#define AUFS_BRPERM_NLWH "nolwh"
++#define AUFS_BRPERM_ROWH AUFS_BRPERM_RO "+" AUFS_BRPERM_WH
++#define AUFS_BRPERM_RRWH AUFS_BRPERM_RR "+" AUFS_BRPERM_WH
++#define AUFS_BRPERM_RWNLWH AUFS_BRPERM_RW "+" AUFS_BRPERM_NLWH
++
++/* ---------------------------------------------------------------------- */
++
++/* ioctl */
++enum {
++ /* readdir in userspace */
++ AuCtl_RDU,
++ AuCtl_RDU_INO,
++
++ /* pathconf wrapper */
++ AuCtl_WBR_FD
++};
++
++/* borrowed from linux/include/linux/kernel.h */
++#ifndef ALIGN
++#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a)-1)
++#define __ALIGN_MASK(x, mask) (((x)+(mask))&~(mask))
++#endif
++
++/* borrowed from linux/include/linux/compiler-gcc3.h */
++#ifndef __aligned
++#define __aligned(x) __attribute__((aligned(x)))
++#define __packed __attribute__((packed))
++#endif
++
++struct au_rdu_cookie {
++ __u64 h_pos;
++ __s16 bindex;
++ __u8 flags;
++ __u8 pad;
++ __u32 generation;
++} __aligned(8);
++
++struct au_rdu_ent {
++ __u64 ino;
++ __s16 bindex;
++ __u8 type;
++ __u8 nlen;
++ __u8 wh;
++ char name[0];
++} __aligned(8);
++
++static inline int au_rdu_len(int nlen)
++{
++ /* include the terminating NULL */
++ return ALIGN(sizeof(struct au_rdu_ent) + nlen + 1,
++ sizeof(__u64));
++}
++
++union au_rdu_ent_ul {
++ struct au_rdu_ent __user *e;
++ __u64 ul;
++};
++
++enum {
++ AufsCtlRduV_SZ,
++ AufsCtlRduV_End
++};
++
++struct aufs_rdu {
++ /* input */
++ union {
++ __u64 sz; /* AuCtl_RDU */
++ __u64 nent; /* AuCtl_RDU_INO */
++ };
++ union au_rdu_ent_ul ent;
++ __u16 verify[AufsCtlRduV_End];
++
++ /* input/output */
++ __u32 blk;
++
++ /* output */
++ union au_rdu_ent_ul tail;
++ /* number of entries which were added in a single call */
++ __u64 rent;
++ __u8 full;
++ __u8 shwh;
++
++ struct au_rdu_cookie cookie;
++} __aligned(8);
++
++#define AuCtlType 'A'
++#define AUFS_CTL_RDU _IOWR(AuCtlType, AuCtl_RDU, struct aufs_rdu)
++#define AUFS_CTL_RDU_INO _IOWR(AuCtlType, AuCtl_RDU_INO, struct aufs_rdu)
++#define AUFS_CTL_WBR_FD _IO(AuCtlType, AuCtl_WBR_FD)
++
++#endif /* __AUFS_TYPE_H__ */
+diff -Nur linux-2.6.36.orig/include/linux/namei.h linux-2.6.36/include/linux/namei.h
+--- linux-2.6.36.orig/include/linux/namei.h 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/include/linux/namei.h 2011-01-10 19:52:38.000000000 +0100
+@@ -73,6 +73,9 @@
+ extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
+ int (*open)(struct inode *, struct file *));
+
++extern struct dentry *lookup_hash(struct nameidata *nd);
++extern int __lookup_one_len(const char *name, struct qstr *this,
++ struct dentry *base, int len);
+ extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
+
+ extern int follow_down(struct path *);
+diff -Nur linux-2.6.36.orig/include/linux/splice.h linux-2.6.36/include/linux/splice.h
+--- linux-2.6.36.orig/include/linux/splice.h 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/include/linux/splice.h 2011-01-10 19:52:38.000000000 +0100
+@@ -89,4 +89,10 @@
+ extern void splice_shrink_spd(struct pipe_inode_info *,
+ struct splice_pipe_desc *);
+
++extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
++ loff_t *ppos, size_t len, unsigned int flags);
++extern long do_splice_to(struct file *in, loff_t *ppos,
++ struct pipe_inode_info *pipe, size_t len,
++ unsigned int flags);
++
+ #endif
+
diff --git a/toolchain/kernel-headers/patches/2.6.37/cleankernel.patch b/toolchain/kernel-headers/patches/2.6.37/cleankernel.patch
new file mode 100644
index 000000000..f8d5448ee
--- /dev/null
+++ b/toolchain/kernel-headers/patches/2.6.37/cleankernel.patch
@@ -0,0 +1,11 @@
+diff -Nur linux-2.6.29.1.orig/scripts/Makefile.headersinst linux-2.6.29.1/scripts/Makefile.headersinst
+--- linux-2.6.29.1.orig/scripts/Makefile.headersinst 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/scripts/Makefile.headersinst 2009-04-17 20:56:09.143476927 +0200
+@@ -65,7 +65,6 @@
+
+ targets += $(install-file)
+ $(install-file): scripts/headers_install.pl $(input-files) FORCE
+- $(if $(unwanted),$(call cmd,remove),)
+ $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
+ $(call if_changed,install)
+
diff --git a/toolchain/kernel-headers/patches/2.6.37/etrax-header.patch b/toolchain/kernel-headers/patches/2.6.37/etrax-header.patch
new file mode 100644
index 000000000..0c644ce25
--- /dev/null
+++ b/toolchain/kernel-headers/patches/2.6.37/etrax-header.patch
@@ -0,0 +1,75 @@
+diff -Nur linux-2.6.36.orig/arch/cris/include/arch-v10/arch/Kbuild linux-2.6.36/arch/cris/include/arch-v10/arch/Kbuild
+--- linux-2.6.36.orig/arch/cris/include/arch-v10/arch/Kbuild 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/arch/cris/include/arch-v10/arch/Kbuild 2010-11-15 17:35:24.000000000 +0100
+@@ -1,4 +1,9 @@
++header-y += dma.h
++header-y += io_interface_mux.h
+ header-y += user.h
+ header-y += svinto.h
+ header-y += sv_addr_ag.h
+ header-y += sv_addr.agh
++header-y += elf.h
++header-y += page.h
++header-y += ptrace.h
+diff -Nur linux-2.6.36.orig/arch/cris/include/arch-v32/arch/Kbuild linux-2.6.36/arch/cris/include/arch-v32/arch/Kbuild
+--- linux-2.6.36.orig/arch/cris/include/arch-v32/arch/Kbuild 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/arch/cris/include/arch-v32/arch/Kbuild 2010-11-15 17:35:24.000000000 +0100
+@@ -1,2 +1,6 @@
+ header-y += user.h
+ header-y += cryptocop.h
++header-y += elf.h
++header-y += page.h
++header-y += ptrace.h
++
+diff -Nur linux-2.6.36.orig/arch/cris/include/asm/Kbuild linux-2.6.36/arch/cris/include/asm/Kbuild
+--- linux-2.6.36.orig/arch/cris/include/asm/Kbuild 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/arch/cris/include/asm/Kbuild 2010-11-15 17:37:57.000000000 +0100
+@@ -1,10 +1,13 @@
+ include include/asm-generic/Kbuild.asm
+
+-header-y += arch-v10/
+-header-y += arch-v32/
+-
++header-y += ../arch-v10/arch/
++header-y += ../arch-v32/arch/
++
++header-y += elf.h
+ header-y += ethernet.h
+ header-y += etraxgpio.h
+ header-y += rs485.h
+ header-y += rtc.h
+ header-y += sync_serial.h
++header-y += page.h
++header-y += user.h
+diff -Nur linux-2.6.36.orig/include/asm-generic/Kbuild linux-2.6.36/include/asm-generic/Kbuild
+--- linux-2.6.36.orig/include/asm-generic/Kbuild 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/include/asm-generic/Kbuild 2010-11-15 17:37:02.000000000 +0100
+@@ -3,14 +3,17 @@
+ header-y += errno-base.h
+ header-y += errno.h
+ header-y += fcntl.h
++header-y += getorder.h
+ header-y += int-l64.h
+ header-y += int-ll64.h
+ header-y += ioctl.h
+ header-y += ioctls.h
+ header-y += ipcbuf.h
++header-y += memory_model.h
+ header-y += mman-common.h
+ header-y += mman.h
+ header-y += msgbuf.h
++header-y += page.h
+ header-y += param.h
+ header-y += poll.h
+ header-y += posix_types.h
+diff -Nur linux-2.6.36.orig/include/linux/Kbuild linux-2.6.36/include/linux/Kbuild
+--- linux-2.6.36.orig/include/linux/Kbuild 2010-10-20 22:30:22.000000000 +0200
++++ linux-2.6.36/include/linux/Kbuild 2010-11-15 17:36:11.000000000 +0100
+@@ -365,6 +365,7 @@
+ header-y += un.h
+ header-y += unistd.h
+ header-y += usbdevice_fs.h
++header-y += user.h
+ header-y += utime.h
+ header-y += utsname.h
+ header-y += veth.h
diff --git a/toolchain/kernel-headers/patches/2.6.37/linux-gcc-check.patch b/toolchain/kernel-headers/patches/2.6.37/linux-gcc-check.patch
new file mode 100644
index 000000000..7cc381845
--- /dev/null
+++ b/toolchain/kernel-headers/patches/2.6.37/linux-gcc-check.patch
@@ -0,0 +1,18 @@
+diff -Nur linux-2.6.32.orig/arch/mips/include/asm/sgidefs.h linux-2.6.32/arch/mips/include/asm/sgidefs.h
+--- linux-2.6.32.orig/arch/mips/include/asm/sgidefs.h 2009-12-03 04:51:21.000000000 +0100
++++ linux-2.6.32/arch/mips/include/asm/sgidefs.h 2010-02-14 11:49:21.000000000 +0100
+@@ -11,14 +11,6 @@
+ #define __ASM_SGIDEFS_H
+
+ /*
+- * Using a Linux compiler for building Linux seems logic but not to
+- * everybody.
+- */
+-#ifndef __linux__
+-#error Use a Linux compiler or give up.
+-#endif
+-
+-/*
+ * Definitions for the ISA levels
+ *
+ * With the introduction of MIPS32 / MIPS64 instruction sets definitions
diff --git a/toolchain/kernel-headers/patches/2.6.37/microperl.patch b/toolchain/kernel-headers/patches/2.6.37/microperl.patch
new file mode 100644
index 000000000..2955b7421
--- /dev/null
+++ b/toolchain/kernel-headers/patches/2.6.37/microperl.patch
@@ -0,0 +1,24 @@
+diff -Nur linux-2.6.30.5.orig/scripts/headers_check.pl linux-2.6.30.5/scripts/headers_check.pl
+--- linux-2.6.30.5.orig/scripts/headers_check.pl 2009-08-16 23:19:38.000000000 +0200
++++ linux-2.6.30.5/scripts/headers_check.pl 2009-09-14 21:16:21.000000000 +0200
+@@ -18,7 +18,7 @@
+ #
+ # 3) Check for leaked CONFIG_ symbols
+
+-use strict;
++#use strict;
+
+ my ($dir, $arch, @files) = @ARGV;
+
+diff -Nur linux-2.6.30.5.orig/scripts/headers_install.pl linux-2.6.30.5/scripts/headers_install.pl
+--- linux-2.6.30.5.orig/scripts/headers_install.pl 2009-08-16 23:19:38.000000000 +0200
++++ linux-2.6.30.5/scripts/headers_install.pl 2009-09-14 21:16:11.000000000 +0200
+@@ -16,7 +16,7 @@
+ # 2) Drop include of compiler.h
+ # 3) Drop all sections defined out by __KERNEL__ (using unifdef)
+
+-use strict;
++#use strict;
+
+ my ($readdir, $installdir, $arch, @files) = @ARGV;
+
diff --git a/toolchain/libelf/Makefile b/toolchain/libelf/Makefile
new file mode 100644
index 000000000..485978cf0
--- /dev/null
+++ b/toolchain/libelf/Makefile
@@ -0,0 +1,31 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include Makefile.inc
+include ../rules.mk
+include ${TOPDIR}/mk/buildhlp.mk
+
+ifeq (${ADK_MAKE_PARALLEL},y)
+LIBELF_MAKEOPTS+= -j${ADK_MAKE_JOBS}
+endif
+
+$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configured:
+ (cd $(WRKBUILD); \
+ $(WRKBUILD)/configure \
+ --prefix=$(STAGING_HOST_DIR) \
+ --disable-shared \
+ --enable-static \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
+ $(MAKE) ${LIBELF_MAKEOPTS} -C $(WRKBUILD) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) install
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/libelf/Makefile.inc b/toolchain/libelf/Makefile.inc
new file mode 100644
index 000000000..66ca9fd2c
--- /dev/null
+++ b/toolchain/libelf/Makefile.inc
@@ -0,0 +1,8 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= libelf
+PKG_VERSION:= 0.8.13
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 4136d7b4c04df68b686570afa26988ac
+PKG_SITES:= http://www.mr511.de/software/
diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile
index 194bce39a..6dd77146f 100644
--- a/toolchain/uClibc/Makefile
+++ b/toolchain/uClibc/Makefile
@@ -14,15 +14,28 @@ endif
$(WRKBUILD)/.headers:
$(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(WRKBUILD)/Rules.mak
- sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${TOOLCHAIN_SYSROOT}/usr/include\"' \
+ sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${STAGING_TARGET_DIR}/usr/include\"' \
$(TOPDIR)/target/$(ADK_TARGET_ARCH)/uclibc.config >${WRKBUILD}/.config
ifneq ($(ADK_DEBUG),)
$(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config
endif
+ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
+ $(SED) 's,.*UCLIBC_HAS_SSP,UCLIBC_HAS_SSP=y,' ${WRKBUILD}/.config
+ echo "UCLIBC_HAS_SSP_COMPAT=n" >> ${WRKBUILD}/.config
+ echo "SSP_QUICK_CANARY=n" >> ${WRKBUILD}/.config
+ echo "UCLIBC_BUILD_SSP=y" >> ${WRKBUILD}/.config
+endif
+ echo N|$(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
+ PREFIX=$(STAGING_TARGET_DIR) \
+ DEVEL_PREFIX=/usr/ \
+ RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
+ HOSTCC="$(HOSTCC)" \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ oldconfig
$(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
- PREFIX=$(TOOLCHAIN_SYSROOT) \
+ PREFIX=$(STAGING_TARGET_DIR) \
DEVEL_PREFIX=/usr/ \
- RUNTIME_PREFIX=$(TOOLCHAIN_SYSROOT) \
+ RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
HOSTCC="$(HOSTCC)" \
CPU_CFLAGS="$(TARGET_CFLAGS)" \
install_headers