3 Replies Latest reply: Aug 20, 2014 11:48 PM by jensbauer RSS

Build startup_cortexA15MPcore using GNU toolchain. URGENT.

mazen.e Nibble

Dear all,

 

I am trying to build the example  startup_cortexA15MPcore (provided with DS-5)  using GNU toolchain. The example is originally designed for build using ARM standard tools, and the following variables are hence defined :

 

CC=armcc

AS=armasm

LD=armlink

AR=armar

FE=fromelf


With what GNU tools should I substitute CC, AS, LD, AR, FE so that the example can be built using GNU toolchain. Does the below work:



CC = arm-none-eabi-gcc

 

AS= arm-none-eabi-as


LD= arm-none-eabi-ld



how about AR and FE?


Please help thank you very much.







  • Re: Build startup_cortexA15MPcore using GNU toolchain. URGENT.
    mweidmann Employee

    AR refers to "armar" which is the ARM utility for creating libraries. FR refers to "fromelf" which is a tool for inspecting ELF objects and images, for converting them to other formats. I haven't got a copy of the example to hand, but I doubt it actually needs either.

     

    Switch to GCC/GNU tools I foresee two problems. GAS (GNU assembler tool) and armasm (ARM's assembler tool) use different syntax. Which makes the .s files for one incompatible with the other.  Meaning you'll have to port it.  It's not too difficult (from limited past experience) but can be fiddly. Helps if you know one of the syntaxes well to start with.

     

    THe other potential problem is libraries.  The calls you make to set up and initialise the C library are different.

    • Re: Build startup_cortexA15MPcore using GNU toolchain. URGENT.
      mazen.e Nibble

      Dear Martin,

       

      Many thanks for your helpful reply.

       

      Great, I believe I can port the ARM .as files into the GNU .as files and I am aware of their major syntax differences.

       

      Could you please provide more information about the issue of Libraries or route me to a  helpful related document.

       

       

      Thank you very much.

      • Re: Re: Build startup_cortexA15MPcore using GNU toolchain. URGENT.
        jensbauer Short

        If you're lucky, you could use the C Pre-Processor in GNU as a wrapper around your ARM assembly files.

        Say... You have foo.as and you want to assemble it using GAS; then wrap the C Pre-Processor aournd GAS for files ending in ".S"

        To wrap GAS in the C Pre-Processor, use GCC with the '-x assembler-with-cpp' switch:

            arm-none-eabi-gcc <some parameters> -x assembler-with-cpp <other parameters>

         

        Make yourself an .S file like the following:

         

        #define KEYWORD    replacement

        ...

        ...

        #define KEYWORDn    replacement_n

        ... After all your #define macros, you can include your ARM-assembly file:

            .include    "foo.as"

        ... or even ...

        #include "foo.as"

         

        Of course, it will not handle all cases, so you may experience the need for modifying the .as files, so they will become "portable"

        Also have a look at GAS's macros. They're quite powerful, and may be able to override keywords in your .as file too.

            .macro    macroname,param1,param2

            .ifnb    \param1

            ...

            .else

            .endif

            .endm