cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
1,135 Views
Registered: ‎02-13-2016

Difference between arm compilers

Jump to solution

Hi,

I just would like to know the difference between the following ARM toolchain and which one can work as a replacement for the other:

  • aarch64-gnu-linux-gcc
  • aarch64-xilinx-linux-gcc
  • arm-none-eabi-gcc

 My goal is to convert an .elf file into a shared library (.so) file. So, I have previously mentioned compilers installed on my machine. Given my goal to convert the ELF file to the shared library for an application deployed on the ZCU104 FPG, which one to use?

 

Thanks.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
580 Views
Registered: ‎02-13-2016

Hello,

I managed to solve my issue. In UG1414, the following command is used:

aarch64-linux-gnu-gcc \
--sysroot=~/petalinux_sdk/sysroots/aarch64-xilinx-linux \
-fPIC -shared dpu_xxxxxx_*.elf -o libdpumodelxxxxxx.so 

This should work instead of using aarch64-xilinx-linux-gcc.

View solution in original post

14 Replies
Highlighted
Teacher
Teacher
1,110 Views
Registered: ‎07-09-2009
I would suggest, based upon the open question,
which ever one you can get the best support for,
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Highlighted
Explorer
Explorer
1,104 Views
Registered: ‎02-13-2016

Hi @drjohnsmith

So, there is no significant difference between these two compilers?

  • aarch64-gnu-linux-gcc
  • aarch64-xilinx-linux-gcc
0 Kudos
Highlighted
Teacher
Teacher
1,067 Views
Registered: ‎07-09-2009
depends upon your definition of significant !
as your asking, Im guessing , you have limited experience in the different compilers,
based purely upon that , sounds like you will need some support,
so I'd go for the one you can get the best support for.
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Highlighted
Moderator
Moderator
1,012 Views
Registered: ‎09-12-2007

one is built with crosstool-ng and aarch64-xilinx-linux-gcc with yocto frame work. However, they should function the same

0 Kudos
Highlighted
1,003 Views
Registered: ‎07-23-2019

 

There is a nomenclature for gnu cross compilers, that is:  arch-vendor-(os-)abi

So both compilers you mention are for aarch64 architecture and having linux as OS. The difference is the vendor (who makes it), GNU in one case, Xilinx in other. Are they the same? It depends on how big is the magnifier you look through. In most cases, it will be the same. 

The last one (arm-none-eabi-gcc) is another thing. It is for arm (not aarch64) architecture and compiles executable binaries (eabi = embedded application binary interface) not, for example, the OS itself.

Highlighted
Explorer
Explorer
935 Views
Registered: ‎02-13-2016

Hi @archangel-lightworks@stephenm@drjohnsmith,

Thanks a lot for giving such information.

I am asking because I am running through a weird problem. I am trying to compile a file using the following command:

aarch64-xilinx-linux-gcc -fPIC -shared dpu_thin_1stage_dense_0.elf -o libdpumodelthin_1stage_dense.so

As can be noted, I am working with Vitis AI stack flow to run my model on the DPU.

 

However, I constantly get the same following error:


/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find crti.o: No such file or directory
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find crtbeginS.o: No such file or directory
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find -lgcc
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find -lgcc_s
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find -lc
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find -lgcc
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find -lgcc_s
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find crtendS.o: No such file or directory
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status

 

However, when I use the aarch64-gnu-linux-gcc, it compiles the file successfully with no errors. Would you please help me why this is happening? And how to solve it?

Thanks.

0 Kudos
Highlighted
Visitor
Visitor
918 Views
Registered: ‎01-19-2020

Hello,

The problem is caused due to your sysroot is not found

You need to specify your sysroot directory as an argument while compiling;

--sysroot=/YOUR_DIRECTORY

 

Helper to see is it in your path;

aarch64-xilinx-linux-gcc -print-search-dirs

 

