LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-26-2008, 02:28 PM   #1
mk27
Member
 
Registered: Sep 2008
Distribution: fedora, gentoo, ubuntu
Posts: 148

Rep: Reputation: 23
compiling 32-bit on 64-bit


I just installed FC10/64 and have come to the conclusion that I have to be able to compile 32-bit apps, which means I need another gcc.

What's the best method? Should I build a cross-compiler or just install the i386 version?
 
Old 12-26-2008, 02:53 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
a quick glance at one of the GCC mirrors tells me that there is no distinction between 32-bit and 64-bit GCC. Have you seen tow different versions.

I would have assumed that the compiled code is controlled by how the source is configured, by flags passed to the compiler, or something like that.

No first-hand knowledge, so take with salt.....
 
Old 12-26-2008, 03:12 PM   #3
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Should be as simple as i.e. gcc -m32 -o output source.c
 
Old 12-26-2008, 03:14 PM   #4
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
You can compile 32 bit apps from the 64 bit version by using the -m32 flag.

HTH

Forrest
 
Old 12-26-2008, 03:18 PM   #5
mk27
Member
 
Registered: Sep 2008
Distribution: fedora, gentoo, ubuntu
Posts: 148

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by makuyl View Post
Should be as simple as i.e. gcc -m32 -o output source.c
Yeah, you're right. I just don't like dealing with makefiles but you can add:
Code:
EXTRA_CFLAGS = -m32
My problem is finding old libraries for a 64-bit hack on slmodem, which I think now requires some headers last found in compat-gcc-34.

Sorry for all the fuss. sigh
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling 64 bit kernel in 32 bit linux MadnessASAP Linux - Hardware 6 05-04-2009 11:47 AM
compiling 64 bit kernel in 32 bit environment tytus Linux - Kernel 8 12-11-2008 10:24 AM
compiling 32 bit application on 64 bit linux(x86_64) uttam_h Linux - Software 16 07-19-2008 02:33 PM
compiling in 32-bit mode on 64-bit Linux germanymontrealexpat Linux - Software 2 05-26-2006 07:39 AM
Compiling 32-bit binary in a 64-bit environment Kaj Linux - Software 1 12-13-2004 09:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:42 PM.

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