Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Cross-Compilation & Interwork

Help
anne
2007-12-27
2013-04-29
  • anne
    anne
    2007-12-27

    I have problems with cross-compiling because the interwork libraries doesn't seem to exist on the expected placed (needed to use both ARM and thumb instructions).

    There are hard references to thumb/interwork in the Makefiles:

    ../../ecrobot/lejos_osek.tmf:LIBPREFIX   := $(GNUARM_ROOT)/arm-elf/lib/thumb/interwork
    ../../ecrobot/lejos_osek.tmf:LIBC        := $(GNUARM_ROOT)/arm-elf/lib/thumb/interwork/libc.a

    And this leads to the following error when issuing "make all" in the helloworld example directory:

    Linking HelloWorld_ram.elf
    /opt/gnuarm/bin/arm-elf-ld -o HelloWorld_ram.elf ../../lejos_nxj/src//nxtvm/platform/nxt/uart.o
    [blah blah blah]
    -T HelloWorld_ram.ld -Map HelloWorld_ram.elf.map -L/opt/gnuarm/arm-elf/lib/thumb/interwork -cref --gc-sections -L../../lejos_nxj/src//nxtvm/platform/nxt -L../../lejos_nxj/src//nxtvm/javavm -L../../ecrobot -lm /opt/gnuarm/arm-elf/lib/thumb/interwork/libc.a /opt/gnuarm/lib/gcc/arm-elf/4.0.2/interwork/libgcc.a
    /opt/gnuarm/bin/arm-elf-ld: /opt/gnuarm/arm-elf/lib/thumb/interwork/libc.a: No such file: No such file or directory
    make: *** [HelloWorld_ram.elf] Error 1

    First I thought I needed an older GNU compiler chain, so I compiled the one with the gcc-4.0.2 compiler (instead of the gcc-4.1.1 I had used previously to compile for ARM processors), but this didn't make any difference. There is no thumb/interwork folder with that compiler either.

    I have compiled with "arm-elf" as target (with "/opt/gcc-4.0.2/configure --target=arm-elf --prefix=/opt/gnuarm --enable-interwork --enable-multilib --enable-languages="c,c++" --with-newlib --with-headers=/opt/newlib-1.14.0/newlib/libc/include" and brothers). See:

    /opt/gnuarm/bin/arm-elf-gcc -dumpmachine
    arm-elf

    Which GNU ARM toolchain have you used? And did you setup it with some additional flags perhaps?

    Kind regards,

    Anne

     
    • anne
      anne
      2007-12-27

      Sorry, to have bothered you with this.

      The --enable-interwork flag is not used to build the full-fledged cross-compiler when the appropriate variables in one of the config files isn't set.

      It can be solved by uncommenting in the (on my system) /opt/gcc-4.1.1/gcc/config/arm/t-arm-elf file:

        MULTILIB_OPTIONS    += mno-thumb-interwork/mthumb-interwork
        MULTILIB_DIRNAMES   += normal interwork

      Regards,

      Anne