summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/libc/newlib.in20
-rw-r--r--config/libc/newlib.in.221
-rw-r--r--patches/gcc/4.8.5/130-pr43538.patch25
-rw-r--r--patches/gcc/4.8.5/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch28
-rw-r--r--patches/gcc/4.9.3/130-pr43538.patch25
-rw-r--r--patches/gcc/4.9.3/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch28
-rw-r--r--scripts/build/cc/100-gcc.sh3
-rw-r--r--scripts/build/libc/newlib.sh11
8 files changed, 158 insertions, 3 deletions
diff --git a/config/libc/newlib.in b/config/libc/newlib.in
index 40203f7..a201551 100644
--- a/config/libc/newlib.in
+++ b/config/libc/newlib.in
@@ -17,7 +17,7 @@ config LIBC_NEWLIB_CUSTOM
bool
prompt "Custom newlib"
depends on EXPERIMENTAL
- select LIBC_NEWLIB_2_2_or_later
+ select LIBC_NEWLIB_2_3_or_later
help
The choosen newlib version shall be not downloaded. Instead use
a custom location to get the source.
@@ -71,6 +71,11 @@ choice
# Don't remove next line
# CT_INSERT_VERSION_BELOW
+config LIBC_NEWLIB_V_2_3_0
+ bool
+ prompt "2.3.0.20160226"
+ select LIBC_NEWLIB_2_3
+
config LIBC_NEWLIB_LINARO_V_2_2_0
bool
prompt "Linaro 2.2.0-2015.01"
@@ -79,7 +84,7 @@ config LIBC_NEWLIB_LINARO_V_2_2_0
config LIBC_NEWLIB_V_2_2_0
bool
- prompt "2.2.0"
+ prompt "2.2.0.20151023"
select LIBC_NEWLIB_2_2
config LIBC_NEWLIB_LINARO_V_2_1_0
@@ -118,6 +123,10 @@ endchoice
endif # ! LIBC_NEWLIB_CUSTOM
+config LIBC_NEWLIB_2_3
+ bool
+ select LIBC_NEWLIB_2_3_or_later
+
config LIBC_NEWLIB_2_2
bool
select LIBC_NEWLIB_2_2_or_later
@@ -130,6 +139,10 @@ config LIBC_NEWLIB_2_0
bool
select LIBC_NEWLIB_2_0_or_later
+config LIBC_NEWLIB_2_3_or_later
+ bool
+ select LIBC_NEWLIB_2_2_or_later
+
config LIBC_NEWLIB_2_2_or_later
bool
select LIBC_NEWLIB_2_1_or_later
@@ -149,8 +162,9 @@ config LIBC_VERSION
string
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
+ default "2.3.0.20160226" if LIBC_NEWLIB_V_2_3_0
default "linaro-2.2.0-2015.01" if LIBC_NEWLIB_LINARO_V_2_2_0
- default "2.2.0" if LIBC_NEWLIB_V_2_2_0
+ default "2.2.0.20151023" if LIBC_NEWLIB_V_2_2_0
default "linaro-2.1.0-2014.09" if LIBC_NEWLIB_LINARO_V_2_1_0
default "2.1.0" if LIBC_NEWLIB_V_2_1_0
default "2.0.0" if LIBC_NEWLIB_V_2_0_0
diff --git a/config/libc/newlib.in.2 b/config/libc/newlib.in.2
index b16b23a..48e5503 100644
--- a/config/libc/newlib.in.2
+++ b/config/libc/newlib.in.2
@@ -44,6 +44,27 @@ config LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE
This will compile newlib with -Os.
+config LIBC_NEWLIB_NANO_MALLOC
+ bool
+ prompt "Enable Nano Malloc"
+ depends on LIBC_NEWLIB_2_1_or_later
+ help
+ NEWLIB has two implementations of malloc family's functions, one in
+ `mallocr.c' and the other one in `nano-mallocr.c'. This options
+ enables the nano-malloc implementation, which is for small systems
+ with very limited memory. Note that this implementation does not
+ support `--enable-malloc-debugging' any more.
+
+config LIBC_NEWLIB_NANO_FORMATTED_IO
+ bool
+ prompt "Enable Nano Formatted I/O"
+ depends on LIBC_NEWLIB_2_2_or_later
+ help
+ This builds NEWLIB with a special implementation of formatted I/O
+ functions, designed to lower the size of application on small systems
+ with size constraint issues. This option does not affect wide-char
+ formatted I/O functions.
+
config LIBC_NEWLIB_EXTRA_CONFIG_ARRAY
string
prompt "Extra config for newlib"
diff --git a/patches/gcc/4.8.5/130-pr43538.patch b/patches/gcc/4.8.5/130-pr43538.patch
new file mode 100644
index 0000000..19e57bb
--- /dev/null
+++ b/patches/gcc/4.8.5/130-pr43538.patch
@@ -0,0 +1,25 @@
+From c037df1be41f8daf4d581d7ffa4ec8cfa640bccf Mon Sep 17 00:00:00 2001
+From: glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 25 Apr 2014 08:03:08 +0000
+Subject: [PATCH] 2014-04-25 Marc Glisse <marc.glisse@inria.fr>
+
+ PR target/43538
+ * mt-gnu: Don't reset CXXFLAGS_FOR_TARGET.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209784 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ config/mt-gnu | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/mt-gnu b/config/mt-gnu
+index 15bf417..5c696f5 100644
+--- a/config/mt-gnu
++++ b/config/mt-gnu
+@@ -1 +1 @@
+-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
++CXXFLAGS_FOR_TARGET += -D_GNU_SOURCE
+--
+2.1.4
+
diff --git a/patches/gcc/4.8.5/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch b/patches/gcc/4.8.5/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000..1c49fb0
--- /dev/null
+++ b/patches/gcc/4.8.5/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch
@@ -0,0 +1,28 @@
+From 9bcf38cd9f382486b3823eb923b50e2e9a89cef7 Mon Sep 17 00:00:00 2001
+From: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 18 Nov 2014 22:12:52 +0000
+Subject: [PATCH] 2014-11-17 Bob Dunlop <bob.dunlop@xyzzy.org.uk>
+
+ * mt-ospace (CFLAGS_FOR_TARGET): Append -g -Os rather than
+ overwriting.
+ (CXXFLAGS_FOR_TARGET): Similarly.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217739 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ config/mt-ospace | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/config/mt-ospace b/config/mt-ospace
+index 7f09104..ce29ff4 100644
+--- a/config/mt-ospace
++++ b/config/mt-ospace
+@@ -1,3 +1,3 @@
+ # Build libraries optimizing for space, not speed.
+- CFLAGS_FOR_TARGET = -g -Os
+- CXXFLAGS_FOR_TARGET = -g -Os
++ CFLAGS_FOR_TARGET += -g -Os
++ CXXFLAGS_FOR_TARGET += -g -Os
+--
+2.1.4
+
diff --git a/patches/gcc/4.9.3/130-pr43538.patch b/patches/gcc/4.9.3/130-pr43538.patch
new file mode 100644
index 0000000..19e57bb
--- /dev/null
+++ b/patches/gcc/4.9.3/130-pr43538.patch
@@ -0,0 +1,25 @@
+From c037df1be41f8daf4d581d7ffa4ec8cfa640bccf Mon Sep 17 00:00:00 2001
+From: glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 25 Apr 2014 08:03:08 +0000
+Subject: [PATCH] 2014-04-25 Marc Glisse <marc.glisse@inria.fr>
+
+ PR target/43538
+ * mt-gnu: Don't reset CXXFLAGS_FOR_TARGET.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209784 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ config/mt-gnu | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/mt-gnu b/config/mt-gnu
+index 15bf417..5c696f5 100644
+--- a/config/mt-gnu
++++ b/config/mt-gnu
+@@ -1 +1 @@
+-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
++CXXFLAGS_FOR_TARGET += -D_GNU_SOURCE
+--
+2.1.4
+
diff --git a/patches/gcc/4.9.3/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch b/patches/gcc/4.9.3/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000..1c49fb0
--- /dev/null
+++ b/patches/gcc/4.9.3/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch
@@ -0,0 +1,28 @@
+From 9bcf38cd9f382486b3823eb923b50e2e9a89cef7 Mon Sep 17 00:00:00 2001
+From: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 18 Nov 2014 22:12:52 +0000
+Subject: [PATCH] 2014-11-17 Bob Dunlop <bob.dunlop@xyzzy.org.uk>
+
+ * mt-ospace (CFLAGS_FOR_TARGET): Append -g -Os rather than
+ overwriting.
+ (CXXFLAGS_FOR_TARGET): Similarly.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217739 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ config/mt-ospace | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/config/mt-ospace b/config/mt-ospace
+index 7f09104..ce29ff4 100644
+--- a/config/mt-ospace
++++ b/config/mt-ospace
+@@ -1,3 +1,3 @@
+ # Build libraries optimizing for space, not speed.
+- CFLAGS_FOR_TARGET = -g -Os
+- CXXFLAGS_FOR_TARGET = -g -Os
++ CFLAGS_FOR_TARGET += -g -Os
++ CXXFLAGS_FOR_TARGET += -g -Os
+--
+2.1.4
+
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index 427058c..7085a90 100644
--- a/scripts/build/cc/100-gcc.sh
+++ b/scripts/build/cc/100-gcc.sh
@@ -423,6 +423,9 @@ do_gcc_core_backend() {
CFLAGS="${cflags}" \
CXXFLAGS="${cflags}" \
LDFLAGS="${core_LDFLAGS[*]}" \
+ CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
+ CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
+ LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \
"${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${host} \
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index ba52268..e70b669 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -65,6 +65,11 @@ do_libc() {
CT_DoLog EXTRA "Configuring C library"
+ # Multilib is the default, so if it is not enabled, disable it.
+ if [ "${CT_MULTILIB}" != "y" ]; then
+ extra_config+=("--disable-multilib")
+ fi
+
if [ "${CT_LIBC_NEWLIB_IO_C99FMT}" = "y" ]; then
newlib_opts+=( "--enable-newlib-io-c99-formats" )
else
@@ -91,6 +96,12 @@ do_libc() {
else
newlib_opts+=( "--enable-newlib-supplied-syscalls" )
fi
+ if [ "${CT_LIBC_NEWLIB_NANO_MALLOC}" = "y" ]; then
+ newlib_opts+=( "--enable-newlib-nano-malloc" )
+ fi
+ if [ "${CT_LIBC_NEWLIB_NANO_FORMATTED_IO}" = "y" ]; then
+ newlib_opts+=( "--enable-newlib-nano-formatted-io" )
+ fi
[ "${CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE}" = "y" ] && newlib_opts+=("--enable-target-optspace")