Highlighted
Teacher
Teacher
905 Views
Registered: ‎07-09-2009
@asobeih
that's a much better question to ask on a forum,
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Highlighted
Explorer
Explorer
793 Views
Registered: ‎02-13-2016

Hi @alperuzgec@drjohnsmith , @archangel-lightworks , @stephenm,

 

Thank you. I followed your advice and here is what I did:

  1. I checked the search path using this command:

 

aarch64-xilinx-linux-gcc -print-search-dirs​

 


And here is what I got:

11.PNG

 

  • I set the --sysroot to my sysroot path found in the toolchain installation directory, which is:  /home/user/petalinux_sdk/sysroots/
    Yet, I got the same errors mentioned in my previous reply

  • I searched for the crti.o file, and found it under this directory: /home/user/petalinux_sdk/sysroots/aarch64-xilinx-linux/usr/lib . I passed this path to my -I, -L, and --sysroot, each at a time, yet, same errors
  • the "real-ld" is a symbolic link. It is not a directory that may contain a library or something.

  • I printed my $PATH library, and here is what I found (I do not set it at all. It gets set by sourcing the toolchain script):
    /home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/bin:/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/sbin:/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/bin:/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/sbin:/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/bin/../x86_64-petalinux-linux/bin:/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux:/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux-musl:/home/user/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • I printed the $LD_LIBRARY_PATH and it was empty.

 

Again, I would like to point out that the file that I am trying to compile was successfully compiled by aarch64-gnu-linux-gcc compiler. I am actually following this tutorial:
https://developer.xilinx.com/en/articles/medical-ai-application-acceleration-with-xilinx-vitis-ai.html

Any advice on this?

0 Kudos
Highlighted
Scholar
Scholar
759 Views
Registered: ‎04-13-2015

@asobeih it seems your issue is not a difference in compiler but just in case.

You can find out how a GCC compiler was build and will operate with these 2 commands:

gcc -dM -E - < dev/null tells you all the internal #define

gcc --print-multi-lib tells you all the type of libraries it can work with (e.g. hard vs soft float)

 

0 Kudos
Highlighted
Explorer
Explorer
719 Views
Registered: ‎02-13-2016

Hi @ericv,

I followed your instructions and the following is the output that I got:

asobeih_0-1602001203497.png

 

Is this output what I should expect? How would this help with solving my issue?

Regarding your comment on the difference of the compilers, my point here is that I did not face the issue I am discussing here when I used the aarch64-gnu-linux-gcc compiler as everything worked smoothly. My problems started when I used the aarch64-xilinx-linux-gcc compiler.

The main point behind my question about the difference was that if there is no true difference between the Xilinx toolchain and GNU toolchain, I would surely stick to the GNU toolchain to avoid this weird issue.

Let me know your thoughts, please

0 Kudos
Highlighted
Scholar
Scholar
706 Views
Registered: ‎04-13-2015

@asobeih First, my mistake as it should obviously be /dev/null and not dev/null.  Is that what is expected? Refer to 

https://stackoverflow.com/questions/37418986/how-to-interpret-the-output-of-gcc-print-multi-lib

for an simplified explanation for --print-multi-lib. The output of -dM -E is self explanatory.

 

0 Kudos
Highlighted
Explorer
Explorer
646 Views
Registered: ‎02-13-2016

@ericv Thanks a lot for helping me out. I just cannot understand how this should help with solving my issue. Would you please clarify this point?

 

@drjohnsmith@alperuzgec@archangel-lightworks@stephenm, your help is greatly appreciated. I am still looking forward to your response.

0 Kudos
Highlighted
Explorer
Explorer
581 Views
Registered: ‎02-13-2016

Hello,

I managed to solve my issue. In UG1414, the following command is used:

aarch64-linux-gnu-gcc \
--sysroot=~/petalinux_sdk/sysroots/aarch64-xilinx-linux \
-fPIC -shared dpu_xxxxxx_*.elf -o libdpumodelxxxxxx.so 

This should work instead of using aarch64-xilinx-linux-gcc.

View solution in original post