summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2010-04-07 07:18:20 (GMT)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2010-04-07 07:18:20 (GMT)
commit24e4d092a5976ab5f4797967f66ea3940f474872 (patch)
tree3a43dd2d0e85202c6bf4445cf7316eb453fef6cf
parent55ba3f63787bfac8e81a7651490bd99654bcb5d5 (diff)
Add basic support for the Blackfin architecture
For uClibc, the name of the Blackfin architecture is 'bfin'. Actually, the naming of the architecture is quite messy: for toolchain tuples and uClibc, it's bfin, but for the kernel, it's blackfin. We've arbitraly choosen to name it "blackfin" in Crosstool-NG. Add Blackfin-related uClibc patch to fix a build failure related to fork() being used in unistd/daemon.c. Yann E. MORIN: Apply the patch to the kernel/linux build script to use 'linux' in the noMMU tuples. See: http://sourceware.org/ml/crossgcc/2010-04/msg00010.html
-rw-r--r--config/arch/blackfin.in12
-rw-r--r--patches/uClibc/0.9.30.2/290-blackfin-nommu-fork-stub.patch32
-rw-r--r--scripts/build/arch/blackfin.sh14
-rw-r--r--scripts/build/kernel/linux.sh7
-rw-r--r--scripts/build/libc/uClibc.sh11
5 files changed, 70 insertions, 6 deletions
diff --git a/config/arch/blackfin.in b/config/arch/blackfin.in
new file mode 100644
index 0000000..f4515e5
--- /dev/null
+++ b/config/arch/blackfin.in
@@ -0,0 +1,12 @@
+# Blackfin specific configuration file
+
+config ARCH_blackfin
+ select ARCH_SUPPORTS_32
+ select ARCH_DEFAULT_32
+ select ARCH_DEFAULT_LE
+ select ARCH_SUPPORT_ARCH
+ select ARCH_SUPPORT_CPU
+ select ARCH_SUPPORT_TUNE
+ select ARCH_SUPPORT_FPU
+ help
+ The Blackfin architecture
diff --git a/patches/uClibc/0.9.30.2/290-blackfin-nommu-fork-stub.patch b/patches/uClibc/0.9.30.2/290-blackfin-nommu-fork-stub.patch
new file mode 100644
index 0000000..7dc0439
--- /dev/null
+++ b/patches/uClibc/0.9.30.2/290-blackfin-nommu-fork-stub.patch
@@ -0,0 +1,32 @@
+From: Jie Zhang <jie.zhang@analog.com>
+Date: Mon, 1 Jun 2009 07:25:42 +0000 (+0000)
+Subject: Backport UCLIBC_HAS_STUBS config option from the upstream. This option makes uClibc...
+X-Git-Url: http://blackfin.uclinux.org/git/?p=readonly-mirrors%2Ftoolchain.git;a=commitdiff_plain;h=cacea6b12bae6f6cfd08e2bbec536e9b23b342f5
+
+Backport UCLIBC_HAS_STUBS config option from the upstream. This option makes uClibc provide fork() stub on NOMMU targets. It's default off.
+
+
+git-svn-id: svn://localhost/svn/toolchain/trunk@3417 2adf4935-75e9-4407-93b2-34b21a1880a4
+---
+
+Index: uClibc-0.9.30.2/libc/unistd/daemon.c
+===================================================================
+--- uClibc-0.9.30.2.orig/libc/unistd/daemon.c 2010-01-13 22:22:31.000000000 +0100
++++ uClibc-0.9.30.2/libc/unistd/daemon.c 2010-04-06 22:04:11.000000000 +0200
+@@ -55,7 +55,6 @@
+ libc_hidden_proto(dup2)
+ libc_hidden_proto(setsid)
+ libc_hidden_proto(chdir)
+-libc_hidden_proto(fork)
+
+ #ifndef __ARCH_USE_MMU__
+ #include <sys/syscall.h>
+@@ -85,6 +84,8 @@
+ return ret;
+ }
+ #else
++libc_hidden_proto(fork)
++
+ static inline pid_t fork_parent(void)
+ {
+ switch (fork()) {
diff --git a/scripts/build/arch/blackfin.sh b/scripts/build/arch/blackfin.sh
new file mode 100644
index 0000000..e707617
--- /dev/null
+++ b/scripts/build/arch/blackfin.sh
@@ -0,0 +1,14 @@
+# Compute Blackfin-specific values
+
+CT_DoArchTupleValues() {
+ # The architecture part of the tuple:
+ CT_TARGET_ARCH="bfin"
+
+ # gcc ./configure flags
+ CT_ARCH_WITH_ARCH=
+ CT_ARCH_WITH_ABI=
+ CT_ARCH_WITH_CPU=
+ CT_ARCH_WITH_TUNE=
+ CT_ARCH_WITH_FPU=
+ CT_ARCH_WITH_FLOAT=
+}
diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh
index 8a568ed..1d08f30 100644
--- a/scripts/build/kernel/linux.sh
+++ b/scripts/build/kernel/linux.sh
@@ -6,7 +6,12 @@ CT_DoKernelTupleValues() {
if [ "${CT_ARCH_USE_MMU}" = "y" ]; then
CT_TARGET_KERNEL="linux"
else
- CT_TARGET_KERNEL="uclinux"
+ # Sometime, noMMU linux targets have a -uclinux tuple, while
+ # sometime it's -linux. We currently have only one noMMU linux
+ # target, and it uses -linux, so let's just use that. Time
+ # to fix that later...
+ # CT_TARGET_KERNEL="uclinux"
+ CT_TARGET_KERNEL="linux"
fi
}
diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh
index f4aa43d..03411a2 100644
--- a/scripts/build/libc/uClibc.sh
+++ b/scripts/build/libc/uClibc.sh
@@ -190,11 +190,12 @@ mungeuClibcConfig() {
# Hack our target in the config file.
case "${CT_ARCH}:${CT_ARCH_BITNESS}" in
- x86:32) arch=i386;;
- x86:64) arch=x86_64;;
- sh:32) arch="sh";;
- sh:64) arch="sh64";;
- *) arch="${CT_ARCH}";;
+ x86:32) arch=i386;;
+ x86:64) arch=x86_64;;
+ sh:32) arch="sh";;
+ sh:64) arch="sh64";;
+ blackfin:32) arch="bfin";;
+ *) arch="${CT_ARCH}";;
esac
# Also remove stripping: its the responsibility of the
# firmware builder to strip or not.