[Crosstool-NG] Blackfin support, RFC

Thomas Petazzoni thomas.petazzoni@free-electrons.com
Wed Apr 7 08:34:00 GMT 2010


Hello,

I've recently started adding Blackfin support to Crosstool-NG. On
Blackfin, there are typically 3 toolchains available :
 * bfin-elf, a bare-metal toolchain using newlib
 * bfin-uclinux, a Linux toolchain that generates flat binaries (no
   shared libaries)
 * bfin-linux-uclibc, a Linux toolchain that generates FDPIC ELF
   binaries (shared libraries are possible)

I've focused on the latest one for the moment, and I've reached the
point where I can compile a small Hello World application, both dynamic
and static and run it on the target. I haven't tried more complicated
examples at the moment.

The attached patches implement the needed modifications:
 * 1838, Add basic support for the Blackfin architecture
 * 1839, Fix the uClibc clean-up-O_CLOEXEC-handling patch
 * 1840, Re-enable the FD_PIC ELF configuration option
 * 1841, Add uClibc support for Blackfin
 * 1842, Add Blackfin-related uClibc patch
 * 1843, Add Blackfin sample

However, in addition to these patches, I had to make a very ugly
modification :

diff -r e4d7a4cd72cc scripts/build/kernel/linux.sh
--- a/scripts/build/kernel/linux.sh	Wed Apr 07 09:26:12 2010 +0200
+++ b/scripts/build/kernel/linux.sh	Wed Apr 07 10:30:07 2010 +0200
@@ -6,7 +6,7 @@
     if [ "${CT_ARCH_USE_MMU}" = "y" ]; then
         CT_TARGET_KERNEL="linux"
     else
-        CT_TARGET_KERNEL="uclinux"
+        CT_TARGET_KERNEL="linux"
     fi
 }

This is because Crosstool-NG assumes that when the architecture has
no-mmu, the kernel part of the tuple must be "uclinux". However, in the
case of Blackfin toolchains, it seems that the tradition is
bfin-uclinux for FLAT toolchains and bfin-linux-uclibc for FDPIC
toolchains. Therefore, I had to hack this part of Crosstool-NG code.

Obviously, this is not the right way to do it, and that's why I'm
requesting for your comments on how to implement this properly.

On a side note, when is Crosstool-NG switching to git ? When you're
used to Git with all the other open-source projects, switching to
Mercurial just for Crosstool-NG is kind of painful.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1838.patch
Type: text/x-patch
Size: 1261 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20100407/4c5388d1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1839.patch
Type: text/x-patch
Size: 1050 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20100407/4c5388d1/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1840.patch
Type: text/x-patch
Size: 1085 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20100407/4c5388d1/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1841.patch
Type: text/x-patch
Size: 1319 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20100407/4c5388d1/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1842.patch
Type: text/x-patch
Size: 1750 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20100407/4c5388d1/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1843.patch
Type: text/x-patch
Size: 14501 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20100407/4c5388d1/attachment-0005.bin>
-------------- next part --------------
--
For unsubscribe information see http://sourceware.org/lists.html#faq


More information about the crossgcc mailing list