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/Makefile44
-rw-r--r--toolchain/gcc/patches/cflags.patch253
-rw-r--r--toolchain/gdb/Makefile1
-rw-r--r--toolchain/glibc/Makefile8
-rw-r--r--toolchain/glibc/Makefile.inc2
-rw-r--r--toolchain/kernel-headers/Makefile5
-rw-r--r--toolchain/libelf/Makefile31
-rw-r--r--toolchain/libelf/Makefile.inc8
-rw-r--r--toolchain/uClibc/Makefile19
15 files changed, 419 insertions, 45 deletions
diff --git a/toolchain/Config.in b/toolchain/Config.in
new file mode 100644
index 000000000..06f0c468a
--- /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 n
+
+config ADK_TOOLCHAIN_GCC_CXX
+ prompt "Enable building of G++ (C++ language support in GCC)"
+ boolean
+ default n
+
+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..afb945000 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,7 @@ 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; \
+ (cd $(GCC_BUILD_DIR_MINIMAL); \
PATH='$(TARGET_PATH)' \
$(WRKBUILD)/configure \
${GCC_CONFOPTS} \
@@ -85,12 +108,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 +117,7 @@ $(GCC_BUILD_DIR_INITIAL)/.configured:
--disable-shared \
--disable-threads \
--with-newlib \
- --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ --with-sysroot=$(STAGING_TARGET_DIR) \
);
touch $@
@@ -115,12 +134,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 +152,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 9480500d5..cfa3690e8 100644
--- a/toolchain/glibc/Makefile
+++ b/toolchain/glibc/Makefile
@@ -31,21 +31,21 @@ $(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
+ mkdir -p $(STAGING_TARGET_DIR)/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:
diff --git a/toolchain/glibc/Makefile.inc b/toolchain/glibc/Makefile.inc
index ff4753465..d7bcecb13 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 \
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/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..cc63b9e5f 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
+ifneq ($(ADK_TOOLCHAIN_GCC_USE_SSP),)
+ $(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