0

I have a PXA270 board and I am trying to use gnu-unknown-linux-gnu-gcc to compile a file and put it in my board. I have done some steps as follow:

1.Unzip the file,

SHELL> sudo tar zxvf arm-linux-toolchain-bin-4.0.2.tar.gz -C/ 

2.Add one line to my ~/.bashrc,

export PATH=$PATH:/opt/microtime/pro/devkit/arm/pxa270/gcc-4.0.2-glibc-2.3.3/arm-unknown-linux-gnu/bin

3.Reload the ~/.bashrc

SHELL>source ~/.bashrc

After these steps are done, I try

SHELL>arm-unknown-linux-gnu-gcc -v

and it turn out that

bash: /opt/microtime/pro/devkit/arm/pxa270/gcc-4.0.2-glibc-2.3.3/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-gcc: No such file or directory

It is weird that I go to the path "/opt/microtime/pro/devkit/arm/pxa270/gcc-4.0.2-glibc-2.3.3/arm-unknown-linux-gnu/bin" and I do see the arm-unlnown-linux- gnu-gcc there.

So my problems are:

1.Why can't my cross compiler arm-unknown-linux-gnu-gcc work after these setting?

2.Is the cross compiler setting the same as gcc?

Thanks for your help!

Edit:

I've founded that the cross compiler file is for 32 bit and my vm is 64 bit. To make some modification and it will work!

KennyYang
  • 235
  • 2
  • 13
  • Observe that the shell was able to find the executable and tried to run it, but then it could not. So it’s not missing, or a permissions issue. I ran into that behavior yesterday with a program that hadn’t been compiled or linked correctly (not sure which), and I got the same error message. So I suspect that’s the issue here. It sounds like you didn’t build the executable yourself? It was in the download? It might help if you built it yourself. – Tom Zych Jan 10 '16 at 09:27
  • the program is a cross compiler, is it still need to be compiled or link? I thought I just need to unzip a file from my CD-ROM and set the path? – KennyYang Jan 10 '16 at 09:44
  • Ah, this is from your installation CD? It should be built correctly for your architecture, in that case. Perhaps I’m wrong about the cause, but I’m still struck by the similarity to what I ran into yesterday. Please edit the question to show what `file arm-unknown-linux-gnu-gcc` prints? – Tom Zych Jan 10 '16 at 09:54
  • Hi, thanks for this comment and I found my mistake that the cross compiler is actually for 32 bit but the VM is 64 bit. By making my VM work for 32 bit program, it works. – KennyYang Jan 11 '16 at 06:57
  • Glad it's working now. It would be useful to future readers if you edited your question to show how you determined that was the problem. – Tom Zych Jan 11 '16 at 09:28

0 Answers0