LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Problem running arm-linux-gcc (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/problem-running-arm-linux-gcc-924478/)

Ninaeve 01-18-2012 03:39 AM

Problem running arm-linux-gcc
 
Hi, I'm a Linux newby.
I unpacked the arm-linux-gcc-3.4.1.tar.bz2 then moved the files on \usr\local but trying to compile a .c file with
arm-linux-gcc-3.4.1 -o hello.exe hello.c
it gives me the error
-bash: /usr/local/bin/arm-linux-gcc-3.4.1: cannot execute binary file

and the same with another distribution (4.2.1).
I'm working in Cygwin but trying to cross-compile.

If someone could give me a hint about this it would be greatly appreciated!
Thanks in advance

jhwilliams 01-18-2012 08:23 PM

That usually means that the binary is for a different architecture than the one you're running on.

For example, maybe the arm-linux-gcc-3.4.1 is 32-bit, and you're on a 64-bit host without binary support. Or something like that.

Compare the output of
Code:

file -b $(which file)
vs.

Code:

file -b /usr/local/bin/arm-linux-gcc-3.4.1

knudfl 01-19-2012 03:39 AM

Cygwin is not Linux style files. Cygwin is all "windows" files.
Thus no executable etc. for Linux will work.


Crosstool-ng : Cygwin is mentioned. http://crosstool-ng.org/


Please use the "Report" button to ask for the thread
to be moved to the "Embedded Forum".
You may get more response to your arm questions in "Embedded".

.

Ninaeve 01-19-2012 07:53 AM

Thank you so much!
I acquired a embedded uClinux system but having Windows on pc the seller on its instructions tells to use cygwin and arm-linux as cross-compiler......:-(
Seems like I'll have to find an alternative solution.
Every suggestion will be very well accepted but thank you again for the informations.
(If I could use native Linux it would be better, I know)

Tinkster 01-19-2012 02:01 PM

Moved on OPs request.

theNbomr 01-24-2012 01:04 PM

You can still use gcc on Cygwin. You'll probably have to build it there, however, unless you can find Cygwin binaries of the right configuration. Cross toolchains for Arm can be a bit tricky with all of the various permutations of Arm processor, ABI's, floating point support, etc. I strongly endorse knudfl's recommendation to use Crosstool-NG if you need to build a toolchain.

These days, Cygwin seems a bit pointless, with the ease of running Linux as a VM. At least from the perspective of software cross-development.

--- rod.

Ninaeve 01-25-2012 02:38 AM

Thanks

Ninaeve 01-25-2012 02:48 AM

Thank you very much
Unfortunately my office is set with MS and I can't change OS so...
Cygwin GCC doesn't run in Linux and Linux GCC doesn't run in Windows ^_^''' as I was told in the previous posts and I discovered on my skin.
I tried different cross-compilers but they didn't have any chance to run.
I was given an ad-hoc cross-compiler for Cygwin by the vendor and IT RUNS!
Now I can start the real work ;-)
Best Regards


All times are GMT -5. The time now is 09:13 PM.