0

I am new in ARM architecture.

I want to compile a simple c code (hello world) and move the output executor onto odroid xu4. (Ubuntu mate 18.04)

But when I move it to odroid. I got this: bash: ./hello: No such file or directory

I download a toolchain gcc-arm-8.3-2019.03-x86_64-arm-eabi.tar.xz from (https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads) and install on my x86_64 computer(Ubuntu 16.04).

here is my hello_world.c

#include <stdio.h>

int main()
{
  printf("Hello World\n");
  return 0;
}

I compile with this cmd:

$ arm-linux-gnueabi-gcc hello_world.c -o hello

Here is the result of file hello

hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 3.2.0, BuildID[sha1]=f80d3d5cecbb2d688b978a6c889613f158dda657, not stripped

here is the normal executor build on odroid-xu4 by its native compiler

hello: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib, for GNU/Linux 3.2.0, BuildID[sha1]=697300990ba7610219175192f540cdd7411caa84, not stripped

Thank you!

林建銘
  • 1
  • 1
  • `arm-eabi-g++` looks strange, can you try `arm-linux-eabi-g++`? The interpreter `/lib/ld-` is invalid. – KamilCuk Apr 02 '19 at 09:50
  • @KamilCuk Thanks for reply. I cannot find ```arm-linux-eabi-g++``` on my computer. And sorry, it's my bad. I did use ```arm-linux-gnueabi-gcc``` to compile the file! ```arm-eabi-g++``` dosen't work. – 林建銘 Apr 02 '19 at 10:01
  • Och right, I knew `arm-eabi` felt strange. `eabi` compiled against an "unkown" system with "unknown" eabi exposed. As you want to compile against GNU/Linux system, use `linux-gnueabi`. You can answer your post and accept the answer. – KamilCuk Apr 02 '19 at 10:04

0 Answers0