LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded
User Name
Password
Linux - Embedded This forum is for the discussion of Linux and embedded devices.

Notices

Reply
 
LinkBack 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: Ubuntu, Debian, Android, LFS
Posts: 1,158

Rep: Reputation: 202Reputation: 202Reputation: 202
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: pclos2010.12, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 9,287

Rep: Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350
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: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,619
Blog Entries: 10

Rep: Reputation: 771Reputation: 771Reputation: 771Reputation: 771Reputation: 771Reputation: 771Reputation: 771
Moved on OPs request.
 
Old 01-24-2012, 01:04 PM   #6
theNbomr
Senior Member
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 4,504

Rep: Reputation: 602Reputation: 602Reputation: 602Reputation: 602Reputation: 602Reputation: 602
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
difference b/w arm-iwmmxt-linux-gnueabi-gcc & arm-linux-gcc ravi_shanker Linux - Software 1 09-12-2011 10:30 AM
arm-linux-gcc linker problem with libmodbus meda75 Linux - Software 1 04-24-2009 05:46 AM
Compile the linux2.6.14.1 for arm must ues the arm-linux-gcc-3.4.4? frankyue Linux - Embedded 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


All times are GMT -5. The time now is 12:57 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration