[uClibc] thumb toolchain

David Muse dmuse at 4accesscommunications.com
Wed Mar 3 23:46:11 UTC 2004


Hello,

I've been hacking for a few days, trying to put together a thumb-linux-uclibc toolchain.  That is, a uclibc toolchain for linux where the tools generate thumb code and the libraries are thumb code.

First, is anyone else working on this?

Second, I've been having a little trouble... I'm running a montavista linux 2.4.18 kernel which alledges to have support for thumb system calls but I can't even get very simple assembly programs (that don't even make system calls) to run without segfaulting.  I'm not terribly experienced with raw assembly, so I may be doing something dumb, but does anyone out there know of any thumb-related problems with that kernel or other kernels?  Can anyone recommend a kernel where thumb code is known or believed to run?

As far as hacking on the toolchain, here's what I've done so far:

binutils:
	nothing, when compiled for an arm target, as can allegedly create thumb code when passed -mthumb

gcc:
	in gcc/config/arm/t-linux:
		added a MULTILIBS definition for mthumb, to build mthumb versions of libgcc,crtbegin,crtend
		added a lib1asm functions that thumb code requires to the LIBASM1FUNCS

uclibc:
	added new system call semantics for thumb: the system call number is passed in r7 instead of in the swi parameter
	add #if defined(__thumb__) in most places where #if defined(__arm__) is called

gcc and uclibc:
	add #ifdef __thumb__'s and (presumed) equivalent thumb-specific code for wherever arm assembly code is used


I've had moderate success getting everything to build so far.  I still get some undefined symbols when trying to link libc.so and a few complaints about arm calls to thumb functions, but hopefully I'll be able to work through those issues soon.

Am I on the right track?  I'm I missing anything signifigant?

Does anyone know of a good arm/thumb emulator/debugger that can run on x86 linux?

Thanks,

David Muse
dmuse at 4accesscommunications.com



More information about the uClibc mailing list