Fedora Linux Support Community & Resources Center
  #1  
Old 14th April 2006, 04:57 PM
mmrezaie Offline
Registered User
 
Join Date: Apr 2006
Posts: 11
Use gcc to compile for different architecture!

How can I compile my code for different archituctures for example when I'm in FC5 x86_64 I compile for FC5 i386 or compile for arm architecture. (but compile in 64bit for 32bit is more important for me).
Reply With Quote
  #2  
Old 14th April 2006, 05:00 PM
Firewing1's Avatar
Firewing1 Offline
Administrator
 
Join Date: Dec 2004
Location: Canada
Age: 22
Posts: 9,224
I'm not sure for GCC, but when RPM building you can use
Code:
rpmbuild -bb --target=i386
Maybe there's something similar in GCC? Have you checked the man pages?
Firewing1
__________________
[+] My open source software and blog
[+] Some of my howtos: (for full list, click here)
Reply With Quote
  #3  
Old 14th April 2006, 05:44 PM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,855
I can only suggest some terminology for what you want to do: Look up the topic of "cross compile" or "cross compiling".
I've never tried it. The article
http://en.wikipedia.org/wiki/Cross_compiler
implies you would need parts of the 32 bit gcc library. I don't know if this article is uptodate.
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."
Reply With Quote
  #4  
Old 15th April 2006, 08:41 AM
RedFedora's Avatar
RedFedora Offline
Registered User
 
Join Date: May 2004
Posts: 503
I think the gcc option you're looking for may be -march
For example

gcc -march=i386 -o MyProgram sourcefile.c
__________________
Registered Linux User # 373325
Reply With Quote
  #5  
Old 7th April 2008, 03:13 AM
fakie_flip Offline
Registered User
 
Join Date: Dec 2006
Posts: 214
How is it done with a make file and configure script?
Reply With Quote
Reply

Tags
architecture, compile, gcc

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
xoscope compile problem on F9 - compile with gcc3.3? tmort Using Fedora 0 28th August 2008 04:35 PM
Architecture Katabatic Using Fedora 3 2nd August 2007 06:54 AM
Which Architecture? Tux_in_Redhat Using Fedora 1 14th January 2007 12:58 AM
different architecture tinyman Using Fedora 5 12th December 2006 02:19 AM


Current GMT-time: 07:31 (Monday, 20-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat