LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 01-18-2012, 03:39 AM   #1
Ninaeve
LQ Newbie
 
Registered: Jan 2012
Posts: 21

Rep: Reputation: Disabled
Question 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

Last edited by Ninaeve; 01-18-2012 at 03:54 AM. Reason: detail needed
 
Old 01-18-2012, 08:23 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
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
 
1 members found this post helpful.
Old 01-19-2012, 03:39 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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".

.

Last edited by knudfl; 01-19-2012 at 06:54 AM.
 
1 members found this post helpful.
Old 01-19-2012, 07:53 AM   #4
Ninaeve
LQ Newbie
 
Registered: Jan 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
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)

Last edited by Ninaeve; 01-19-2012 at 07:59 AM.
 
Old 01-19-2012, 02:01 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved on OPs request.
 
Old 01-24-2012, 01:04 PM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
Old 01-25-2012, 02:38 AM   #7
Ninaeve
LQ Newbie
 
Registered: Jan 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
Thanks

Last edited by Ninaeve; 01-25-2012 at 02:49 AM.
 
Old 01-25-2012, 02:48 AM   #8
Ninaeve
LQ Newbie
 
Registered: Jan 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
arm-linux-gcc linker problem with libmodbus meda75 Linux - Software 7 01-07-2014 09:16 AM
difference b/w arm-iwmmxt-linux-gnueabi-gcc & arm-linux-gcc ravi_shanker Linux - Software 1 09-12-2011 10:30 AM
Compile the linux2.6.14.1 for arm must ues the arm-linux-gcc-3.4.4? frankyue Linux - Embedded & Single-board computer 2 12-20-2008 07:28 AM
urgent:problem reg compling prog using arm-linux-gcc ashok kumar reddy Linux - Kernel 1 06-30-2006 04:46 AM
a doubt with host gcc and arm-linux-gcc renjithgopal Linux - General 1 09-11-2003 04:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 11:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration