Search code examples
carmtoolchainbuildroot

Buildroot ARM Toolchain for arm7tdmi to compile SourceForge Archopen


I'm interested in compiling the sourceforge project https://svn.code.sf.net/p/archopen/code/ArchOpen/trunk/, and more especifically the app AOnes, which is a NES emulator for Archos Gmini 400 (Inactive old project)

Analyzing the source code, I saw that the Gmini400 is an arm7tdmi device, no MMU and the toolchain used to compile was a buildroot one named arm-linux-nofpu. I supposed (according to the buildroot-2009-02 menuconfig) that no-fpu means soft floating point, so i tried to build such a toolchain.

I build a toolchain with buildroot-2013-02 (both year 2009 and 2010 don't work for me) with the following options:

  • arm7tdmi
  • no MMU
  • Software Floating Point
  • Enable elf2flt support (i saw there were such a reference in the Makefile of ArchOpen)

I let the other options as they were and made the build.

I made a checkout of ArchOpen, launch the configuration script to choose Gmini4XX as the target (and not Gmini 402 chich is quite different), selected to defaut.rules and edit the resulting Makefile.conf to adapt the tools paths and names (as my generated toolchain name is different)

First error:

[thread.o]
{standard input}: Assembler messages:
{standard input}:1236: Error: Rn must not overlap other operand -- swpb r0,r3,[r0] 

Well, this code is supposed to be working, but i opened thread.h and corrected the source to pass through (adding a "&")

Second error:

undefined reference to __aeabi_idivmod and undefined reference to __aeabi_ldivmod

As google says, it seems to be a -lgcc missing problem. I edited the wav folder makefile to add -lgcc and specified -L/lib_folder_of_my_toolchain_containing_libgcc.a

Third error:

in gcc/config/arm/lib1funcs.asm : multiple definition of __divsi3
in gcc/config/arm/lib1funcs.asm : undefined reference to raise
in libgcc.a (some .o inside) : undefined reference to __aeabi_unwind_cpp_pr0

I've no idea to solve this...

Does anyone have an idea? Does anyone can help me to get a working arm7 toolchain compatible with this archopen code?

Thanks!


Solution

  • Well, in this particular case, back to 2005 was a good solution...

    With a ubuntu 5.04, buildroot has been built with the defaut generic ARM (little endian) configuration, except for the following options:

    • GCC 3.3.5
    • No use the daily uClibc snapshot
    • The processor has no MMU
    • No support large file
    • Use softfloat by default
    • No install busybox (as I only wanted the toolchain)
    • No create an Ext2 filesystem (same reason than above)

    The build fail just after having compiled the last GCC phase. At this point, add the buildroot/build_arm_nofpu/staging_dir/bin in the PATH env. variable, download the libfloat source (libfloat-990616.orig.tar.bz2) tarball, edit the Makefile changing gcc, ld and as repectively by arm-linux-uclibc-gcc, arm-linux-uclibc-ld and arm-linux-uclibc-as and build libfloat (make clean & make). Copy libfloat.a into buildroot/build_arm_nofpu/staging_dir/lib and run the buildroot make again (without cleaning). The build should end successfully. With this toolchain, mediOS will compile without any warning.