Loading ...
Sorry, an error occurred while loading the content.

Re: [gnuarm] Can't compile for XScale

Expand Messages
  • Pablo Bleyer Kocik
    ... In the latest GCCs you can set the FPU generation with the -mfpu=xxx switch, where xxx is either vfp, fpa or the soft versions of these. However this
    Message 1 of 4 , Sep 29, 2005
    View Source
    • 0 Attachment
      yidthatton wrote:
      >
      > Unfortunately, when I try and compile my hello world C program I get
      > an error saying my object file uses VFP instructions.
      >
      > My compilation line is simply:
      > arm-elf-gcc.exe -mcpu=xscale hello.c -o hello
      >
      > I've tried playing around with -msoft-float and other -m parameters
      > but I'm just guessing and not getting very far.

      In the latest GCCs you can set the FPU generation with the "-mfpu=xxx"
      switch, where xxx is either vfp, fpa or the soft versions of these. However
      this won't do much help. GNUARM is compiled with the arm-elf template which
      selects VFP by default and the support libraries (libgcc, newlib-libc) are
      compiled with that.

      What you need is a GCC toolchain compiled with the arm-linux template
      (IIRC, softfpa is implied), the kernel headers configured for your platform
      and the respective libc you are using (glibc, newlib, uclibc, dietlibc,
      ...). If you wish to build the toolchain yourself you should be aware that
      there are patches to be applied to any configuration.

      I don't know which libc Compulab uses. If it is uClibc then use their
      buildroot system -- http://buildroot.uclibc.org/. If it is glibc, then I'd
      suggest to use Dan Kegel's crosstool -- http://kegel.com/crosstool/. In the
      newlib case you may follow the same compilation steps that I use to build
      GNUARM.

      > Has anyone used GNUARM to complile code for this CPU? If so, what
      > settings do I need? Is there anything else I should know about that
      > I'm obviously doing wrong?

      I have tried all of the toolchains above with different tool versions
      under Cygwin without major problems and in a several platforms (little and
      big endian). With the XScale, for the PXA255 I have recently used the
      Gumstix board with their supplied toolchain (gcc-3.4.2 based) compiled in
      Cygwin, tweaking a little bit the buildroot they provide --
      http://svn.rungie.com/svn/gumstix-buildroot/trunk/. I have also used my own
      4.0.1-based toolchain with it too.

      I am also using an Arcom board that uses an IXP425 big-endian XScale with
      my own Cygwin toolchain (linux 2.6.11, gcc-4.0.1, glibc-2.3.5). If it helps,
      I am uploading the patched sources of the tools I used to compile the latter
      in my website -- http://bleyer.org/armlinux/. The compilation process goes
      below.

      Best regards.

      ----8<----

      # in binutils build directory
      ../binutils-2.16.1/configure --target=arm-linux --prefix=c:/xscale
      --with-cpu=xscale --enable-multilib --enable-interwork --enable-shared
      --enable-threads

      make
      make install

      export PATH="/c/arm-linux/bin:$PATH"

      # in gcc build directory
      # configure.boot is the same as the original configure
      ../gcc-4.0.1/configure.boot --target=arm-linux --prefix=c:/arm-linux
      --enable-multilib --disable-shared --enable-threads
      --with-headers={kernel_headers} --enable-languages=c --disable-libmudflap

      make all-gcc
      make install-gcc

      # in glibc build directory
      # edit your configurations to match your platform
      CC="arm-linux-gcc -mcpu=xscale -mbig-endian" AS="arm-linux-as -mcpu=xscale
      -EB" LD="arm-linux-ld -EB" ../glibc-2.3.5/configure --build=i686-pc-cygwin
      --host=arm-linux --prefix=c:/arm-linux
      --with-headers=/c/arm-linux/arm-linux/sys-include --enable-shared
      --enable-threads --enable-add-ons --libdir=c:/arm-linux/lib/be

      make
      make install

      # in gcc build directory again
      # edit the configure script and modify FLAGS_FOR_TARGET to fit your platform
      (little or big endian)
      ../gcc-4.0.1/configure --target=arm-linux --prefix=c:/xscale
      --enable-multilib --enable-static --enable-shared --enable-threads
      --with-headers={kernel_headers} --enable-languages="c,c++"

      make
      make install

      # Alea jacta est

      --
      PabloBleyerKocik /
      pablo / "Their primitive minds couldn't accept the truths."
      @... /- Cheech Wizard in 'Captured by Morton Frog'
    • yidthatton
      ... -mfpu=xxx ... However ... template which ... newlib-libc) are ... platform ... aware that ... then I d ... In the ... build ... (little and ... compiled
      Message 2 of 4 , Sep 30, 2005
      View Source
      • 0 Attachment
        --- In gnuarm@yahoogroups.com, Pablo Bleyer Kocik <pbk@e...> wrote:
        > yidthatton wrote:
        > >
        > > Unfortunately, when I try and compile my hello world C program I get
        > > an error saying my object file uses VFP instructions.
        > >
        > > My compilation line is simply:
        > > arm-elf-gcc.exe -mcpu=xscale hello.c -o hello
        > >
        > > I've tried playing around with -msoft-float and other -m parameters
        > > but I'm just guessing and not getting very far.
        >
        > In the latest GCCs you can set the FPU generation with the
        "-mfpu=xxx"
        > switch, where xxx is either vfp, fpa or the soft versions of these.
        However
        > this won't do much help. GNUARM is compiled with the arm-elf
        template which
        > selects VFP by default and the support libraries (libgcc,
        newlib-libc) are
        > compiled with that.
        >
        > What you need is a GCC toolchain compiled with the arm-linux template
        > (IIRC, softfpa is implied), the kernel headers configured for your
        platform
        > and the respective libc you are using (glibc, newlib, uclibc, dietlibc,
        > ...). If you wish to build the toolchain yourself you should be
        aware that
        > there are patches to be applied to any configuration.
        >
        > I don't know which libc Compulab uses. If it is uClibc then use their
        > buildroot system -- http://buildroot.uclibc.org/. If it is glibc,
        then I'd
        > suggest to use Dan Kegel's crosstool -- http://kegel.com/crosstool/.
        In the
        > newlib case you may follow the same compilation steps that I use to
        build
        > GNUARM.
        >
        > > Has anyone used GNUARM to complile code for this CPU? If so, what
        > > settings do I need? Is there anything else I should know about that
        > > I'm obviously doing wrong?
        >
        > I have tried all of the toolchains above with different tool versions
        > under Cygwin without major problems and in a several platforms
        (little and
        > big endian). With the XScale, for the PXA255 I have recently used the
        > Gumstix board with their supplied toolchain (gcc-3.4.2 based)
        compiled in
        > Cygwin, tweaking a little bit the buildroot they provide --
        > http://svn.rungie.com/svn/gumstix-buildroot/trunk/. I have also used
        my own
        > 4.0.1-based toolchain with it too.
        >
        > I am also using an Arcom board that uses an IXP425 big-endian
        XScale with
        > my own Cygwin toolchain (linux 2.6.11, gcc-4.0.1, glibc-2.3.5). If
        it helps,
        > I am uploading the patched sources of the tools I used to compile
        the latter
        > in my website -- http://bleyer.org/armlinux/. The compilation
        process goes
        > below.
        >
        > Best regards.
        >
        > ----8<----
        >
        > # in binutils build directory
        > ../binutils-2.16.1/configure --target=arm-linux --prefix=c:/xscale
        > --with-cpu=xscale --enable-multilib --enable-interwork --enable-shared
        > --enable-threads
        >
        > make
        > make install
        >
        > export PATH="/c/arm-linux/bin:$PATH"
        >
        > # in gcc build directory
        > # configure.boot is the same as the original configure
        > ../gcc-4.0.1/configure.boot --target=arm-linux --prefix=c:/arm-linux
        > --enable-multilib --disable-shared --enable-threads
        > --with-headers={kernel_headers} --enable-languages=c
        --disable-libmudflap
        >
        > make all-gcc
        > make install-gcc
        >
        > # in glibc build directory
        > # edit your configurations to match your platform
        > CC="arm-linux-gcc -mcpu=xscale -mbig-endian" AS="arm-linux-as
        -mcpu=xscale
        > -EB" LD="arm-linux-ld -EB" ../glibc-2.3.5/configure
        --build=i686-pc-cygwin
        > --host=arm-linux --prefix=c:/arm-linux
        > --with-headers=/c/arm-linux/arm-linux/sys-include --enable-shared
        > --enable-threads --enable-add-ons --libdir=c:/arm-linux/lib/be
        >
        > make
        > make install
        >
        > # in gcc build directory again
        > # edit the configure script and modify FLAGS_FOR_TARGET to fit your
        platform
        > (little or big endian)
        > ../gcc-4.0.1/configure --target=arm-linux --prefix=c:/xscale
        > --enable-multilib --enable-static --enable-shared --enable-threads
        > --with-headers={kernel_headers} --enable-languages="c,c++"
        >
        > make
        > make install
        >
        > # Alea jacta est
        >
        > --
        > PabloBleyerKocik /
        > pablo / "Their primitive minds couldn't accept the truths."
        > @... /- Cheech Wizard in 'Captured by Morton Frog'

        Thanks you Pablo for all your info. It will take me a couple of days
        to digest all this and see what I can do.
        I will post my results,
        Tim
      • Coert Langkemper
        Hi Tim, If something as basic as the hello.c can t be compiled, I doubt you have to go as far as mentioned in the other replies. You may check these issues
        Message 3 of 4 , Sep 30, 2005
        View Source
        • 0 Attachment
          Hi Tim,

          If something as basic as the hello.c can't be compiled, I doubt you have to
          go as far as mentioned in the other replies.

          You may check these issues first:

          - Did you properly install Cygwin?
          - Did you take care of the environment variables in Windows?
          - Do you have this file, at this location: c:\winnt\system32\cygwin1.dll,
          remove it!
          - Do you have this file, at this location: c:\cygwin\bin\cygwin1.dll = OK!
          - Multiple copies of cygwin1.dll causes problems!
          - Does the version of cygwin1.dll correlate with the distributions used?
          - Are the cygwin and gnu-arm distribution versions used, compatible?

          Info to check:
          **********
          The cygwin "cygcheck" utility:

          Type:
          C:\>cygcheck arm-elf-gcc.exe

          Found: c:\program files\gnuarm\bin\arm-elf-gcc.exe
          c:/program files/gnuarm/bin/arm-elf-gcc.exe
          C:\cygwin\bin\cygwin1.dll
          C:\WINNT\system32\ADVAPI32.DLL
          C:\WINNT\system32\NTDLL.DLL
          C:\WINNT\system32\KERNEL32.DLL
          C:\WINNT\system32\RPCRT4.DLL
          C:\>

          **********
          Environment setting:
          Path=C:\WINNT\system32;C:\WINNT;c:\cygwin\bin;c:\program files\gnuarm\bin;

          **********

          I copied the above from my system where it works fine.
          Take care that there are no conflicting environment settings and that the
          ones you have correspond with the installed distributions.

          Regards,
          Coert


          -----Original Message-----
          From: gnuarm@yahoogroups.com [mailto:gnuarm@yahoogroups.com]On Behalf Of
          yidthatton
          Sent: Thursday, 29, September, 2005 16:54
          To: gnuarm@yahoogroups.com
          Subject: [gnuarm] Can't compile for XScale


          Hi there,
          I've been successfuly developing an application for a board which uses
          Intel's XScale PXA255 CPU (for the record the board is called CM-X255
          from a company called Compulab). Anyway, I've been developing the app
          under Linux with a toolchain binary I got from their web site without
          problems.

          For various reasons, I need to move some of the development over to
          Windows and have spent a couple of days unsuccessfully trying to
          compile GCC for cross compilation. So, I thought I'd try downloading
          the GNUARM Windows binary (4.0.0) and see if I could compile and run
          some code with that instead.

          Unfortunately, when I try and compile my hello world C program I get
          an error saying my object file uses VFP instructions.

          My compilation line is simply:
          arm-elf-gcc.exe -mcpu=xscale hello.c -o hello

          I've tried playing around with -msoft-float and other -m parameters
          but I'm just guessing and not getting very far.

          Has anyone used GNUARM to complile code for this CPU? If so, what
          settings do I need? Is there anything else I should know about that
          I'm obviously doing wrong?

          Any help would be greatly appreciated,
          Thanks in advance,
          Tim





          Yahoo! Groups Links
        Your message has been successfully submitted and would be delivered to recipients shortly.