1

I'm using Fedora 36 through VirtualBox, and trying to compile some code for Cortex-A53 by toolchain taken from developer.arm.com

I have downloaded the archive, unpacked it in Downloads folder and then invoked GCC as it said in release note on the site.

Compiler successfully found VLA in my code and gave me the line numbers where to fix them. So it got the source code with no problem. I fixed VLA in the code, and then compilation succeed with no warning or error messages, so i gone for an executable.

But, for some reason there did not appear any with exact name.

I used this invocation command to compile:

/home/User/Downloads/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-gcc   my_code.c  -o  compiled/my_prog

What am I doing wrong?

UPD:

Although I have "solution" now, the point is stays undiscovered: I even can't guess how can one compiler not create executable while other one - creates it. From/to same place, same OS, and other setup stuff. Only compilers are different, and as it was said in comments, their main difference is in targeting - one compiles for 32-bit ARM, other compiles for 64-bit ARM.

If my case was not to compile for 64-bit chip, then my own answer would not be counted as the solution.

Mk Kvease
  • 41
  • 5

1 Answers1

1

Okay, solution was pretty dumb, but for some not quite understandable by me reason, aarch64-none-linux-gnu-gcc successfully creates an executable, while arm-none-linux-gnueabihf-gcc - does not.

that is a little bit confusing to compile something for ARM chip with tool which has no arm in its name.

If someone can clarify differences among a-a-all these stuff - it would be appreciated, I suppose. (by me at least)

I can't do that due to lack of the knowledge, and maybe my executable won't even run due to other mistakes I accidentally made.

EDIT: Exec is successfully ran, so aarch64-none-linux-gnu-gcc is surely compiling for hard-float chips, because Cortex-A53 is such one. I have no idea why there is other one which states -gnueabihf- explicitly which stands for Hard-Float.

Mk Kvease
  • 41
  • 5
  • 1
    Clarify which part exactly? https://stackoverflow.com/questions/5731495/can-anyone-explain-the-gcc-cross-compiler-naming-convention – KamilCuk Jul 28 '23 at 21:09
  • @KamilCuk , thanks for the link, it covers a big part of the question. Maybe you know, what the difference between those two compilers? i mean, `-gnueabi(hard-float)-` is the same thing just as `-gnu-`, i suppose, because my exec is works fine on the target, and target's chip is HF as i learnt. And as written [here](https://stackoverflow.com/questions/31851611/differences-between-arm64-and-aarch64), - `aarch64-` and `arm-` is the same thing. So, why there are two same things allowed to be downloaded? Why one of them does not create exec, and other - does? – Mk Kvease Jul 28 '23 at 22:24
  • 1
    `aarch64-` is the same of `arm64-` and they are compilers for 64-bit ARM CPU whereas `arm-` is a compiler for 32-bit ARM CPU. Since Cortex-A53 implements the 64 bit ARM architecture you should use the `aarch64-` compiler. – Kalendistrien Jul 29 '23 at 00:29