Hi Ikram

Get a variant of GCC that outputs ARM binaries by default (aarch64 is
probably what you want). Maybe try aarch64-linux-gnu-gcc toolchain
https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain or compile
it yourself. Add it to PATH for ease.

Compile your .c program forcing everything to be statically linked so that
library loading is not a headache

aarch64-linux-gnu-gcc -static -static-libgcc -static-libstdc++
testprog.c -o testprog

You can then run it with any config file, here from the tutorial

./gem5.opt configs/two_level_opt.py testprog

Thanks

Siddharth


On Mon, Jan 23, 2023 at 6:20 AM Setu Gupta via gem5-users <
gem5-users@gem5.org> wrote:

> Hi Ikram
>
> You need to use a compiler which supports compiling for the ARM ISA.
>
> Thanks
> Setu
>
> On Mon, Jan 23, 2023, 4:39 PM IKRAM via gem5-users <gem5-users@gem5.org>
> wrote:
>
>> Hi Setu,
>>
>> I have written a c code which has to be converted based on arm isa, so
>> that if I run config .py this c code which is written in perspective of arm
>> will be simulated.
>>
>>
>> If I do
>>  >>gcc arm.c
>> then a.out binary file will be created but it is not created in
>> perspective of arm.
>>
>>
>>
>>
>> Regards
>> - Ikram
>>
>> On Mon, 23 Jan, 2023, 4:28 pm Setu Gupta via gem5-users, <
>> gem5-users@gem5.org> wrote:
>>
>>> Hi Ikram
>>>
>>> To generate the binary files, you just need to compile your C code using
>>> a compiler.
>>>
>>> Thanks
>>> Setu
>>>
>>> On Mon, Jan 23, 2023, 4:18 PM IKRAM via gem5-users <gem5-users@gem5.org>
>>> wrote:
>>>
>>>>
>>>> Hi Team,
>>>>
>>>> I am working on ARM ISA.
>>>>
>>>> I want to know how we create binary files from c test.
>>>>
>>>> For example, in *simple.py* config file, we assign
>>>> *tests/test-progs/hello/bin/arm/linux/hello* binary workload.
>>>>
>>>>
>>>> So when we simulate simple.py "hello world" will be printed.
>>>>
>>>>
>>>> I wanted to write a c test and create its binary file and simulate with
>>>> config file.
>>>>
>>>> So, how c test is getting converted to binary file.
>>>>
>>>>
>>>> Thanks
>>>>  - Ikram
>>>> _______________________________________________
>>>> gem5-users mailing list -- gem5-users@gem5.org
>>>> To unsubscribe send an email to gem5-users-le...@gem5.org
>>>>
>>> _______________________________________________
>>> gem5-users mailing list -- gem5-users@gem5.org
>>> To unsubscribe send an email to gem5-users-le...@gem5.org
>>>
>> _______________________________________________
>> gem5-users mailing list -- gem5-users@gem5.org
>> To unsubscribe send an email to gem5-users-le...@gem5.org
>>
> _______________________________________________
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
>


-- 
Thanks
Siddharth
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org

Reply via email to