Question about compiling LLVM through cross-compiler for ARM

Hi All,

I’m trying to compile clang+llvm on my desktop with cross-compiler to be able to work with llvm commands in ubuntu-arm image whithin gem5.
If anybody has done this before I’d be so thankful to know the exact process and commands. I tried to configure llvm as follows but I couldn’t get the arm-arm version correctly. To sum up, I need to cross-compile llvm for ARM to work in gem5 through the ubuntu image for ARM systems.

…/llvm/configure --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi --prefix=/path/to/install --with-sysroot=/usr/arm-linux-gnueabi

Best regards
Negar

Hello

It will be really great if you'd provide which problems you had. Just
"couldn't get" is definitely not enough for any suggestion.
Unfortunately, telepathy modules are not mainstream yet :wink:

It is done. Then, I should copy this version on my image and then boot the image with gem5. The
problem is when I try to run llvm-commands in gem5, they don't work and said : "cannot execute binary file".

What does "file" says on the binary?

This means that I couldn't cross-compile the llvm for ARM to work on ARM!

Something is broken on your side. I can definitely cross-compile LLVM to mingw32

> It is done. Then, I should copy this version on my image and then boot
> the image with gem5. The
> problem is when I try to run llvm-commands in gem5, they don't work and
> said : "cannot execute binary file".
What does "file" says on the binary?

when I use commands like : "#arm-linux-gnueabi-clang test.c -o test" or any
other commands like lli, clang++, ... the error occurs.

Sorry, I won't be able to help you if you won't show the output as I requested.

Could you tell me how did you cross-compiled LLVM to mingw32? I mean the
command which you used for. So, I can compare it with mine and maybe find
something useful!

Just straight --host / --target configure

PS: There is "Reply All" button, please reply to the list as well

It is done. Then, I should copy this version on my image and then boot
the image with gem5. The
problem is when I try to run llvm-commands in gem5, they don’t work and
said : “cannot execute binary file”.
What does “file” says on the binary?
when I use commands like : “#arm-linux-gnueabi-clang test.c -o test” or any
other commands like lli, clang++, … the error occurs.

Sorry, I won’t be able to help you if you won’t show the output as I requested.

Alright, the attached file is a photo of two terminals. the left hand side is the error after I tried to cross-compile llvm with the mentioned command. And, the right one is the error when I just used --host and --target without considering the sys-root:
…/llvm/configure --host=arm-none-linux-gnueabi --target=arm-none-linux-
gnueabi --prefix=/path/to/install

I hope it will help.

Could you tell me how did you cross-compiled LLVM to mingw32? I mean the
command which you used for. So, I can compare it with mine and maybe find
something useful!

Just straight --host / --target configure

PS: There is “Reply All” button, please reply to the list as well

You’re right, thank you.


With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University

Cheers
Negar

Alright, the attached file is a photo of two terminals. the left hand side
is the error after I tried to cross-compile llvm with the mentioned command.
And, the right one is the error when I just used --host and --target without
considering the sys-root:

No attach. Note that I just asked you to run "file clang" on the
binary you compiled.

oops! sorry, I’ve had an exhausting day !

Alright, the attached file is a photo of two terminals. the left hand side
is the error after I tried to cross-compile llvm with the mentioned command.
And, the right one is the error when I just used --host and --target without
considering the sys-root:

No attach. Note that I just asked you to run “file clang” on the
binary you compiled.

Yes, it is in the attached photo.